diff options
| -rw-r--r-- | .gitignore | 15 | ||||
| -rw-r--r-- | SConstruct | 4 | ||||
| -rw-r--r-- | core/SCsub | 5 | ||||
| -rw-r--r-- | core/bind/core_bind.cpp | 538 | ||||
| -rw-r--r-- | core/bind/core_bind.h | 8 | ||||
| -rw-r--r-- | core/class_db.cpp | 26 | ||||
| -rw-r--r-- | core/class_db.h | 28 | ||||
| -rw-r--r-- | core/compressed_translation.cpp | 2 | ||||
| -rw-r--r-- | core/core_string_names.cpp | 2 | ||||
| -rw-r--r-- | core/dvector.h | 11 | ||||
| -rw-r--r-- | core/func_ref.cpp | 4 | ||||
| -rw-r--r-- | core/global_config.cpp (renamed from core/globals.cpp) | 169 | ||||
| -rw-r--r-- | core/global_config.h (renamed from core/globals.h) | 4 | ||||
| -rw-r--r-- | core/hash_map.h | 61 | ||||
| -rw-r--r-- | core/hashfuncs.h | 42 | ||||
| -rw-r--r-- | core/helper/SCsub | 7 | ||||
| -rw-r--r-- | core/helper/math_fieldwise.cpp | 171 | ||||
| -rw-r--r-- | core/helper/math_fieldwise.h | 40 | ||||
| -rw-r--r-- | core/input_map.cpp | 28 | ||||
| -rw-r--r-- | core/io/config_file.cpp | 18 | ||||
| -rw-r--r-- | core/io/file_access_memory.cpp | 2 | ||||
| -rw-r--r-- | core/io/file_access_network.cpp | 2 | ||||
| -rw-r--r-- | core/io/file_access_pack.cpp | 6 | ||||
| -rw-r--r-- | core/io/http_client.cpp | 59 | ||||
| -rw-r--r-- | core/io/http_client.h | 2 | ||||
| -rw-r--r-- | core/io/ip.cpp | 16 | ||||
| -rw-r--r-- | core/io/ip_address.cpp | 27 | ||||
| -rw-r--r-- | core/io/ip_address.h | 9 | ||||
| -rw-r--r-- | core/io/json.cpp | 4 | ||||
| -rw-r--r-- | core/io/marshalls.cpp | 4 | ||||
| -rw-r--r-- | core/io/networked_multiplayer_peer.cpp | 16 | ||||
| -rw-r--r-- | core/io/packet_peer.cpp | 16 | ||||
| -rw-r--r-- | core/io/packet_peer_udp.cpp | 28 | ||||
| -rw-r--r-- | core/io/packet_peer_udp.h | 7 | ||||
| -rw-r--r-- | core/io/pck_packer.cpp | 6 | ||||
| -rw-r--r-- | core/io/resource_format_binary.cpp | 51 | ||||
| -rw-r--r-- | core/io/resource_format_binary.h | 2 | ||||
| -rw-r--r-- | core/io/resource_import.cpp | 35 | ||||
| -rw-r--r-- | core/io/resource_import.h | 28 | ||||
| -rw-r--r-- | core/io/resource_loader.cpp | 20 | ||||
| -rw-r--r-- | core/io/resource_saver.cpp | 2 | ||||
| -rw-r--r-- | core/io/stream_peer.cpp | 92 | ||||
| -rw-r--r-- | core/io/stream_peer_ssl.cpp | 8 | ||||
| -rw-r--r-- | core/io/stream_peer_tcp.cpp | 23 | ||||
| -rw-r--r-- | core/io/stream_peer_tcp.h | 3 | ||||
| -rw-r--r-- | core/io/tcp_server.cpp | 26 | ||||
| -rw-r--r-- | core/io/tcp_server.h | 6 | ||||
| -rw-r--r-- | core/io/xml_parser.cpp | 34 | ||||
| -rw-r--r-- | core/math/a_star.cpp | 26 | ||||
| -rw-r--r-- | core/math/audio_frame.cpp | 28 | ||||
| -rw-r--r-- | core/math/audio_frame.h | 28 | ||||
| -rw-r--r-- | core/math/geometry.h | 28 | ||||
| -rw-r--r-- | core/math/math_funcs.h | 4 | ||||
| -rw-r--r-- | core/message_queue.cpp | 2 | ||||
| -rw-r--r-- | core/method_ptrcall.h | 28 | ||||
| -rw-r--r-- | core/object.cpp | 76 | ||||
| -rw-r--r-- | core/object.h | 14 | ||||
| -rw-r--r-- | core/os/dir_access.cpp | 2 | ||||
| -rw-r--r-- | core/os/file_access.cpp | 2 | ||||
| -rw-r--r-- | core/os/input.cpp | 70 | ||||
| -rw-r--r-- | core/os/main_loop.cpp | 12 | ||||
| -rw-r--r-- | core/os/os.cpp | 12 | ||||
| -rw-r--r-- | core/os/os.h | 6 | ||||
| -rw-r--r-- | core/os/power.h | 44 | ||||
| -rw-r--r-- | core/os/rw_lock.cpp | 31 | ||||
| -rw-r--r-- | core/os/rw_lock.h | 28 | ||||
| -rw-r--r-- | core/packed_data_container.cpp | 28 | ||||
| -rw-r--r-- | core/pool_allocator.cpp | 4 | ||||
| -rw-r--r-- | core/reference.cpp | 8 | ||||
| -rw-r--r-- | core/register_core_types.cpp | 2 | ||||
| -rw-r--r-- | core/resource.cpp | 30 | ||||
| -rw-r--r-- | core/script_debugger_remote.cpp | 2 | ||||
| -rw-r--r-- | core/script_language.cpp | 14 | ||||
| -rw-r--r-- | core/string_db.h | 3 | ||||
| -rw-r--r-- | core/translation.cpp | 38 | ||||
| -rw-r--r-- | core/undo_redo.cpp | 22 | ||||
| -rw-r--r-- | core/ustring.cpp | 47 | ||||
| -rw-r--r-- | core/ustring.h | 2 | ||||
| -rw-r--r-- | core/variant.cpp | 192 | ||||
| -rw-r--r-- | core/variant.h | 7 | ||||
| -rw-r--r-- | core/variant_call.cpp | 12 | ||||
| -rw-r--r-- | core/variant_op.cpp | 4 | ||||
| -rw-r--r-- | core/variant_parser.cpp | 2 | ||||
| -rw-r--r-- | doc/base/classes.xml | 42 | ||||
| -rw-r--r-- | drivers/alsa/audio_driver_alsa.cpp | 2 | ||||
| -rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 2 | ||||
| -rw-r--r-- | drivers/gles2/shader_gles2.h | 2 | ||||
| -rw-r--r-- | drivers/gles3/rasterizer_canvas_gles3.cpp | 39 | ||||
| -rw-r--r-- | drivers/gles3/rasterizer_canvas_gles3.h | 28 | ||||
| -rw-r--r-- | drivers/gles3/rasterizer_gles3.cpp | 38 | ||||
| -rw-r--r-- | drivers/gles3/rasterizer_gles3.h | 28 | ||||
| -rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 73 | ||||
| -rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.h | 28 | ||||
| -rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 150 | ||||
| -rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.h | 51 | ||||
| -rw-r--r-- | drivers/gles3/shader_compiler_gles3.cpp | 30 | ||||
| -rw-r--r-- | drivers/gles3/shader_compiler_gles3.h | 28 | ||||
| -rw-r--r-- | drivers/gles3/shader_gles3.cpp | 4 | ||||
| -rw-r--r-- | drivers/gles3/shader_gles3.h | 6 | ||||
| -rw-r--r-- | drivers/gles3/shaders/scene.glsl | 24 | ||||
| -rw-r--r-- | drivers/gles3/shaders/ssao.glsl | 18 | ||||
| -rw-r--r-- | drivers/gles3/shaders/ssao_minify.glsl | 2 | ||||
| -rw-r--r-- | drivers/png/resource_saver_png.cpp | 2 | ||||
| -rw-r--r-- | drivers/pulseaudio/audio_driver_pulseaudio.cpp | 2 | ||||
| -rw-r--r-- | drivers/rtaudio/audio_driver_rtaudio.cpp | 2 | ||||
| -rw-r--r-- | drivers/unix/memory_pool_static_malloc.cpp | 2 | ||||
| -rw-r--r-- | drivers/unix/memory_pool_static_malloc.h | 0 | ||||
| -rw-r--r-- | drivers/unix/os_unix.cpp | 18 | ||||
| -rw-r--r-- | drivers/unix/packet_peer_udp_posix.cpp | 40 | ||||
| -rw-r--r-- | drivers/unix/packet_peer_udp_posix.h | 3 | ||||
| -rw-r--r-- | drivers/unix/rw_lock_posix.cpp | 32 | ||||
| -rw-r--r-- | drivers/unix/rw_lock_posix.h | 28 | ||||
| -rw-r--r-- | drivers/unix/socket_helpers.h | 44 | ||||
| -rw-r--r-- | drivers/unix/stream_peer_tcp_posix.cpp | 21 | ||||
| -rw-r--r-- | drivers/unix/stream_peer_tcp_posix.h | 4 | ||||
| -rw-r--r-- | drivers/unix/tcp_server_posix.cpp | 26 | ||||
| -rw-r--r-- | drivers/unix/tcp_server_posix.h | 3 | ||||
| -rw-r--r-- | drivers/windows/rw_lock_windows.cpp | 32 | ||||
| -rw-r--r-- | drivers/windows/rw_lock_windows.h | 28 | ||||
| -rw-r--r-- | drivers/xaudio2/audio_driver_xaudio2.cpp | 2 | ||||
| -rw-r--r-- | editor/SCsub (renamed from tools/editor/SCsub) | 47 | ||||
| -rw-r--r-- | editor/animation_editor.cpp (renamed from tools/editor/animation_editor.cpp) | 60 | ||||
| -rw-r--r-- | editor/animation_editor.h (renamed from tools/editor/animation_editor.h) | 0 | ||||
| -rw-r--r-- | editor/array_property_edit.cpp (renamed from tools/editor/array_property_edit.cpp) | 8 | ||||
| -rw-r--r-- | editor/array_property_edit.h (renamed from tools/editor/array_property_edit.h) | 0 | ||||
| -rw-r--r-- | editor/asset_library_editor_plugin.cpp (renamed from tools/editor/asset_library_editor_plugin.cpp) | 6 | ||||
| -rw-r--r-- | editor/asset_library_editor_plugin.h (renamed from tools/editor/asset_library_editor_plugin.h) | 0 | ||||
| -rw-r--r-- | editor/call_dialog.cpp (renamed from tools/editor/call_dialog.cpp) | 0 | ||||
| -rw-r--r-- | editor/call_dialog.h (renamed from tools/editor/call_dialog.h) | 2 | ||||
| -rw-r--r-- | editor/code_editor.cpp (renamed from tools/editor/code_editor.cpp) | 2 | ||||
| -rw-r--r-- | editor/code_editor.h (renamed from tools/editor/code_editor.h) | 2 | ||||
| -rw-r--r-- | editor/collada/SCsub (renamed from tools/editor/collada/SCsub) | 0 | ||||
| -rw-r--r-- | editor/collada/collada.cpp (renamed from tools/editor/collada/collada.cpp) | 8 | ||||
| -rw-r--r-- | editor/collada/collada.h (renamed from tools/editor/collada/collada.h) | 2 | ||||
| -rw-r--r-- | editor/connections_dialog.cpp (renamed from tools/editor/connections_dialog.cpp) | 0 | ||||
| -rw-r--r-- | editor/connections_dialog.h (renamed from tools/editor/connections_dialog.h) | 4 | ||||
| -rw-r--r-- | editor/create_dialog.cpp (renamed from tools/editor/create_dialog.cpp) | 18 | ||||
| -rw-r--r-- | editor/create_dialog.h (renamed from tools/editor/create_dialog.h) | 0 | ||||
| -rw-r--r-- | editor/dependency_editor.cpp (renamed from tools/editor/dependency_editor.cpp) | 10 | ||||
| -rw-r--r-- | editor/dependency_editor.h (renamed from tools/editor/dependency_editor.h) | 0 | ||||
| -rw-r--r-- | editor/doc/SCsub (renamed from tools/editor/doc/SCsub) | 0 | ||||
| -rw-r--r-- | editor/doc/doc_data.cpp (renamed from tools/editor/doc/doc_data.cpp) | 9 | ||||
| -rw-r--r-- | editor/doc/doc_data.h (renamed from tools/editor/doc/doc_data.h) | 1 | ||||
| -rw-r--r-- | editor/doc/doc_dump.cpp (renamed from tools/editor/doc/doc_dump.cpp) | 0 | ||||
| -rw-r--r-- | editor/doc/doc_dump.h (renamed from tools/editor/doc/doc_dump.h) | 0 | ||||
| -rw-r--r-- | editor/doc_code_font.h (renamed from tools/editor/doc_code_font.h) | 0 | ||||
| -rw-r--r-- | editor/doc_font.h (renamed from tools/editor/doc_font.h) | 0 | ||||
| -rw-r--r-- | editor/doc_title_font.h (renamed from tools/editor/doc_title_font.h) | 0 | ||||
| -rw-r--r-- | editor/editor_asset_installer.cpp (renamed from tools/editor/editor_asset_installer.cpp) | 0 | ||||
| -rw-r--r-- | editor/editor_asset_installer.h (renamed from tools/editor/editor_asset_installer.h) | 0 | ||||
| -rw-r--r-- | editor/editor_audio_buses.cpp (renamed from tools/editor/editor_audio_buses.cpp) | 29 | ||||
| -rw-r--r-- | editor/editor_audio_buses.h (renamed from tools/editor/editor_audio_buses.h) | 30 | ||||
| -rw-r--r-- | editor/editor_autoload_settings.cpp (renamed from tools/editor/editor_autoload_settings.cpp) | 2 | ||||
| -rw-r--r-- | editor/editor_autoload_settings.h (renamed from tools/editor/editor_autoload_settings.h) | 0 | ||||
| -rw-r--r-- | editor/editor_data.cpp (renamed from tools/editor/editor_data.cpp) | 14 | ||||
| -rw-r--r-- | editor/editor_data.h (renamed from tools/editor/editor_data.h) | 2 | ||||
| -rw-r--r-- | editor/editor_dir_dialog.cpp (renamed from tools/editor/editor_dir_dialog.cpp) | 12 | ||||
| -rw-r--r-- | editor/editor_dir_dialog.h (renamed from tools/editor/editor_dir_dialog.h) | 0 | ||||
| -rw-r--r-- | editor/editor_export.cpp (renamed from tools/editor/editor_import_export.cpp) | 1043 | ||||
| -rw-r--r-- | editor/editor_export.h | 297 | ||||
| -rw-r--r-- | editor/editor_file_dialog.cpp (renamed from tools/editor/editor_file_dialog.cpp) | 108 | ||||
| -rw-r--r-- | editor/editor_file_dialog.h (renamed from tools/editor/editor_file_dialog.h) | 0 | ||||
| -rw-r--r-- | editor/editor_file_system.cpp (renamed from tools/editor/editor_file_system.cpp) | 40 | ||||
| -rw-r--r-- | editor/editor_file_system.h (renamed from tools/editor/editor_file_system.h) | 0 | ||||
| -rw-r--r-- | editor/editor_fonts.cpp (renamed from tools/editor/editor_fonts.cpp) | 0 | ||||
| -rw-r--r-- | editor/editor_fonts.h (renamed from tools/editor/editor_fonts.h) | 0 | ||||
| -rw-r--r-- | editor/editor_help.cpp (renamed from tools/editor/editor_help.cpp) | 10 | ||||
| -rw-r--r-- | editor/editor_help.h (renamed from tools/editor/editor_help.h) | 6 | ||||
| -rw-r--r-- | editor/editor_icons.h (renamed from tools/editor/editor_icons.h) | 0 | ||||
| -rw-r--r-- | editor/editor_initialize_ssl.cpp (renamed from tools/editor/editor_initialize_ssl.cpp) | 0 | ||||
| -rw-r--r-- | editor/editor_initialize_ssl.h (renamed from tools/editor/editor_initialize_ssl.h) | 0 | ||||
| -rw-r--r-- | editor/editor_log.cpp (renamed from tools/editor/editor_log.cpp) | 4 | ||||
| -rw-r--r-- | editor/editor_log.h (renamed from tools/editor/editor_log.h) | 0 | ||||
| -rw-r--r-- | editor/editor_name_dialog.cpp (renamed from tools/editor/editor_name_dialog.cpp) | 0 | ||||
| -rw-r--r-- | editor/editor_name_dialog.h (renamed from tools/editor/editor_name_dialog.h) | 0 | ||||
| -rw-r--r-- | editor/editor_node.cpp (renamed from tools/editor/editor_node.cpp) | 114 | ||||
| -rw-r--r-- | editor/editor_node.h (renamed from tools/editor/editor_node.h) | 71 | ||||
| -rw-r--r-- | editor/editor_path.cpp (renamed from tools/editor/editor_path.cpp) | 0 | ||||
| -rw-r--r-- | editor/editor_path.h (renamed from tools/editor/editor_path.h) | 0 | ||||
| -rw-r--r-- | editor/editor_plugin.cpp (renamed from tools/editor/editor_plugin.cpp) | 58 | ||||
| -rw-r--r-- | editor/editor_plugin.h (renamed from tools/editor/editor_plugin.h) | 2 | ||||
| -rw-r--r-- | editor/editor_plugin_settings.cpp (renamed from tools/editor/editor_plugin_settings.cpp) | 2 | ||||
| -rw-r--r-- | editor/editor_plugin_settings.h (renamed from tools/editor/editor_plugin_settings.h) | 0 | ||||
| -rw-r--r-- | editor/editor_profiler.cpp (renamed from tools/editor/editor_profiler.cpp) | 20 | ||||
| -rw-r--r-- | editor/editor_profiler.h (renamed from tools/editor/editor_profiler.h) | 0 | ||||
| -rw-r--r-- | editor/editor_reimport_dialog.cpp (renamed from tools/editor/editor_reimport_dialog.cpp) | 0 | ||||
| -rw-r--r-- | editor/editor_reimport_dialog.h (renamed from tools/editor/editor_reimport_dialog.h) | 0 | ||||
| -rw-r--r-- | editor/editor_resource_preview.cpp (renamed from tools/editor/editor_resource_preview.cpp) | 12 | ||||
| -rw-r--r-- | editor/editor_resource_preview.h (renamed from tools/editor/editor_resource_preview.h) | 0 | ||||
| -rw-r--r-- | editor/editor_run.cpp (renamed from tools/editor/editor_run.cpp) | 10 | ||||
| -rw-r--r-- | editor/editor_run.h (renamed from tools/editor/editor_run.h) | 2 | ||||
| -rw-r--r-- | editor/editor_run_native.cpp (renamed from tools/editor/editor_run_native.cpp) | 2 | ||||
| -rw-r--r-- | editor/editor_run_native.h (renamed from tools/editor/editor_run_native.h) | 0 | ||||
| -rw-r--r-- | editor/editor_run_script.cpp (renamed from tools/editor/editor_run_script.cpp) | 4 | ||||
| -rw-r--r-- | editor/editor_run_script.h (renamed from tools/editor/editor_run_script.h) | 0 | ||||
| -rw-r--r-- | editor/editor_scale.cpp (renamed from tools/editor/editor_scale.cpp) | 0 | ||||
| -rw-r--r-- | editor/editor_scale.h (renamed from tools/editor/editor_scale.h) | 0 | ||||
| -rw-r--r-- | editor/editor_settings.cpp (renamed from tools/editor/editor_settings.cpp) | 42 | ||||
| -rw-r--r-- | editor/editor_settings.h (renamed from tools/editor/editor_settings.h) | 4 | ||||
| -rw-r--r-- | editor/editor_sub_scene.cpp (renamed from tools/editor/editor_sub_scene.cpp) | 6 | ||||
| -rw-r--r-- | editor/editor_sub_scene.h (renamed from tools/editor/editor_sub_scene.h) | 2 | ||||
| -rw-r--r-- | editor/editor_themes.cpp (renamed from tools/editor/editor_themes.cpp) | 0 | ||||
| -rw-r--r-- | editor/editor_themes.h (renamed from tools/editor/editor_themes.h) | 0 | ||||
| -rw-r--r-- | editor/file_type_cache.cpp (renamed from tools/editor/file_type_cache.cpp) | 2 | ||||
| -rw-r--r-- | editor/file_type_cache.h (renamed from tools/editor/file_type_cache.h) | 0 | ||||
| -rw-r--r-- | editor/fileserver/SCsub (renamed from tools/editor/fileserver/SCsub) | 0 | ||||
| -rw-r--r-- | editor/fileserver/editor_file_server.cpp (renamed from tools/editor/fileserver/editor_file_server.cpp) | 0 | ||||
| -rw-r--r-- | editor/fileserver/editor_file_server.h (renamed from tools/editor/fileserver/editor_file_server.h) | 0 | ||||
| -rw-r--r-- | editor/filesystem_dock.cpp (renamed from tools/editor/filesystem_dock.cpp) | 97 | ||||
| -rw-r--r-- | editor/filesystem_dock.h (renamed from tools/editor/filesystem_dock.h) | 1 | ||||
| -rw-r--r-- | editor/groups_editor.cpp (renamed from tools/editor/groups_editor.cpp) | 0 | ||||
| -rw-r--r-- | editor/groups_editor.h (renamed from tools/editor/groups_editor.h) | 0 | ||||
| -rw-r--r-- | editor/icons/2x/icon_accept_dialog.png (renamed from tools/editor/icons/2x/icon_accept_dialog.png) | bin | 581 -> 581 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_add.png (renamed from tools/editor/icons/2x/icon_add.png) | bin | 151 -> 151 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_add_track.png (renamed from tools/editor/icons/2x/icon_add_track.png) | bin | 151 -> 151 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_anchor.png (renamed from tools/editor/icons/2x/icon_anchor.png) | bin | 828 -> 828 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_animated_sprite.png (renamed from tools/editor/icons/2x/icon_animated_sprite.png) | bin | 1212 -> 1212 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_animated_sprite_3d.png (renamed from tools/editor/icons/2x/icon_animated_sprite_3d.png) | bin | 1125 -> 1125 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_animation.png (renamed from tools/editor/icons/2x/icon_animation.png) | bin | 912 -> 912 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_animation_player.png (renamed from tools/editor/icons/2x/icon_animation_player.png) | bin | 174 -> 174 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_animation_tree.png (renamed from tools/editor/icons/2x/icon_animation_tree.png) | bin | 471 -> 471 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_animation_tree_player.png (renamed from tools/editor/icons/2x/icon_animation_tree_player.png) | bin | 471 -> 471 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_area.png (renamed from tools/editor/icons/2x/icon_area.png) | bin | 209 -> 209 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_area_2d.png (renamed from tools/editor/icons/2x/icon_area_2d.png) | bin | 211 -> 211 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_arrow_left.png (renamed from tools/editor/icons/2x/icon_arrow_left.png) | bin | 333 -> 333 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_arrow_right.png (renamed from tools/editor/icons/2x/icon_arrow_right.png) | bin | 308 -> 308 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_arrow_up.png (renamed from tools/editor/icons/2x/icon_arrow_up.png) | bin | 293 -> 293 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_atlas_texture.png (renamed from tools/editor/icons/2x/icon_atlas_texture.png) | bin | 382 -> 382 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_audio_stream_gibberish.png (renamed from tools/editor/icons/2x/icon_audio_stream_gibberish.png) | bin | 437 -> 437 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_auto_play.png (renamed from tools/editor/icons/2x/icon_auto_play.png) | bin | 699 -> 699 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_back.png (renamed from tools/editor/icons/2x/icon_back.png) | bin | 323 -> 323 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_back_buffer_copy.png (renamed from tools/editor/icons/2x/icon_back_buffer_copy.png) | bin | 190 -> 190 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_bake.png (renamed from tools/editor/icons/2x/icon_bake.png) | bin | 267 -> 267 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_baked_light.png (renamed from tools/editor/icons/2x/icon_baked_light.png) | bin | 267 -> 267 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_baked_light_instance.png (renamed from tools/editor/icons/2x/icon_baked_light_instance.png) | bin | 264 -> 264 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_baked_light_sampler.png (renamed from tools/editor/icons/2x/icon_baked_light_sampler.png) | bin | 391 -> 391 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_bit_map.png (renamed from tools/editor/icons/2x/icon_bit_map.png) | bin | 148 -> 148 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_bitmap_font.png (renamed from tools/editor/icons/2x/icon_bitmap_font.png) | bin | 191 -> 191 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_blend.png (renamed from tools/editor/icons/2x/icon_blend.png) | bin | 1091 -> 1091 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_bone.png (renamed from tools/editor/icons/2x/icon_bone.png) | bin | 597 -> 597 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_bone_attachment.png (renamed from tools/editor/icons/2x/icon_bone_attachment.png) | bin | 576 -> 576 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_bone_track.png (renamed from tools/editor/icons/2x/icon_bone_track.png) | bin | 565 -> 565 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_bool.png (renamed from tools/editor/icons/2x/icon_bool.png) | bin | 171 -> 171 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_box_shape.png (renamed from tools/editor/icons/2x/icon_box_shape.png) | bin | 597 -> 597 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_button.png (renamed from tools/editor/icons/2x/icon_button.png) | bin | 186 -> 186 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_button_group.png (renamed from tools/editor/icons/2x/icon_button_group.png) | bin | 251 -> 251 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_camera.png (renamed from tools/editor/icons/2x/icon_camera.png) | bin | 352 -> 352 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_camera_2d.png (renamed from tools/editor/icons/2x/icon_camera_2d.png) | bin | 364 -> 364 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_canvas_item.png (renamed from tools/editor/icons/2x/icon_canvas_item.png) | bin | 709 -> 709 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_canvas_item_material.png (renamed from tools/editor/icons/2x/icon_canvas_item_material.png) | bin | 640 -> 640 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_canvas_item_shader.png (renamed from tools/editor/icons/2x/icon_canvas_item_shader.png) | bin | 716 -> 716 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_canvas_item_shader_graph.png (renamed from tools/editor/icons/2x/icon_canvas_item_shader_graph.png) | bin | 707 -> 707 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_canvas_layer.png (renamed from tools/editor/icons/2x/icon_canvas_layer.png) | bin | 860 -> 860 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_canvas_modulate.png (renamed from tools/editor/icons/2x/icon_canvas_modulate.png) | bin | 273 -> 273 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_capsule_shape.png (renamed from tools/editor/icons/2x/icon_capsule_shape.png) | bin | 372 -> 372 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_capsule_shape_2d.png (renamed from tools/editor/icons/2x/icon_capsule_shape_2d.png) | bin | 552 -> 552 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_center_container.png (renamed from tools/editor/icons/2x/icon_center_container.png) | bin | 478 -> 478 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_check_box.png (renamed from tools/editor/icons/2x/icon_check_box.png) | bin | 565 -> 565 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_check_button.png (renamed from tools/editor/icons/2x/icon_check_button.png) | bin | 528 -> 528 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_circle_shape_2d.png (renamed from tools/editor/icons/2x/icon_circle_shape_2d.png) | bin | 838 -> 838 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_class_list.png (renamed from tools/editor/icons/2x/icon_class_list.png) | bin | 192 -> 192 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_close.png (renamed from tools/editor/icons/2x/icon_close.png) | bin | 461 -> 461 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_collapse.png (renamed from tools/editor/icons/2x/icon_collapse.png) | bin | 383 -> 383 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_collision_2d.png (renamed from tools/editor/icons/2x/icon_collision_2d.png) | bin | 407 -> 407 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_collision_polygon.png (renamed from tools/editor/icons/2x/icon_collision_polygon.png) | bin | 397 -> 397 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_collision_polygon_2d.png (renamed from tools/editor/icons/2x/icon_collision_polygon_2d.png) | bin | 407 -> 407 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_collision_shape.png (renamed from tools/editor/icons/2x/icon_collision_shape.png) | bin | 439 -> 439 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_collision_shape_2d.png (renamed from tools/editor/icons/2x/icon_collision_shape_2d.png) | bin | 235 -> 235 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_color.png (renamed from tools/editor/icons/2x/icon_color.png) | bin | 1406 -> 1406 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_color_pick.png (renamed from tools/editor/icons/2x/icon_color_pick.png) | bin | 822 -> 822 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_color_picker.png (renamed from tools/editor/icons/2x/icon_color_picker.png) | bin | 837 -> 837 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_color_picker_button.png (renamed from tools/editor/icons/2x/icon_color_picker_button.png) | bin | 942 -> 942 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_color_ramp.png (renamed from tools/editor/icons/2x/icon_color_ramp.png) | bin | 342 -> 342 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_color_rect.png (renamed from tools/editor/icons/2x/icon_color_rect.png) | bin | 289 -> 289 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_concave_polygon_shape.png (renamed from tools/editor/icons/2x/icon_concave_polygon_shape.png) | bin | 709 -> 709 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_concave_polygon_shape_2d.png (renamed from tools/editor/icons/2x/icon_concave_polygon_shape_2d.png) | bin | 436 -> 436 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_cone_twist_joint.png (renamed from tools/editor/icons/2x/icon_cone_twist_joint.png) | bin | 906 -> 906 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_confirmation_dialog.png (renamed from tools/editor/icons/2x/icon_confirmation_dialog.png) | bin | 694 -> 694 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_connect.png (renamed from tools/editor/icons/2x/icon_connect.png) | bin | 251 -> 251 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_connection_and_groups.png (renamed from tools/editor/icons/2x/icon_connection_and_groups.png) | bin | 397 -> 397 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_container.png (renamed from tools/editor/icons/2x/icon_container.png) | bin | 319 -> 319 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control.png (renamed from tools/editor/icons/2x/icon_control.png) | bin | 825 -> 825 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_bottom_center.png (renamed from tools/editor/icons/2x/icon_control_align_bottom_center.png) | bin | 156 -> 156 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_bottom_left.png (renamed from tools/editor/icons/2x/icon_control_align_bottom_left.png) | bin | 154 -> 154 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_bottom_right.png (renamed from tools/editor/icons/2x/icon_control_align_bottom_right.png) | bin | 155 -> 155 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_bottom_wide.png (renamed from tools/editor/icons/2x/icon_control_align_bottom_wide.png) | bin | 160 -> 160 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_center.png (renamed from tools/editor/icons/2x/icon_control_align_center.png) | bin | 171 -> 171 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_center_left.png (renamed from tools/editor/icons/2x/icon_control_align_center_left.png) | bin | 130 -> 130 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_center_right.png (renamed from tools/editor/icons/2x/icon_control_align_center_right.png) | bin | 127 -> 127 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_left_center.png (renamed from tools/editor/icons/2x/icon_control_align_left_center.png) | bin | 169 -> 169 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_left_wide.png (renamed from tools/editor/icons/2x/icon_control_align_left_wide.png) | bin | 143 -> 143 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_right_center.png (renamed from tools/editor/icons/2x/icon_control_align_right_center.png) | bin | 171 -> 171 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_right_wide.png (renamed from tools/editor/icons/2x/icon_control_align_right_wide.png) | bin | 144 -> 144 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_top_center.png (renamed from tools/editor/icons/2x/icon_control_align_top_center.png) | bin | 165 -> 165 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_top_left.png (renamed from tools/editor/icons/2x/icon_control_align_top_left.png) | bin | 159 -> 159 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_top_right.png (renamed from tools/editor/icons/2x/icon_control_align_top_right.png) | bin | 167 -> 167 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_top_wide.png (renamed from tools/editor/icons/2x/icon_control_align_top_wide.png) | bin | 160 -> 160 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_align_wide.png (renamed from tools/editor/icons/2x/icon_control_align_wide.png) | bin | 145 -> 145 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_hcenter_wide.png (renamed from tools/editor/icons/2x/icon_control_hcenter_wide.png) | bin | 169 -> 169 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_control_vcenter_wide.png (renamed from tools/editor/icons/2x/icon_control_vcenter_wide.png) | bin | 148 -> 148 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_convex_polygon_shape.png (renamed from tools/editor/icons/2x/icon_convex_polygon_shape.png) | bin | 648 -> 648 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_convex_polygon_shape_2d.png (renamed from tools/editor/icons/2x/icon_convex_polygon_shape_2d.png) | bin | 373 -> 373 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_copy_node_path.png (renamed from tools/editor/icons/2x/icon_copy_node_path.png) | bin | 356 -> 356 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_create_new_scene_from.png (renamed from tools/editor/icons/2x/icon_create_new_scene_from.png) | bin | 639 -> 639 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_cube_map.png (renamed from tools/editor/icons/2x/icon_cube_map.png) | bin | 159 -> 159 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_2d.png (renamed from tools/editor/icons/2x/icon_curve_2d.png) | bin | 591 -> 591 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_3d.png (renamed from tools/editor/icons/2x/icon_curve_3d.png) | bin | 522 -> 522 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_close.png (renamed from tools/editor/icons/2x/icon_curve_close.png) | bin | 610 -> 610 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_constant.png (renamed from tools/editor/icons/2x/icon_curve_constant.png) | bin | 162 -> 162 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_create.png (renamed from tools/editor/icons/2x/icon_curve_create.png) | bin | 698 -> 698 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_curve.png (renamed from tools/editor/icons/2x/icon_curve_curve.png) | bin | 744 -> 744 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_delete.png (renamed from tools/editor/icons/2x/icon_curve_delete.png) | bin | 926 -> 926 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_edit.png (renamed from tools/editor/icons/2x/icon_curve_edit.png) | bin | 954 -> 954 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_in.png (renamed from tools/editor/icons/2x/icon_curve_in.png) | bin | 449 -> 449 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_in_out.png (renamed from tools/editor/icons/2x/icon_curve_in_out.png) | bin | 494 -> 494 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_linear.png (renamed from tools/editor/icons/2x/icon_curve_linear.png) | bin | 283 -> 283 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_out.png (renamed from tools/editor/icons/2x/icon_curve_out.png) | bin | 459 -> 459 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_curve_out_in.png (renamed from tools/editor/icons/2x/icon_curve_out_in.png) | bin | 489 -> 489 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_damped_spring_joint_2d.png (renamed from tools/editor/icons/2x/icon_damped_spring_joint_2d.png) | bin | 496 -> 496 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_debug_continue.png (renamed from tools/editor/icons/2x/icon_debug_continue.png) | bin | 525 -> 525 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_debug_next.png (renamed from tools/editor/icons/2x/icon_debug_next.png) | bin | 284 -> 284 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_debug_step.png (renamed from tools/editor/icons/2x/icon_debug_step.png) | bin | 317 -> 317 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_dependency_changed.png (renamed from tools/editor/icons/2x/icon_dependency_changed.png) | bin | 731 -> 731 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_dependency_changed_hl.png (renamed from tools/editor/icons/2x/icon_dependency_changed_hl.png) | bin | 601 -> 601 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_dependency_local_changed.png (renamed from tools/editor/icons/2x/icon_dependency_local_changed.png) | bin | 1104 -> 1104 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_dependency_local_changed_hl.png (renamed from tools/editor/icons/2x/icon_dependency_local_changed_hl.png) | bin | 926 -> 926 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_dependency_ok.png (renamed from tools/editor/icons/2x/icon_dependency_ok.png) | bin | 1015 -> 1015 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_dependency_ok_hl.png (renamed from tools/editor/icons/2x/icon_dependency_ok_hl.png) | bin | 836 -> 836 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_directional_light.png (renamed from tools/editor/icons/2x/icon_directional_light.png) | bin | 756 -> 756 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_distraction_free.png (renamed from tools/editor/icons/2x/icon_distraction_free.png) | bin | 575 -> 575 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_duplicate.png (renamed from tools/editor/icons/2x/icon_duplicate.png) | bin | 225 -> 225 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_dynamic_font.png (renamed from tools/editor/icons/2x/icon_dynamic_font.png) | bin | 383 -> 383 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_dynamic_font_data.png (renamed from tools/editor/icons/2x/icon_dynamic_font_data.png) | bin | 379 -> 379 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_edit.png (renamed from tools/editor/icons/2x/icon_edit.png) | bin | 525 -> 525 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_edit_key.png (renamed from tools/editor/icons/2x/icon_edit_key.png) | bin | 641 -> 641 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_edit_pivot.png (renamed from tools/editor/icons/2x/icon_edit_pivot.png) | bin | 595 -> 595 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_edit_resource.png (renamed from tools/editor/icons/2x/icon_edit_resource.png) | bin | 396 -> 396 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_editor_3d_handle.png (renamed from tools/editor/icons/2x/icon_editor_3d_handle.png) | bin | 705 -> 705 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_editor_handle.png (renamed from tools/editor/icons/2x/icon_editor_handle.png) | bin | 427 -> 427 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_editor_pivot.png (renamed from tools/editor/icons/2x/icon_editor_pivot.png) | bin | 198 -> 198 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_editor_plugin.png (renamed from tools/editor/icons/2x/icon_editor_plugin.png) | bin | 469 -> 469 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_enum.png (renamed from tools/editor/icons/2x/icon_enum.png) | bin | 137 -> 137 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_environment.png (renamed from tools/editor/icons/2x/icon_environment.png) | bin | 1270 -> 1270 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_error.png (renamed from tools/editor/icons/2x/icon_error.png) | bin | 155 -> 155 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_error_sign.png (renamed from tools/editor/icons/2x/icon_error_sign.png) | bin | 441 -> 441 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_event_player.png (renamed from tools/editor/icons/2x/icon_event_player.png) | bin | 167 -> 167 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_favorites.png (renamed from tools/editor/icons/2x/icon_favorites.png) | bin | 702 -> 702 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_file.png (renamed from tools/editor/icons/2x/icon_file.png) | bin | 196 -> 196 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_file_big.png (renamed from tools/editor/icons/2x/icon_file_big.png) | bin | 505 -> 505 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_file_dialog.png (renamed from tools/editor/icons/2x/icon_file_dialog.png) | bin | 342 -> 342 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_file_list.png (renamed from tools/editor/icons/2x/icon_file_list.png) | bin | 137 -> 137 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_file_server.png (renamed from tools/editor/icons/2x/icon_file_server.png) | bin | 172 -> 172 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_file_server_active.png (renamed from tools/editor/icons/2x/icon_file_server_active.png) | bin | 173 -> 173 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_file_thumbnail.png (renamed from tools/editor/icons/2x/icon_file_thumbnail.png) | bin | 137 -> 137 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_filesystem.png (renamed from tools/editor/icons/2x/icon_filesystem.png) | bin | 192 -> 192 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_fixed_material.png (renamed from tools/editor/icons/2x/icon_fixed_material.png) | bin | 736 -> 736 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_fixed_spatial_material.png (renamed from tools/editor/icons/2x/icon_fixed_spatial_material.png) | bin | 768 -> 768 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_folder.png (renamed from tools/editor/icons/2x/icon_folder.png) | bin | 228 -> 228 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_folder_big.png (renamed from tools/editor/icons/2x/icon_folder_big.png) | bin | 991 -> 991 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_font.png (renamed from tools/editor/icons/2x/icon_font.png) | bin | 369 -> 369 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_forward.png (renamed from tools/editor/icons/2x/icon_forward.png) | bin | 326 -> 326 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_g_d_script.png (renamed from tools/editor/icons/2x/icon_g_d_script.png) | bin | 759 -> 759 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_g_i_probe.png (renamed from tools/editor/icons/2x/icon_g_i_probe.png) | bin | 680 -> 680 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_g_i_probe_data.png (renamed from tools/editor/icons/2x/icon_g_i_probe_data.png) | bin | 662 -> 662 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_generic_6_d_o_f_joint.png (renamed from tools/editor/icons/2x/icon_generic_6_d_o_f_joint.png) | bin | 535 -> 535 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_gizmo_directional_light.png (renamed from tools/editor/icons/2x/icon_gizmo_directional_light.png) | bin | 8264 -> 8264 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_gizmo_light.png (renamed from tools/editor/icons/2x/icon_gizmo_light.png) | bin | 6282 -> 6282 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_gizmo_listener.png (renamed from tools/editor/icons/2x/icon_gizmo_listener.png) | bin | 7636 -> 7636 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_gizmo_spatial_sample_player.png (renamed from tools/editor/icons/2x/icon_gizmo_spatial_sample_player.png) | bin | 2831 -> 2831 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_gizmo_spatial_stream_player.png (renamed from tools/editor/icons/2x/icon_gizmo_spatial_stream_player.png) | bin | 3649 -> 3649 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_godot.png (renamed from tools/editor/icons/2x/icon_godot.png) | bin | 1842 -> 1842 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_color_ramp.png (renamed from tools/editor/icons/2x/icon_graph_color_ramp.png) | bin | 342 -> 342 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_comment.png (renamed from tools/editor/icons/2x/icon_graph_comment.png) | bin | 152 -> 152 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_cube_uniform.png (renamed from tools/editor/icons/2x/icon_graph_cube_uniform.png) | bin | 795 -> 795 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_curve_map.png (renamed from tools/editor/icons/2x/icon_graph_curve_map.png) | bin | 587 -> 587 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_default_texture.png (renamed from tools/editor/icons/2x/icon_graph_default_texture.png) | bin | 254 -> 254 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_edit.png (renamed from tools/editor/icons/2x/icon_graph_edit.png) | bin | 815 -> 815 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_input.png (renamed from tools/editor/icons/2x/icon_graph_input.png) | bin | 521 -> 521 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_node.png (renamed from tools/editor/icons/2x/icon_graph_node.png) | bin | 710 -> 710 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_rgb.png (renamed from tools/editor/icons/2x/icon_graph_rgb.png) | bin | 951 -> 951 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_rgb_op.png (renamed from tools/editor/icons/2x/icon_graph_rgb_op.png) | bin | 219 -> 219 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_rgb_uniform.png (renamed from tools/editor/icons/2x/icon_graph_rgb_uniform.png) | bin | 696 -> 696 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_scalar.png (renamed from tools/editor/icons/2x/icon_graph_scalar.png) | bin | 461 -> 461 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_scalar_interp.png (renamed from tools/editor/icons/2x/icon_graph_scalar_interp.png) | bin | 307 -> 307 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_scalar_op.png (renamed from tools/editor/icons/2x/icon_graph_scalar_op.png) | bin | 390 -> 390 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_scalar_uniform.png (renamed from tools/editor/icons/2x/icon_graph_scalar_uniform.png) | bin | 570 -> 570 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_scalars_to_vec.png (renamed from tools/editor/icons/2x/icon_graph_scalars_to_vec.png) | bin | 255 -> 255 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_texscreen.png (renamed from tools/editor/icons/2x/icon_graph_texscreen.png) | bin | 217 -> 217 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_texture_uniform.png (renamed from tools/editor/icons/2x/icon_graph_texture_uniform.png) | bin | 394 -> 394 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_time.png (renamed from tools/editor/icons/2x/icon_graph_time.png) | bin | 819 -> 819 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_vec_dp.png (renamed from tools/editor/icons/2x/icon_graph_vec_dp.png) | bin | 482 -> 482 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_vec_interp.png (renamed from tools/editor/icons/2x/icon_graph_vec_interp.png) | bin | 307 -> 307 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_vec_length.png (renamed from tools/editor/icons/2x/icon_graph_vec_length.png) | bin | 513 -> 513 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_vec_op.png (renamed from tools/editor/icons/2x/icon_graph_vec_op.png) | bin | 387 -> 387 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_vec_scalar_op.png (renamed from tools/editor/icons/2x/icon_graph_vec_scalar_op.png) | bin | 431 -> 431 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_vec_to_scalars.png (renamed from tools/editor/icons/2x/icon_graph_vec_to_scalars.png) | bin | 257 -> 257 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_vecs_to_xform.png (renamed from tools/editor/icons/2x/icon_graph_vecs_to_xform.png) | bin | 282 -> 282 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_vector.png (renamed from tools/editor/icons/2x/icon_graph_vector.png) | bin | 620 -> 620 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_vector_uniform.png (renamed from tools/editor/icons/2x/icon_graph_vector_uniform.png) | bin | 718 -> 718 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_xform.png (renamed from tools/editor/icons/2x/icon_graph_xform.png) | bin | 380 -> 380 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_xform_mult.png (renamed from tools/editor/icons/2x/icon_graph_xform_mult.png) | bin | 321 -> 321 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_xform_scalar_func.png (renamed from tools/editor/icons/2x/icon_graph_xform_scalar_func.png) | bin | 467 -> 467 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_xform_to_vecs.png (renamed from tools/editor/icons/2x/icon_graph_xform_to_vecs.png) | bin | 277 -> 277 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_xform_uniform.png (renamed from tools/editor/icons/2x/icon_graph_xform_uniform.png) | bin | 526 -> 526 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_xform_vec_func.png (renamed from tools/editor/icons/2x/icon_graph_xform_vec_func.png) | bin | 476 -> 476 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_xform_vec_imult.png (renamed from tools/editor/icons/2x/icon_graph_xform_vec_imult.png) | bin | 601 -> 601 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_graph_xform_vec_mult.png (renamed from tools/editor/icons/2x/icon_graph_xform_vec_mult.png) | bin | 600 -> 600 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_grid.png (renamed from tools/editor/icons/2x/icon_grid.png) | bin | 194 -> 194 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_grid_container.png (renamed from tools/editor/icons/2x/icon_grid_container.png) | bin | 329 -> 329 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_grid_map.png (renamed from tools/editor/icons/2x/icon_grid_map.png) | bin | 138 -> 138 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_groove_joint_2d.png (renamed from tools/editor/icons/2x/icon_groove_joint_2d.png) | bin | 179 -> 179 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_group.png (renamed from tools/editor/icons/2x/icon_group.png) | bin | 207 -> 207 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_groups.png (renamed from tools/editor/icons/2x/icon_groups.png) | bin | 353 -> 353 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_h_box_container.png (renamed from tools/editor/icons/2x/icon_h_box_container.png) | bin | 307 -> 307 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_h_button_array.png (renamed from tools/editor/icons/2x/icon_h_button_array.png) | bin | 224 -> 224 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_h_scroll_bar.png (renamed from tools/editor/icons/2x/icon_h_scroll_bar.png) | bin | 324 -> 324 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_h_separator.png (renamed from tools/editor/icons/2x/icon_h_separator.png) | bin | 148 -> 148 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_h_slider.png (renamed from tools/editor/icons/2x/icon_h_slider.png) | bin | 360 -> 360 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_h_split_container.png (renamed from tools/editor/icons/2x/icon_h_split_container.png) | bin | 399 -> 399 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_h_t_t_p_request.png (renamed from tools/editor/icons/2x/icon_h_t_t_p_request.png) | bin | 425 -> 425 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_headphones.png (renamed from tools/editor/icons/2x/icon_headphones.png) | bin | 620 -> 620 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_help.png (renamed from tools/editor/icons/2x/icon_help.png) | bin | 1126 -> 1126 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_hidden.png (renamed from tools/editor/icons/2x/icon_hidden.png) | bin | 640 -> 640 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_hinge_joint.png (renamed from tools/editor/icons/2x/icon_hinge_joint.png) | bin | 663 -> 663 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_history.png (renamed from tools/editor/icons/2x/icon_history.png) | bin | 814 -> 814 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_hsize.png (renamed from tools/editor/icons/2x/icon_hsize.png) | bin | 247 -> 247 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_image.png (renamed from tools/editor/icons/2x/icon_image.png) | bin | 404 -> 404 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_image_sky_box.png (renamed from tools/editor/icons/2x/icon_image_sky_box.png) | bin | 904 -> 904 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_image_texture.png (renamed from tools/editor/icons/2x/icon_image_texture.png) | bin | 262 -> 262 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_immediate_geometry.png (renamed from tools/editor/icons/2x/icon_immediate_geometry.png) | bin | 706 -> 706 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_import_check.png (renamed from tools/editor/icons/2x/icon_import_check.png) | bin | 386 -> 386 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_import_fail.png (renamed from tools/editor/icons/2x/icon_import_fail.png) | bin | 464 -> 464 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_instance.png (renamed from tools/editor/icons/2x/icon_instance.png) | bin | 817 -> 817 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_instance_options.png (renamed from tools/editor/icons/2x/icon_instance_options.png) | bin | 708 -> 708 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_integer.png (renamed from tools/editor/icons/2x/icon_integer.png) | bin | 147 -> 147 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_interp_cubic.png (renamed from tools/editor/icons/2x/icon_interp_cubic.png) | bin | 483 -> 483 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_interp_linear.png (renamed from tools/editor/icons/2x/icon_interp_linear.png) | bin | 398 -> 398 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_interp_raw.png (renamed from tools/editor/icons/2x/icon_interp_raw.png) | bin | 221 -> 221 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_interp_wrap_clamp.png (renamed from tools/editor/icons/2x/icon_interp_wrap_clamp.png) | bin | 348 -> 348 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_interp_wrap_loop.png (renamed from tools/editor/icons/2x/icon_interp_wrap_loop.png) | bin | 548 -> 548 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_interpolated_camera.png (renamed from tools/editor/icons/2x/icon_interpolated_camera.png) | bin | 454 -> 454 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_invalid_key.png (renamed from tools/editor/icons/2x/icon_invalid_key.png) | bin | 385 -> 385 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_inverse_kinematics.png (renamed from tools/editor/icons/2x/icon_inverse_kinematics.png) | bin | 459 -> 459 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_item_list.png (renamed from tools/editor/icons/2x/icon_item_list.png) | bin | 338 -> 338 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_joy_axis.png (renamed from tools/editor/icons/2x/icon_joy_axis.png) | bin | 425 -> 425 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_joy_button.png (renamed from tools/editor/icons/2x/icon_joy_button.png) | bin | 499 -> 499 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_joypad.png (renamed from tools/editor/icons/2x/icon_joypad.png) | bin | 380 -> 380 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_key.png (renamed from tools/editor/icons/2x/icon_key.png) | bin | 572 -> 572 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_key_hover.png (renamed from tools/editor/icons/2x/icon_key_hover.png) | bin | 376 -> 376 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_key_invalid.png (renamed from tools/editor/icons/2x/icon_key_invalid.png) | bin | 385 -> 385 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_key_next.png (renamed from tools/editor/icons/2x/icon_key_next.png) | bin | 579 -> 579 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_key_selected.png (renamed from tools/editor/icons/2x/icon_key_selected.png) | bin | 353 -> 353 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_key_value.png (renamed from tools/editor/icons/2x/icon_key_value.png) | bin | 380 -> 380 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_key_xform.png (renamed from tools/editor/icons/2x/icon_key_xform.png) | bin | 388 -> 388 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_keyboard.png (renamed from tools/editor/icons/2x/icon_keyboard.png) | bin | 486 -> 486 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_kinematic_body.png (renamed from tools/editor/icons/2x/icon_kinematic_body.png) | bin | 197 -> 197 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_kinematic_body_2d.png (renamed from tools/editor/icons/2x/icon_kinematic_body_2d.png) | bin | 204 -> 204 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_label.png (renamed from tools/editor/icons/2x/icon_label.png) | bin | 370 -> 370 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_large_texture.png (renamed from tools/editor/icons/2x/icon_large_texture.png) | bin | 211 -> 211 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_light_2d.png (renamed from tools/editor/icons/2x/icon_light_2d.png) | bin | 669 -> 669 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_light_occluder_2d.png (renamed from tools/editor/icons/2x/icon_light_occluder_2d.png) | bin | 175 -> 175 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_line_2d.png | bin | 0 -> 795 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_line_edit.png (renamed from tools/editor/icons/2x/icon_line_edit.png) | bin | 323 -> 323 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_line_shape_2d.png (renamed from tools/editor/icons/2x/icon_line_shape_2d.png) | bin | 597 -> 597 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_link_button.png (renamed from tools/editor/icons/2x/icon_link_button.png) | bin | 774 -> 774 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_list_select.png (renamed from tools/editor/icons/2x/icon_list_select.png) | bin | 653 -> 653 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_listener.png (renamed from tools/editor/icons/2x/icon_listener.png) | bin | 885 -> 885 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_load.png (renamed from tools/editor/icons/2x/icon_load.png) | bin | 523 -> 523 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_lock.png (renamed from tools/editor/icons/2x/icon_lock.png) | bin | 441 -> 441 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_loop.png (renamed from tools/editor/icons/2x/icon_loop.png) | bin | 806 -> 806 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_loop_interpolation.png (renamed from tools/editor/icons/2x/icon_loop_interpolation.png) | bin | 709 -> 709 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_main_play.png (renamed from tools/editor/icons/2x/icon_main_play.png) | bin | 359 -> 359 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_main_stop.png (renamed from tools/editor/icons/2x/icon_main_stop.png) | bin | 197 -> 197 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_margin_container.png (renamed from tools/editor/icons/2x/icon_margin_container.png) | bin | 365 -> 365 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_material_preview_cube.png (renamed from tools/editor/icons/2x/icon_material_preview_cube.png) | bin | 562 -> 562 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_material_preview_cube_off.png (renamed from tools/editor/icons/2x/icon_material_preview_cube_off.png) | bin | 598 -> 598 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_material_preview_light_1.png (renamed from tools/editor/icons/2x/icon_material_preview_light_1.png) | bin | 724 -> 724 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_material_preview_light_1_off.png (renamed from tools/editor/icons/2x/icon_material_preview_light_1_off.png) | bin | 596 -> 596 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_material_preview_light_2.png (renamed from tools/editor/icons/2x/icon_material_preview_light_2.png) | bin | 740 -> 740 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_material_preview_light_2_off.png (renamed from tools/editor/icons/2x/icon_material_preview_light_2_off.png) | bin | 843 -> 843 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_material_preview_sphere.png (renamed from tools/editor/icons/2x/icon_material_preview_sphere.png) | bin | 704 -> 704 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_material_preview_sphere_off.png (renamed from tools/editor/icons/2x/icon_material_preview_sphere_off.png) | bin | 518 -> 518 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_material_shader.png (renamed from tools/editor/icons/2x/icon_material_shader.png) | bin | 342 -> 342 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_material_shader_graph.png (renamed from tools/editor/icons/2x/icon_material_shader_graph.png) | bin | 707 -> 707 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_matrix.png (renamed from tools/editor/icons/2x/icon_matrix.png) | bin | 185 -> 185 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_menu_button.png (renamed from tools/editor/icons/2x/icon_menu_button.png) | bin | 296 -> 296 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mesh.png (renamed from tools/editor/icons/2x/icon_mesh.png) | bin | 582 -> 582 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mesh_instance.png (renamed from tools/editor/icons/2x/icon_mesh_instance.png) | bin | 563 -> 563 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mesh_library.png (renamed from tools/editor/icons/2x/icon_mesh_library.png) | bin | 631 -> 631 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_aabb.png (renamed from tools/editor/icons/2x/icon_mini_aabb.png) | bin | 695 -> 695 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_array.png (renamed from tools/editor/icons/2x/icon_mini_array.png) | bin | 326 -> 326 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_boolean.png (renamed from tools/editor/icons/2x/icon_mini_boolean.png) | bin | 434 -> 434 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_color.png (renamed from tools/editor/icons/2x/icon_mini_color.png) | bin | 411 -> 411 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_color_array.png (renamed from tools/editor/icons/2x/icon_mini_color_array.png) | bin | 445 -> 445 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_dictionary.png (renamed from tools/editor/icons/2x/icon_mini_dictionary.png) | bin | 371 -> 371 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_float.png (renamed from tools/editor/icons/2x/icon_mini_float.png) | bin | 355 -> 355 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_float_array.png (renamed from tools/editor/icons/2x/icon_mini_float_array.png) | bin | 451 -> 451 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_image.png (renamed from tools/editor/icons/2x/icon_mini_image.png) | bin | 450 -> 450 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_input.png (renamed from tools/editor/icons/2x/icon_mini_input.png) | bin | 409 -> 409 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_int_array.png (renamed from tools/editor/icons/2x/icon_mini_int_array.png) | bin | 384 -> 384 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_integer.png (renamed from tools/editor/icons/2x/icon_mini_integer.png) | bin | 367 -> 367 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_matrix3.png (renamed from tools/editor/icons/2x/icon_mini_matrix3.png) | bin | 391 -> 391 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_matrix32.png (renamed from tools/editor/icons/2x/icon_mini_matrix32.png) | bin | 573 -> 573 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_object.png (renamed from tools/editor/icons/2x/icon_mini_object.png) | bin | 507 -> 507 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_path.png (renamed from tools/editor/icons/2x/icon_mini_path.png) | bin | 435 -> 435 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_plane.png (renamed from tools/editor/icons/2x/icon_mini_plane.png) | bin | 424 -> 424 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_quat.png (renamed from tools/editor/icons/2x/icon_mini_quat.png) | bin | 509 -> 509 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_raw_array.png (renamed from tools/editor/icons/2x/icon_mini_raw_array.png) | bin | 382 -> 382 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_rect2.png (renamed from tools/editor/icons/2x/icon_mini_rect2.png) | bin | 431 -> 431 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_rid.png (renamed from tools/editor/icons/2x/icon_mini_rid.png) | bin | 349 -> 349 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_string.png (renamed from tools/editor/icons/2x/icon_mini_string.png) | bin | 437 -> 437 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_string_array.png (renamed from tools/editor/icons/2x/icon_mini_string_array.png) | bin | 479 -> 479 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_transform.png (renamed from tools/editor/icons/2x/icon_mini_transform.png) | bin | 539 -> 539 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_variant.png (renamed from tools/editor/icons/2x/icon_mini_variant.png) | bin | 405 -> 405 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_vector2.png (renamed from tools/editor/icons/2x/icon_mini_vector2.png) | bin | 541 -> 541 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_vector2_array.png (renamed from tools/editor/icons/2x/icon_mini_vector2_array.png) | bin | 485 -> 485 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_vector3.png (renamed from tools/editor/icons/2x/icon_mini_vector3.png) | bin | 509 -> 509 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mini_vector3_array.png (renamed from tools/editor/icons/2x/icon_mini_vector3_array.png) | bin | 416 -> 416 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mirror_x.png (renamed from tools/editor/icons/2x/icon_mirror_x.png) | bin | 247 -> 247 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mirror_y.png (renamed from tools/editor/icons/2x/icon_mirror_y.png) | bin | 240 -> 240 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_mouse.png (renamed from tools/editor/icons/2x/icon_mouse.png) | bin | 476 -> 476 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_move_down.png (renamed from tools/editor/icons/2x/icon_move_down.png) | bin | 357 -> 357 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_move_point.png (renamed from tools/editor/icons/2x/icon_move_point.png) | bin | 1205 -> 1205 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_move_up.png (renamed from tools/editor/icons/2x/icon_move_up.png) | bin | 346 -> 346 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_multi_edit.png (renamed from tools/editor/icons/2x/icon_multi_edit.png) | bin | 558 -> 558 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_multi_line.png (renamed from tools/editor/icons/2x/icon_multi_line.png) | bin | 166 -> 166 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_multi_mesh.png (renamed from tools/editor/icons/2x/icon_multi_mesh.png) | bin | 591 -> 591 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_multi_mesh_instance.png (renamed from tools/editor/icons/2x/icon_multi_mesh_instance.png) | bin | 653 -> 653 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_multi_node_edit.png (renamed from tools/editor/icons/2x/icon_multi_node_edit.png) | bin | 558 -> 558 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_navigation.png (renamed from tools/editor/icons/2x/icon_navigation.png) | bin | 534 -> 534 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_navigation_2d.png (renamed from tools/editor/icons/2x/icon_navigation_2d.png) | bin | 558 -> 558 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_navigation_mesh.png (renamed from tools/editor/icons/2x/icon_navigation_mesh.png) | bin | 806 -> 806 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_navigation_mesh_instance.png (renamed from tools/editor/icons/2x/icon_navigation_mesh_instance.png) | bin | 867 -> 867 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_navigation_polygon.png (renamed from tools/editor/icons/2x/icon_navigation_polygon.png) | bin | 640 -> 640 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_navigation_polygon_instance.png (renamed from tools/editor/icons/2x/icon_navigation_polygon_instance.png) | bin | 712 -> 712 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_new.png (renamed from tools/editor/icons/2x/icon_new.png) | bin | 196 -> 196 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_nine_patch_rect.png (renamed from tools/editor/icons/2x/icon_nine_patch_rect.png) | bin | 162 -> 162 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_node.png (renamed from tools/editor/icons/2x/icon_node.png) | bin | 788 -> 788 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_node_2d.png (renamed from tools/editor/icons/2x/icon_node_2d.png) | bin | 864 -> 864 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_node_warning.png (renamed from tools/editor/icons/2x/icon_node_warning.png) | bin | 443 -> 443 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_non_favorite.png (renamed from tools/editor/icons/2x/icon_non_favorite.png) | bin | 946 -> 946 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_object.png (renamed from tools/editor/icons/2x/icon_object.png) | bin | 500 -> 500 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_occluder_polygon_2d.png (renamed from tools/editor/icons/2x/icon_occluder_polygon_2d.png) | bin | 384 -> 384 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_omni_light.png (renamed from tools/editor/icons/2x/icon_omni_light.png) | bin | 659 -> 659 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_open.png (renamed from tools/editor/icons/2x/icon_open.png) | bin | 228 -> 228 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_option_button.png (renamed from tools/editor/icons/2x/icon_option_button.png) | bin | 366 -> 366 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_override.png (renamed from tools/editor/icons/2x/icon_override.png) | bin | 488 -> 488 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_p_hash_translation.png (renamed from tools/editor/icons/2x/icon_p_hash_translation.png) | bin | 285 -> 285 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_packed_data_container.png (renamed from tools/editor/icons/2x/icon_packed_data_container.png) | bin | 253 -> 253 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_packed_scene.png (renamed from tools/editor/icons/2x/icon_packed_scene.png) | bin | 569 -> 569 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_panel.png (renamed from tools/editor/icons/2x/icon_panel.png) | bin | 277 -> 277 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_panel_container.png (renamed from tools/editor/icons/2x/icon_panel_container.png) | bin | 309 -> 309 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_panels_1.png (renamed from tools/editor/icons/2x/icon_panels_1.png) | bin | 117 -> 117 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_panels_2.png (renamed from tools/editor/icons/2x/icon_panels_2.png) | bin | 127 -> 127 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_panels_2_alt.png (renamed from tools/editor/icons/2x/icon_panels_2_alt.png) | bin | 134 -> 134 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_panels_3.png (renamed from tools/editor/icons/2x/icon_panels_3.png) | bin | 141 -> 141 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_panels_3_alt.png (renamed from tools/editor/icons/2x/icon_panels_3_alt.png) | bin | 152 -> 152 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_panels_4.png (renamed from tools/editor/icons/2x/icon_panels_4.png) | bin | 136 -> 136 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_parallax_background.png (renamed from tools/editor/icons/2x/icon_parallax_background.png) | bin | 335 -> 335 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_parallax_layer.png (renamed from tools/editor/icons/2x/icon_parallax_layer.png) | bin | 469 -> 469 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_particle_attractor_2d.png (renamed from tools/editor/icons/2x/icon_particle_attractor_2d.png) | bin | 1578 -> 1578 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_particles.png (renamed from tools/editor/icons/2x/icon_particles.png) | bin | 686 -> 686 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_particles_2d.png (renamed from tools/editor/icons/2x/icon_particles_2d.png) | bin | 728 -> 728 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_particles_shader.png (renamed from tools/editor/icons/2x/icon_particles_shader.png) | bin | 657 -> 657 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_patch_9_rect.png (renamed from tools/editor/icons/2x/icon_patch_9_rect.png) | bin | 162 -> 162 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_path.png (renamed from tools/editor/icons/2x/icon_path.png) | bin | 666 -> 666 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_path_2d.png (renamed from tools/editor/icons/2x/icon_path_2d.png) | bin | 687 -> 687 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_path_follow.png (renamed from tools/editor/icons/2x/icon_path_follow.png) | bin | 725 -> 725 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_path_follow_2d.png (renamed from tools/editor/icons/2x/icon_path_follow_2d.png) | bin | 725 -> 725 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_pause.png (renamed from tools/editor/icons/2x/icon_pause.png) | bin | 194 -> 194 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_pin.png (renamed from tools/editor/icons/2x/icon_pin.png) | bin | 322 -> 322 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_pin_joint.png (renamed from tools/editor/icons/2x/icon_pin_joint.png) | bin | 686 -> 686 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_pin_joint_2d.png (renamed from tools/editor/icons/2x/icon_pin_joint_2d.png) | bin | 719 -> 719 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_pin_pressed.png (renamed from tools/editor/icons/2x/icon_pin_pressed.png) | bin | 322 -> 322 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_plane.png (renamed from tools/editor/icons/2x/icon_plane.png) | bin | 306 -> 306 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_plane_shape.png (renamed from tools/editor/icons/2x/icon_plane_shape.png) | bin | 316 -> 316 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_play.png (renamed from tools/editor/icons/2x/icon_play.png) | bin | 395 -> 395 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_play_backwards.png (renamed from tools/editor/icons/2x/icon_play_backwards.png) | bin | 424 -> 424 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_play_custom.png (renamed from tools/editor/icons/2x/icon_play_custom.png) | bin | 572 -> 572 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_play_scene.png (renamed from tools/editor/icons/2x/icon_play_scene.png) | bin | 686 -> 686 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_play_start.png (renamed from tools/editor/icons/2x/icon_play_start.png) | bin | 463 -> 463 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_play_start_backwards.png (renamed from tools/editor/icons/2x/icon_play_start_backwards.png) | bin | 497 -> 497 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_polygon_2d.png (renamed from tools/editor/icons/2x/icon_polygon_2d.png) | bin | 407 -> 407 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_polygon_path_finder.png (renamed from tools/editor/icons/2x/icon_polygon_path_finder.png) | bin | 491 -> 491 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_popup.png (renamed from tools/editor/icons/2x/icon_popup.png) | bin | 329 -> 329 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_popup_dialog.png (renamed from tools/editor/icons/2x/icon_popup_dialog.png) | bin | 347 -> 347 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_popup_menu.png (renamed from tools/editor/icons/2x/icon_popup_menu.png) | bin | 301 -> 301 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_popup_panel.png (renamed from tools/editor/icons/2x/icon_popup_panel.png) | bin | 279 -> 279 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_portal.png (renamed from tools/editor/icons/2x/icon_portal.png) | bin | 855 -> 855 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_position_2d.png (renamed from tools/editor/icons/2x/icon_position_2d.png) | bin | 152 -> 152 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_position_3d.png (renamed from tools/editor/icons/2x/icon_position_3d.png) | bin | 151 -> 151 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_progress_1.png (renamed from tools/editor/icons/2x/icon_progress_1.png) | bin | 781 -> 781 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_progress_2.png (renamed from tools/editor/icons/2x/icon_progress_2.png) | bin | 785 -> 785 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_progress_3.png (renamed from tools/editor/icons/2x/icon_progress_3.png) | bin | 800 -> 800 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_progress_4.png (renamed from tools/editor/icons/2x/icon_progress_4.png) | bin | 808 -> 808 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_progress_5.png (renamed from tools/editor/icons/2x/icon_progress_5.png) | bin | 807 -> 807 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_progress_6.png (renamed from tools/editor/icons/2x/icon_progress_6.png) | bin | 793 -> 793 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_progress_7.png (renamed from tools/editor/icons/2x/icon_progress_7.png) | bin | 815 -> 815 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_progress_8.png (renamed from tools/editor/icons/2x/icon_progress_8.png) | bin | 791 -> 791 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_progress_bar.png (renamed from tools/editor/icons/2x/icon_progress_bar.png) | bin | 328 -> 328 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_proximity_group.png (renamed from tools/editor/icons/2x/icon_proximity_group.png) | bin | 326 -> 326 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_quad.png (renamed from tools/editor/icons/2x/icon_quad.png) | bin | 289 -> 289 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_quat.png (renamed from tools/editor/icons/2x/icon_quat.png) | bin | 668 -> 668 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_range.png (renamed from tools/editor/icons/2x/icon_range.png) | bin | 177 -> 177 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rating_no_star.png (renamed from tools/editor/icons/2x/icon_rating_no_star.png) | bin | 1077 -> 1077 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rating_star.png (renamed from tools/editor/icons/2x/icon_rating_star.png) | bin | 696 -> 696 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_ray_cast.png (renamed from tools/editor/icons/2x/icon_ray_cast.png) | bin | 308 -> 308 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_ray_cast_2d.png (renamed from tools/editor/icons/2x/icon_ray_cast_2d.png) | bin | 337 -> 337 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_ray_shape.png (renamed from tools/editor/icons/2x/icon_ray_shape.png) | bin | 541 -> 541 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_ray_shape_2d.png (renamed from tools/editor/icons/2x/icon_ray_shape_2d.png) | bin | 330 -> 330 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rayito.png (renamed from tools/editor/icons/2x/icon_rayito.png) | bin | 449 -> 449 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_real.png (renamed from tools/editor/icons/2x/icon_real.png) | bin | 423 -> 423 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rectangle_shape_2d.png (renamed from tools/editor/icons/2x/icon_rectangle_shape_2d.png) | bin | 213 -> 213 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_reference_rect.png (renamed from tools/editor/icons/2x/icon_reference_rect.png) | bin | 160 -> 160 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_reflection_probe.png (renamed from tools/editor/icons/2x/icon_reflection_probe.png) | bin | 533 -> 533 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_region_edit.png (renamed from tools/editor/icons/2x/icon_region_edit.png) | bin | 158 -> 158 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_reload.png (renamed from tools/editor/icons/2x/icon_reload.png) | bin | 786 -> 786 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_reload_small.png (renamed from tools/editor/icons/2x/icon_reload_small.png) | bin | 756 -> 756 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_remote.png (renamed from tools/editor/icons/2x/icon_remote.png) | bin | 824 -> 824 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_remote_transform.png (renamed from tools/editor/icons/2x/icon_remote_transform.png) | bin | 1140 -> 1140 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_remote_transform_2d.png (renamed from tools/editor/icons/2x/icon_remote_transform_2d.png) | bin | 1197 -> 1197 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_remove.png (renamed from tools/editor/icons/2x/icon_remove.png) | bin | 271 -> 271 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rename.png (renamed from tools/editor/icons/2x/icon_rename.png) | bin | 215 -> 215 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_reparent.png (renamed from tools/editor/icons/2x/icon_reparent.png) | bin | 741 -> 741 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_resource_preloader.png (renamed from tools/editor/icons/2x/icon_resource_preloader.png) | bin | 609 -> 609 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rich_text_label.png (renamed from tools/editor/icons/2x/icon_rich_text_label.png) | bin | 313 -> 313 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rigid_body.png (renamed from tools/editor/icons/2x/icon_rigid_body.png) | bin | 1139 -> 1139 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rigid_body_2d.png (renamed from tools/editor/icons/2x/icon_rigid_body_2d.png) | bin | 1206 -> 1206 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_room.png (renamed from tools/editor/icons/2x/icon_room.png) | bin | 567 -> 567 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_room_bounds.png (renamed from tools/editor/icons/2x/icon_room_bounds.png) | bin | 631 -> 631 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rotate_0.png (renamed from tools/editor/icons/2x/icon_rotate_0.png) | bin | 878 -> 878 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rotate_180.png (renamed from tools/editor/icons/2x/icon_rotate_180.png) | bin | 713 -> 713 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rotate_270.png (renamed from tools/editor/icons/2x/icon_rotate_270.png) | bin | 666 -> 666 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_rotate_90.png (renamed from tools/editor/icons/2x/icon_rotate_90.png) | bin | 805 -> 805 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_sample.png (renamed from tools/editor/icons/2x/icon_sample.png) | bin | 197 -> 197 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_sample_library.png (renamed from tools/editor/icons/2x/icon_sample_library.png) | bin | 568 -> 568 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_sample_player.png (renamed from tools/editor/icons/2x/icon_sample_player.png) | bin | 345 -> 345 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_sample_player_2d.png (renamed from tools/editor/icons/2x/icon_sample_player_2d.png) | bin | 376 -> 376 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_save.png (renamed from tools/editor/icons/2x/icon_save.png) | bin | 466 -> 466 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_script.png (renamed from tools/editor/icons/2x/icon_script.png) | bin | 465 -> 465 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_script_create.png (renamed from tools/editor/icons/2x/icon_script_create.png) | bin | 491 -> 491 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_script_remove.png (renamed from tools/editor/icons/2x/icon_script_remove.png) | bin | 787 -> 787 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_scroll_bar.png (renamed from tools/editor/icons/2x/icon_scroll_bar.png) | bin | 324 -> 324 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_scroll_container.png (renamed from tools/editor/icons/2x/icon_scroll_container.png) | bin | 483 -> 483 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_segment_shape_2d.png (renamed from tools/editor/icons/2x/icon_segment_shape_2d.png) | bin | 320 -> 320 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_shader.png (renamed from tools/editor/icons/2x/icon_shader.png) | bin | 342 -> 342 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_shader_material.png (renamed from tools/editor/icons/2x/icon_shader_material.png) | bin | 342 -> 342 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_short_cut.png (renamed from tools/editor/icons/2x/icon_short_cut.png) | bin | 473 -> 473 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_signal.png (renamed from tools/editor/icons/2x/icon_signal.png) | bin | 327 -> 327 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_skeleton.png (renamed from tools/editor/icons/2x/icon_skeleton.png) | bin | 649 -> 649 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_slider_joint.png (renamed from tools/editor/icons/2x/icon_slider_joint.png) | bin | 180 -> 180 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_slot.png (renamed from tools/editor/icons/2x/icon_slot.png) | bin | 342 -> 342 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_snap.png (renamed from tools/editor/icons/2x/icon_snap.png) | bin | 424 -> 424 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_sound_room_params.png (renamed from tools/editor/icons/2x/icon_sound_room_params.png) | bin | 375 -> 375 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_spatial.png (renamed from tools/editor/icons/2x/icon_spatial.png) | bin | 835 -> 835 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_spatial_sample_player.png (renamed from tools/editor/icons/2x/icon_spatial_sample_player.png) | bin | 353 -> 353 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_spatial_shader.png (renamed from tools/editor/icons/2x/icon_spatial_shader.png) | bin | 704 -> 704 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_spatial_stream_player.png (renamed from tools/editor/icons/2x/icon_spatial_stream_player.png) | bin | 262 -> 262 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_sphere_shape.png (renamed from tools/editor/icons/2x/icon_sphere_shape.png) | bin | 712 -> 712 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_spin_box.png (renamed from tools/editor/icons/2x/icon_spin_box.png) | bin | 436 -> 436 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_spot_light.png (renamed from tools/editor/icons/2x/icon_spot_light.png) | bin | 669 -> 669 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_sprite.png (renamed from tools/editor/icons/2x/icon_sprite.png) | bin | 841 -> 841 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_sprite_3d.png (renamed from tools/editor/icons/2x/icon_sprite_3d.png) | bin | 838 -> 838 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_sprite_frames.png (renamed from tools/editor/icons/2x/icon_sprite_frames.png) | bin | 691 -> 691 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_static_body.png (renamed from tools/editor/icons/2x/icon_static_body.png) | bin | 397 -> 397 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_static_body_2d.png (renamed from tools/editor/icons/2x/icon_static_body_2d.png) | bin | 417 -> 417 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_stream_player.png (renamed from tools/editor/icons/2x/icon_stream_player.png) | bin | 263 -> 263 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_string.png (renamed from tools/editor/icons/2x/icon_string.png) | bin | 217 -> 217 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_style_box_empty.png (renamed from tools/editor/icons/2x/icon_style_box_empty.png) | bin | 555 -> 555 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_style_box_flat.png (renamed from tools/editor/icons/2x/icon_style_box_flat.png) | bin | 695 -> 695 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_style_box_texture.png (renamed from tools/editor/icons/2x/icon_style_box_texture.png) | bin | 693 -> 693 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tab_container.png (renamed from tools/editor/icons/2x/icon_tab_container.png) | bin | 334 -> 334 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tabs.png (renamed from tools/editor/icons/2x/icon_tabs.png) | bin | 222 -> 222 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_test_cube.png (renamed from tools/editor/icons/2x/icon_test_cube.png) | bin | 596 -> 596 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_text_edit.png (renamed from tools/editor/icons/2x/icon_text_edit.png) | bin | 329 -> 329 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_texture.png (renamed from tools/editor/icons/2x/icon_texture.png) | bin | 262 -> 262 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_texture_button.png (renamed from tools/editor/icons/2x/icon_texture_button.png) | bin | 190 -> 190 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_texture_progress.png (renamed from tools/editor/icons/2x/icon_texture_progress.png) | bin | 344 -> 344 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_texture_rect.png (renamed from tools/editor/icons/2x/icon_texture_rect.png) | bin | 201 -> 201 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_theme.png (renamed from tools/editor/icons/2x/icon_theme.png) | bin | 809 -> 809 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tile_map.png (renamed from tools/editor/icons/2x/icon_tile_map.png) | bin | 139 -> 139 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tile_set.png (renamed from tools/editor/icons/2x/icon_tile_set.png) | bin | 242 -> 242 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_timer.png (renamed from tools/editor/icons/2x/icon_timer.png) | bin | 909 -> 909 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tool_button.png (renamed from tools/editor/icons/2x/icon_tool_button.png) | bin | 425 -> 425 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tool_move.png (renamed from tools/editor/icons/2x/icon_tool_move.png) | bin | 353 -> 353 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tool_pan.png (renamed from tools/editor/icons/2x/icon_tool_pan.png) | bin | 479 -> 479 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tool_rotate.png (renamed from tools/editor/icons/2x/icon_tool_rotate.png) | bin | 786 -> 786 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tool_scale.png (renamed from tools/editor/icons/2x/icon_tool_scale.png) | bin | 562 -> 562 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tool_select.png (renamed from tools/editor/icons/2x/icon_tool_select.png) | bin | 659 -> 659 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tools.png (renamed from tools/editor/icons/2x/icon_tools.png) | bin | 759 -> 759 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_touch_screen_button.png (renamed from tools/editor/icons/2x/icon_touch_screen_button.png) | bin | 511 -> 511 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_track_add_key.png (renamed from tools/editor/icons/2x/icon_track_add_key.png) | bin | 127 -> 127 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_track_add_key_hl.png (renamed from tools/editor/icons/2x/icon_track_add_key_hl.png) | bin | 128 -> 128 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_track_continuous.png (renamed from tools/editor/icons/2x/icon_track_continuous.png) | bin | 434 -> 434 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_track_discrete.png (renamed from tools/editor/icons/2x/icon_track_discrete.png) | bin | 196 -> 196 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_track_trigger.png (renamed from tools/editor/icons/2x/icon_track_trigger.png) | bin | 214 -> 214 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_translation.png (renamed from tools/editor/icons/2x/icon_translation.png) | bin | 285 -> 285 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_transparent.png (renamed from tools/editor/icons/2x/icon_transparent.png) | bin | 177 -> 177 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_transpose.png (renamed from tools/editor/icons/2x/icon_transpose.png) | bin | 210 -> 210 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tree.png (renamed from tools/editor/icons/2x/icon_tree.png) | bin | 417 -> 417 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_tween.png (renamed from tools/editor/icons/2x/icon_tween.png) | bin | 315 -> 315 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_unbone.png (renamed from tools/editor/icons/2x/icon_unbone.png) | bin | 661 -> 661 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_ungroup.png (renamed from tools/editor/icons/2x/icon_ungroup.png) | bin | 202 -> 202 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_uninstance.png (renamed from tools/editor/icons/2x/icon_uninstance.png) | bin | 883 -> 883 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_unlock.png (renamed from tools/editor/icons/2x/icon_unlock.png) | bin | 388 -> 388 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_uv.png (renamed from tools/editor/icons/2x/icon_uv.png) | bin | 502 -> 502 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_v_box_container.png (renamed from tools/editor/icons/2x/icon_v_box_container.png) | bin | 327 -> 327 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_v_button_array.png (renamed from tools/editor/icons/2x/icon_v_button_array.png) | bin | 231 -> 231 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_v_scroll_bar.png (renamed from tools/editor/icons/2x/icon_v_scroll_bar.png) | bin | 328 -> 328 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_v_separator.png (renamed from tools/editor/icons/2x/icon_v_separator.png) | bin | 154 -> 154 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_v_slider.png (renamed from tools/editor/icons/2x/icon_v_slider.png) | bin | 391 -> 391 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_v_split_container.png (renamed from tools/editor/icons/2x/icon_v_split_container.png) | bin | 425 -> 425 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_vector.png (renamed from tools/editor/icons/2x/icon_vector.png) | bin | 270 -> 270 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_vector2.png (renamed from tools/editor/icons/2x/icon_vector2.png) | bin | 141 -> 141 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_vehicle_body.png (renamed from tools/editor/icons/2x/icon_vehicle_body.png) | bin | 410 -> 410 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_vehicle_wheel.png (renamed from tools/editor/icons/2x/icon_vehicle_wheel.png) | bin | 1269 -> 1269 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_video_player.png (renamed from tools/editor/icons/2x/icon_video_player.png) | bin | 501 -> 501 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_viewport.png (renamed from tools/editor/icons/2x/icon_viewport.png) | bin | 349 -> 349 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_viewport_container.png (renamed from tools/editor/icons/2x/icon_viewport_container.png) | bin | 528 -> 528 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_viewport_sprite.png (renamed from tools/editor/icons/2x/icon_viewport_sprite.png) | bin | 403 -> 403 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_viewport_texture.png (renamed from tools/editor/icons/2x/icon_viewport_texture.png) | bin | 404 -> 404 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_visibility_enabler.png (renamed from tools/editor/icons/2x/icon_visibility_enabler.png) | bin | 1106 -> 1106 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_visibility_enabler_2d.png (renamed from tools/editor/icons/2x/icon_visibility_enabler_2d.png) | bin | 1114 -> 1114 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_visibility_notifier.png (renamed from tools/editor/icons/2x/icon_visibility_notifier.png) | bin | 832 -> 832 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_visibility_notifier_2d.png (renamed from tools/editor/icons/2x/icon_visibility_notifier_2d.png) | bin | 844 -> 844 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_visible.png (renamed from tools/editor/icons/2x/icon_visible.png) | bin | 994 -> 994 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_visual_script.png (renamed from tools/editor/icons/2x/icon_visual_script.png) | bin | 707 -> 707 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_visual_shader_port.png (renamed from tools/editor/icons/2x/icon_visual_shader_port.png) | bin | 338 -> 338 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_vu_empty.png (renamed from tools/editor/icons/2x/icon_vu_empty.png) | bin | 452 -> 452 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_vu_full.png (renamed from tools/editor/icons/2x/icon_vu_full.png) | bin | 350 -> 350 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_warning.png (renamed from tools/editor/icons/2x/icon_warning.png) | bin | 154 -> 154 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_window_dialog.png (renamed from tools/editor/icons/2x/icon_window_dialog.png) | bin | 311 -> 311 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_world.png (renamed from tools/editor/icons/2x/icon_world.png) | bin | 502 -> 502 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_world_2d.png (renamed from tools/editor/icons/2x/icon_world_2d.png) | bin | 584 -> 584 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_world_environment.png (renamed from tools/editor/icons/2x/icon_world_environment.png) | bin | 1371 -> 1371 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_y_sort.png (renamed from tools/editor/icons/2x/icon_y_sort.png) | bin | 293 -> 293 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_zoom.png (renamed from tools/editor/icons/2x/icon_zoom.png) | bin | 762 -> 762 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_zoom_less.png (renamed from tools/editor/icons/2x/icon_zoom_less.png) | bin | 162 -> 162 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_zoom_more.png (renamed from tools/editor/icons/2x/icon_zoom_more.png) | bin | 290 -> 290 bytes | |||
| -rw-r--r-- | editor/icons/2x/icon_zoom_reset.png (renamed from tools/editor/icons/2x/icon_zoom_reset.png) | bin | 689 -> 689 bytes | |||
| -rw-r--r-- | editor/icons/SCsub (renamed from tools/editor/icons/SCsub) | 4 | ||||
| -rw-r--r-- | editor/icons/icon_accept_dialog.png (renamed from tools/editor/icons/icon_accept_dialog.png) | bin | 338 -> 338 bytes | |||
| -rw-r--r-- | editor/icons/icon_add.png (renamed from tools/editor/icons/icon_add.png) | bin | 129 -> 129 bytes | |||
| -rw-r--r-- | editor/icons/icon_add_track.png (renamed from tools/editor/icons/icon_add_track.png) | bin | 129 -> 129 bytes | |||
| -rw-r--r-- | editor/icons/icon_anchor.png (renamed from tools/editor/icons/icon_anchor.png) | bin | 451 -> 451 bytes | |||
| -rw-r--r-- | editor/icons/icon_anim_export.png (renamed from tools/editor/icons/icon_anim_export.png) | bin | 552 -> 552 bytes | |||
| -rw-r--r-- | editor/icons/icon_anim_export_all.png (renamed from tools/editor/icons/icon_anim_export_all.png) | bin | 566 -> 566 bytes | |||
| -rw-r--r-- | editor/icons/icon_anim_get.png (renamed from tools/editor/icons/icon_anim_get.png) | bin | 276 -> 276 bytes | |||
| -rw-r--r-- | editor/icons/icon_anim_get_hl.png (renamed from tools/editor/icons/icon_anim_get_hl.png) | bin | 270 -> 270 bytes | |||
| -rw-r--r-- | editor/icons/icon_anim_import.png (renamed from tools/editor/icons/icon_anim_import.png) | bin | 572 -> 572 bytes | |||
| -rw-r--r-- | editor/icons/icon_anim_import_all.png (renamed from tools/editor/icons/icon_anim_import_all.png) | bin | 586 -> 586 bytes | |||
| -rw-r--r-- | editor/icons/icon_anim_set.png (renamed from tools/editor/icons/icon_anim_set.png) | bin | 287 -> 287 bytes | |||
| -rw-r--r-- | editor/icons/icon_anim_set_hl.png (renamed from tools/editor/icons/icon_anim_set_hl.png) | bin | 268 -> 268 bytes | |||
| -rw-r--r-- | editor/icons/icon_animated_sprite.png (renamed from tools/editor/icons/icon_animated_sprite.png) | bin | 584 -> 584 bytes | |||
| -rw-r--r-- | editor/icons/icon_animated_sprite_3d.png (renamed from tools/editor/icons/icon_animated_sprite_3d.png) | bin | 552 -> 552 bytes | |||
| -rw-r--r-- | editor/icons/icon_animation.png (renamed from tools/editor/icons/icon_animation.png) | bin | 399 -> 399 bytes | |||
| -rw-r--r-- | editor/icons/icon_animation_node.png (renamed from tools/editor/icons/icon_animation_node.png) | bin | 261 -> 261 bytes | |||
| -rw-r--r-- | editor/icons/icon_animation_play.png (renamed from tools/editor/icons/icon_animation_play.png) | bin | 593 -> 593 bytes | |||
| -rw-r--r-- | editor/icons/icon_animation_player.png (renamed from tools/editor/icons/icon_animation_player.png) | bin | 153 -> 153 bytes | |||
| -rw-r--r-- | editor/icons/icon_animation_set.png (renamed from tools/editor/icons/icon_animation_set.png) | bin | 529 -> 529 bytes | |||
| -rw-r--r-- | editor/icons/icon_animation_tree.png (renamed from tools/editor/icons/icon_animation_tree.png) | bin | 279 -> 279 bytes | |||
| -rw-r--r-- | editor/icons/icon_animation_tree_player.png (renamed from tools/editor/icons/icon_animation_tree_player.png) | bin | 279 -> 279 bytes | |||
| -rw-r--r-- | editor/icons/icon_area.png (renamed from tools/editor/icons/icon_area.png) | bin | 176 -> 176 bytes | |||
| -rw-r--r-- | editor/icons/icon_area_2d.png (renamed from tools/editor/icons/icon_area_2d.png) | bin | 182 -> 182 bytes | |||
| -rw-r--r-- | editor/icons/icon_array_data.png (renamed from tools/editor/icons/icon_array_data.png) | bin | 176 -> 176 bytes | |||
| -rw-r--r-- | editor/icons/icon_array_float.png (renamed from tools/editor/icons/icon_array_float.png) | bin | 177 -> 177 bytes | |||
| -rw-r--r-- | editor/icons/icon_array_int.png (renamed from tools/editor/icons/icon_array_int.png) | bin | 172 -> 172 bytes | |||
| -rw-r--r-- | editor/icons/icon_array_string.png (renamed from tools/editor/icons/icon_array_string.png) | bin | 178 -> 178 bytes | |||
| -rw-r--r-- | editor/icons/icon_array_variant.png (renamed from tools/editor/icons/icon_array_variant.png) | bin | 172 -> 172 bytes | |||
| -rw-r--r-- | editor/icons/icon_arrow_left.png (renamed from tools/editor/icons/icon_arrow_left.png) | bin | 211 -> 211 bytes | |||
| -rw-r--r-- | editor/icons/icon_arrow_left_disabled.png (renamed from tools/editor/icons/icon_arrow_left_disabled.png) | bin | 244 -> 244 bytes | |||
| -rw-r--r-- | editor/icons/icon_arrow_right.png (renamed from tools/editor/icons/icon_arrow_right.png) | bin | 215 -> 215 bytes | |||
| -rw-r--r-- | editor/icons/icon_arrow_right_disabled.png (renamed from tools/editor/icons/icon_arrow_right_disabled.png) | bin | 252 -> 252 bytes | |||
| -rw-r--r-- | editor/icons/icon_arrow_up.png (renamed from tools/editor/icons/icon_arrow_up.png) | bin | 223 -> 223 bytes | |||
| -rw-r--r-- | editor/icons/icon_arrow_up_disabled.png (renamed from tools/editor/icons/icon_arrow_up_disabled.png) | bin | 275 -> 275 bytes | |||
| -rw-r--r-- | editor/icons/icon_atlas_texture.png (renamed from tools/editor/icons/icon_atlas_texture.png) | bin | 286 -> 286 bytes | |||
| -rw-r--r-- | editor/icons/icon_audio_effect_amplify.png (renamed from tools/editor/icons/icon_audio_effect_amplify.png) | bin | 379 -> 379 bytes | |||
| -rw-r--r-- | editor/icons/icon_audio_stream_gibberish.png (renamed from tools/editor/icons/icon_audio_stream_gibberish.png) | bin | 250 -> 250 bytes | |||
| -rw-r--r-- | editor/icons/icon_audio_stream_m_p_c.png (renamed from tools/editor/icons/icon_audio_stream_m_p_c.png) | bin | 832 -> 832 bytes | |||
| -rw-r--r-- | editor/icons/icon_audio_stream_o_g_g_vorbis.png (renamed from tools/editor/icons/icon_audio_stream_o_g_g_vorbis.png) | bin | 774 -> 774 bytes | |||
| -rw-r--r-- | editor/icons/icon_audio_stream_opus.png (renamed from tools/editor/icons/icon_audio_stream_opus.png) | bin | 559 -> 559 bytes | |||
| -rw-r--r-- | editor/icons/icon_audio_stream_speex.png (renamed from tools/editor/icons/icon_audio_stream_speex.png) | bin | 1080 -> 1080 bytes | |||
| -rw-r--r-- | editor/icons/icon_auto_play.png (renamed from tools/editor/icons/icon_auto_play.png) | bin | 370 -> 370 bytes | |||
| -rw-r--r-- | editor/icons/icon_b_c_s_f_x.png (renamed from tools/editor/icons/icon_b_c_s_f_x.png) | bin | 451 -> 451 bytes | |||
| -rw-r--r-- | editor/icons/icon_b_g_color_f_x.png (renamed from tools/editor/icons/icon_b_g_color_f_x.png) | bin | 367 -> 367 bytes | |||
| -rw-r--r-- | editor/icons/icon_b_g_image_f_x.png (renamed from tools/editor/icons/icon_b_g_image_f_x.png) | bin | 753 -> 753 bytes | |||
| -rw-r--r-- | editor/icons/icon_back.png (renamed from tools/editor/icons/icon_back.png) | bin | 223 -> 223 bytes | |||
| -rw-r--r-- | editor/icons/icon_back_buffer_copy.png (renamed from tools/editor/icons/icon_back_buffer_copy.png) | bin | 158 -> 158 bytes | |||
| -rw-r--r-- | editor/icons/icon_back_disabled.png (renamed from tools/editor/icons/icon_back_disabled.png) | bin | 175 -> 175 bytes | |||
| -rw-r--r-- | editor/icons/icon_back_no.png (renamed from tools/editor/icons/icon_back_no.png) | bin | 213 -> 213 bytes | |||
| -rw-r--r-- | editor/icons/icon_bake.png (renamed from tools/editor/icons/icon_bake.png) | bin | 180 -> 180 bytes | |||
| -rw-r--r-- | editor/icons/icon_baked_light.png (renamed from tools/editor/icons/icon_baked_light.png) | bin | 180 -> 180 bytes | |||
| -rw-r--r-- | editor/icons/icon_baked_light_instance.png (renamed from tools/editor/icons/icon_baked_light_instance.png) | bin | 179 -> 179 bytes | |||
| -rw-r--r-- | editor/icons/icon_baked_light_sampler.png (renamed from tools/editor/icons/icon_baked_light_sampler.png) | bin | 230 -> 230 bytes | |||
| -rw-r--r-- | editor/icons/icon_bit_map.png (renamed from tools/editor/icons/icon_bit_map.png) | bin | 113 -> 113 bytes | |||
| -rw-r--r-- | editor/icons/icon_bitmap_font.png (renamed from tools/editor/icons/icon_bitmap_font.png) | bin | 160 -> 160 bytes | |||
| -rw-r--r-- | editor/icons/icon_blend.png (renamed from tools/editor/icons/icon_blend.png) | bin | 578 -> 578 bytes | |||
| -rw-r--r-- | editor/icons/icon_bone.png (renamed from tools/editor/icons/icon_bone.png) | bin | 349 -> 349 bytes | |||
| -rw-r--r-- | editor/icons/icon_bone_attachment.png (renamed from tools/editor/icons/icon_bone_attachment.png) | bin | 333 -> 333 bytes | |||
| -rw-r--r-- | editor/icons/icon_bone_track.png (renamed from tools/editor/icons/icon_bone_track.png) | bin | 343 -> 343 bytes | |||
| -rw-r--r-- | editor/icons/icon_bool.png (renamed from tools/editor/icons/icon_bool.png) | bin | 154 -> 154 bytes | |||
| -rw-r--r-- | editor/icons/icon_box_shape.png (renamed from tools/editor/icons/icon_box_shape.png) | bin | 392 -> 392 bytes | |||
| -rw-r--r-- | editor/icons/icon_bus_vu_db.png (renamed from tools/editor/icons/icon_bus_vu_db.png) | bin | 1136 -> 1136 bytes | |||
| -rw-r--r-- | editor/icons/icon_bus_vu_empty.png (renamed from tools/editor/icons/icon_bus_vu_empty.png) | bin | 1631 -> 1631 bytes | |||
| -rw-r--r-- | editor/icons/icon_bus_vu_frozen.png (renamed from tools/editor/icons/icon_bus_vu_frozen.png) | bin | 267 -> 267 bytes | |||
| -rw-r--r-- | editor/icons/icon_bus_vu_full.png (renamed from tools/editor/icons/icon_bus_vu_full.png) | bin | 2463 -> 2463 bytes | |||
| -rw-r--r-- | editor/icons/icon_button.png (renamed from tools/editor/icons/icon_button.png) | bin | 163 -> 163 bytes | |||
| -rw-r--r-- | editor/icons/icon_button_group.png (renamed from tools/editor/icons/icon_button_group.png) | bin | 165 -> 165 bytes | |||
| -rw-r--r-- | editor/icons/icon_camera.png (renamed from tools/editor/icons/icon_camera.png) | bin | 225 -> 225 bytes | |||
| -rw-r--r-- | editor/icons/icon_camera_2d.png (renamed from tools/editor/icons/icon_camera_2d.png) | bin | 229 -> 229 bytes | |||
| -rw-r--r-- | editor/icons/icon_canvas_item.png (renamed from tools/editor/icons/icon_canvas_item.png) | bin | 411 -> 411 bytes | |||
| -rw-r--r-- | editor/icons/icon_canvas_item_material.png (renamed from tools/editor/icons/icon_canvas_item_material.png) | bin | 350 -> 350 bytes | |||
| -rw-r--r-- | editor/icons/icon_canvas_item_shader.png (renamed from tools/editor/icons/icon_canvas_item_shader.png) | bin | 416 -> 416 bytes | |||
| -rw-r--r-- | editor/icons/icon_canvas_item_shader_graph.png (renamed from tools/editor/icons/icon_canvas_item_shader_graph.png) | bin | 440 -> 440 bytes | |||
| -rw-r--r-- | editor/icons/icon_canvas_layer.png (renamed from tools/editor/icons/icon_canvas_layer.png) | bin | 474 -> 474 bytes | |||
| -rw-r--r-- | editor/icons/icon_canvas_modulate.png (renamed from tools/editor/icons/icon_canvas_modulate.png) | bin | 213 -> 213 bytes | |||
| -rw-r--r-- | editor/icons/icon_capsule_shape.png (renamed from tools/editor/icons/icon_capsule_shape.png) | bin | 225 -> 225 bytes | |||
| -rw-r--r-- | editor/icons/icon_capsule_shape_2d.png (renamed from tools/editor/icons/icon_capsule_shape_2d.png) | bin | 309 -> 309 bytes | |||
| -rw-r--r-- | editor/icons/icon_center_container.png (renamed from tools/editor/icons/icon_center_container.png) | bin | 294 -> 294 bytes | |||
| -rw-r--r-- | editor/icons/icon_character_body.png (renamed from tools/editor/icons/icon_character_body.png) | bin | 559 -> 559 bytes | |||
| -rw-r--r-- | editor/icons/icon_character_camera.png (renamed from tools/editor/icons/icon_character_camera.png) | bin | 477 -> 477 bytes | |||
| -rw-r--r-- | editor/icons/icon_check_box.png (renamed from tools/editor/icons/icon_check_box.png) | bin | 404 -> 404 bytes | |||
| -rw-r--r-- | editor/icons/icon_check_button.png (renamed from tools/editor/icons/icon_check_button.png) | bin | 283 -> 283 bytes | |||
| -rw-r--r-- | editor/icons/icon_checkerboard.png (renamed from tools/editor/icons/icon_checkerboard.png) | bin | 253 -> 253 bytes | |||
| -rw-r--r-- | editor/icons/icon_circle_shape_2d.png (renamed from tools/editor/icons/icon_circle_shape_2d.png) | bin | 425 -> 425 bytes | |||
| -rw-r--r-- | editor/icons/icon_class_list.png (renamed from tools/editor/icons/icon_class_list.png) | bin | 157 -> 157 bytes | |||
| -rw-r--r-- | editor/icons/icon_click2edit.png (renamed from tools/editor/icons/icon_click2edit.png) | bin | 294 -> 294 bytes | |||
| -rw-r--r-- | editor/icons/icon_close.png (renamed from tools/editor/icons/icon_close.png) | bin | 325 -> 325 bytes | |||
| -rw-r--r-- | editor/icons/icon_close_hover.png (renamed from tools/editor/icons/icon_close_hover.png) | bin | 391 -> 391 bytes | |||
| -rw-r--r-- | editor/icons/icon_collapse.png (renamed from tools/editor/icons/icon_collapse.png) | bin | 230 -> 230 bytes | |||
| -rw-r--r-- | editor/icons/icon_collapse_hl.png (renamed from tools/editor/icons/icon_collapse_hl.png) | bin | 338 -> 338 bytes | |||
| -rw-r--r-- | editor/icons/icon_collision.png (renamed from tools/editor/icons/icon_collision.png) | bin | 320 -> 320 bytes | |||
| -rw-r--r-- | editor/icons/icon_collision_2d.png (renamed from tools/editor/icons/icon_collision_2d.png) | bin | 281 -> 281 bytes | |||
| -rw-r--r-- | editor/icons/icon_collision_polygon.png (renamed from tools/editor/icons/icon_collision_polygon.png) | bin | 287 -> 287 bytes | |||
| -rw-r--r-- | editor/icons/icon_collision_polygon_2d.png (renamed from tools/editor/icons/icon_collision_polygon_2d.png) | bin | 281 -> 281 bytes | |||
| -rw-r--r-- | editor/icons/icon_collision_shape.png (renamed from tools/editor/icons/icon_collision_shape.png) | bin | 278 -> 278 bytes | |||
| -rw-r--r-- | editor/icons/icon_collision_shape_2d.png (renamed from tools/editor/icons/icon_collision_shape_2d.png) | bin | 164 -> 164 bytes | |||
| -rw-r--r-- | editor/icons/icon_color.png (renamed from tools/editor/icons/icon_color.png) | bin | 582 -> 582 bytes | |||
| -rw-r--r-- | editor/icons/icon_color_pick.png (renamed from tools/editor/icons/icon_color_pick.png) | bin | 416 -> 416 bytes | |||
| -rw-r--r-- | editor/icons/icon_color_picker.png (renamed from tools/editor/icons/icon_color_picker.png) | bin | 432 -> 432 bytes | |||
| -rw-r--r-- | editor/icons/icon_color_picker_button.png (renamed from tools/editor/icons/icon_color_picker_button.png) | bin | 548 -> 548 bytes | |||
| -rw-r--r-- | editor/icons/icon_color_ramp.png (renamed from tools/editor/icons/icon_color_ramp.png) | bin | 222 -> 222 bytes | |||
| -rw-r--r-- | editor/icons/icon_color_rect.png (renamed from tools/editor/icons/icon_color_rect.png) | bin | 214 -> 214 bytes | |||
| -rw-r--r-- | editor/icons/icon_concave_polygon_shape.png (renamed from tools/editor/icons/icon_concave_polygon_shape.png) | bin | 449 -> 449 bytes | |||
| -rw-r--r-- | editor/icons/icon_concave_polygon_shape_2d.png (renamed from tools/editor/icons/icon_concave_polygon_shape_2d.png) | bin | 321 -> 321 bytes | |||
| -rw-r--r-- | editor/icons/icon_cone_twist_joint.png (renamed from tools/editor/icons/icon_cone_twist_joint.png) | bin | 497 -> 497 bytes | |||
| -rw-r--r-- | editor/icons/icon_confirmation_dialog.png (renamed from tools/editor/icons/icon_confirmation_dialog.png) | bin | 330 -> 330 bytes | |||
| -rw-r--r-- | editor/icons/icon_connect.png (renamed from tools/editor/icons/icon_connect.png) | bin | 170 -> 170 bytes | |||
| -rw-r--r-- | editor/icons/icon_connection_and_groups.png (renamed from tools/editor/icons/icon_connection_and_groups.png) | bin | 228 -> 228 bytes | |||
| -rw-r--r-- | editor/icons/icon_console.png (renamed from tools/editor/icons/icon_console.png) | bin | 640 -> 640 bytes | |||
| -rw-r--r-- | editor/icons/icon_container.png (renamed from tools/editor/icons/icon_container.png) | bin | 188 -> 188 bytes | |||
| -rw-r--r-- | editor/icons/icon_control.png (renamed from tools/editor/icons/icon_control.png) | bin | 414 -> 414 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_bottom_center.png (renamed from tools/editor/icons/icon_control_align_bottom_center.png) | bin | 134 -> 134 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_bottom_left.png (renamed from tools/editor/icons/icon_control_align_bottom_left.png) | bin | 134 -> 134 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_bottom_right.png (renamed from tools/editor/icons/icon_control_align_bottom_right.png) | bin | 134 -> 134 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_bottom_wide.png (renamed from tools/editor/icons/icon_control_align_bottom_wide.png) | bin | 135 -> 135 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_center.png (renamed from tools/editor/icons/icon_control_align_center.png) | bin | 142 -> 142 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_center_left.png (renamed from tools/editor/icons/icon_control_align_center_left.png) | bin | 116 -> 116 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_center_right.png (renamed from tools/editor/icons/icon_control_align_center_right.png) | bin | 117 -> 117 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_left_center.png (renamed from tools/editor/icons/icon_control_align_left_center.png) | bin | 141 -> 141 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_left_wide.png (renamed from tools/editor/icons/icon_control_align_left_wide.png) | bin | 123 -> 123 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_right_center.png (renamed from tools/editor/icons/icon_control_align_right_center.png) | bin | 142 -> 142 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_right_wide.png (renamed from tools/editor/icons/icon_control_align_right_wide.png) | bin | 124 -> 124 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_top_center.png (renamed from tools/editor/icons/icon_control_align_top_center.png) | bin | 141 -> 141 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_top_left.png (renamed from tools/editor/icons/icon_control_align_top_left.png) | bin | 136 -> 136 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_top_right.png (renamed from tools/editor/icons/icon_control_align_top_right.png) | bin | 141 -> 141 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_top_wide.png (renamed from tools/editor/icons/icon_control_align_top_wide.png) | bin | 136 -> 136 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_align_wide.png (renamed from tools/editor/icons/icon_control_align_wide.png) | bin | 123 -> 123 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_hcenter_wide.png (renamed from tools/editor/icons/icon_control_hcenter_wide.png) | bin | 142 -> 142 bytes | |||
| -rw-r--r-- | editor/icons/icon_control_vcenter_wide.png (renamed from tools/editor/icons/icon_control_vcenter_wide.png) | bin | 128 -> 128 bytes | |||
| -rw-r--r-- | editor/icons/icon_convex_polygon_shape.png (renamed from tools/editor/icons/icon_convex_polygon_shape.png) | bin | 404 -> 404 bytes | |||
| -rw-r--r-- | editor/icons/icon_convex_polygon_shape_2d.png (renamed from tools/editor/icons/icon_convex_polygon_shape_2d.png) | bin | 297 -> 297 bytes | |||
| -rw-r--r-- | editor/icons/icon_copy_node_path.png (renamed from tools/editor/icons/icon_copy_node_path.png) | bin | 248 -> 248 bytes | |||
| -rw-r--r-- | editor/icons/icon_create_new_scene_from.png (renamed from tools/editor/icons/icon_create_new_scene_from.png) | bin | 349 -> 349 bytes | |||
| -rw-r--r-- | editor/icons/icon_cube_grid_map.png (renamed from tools/editor/icons/icon_cube_grid_map.png) | bin | 607 -> 607 bytes | |||
| -rw-r--r-- | editor/icons/icon_cube_map.png (renamed from tools/editor/icons/icon_cube_map.png) | bin | 134 -> 134 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve.png (renamed from tools/editor/icons/icon_curve.png) | bin | 315 -> 315 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_2d.png (renamed from tools/editor/icons/icon_curve_2d.png) | bin | 342 -> 342 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_3d.png (renamed from tools/editor/icons/icon_curve_3d.png) | bin | 336 -> 336 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_close.png (renamed from tools/editor/icons/icon_curve_close.png) | bin | 351 -> 351 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_constant.png (renamed from tools/editor/icons/icon_curve_constant.png) | bin | 114 -> 114 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_create.png (renamed from tools/editor/icons/icon_curve_create.png) | bin | 375 -> 375 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_curve.png (renamed from tools/editor/icons/icon_curve_curve.png) | bin | 412 -> 412 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_delete.png (renamed from tools/editor/icons/icon_curve_delete.png) | bin | 457 -> 457 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_edit.png (renamed from tools/editor/icons/icon_curve_edit.png) | bin | 488 -> 488 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_in.png (renamed from tools/editor/icons/icon_curve_in.png) | bin | 257 -> 257 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_in_out.png (renamed from tools/editor/icons/icon_curve_in_out.png) | bin | 282 -> 282 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_linear.png (renamed from tools/editor/icons/icon_curve_linear.png) | bin | 219 -> 219 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_out.png (renamed from tools/editor/icons/icon_curve_out.png) | bin | 263 -> 263 bytes | |||
| -rw-r--r-- | editor/icons/icon_curve_out_in.png (renamed from tools/editor/icons/icon_curve_out_in.png) | bin | 288 -> 288 bytes | |||
| -rw-r--r-- | editor/icons/icon_cylinder_shape.png (renamed from tools/editor/icons/icon_cylinder_shape.png) | bin | 673 -> 673 bytes | |||
| -rw-r--r-- | editor/icons/icon_d_o_f_blur_f_x.png (renamed from tools/editor/icons/icon_d_o_f_blur_f_x.png) | bin | 796 -> 796 bytes | |||
| -rw-r--r-- | editor/icons/icon_damped_spring_joint_2d.png (renamed from tools/editor/icons/icon_damped_spring_joint_2d.png) | bin | 316 -> 316 bytes | |||
| -rw-r--r-- | editor/icons/icon_debug.png (renamed from tools/editor/icons/icon_debug.png) | bin | 659 -> 659 bytes | |||
| -rw-r--r-- | editor/icons/icon_debug_continue.png (renamed from tools/editor/icons/icon_debug_continue.png) | bin | 302 -> 302 bytes | |||
| -rw-r--r-- | editor/icons/icon_debug_next.png (renamed from tools/editor/icons/icon_debug_next.png) | bin | 220 -> 220 bytes | |||
| -rw-r--r-- | editor/icons/icon_debug_step.png (renamed from tools/editor/icons/icon_debug_step.png) | bin | 219 -> 219 bytes | |||
| -rw-r--r-- | editor/icons/icon_default_project_icon.png (renamed from tools/editor/icons/icon_default_project_icon.png) | bin | 2713 -> 2713 bytes | |||
| -rw-r--r-- | editor/icons/icon_del.png (renamed from tools/editor/icons/icon_del.png) | bin | 398 -> 398 bytes | |||
| -rw-r--r-- | editor/icons/icon_dependency_changed.png (renamed from tools/editor/icons/icon_dependency_changed.png) | bin | 392 -> 392 bytes | |||
| -rw-r--r-- | editor/icons/icon_dependency_changed_hl.png (renamed from tools/editor/icons/icon_dependency_changed_hl.png) | bin | 330 -> 330 bytes | |||
| -rw-r--r-- | editor/icons/icon_dependency_local_changed.png (renamed from tools/editor/icons/icon_dependency_local_changed.png) | bin | 571 -> 571 bytes | |||
| -rw-r--r-- | editor/icons/icon_dependency_local_changed_hl.png (renamed from tools/editor/icons/icon_dependency_local_changed_hl.png) | bin | 460 -> 460 bytes | |||
| -rw-r--r-- | editor/icons/icon_dependency_ok.png (renamed from tools/editor/icons/icon_dependency_ok.png) | bin | 518 -> 518 bytes | |||
| -rw-r--r-- | editor/icons/icon_dependency_ok_hl.png (renamed from tools/editor/icons/icon_dependency_ok_hl.png) | bin | 413 -> 413 bytes | |||
| -rw-r--r-- | editor/icons/icon_directional_light.png (renamed from tools/editor/icons/icon_directional_light.png) | bin | 426 -> 426 bytes | |||
| -rw-r--r-- | editor/icons/icon_distraction_free.png (renamed from tools/editor/icons/icon_distraction_free.png) | bin | 397 -> 397 bytes | |||
| -rw-r--r-- | editor/icons/icon_doc_code_font.png (renamed from tools/editor/icons/icon_doc_code_font.png) | bin | 8123 -> 8123 bytes | |||
| -rw-r--r-- | editor/icons/icon_doc_font.png (renamed from tools/editor/icons/icon_doc_font.png) | bin | 8213 -> 8213 bytes | |||
| -rw-r--r-- | editor/icons/icon_doc_title_font.png (renamed from tools/editor/icons/icon_doc_title_font.png) | bin | 10222 -> 10222 bytes | |||
| -rw-r--r-- | editor/icons/icon_down.png (renamed from tools/editor/icons/icon_down.png) | bin | 186 -> 186 bytes | |||
| -rw-r--r-- | editor/icons/icon_dummy.png (renamed from tools/editor/icons/icon_dummy.png) | bin | 217 -> 217 bytes | |||
| -rw-r--r-- | editor/icons/icon_duplicate.png (renamed from tools/editor/icons/icon_duplicate.png) | bin | 167 -> 167 bytes | |||
| -rw-r--r-- | editor/icons/icon_dynamic_character_body.png (renamed from tools/editor/icons/icon_dynamic_character_body.png) | bin | 559 -> 559 bytes | |||
| -rw-r--r-- | editor/icons/icon_dynamic_custom_body.png (renamed from tools/editor/icons/icon_dynamic_custom_body.png) | bin | 556 -> 556 bytes | |||
| -rw-r--r-- | editor/icons/icon_dynamic_font.png (renamed from tools/editor/icons/icon_dynamic_font.png) | bin | 239 -> 239 bytes | |||
| -rw-r--r-- | editor/icons/icon_dynamic_font_data.png (renamed from tools/editor/icons/icon_dynamic_font_data.png) | bin | 246 -> 246 bytes | |||
| -rw-r--r-- | editor/icons/icon_dynamic_rigid_body.png (renamed from tools/editor/icons/icon_dynamic_rigid_body.png) | bin | 546 -> 546 bytes | |||
| -rw-r--r-- | editor/icons/icon_edit.png (renamed from tools/editor/icons/icon_edit.png) | bin | 346 -> 346 bytes | |||
| -rw-r--r-- | editor/icons/icon_edit_key.png (renamed from tools/editor/icons/icon_edit_key.png) | bin | 405 -> 405 bytes | |||
| -rw-r--r-- | editor/icons/icon_edit_pivot.png (renamed from tools/editor/icons/icon_edit_pivot.png) | bin | 327 -> 327 bytes | |||
| -rw-r--r-- | editor/icons/icon_edit_resource.png (renamed from tools/editor/icons/icon_edit_resource.png) | bin | 232 -> 232 bytes | |||
| -rw-r--r-- | editor/icons/icon_edit_small.png (renamed from tools/editor/icons/icon_edit_small.png) | bin | 365 -> 365 bytes | |||
| -rw-r--r-- | editor/icons/icon_editor_2d.png (renamed from tools/editor/icons/icon_editor_2d.png) | bin | 197 -> 197 bytes | |||
| -rw-r--r-- | editor/icons/icon_editor_3d_handle.png (renamed from tools/editor/icons/icon_editor_3d_handle.png) | bin | 350 -> 350 bytes | |||
| -rw-r--r-- | editor/icons/icon_editor_focus.png (renamed from tools/editor/icons/icon_editor_focus.png) | bin | 629 -> 629 bytes | |||
| -rw-r--r-- | editor/icons/icon_editor_handle.png (renamed from tools/editor/icons/icon_editor_handle.png) | bin | 214 -> 214 bytes | |||
| -rw-r--r-- | editor/icons/icon_editor_node.png (renamed from tools/editor/icons/icon_editor_node.png) | bin | 311 -> 311 bytes | |||
| -rw-r--r-- | editor/icons/icon_editor_pivot.png (renamed from tools/editor/icons/icon_editor_pivot.png) | bin | 177 -> 177 bytes | |||
| -rw-r--r-- | editor/icons/icon_editor_plugin.png (renamed from tools/editor/icons/icon_editor_plugin.png) | bin | 248 -> 248 bytes | |||
| -rw-r--r-- | editor/icons/icon_editor_rect_2d.png (renamed from tools/editor/icons/icon_editor_rect_2d.png) | bin | 222 -> 222 bytes | |||
| -rw-r--r-- | editor/icons/icon_empty_control.png (renamed from tools/editor/icons/icon_empty_control.png) | bin | 233 -> 233 bytes | |||
| -rw-r--r-- | editor/icons/icon_enum.png (renamed from tools/editor/icons/icon_enum.png) | bin | 123 -> 123 bytes | |||
| -rw-r--r-- | editor/icons/icon_environment.png (renamed from tools/editor/icons/icon_environment.png) | bin | 588 -> 588 bytes | |||
| -rw-r--r-- | editor/icons/icon_error.png (renamed from tools/editor/icons/icon_error.png) | bin | 121 -> 121 bytes | |||
| -rw-r--r-- | editor/icons/icon_error_sign.png (renamed from tools/editor/icons/icon_error_sign.png) | bin | 255 -> 255 bytes | |||
| -rw-r--r-- | editor/icons/icon_event_player.png (renamed from tools/editor/icons/icon_event_player.png) | bin | 142 -> 142 bytes | |||
| -rw-r--r-- | editor/icons/icon_expand.png (renamed from tools/editor/icons/icon_expand.png) | bin | 322 -> 322 bytes | |||
| -rw-r--r-- | editor/icons/icon_expand_hl.png (renamed from tools/editor/icons/icon_expand_hl.png) | bin | 320 -> 320 bytes | |||
| -rw-r--r-- | editor/icons/icon_favorites.png (renamed from tools/editor/icons/icon_favorites.png) | bin | 385 -> 385 bytes | |||
| -rw-r--r-- | editor/icons/icon_file.png (renamed from tools/editor/icons/icon_file.png) | bin | 157 -> 157 bytes | |||
| -rw-r--r-- | editor/icons/icon_file_big.png (renamed from tools/editor/icons/icon_file_big.png) | bin | 317 -> 317 bytes | |||
| -rw-r--r-- | editor/icons/icon_file_dialog.png (renamed from tools/editor/icons/icon_file_dialog.png) | bin | 220 -> 220 bytes | |||
| -rw-r--r-- | editor/icons/icon_file_list.png (renamed from tools/editor/icons/icon_file_list.png) | bin | 123 -> 123 bytes | |||
| -rw-r--r-- | editor/icons/icon_file_server.png (renamed from tools/editor/icons/icon_file_server.png) | bin | 145 -> 145 bytes | |||
| -rw-r--r-- | editor/icons/icon_file_server_active.png (renamed from tools/editor/icons/icon_file_server_active.png) | bin | 145 -> 145 bytes | |||
| -rw-r--r-- | editor/icons/icon_file_thumbnail.png (renamed from tools/editor/icons/icon_file_thumbnail.png) | bin | 116 -> 116 bytes | |||
| -rw-r--r-- | editor/icons/icon_filesystem.png (renamed from tools/editor/icons/icon_filesystem.png) | bin | 157 -> 157 bytes | |||
| -rw-r--r-- | editor/icons/icon_fixed_material.png (renamed from tools/editor/icons/icon_fixed_material.png) | bin | 377 -> 377 bytes | |||
| -rw-r--r-- | editor/icons/icon_fixed_spatial_material.png (renamed from tools/editor/icons/icon_fixed_spatial_material.png) | bin | 409 -> 409 bytes | |||
| -rw-r--r-- | editor/icons/icon_fog_f_x.png (renamed from tools/editor/icons/icon_fog_f_x.png) | bin | 540 -> 540 bytes | |||
| -rw-r--r-- | editor/icons/icon_folder.png (renamed from tools/editor/icons/icon_folder.png) | bin | 170 -> 170 bytes | |||
| -rw-r--r-- | editor/icons/icon_folder_big.png (renamed from tools/editor/icons/icon_folder_big.png) | bin | 482 -> 482 bytes | |||
| -rw-r--r-- | editor/icons/icon_folder_scene.png (renamed from tools/editor/icons/icon_folder_scene.png) | bin | 644 -> 644 bytes | |||
| -rw-r--r-- | editor/icons/icon_font.png (renamed from tools/editor/icons/icon_font.png) | bin | 215 -> 215 bytes | |||
| -rw-r--r-- | editor/icons/icon_forward.png (renamed from tools/editor/icons/icon_forward.png) | bin | 224 -> 224 bytes | |||
| -rw-r--r-- | editor/icons/icon_forward_no.png (renamed from tools/editor/icons/icon_forward_no.png) | bin | 217 -> 217 bytes | |||
| -rw-r--r-- | editor/icons/icon_func.png (renamed from tools/editor/icons/icon_func.png) | bin | 262 -> 262 bytes | |||
| -rw-r--r-- | editor/icons/icon_g_d_script.png (renamed from tools/editor/icons/icon_g_d_script.png) | bin | 392 -> 392 bytes | |||
| -rw-r--r-- | editor/icons/icon_g_i_probe.png (renamed from tools/editor/icons/icon_g_i_probe.png) | bin | 341 -> 341 bytes | |||
| -rw-r--r-- | editor/icons/icon_g_i_probe_data.png (renamed from tools/editor/icons/icon_g_i_probe_data.png) | bin | 350 -> 350 bytes | |||
| -rw-r--r-- | editor/icons/icon_gamma_f_x.png (renamed from tools/editor/icons/icon_gamma_f_x.png) | bin | 461 -> 461 bytes | |||
| -rw-r--r-- | editor/icons/icon_generic_6_d_o_f_joint.png (renamed from tools/editor/icons/icon_generic_6_d_o_f_joint.png) | bin | 390 -> 390 bytes | |||
| -rw-r--r-- | editor/icons/icon_gizmo_directional_light.png (renamed from tools/editor/icons/icon_gizmo_directional_light.png) | bin | 3628 -> 3628 bytes | |||
| -rw-r--r-- | editor/icons/icon_gizmo_light.png (renamed from tools/editor/icons/icon_gizmo_light.png) | bin | 3064 -> 3064 bytes | |||
| -rw-r--r-- | editor/icons/icon_gizmo_listener.png (renamed from tools/editor/icons/icon_gizmo_listener.png) | bin | 3613 -> 3613 bytes | |||
| -rw-r--r-- | editor/icons/icon_gizmo_spatial_sample_player.png (renamed from tools/editor/icons/icon_gizmo_spatial_sample_player.png) | bin | 1297 -> 1297 bytes | |||
| -rw-r--r-- | editor/icons/icon_gizmo_spatial_stream_player.png (renamed from tools/editor/icons/icon_gizmo_spatial_stream_player.png) | bin | 1720 -> 1720 bytes | |||
| -rw-r--r-- | editor/icons/icon_glow_f_x.png (renamed from tools/editor/icons/icon_glow_f_x.png) | bin | 676 -> 676 bytes | |||
| -rw-r--r-- | editor/icons/icon_godot.png (renamed from tools/editor/icons/icon_godot.png) | bin | 769 -> 769 bytes | |||
| -rw-r--r-- | editor/icons/icon_godot_asset_default.png (renamed from tools/editor/icons/icon_godot_asset_default.png) | bin | 4167 -> 4167 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_color_ramp.png (renamed from tools/editor/icons/icon_graph_color_ramp.png) | bin | 222 -> 222 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_comment.png (renamed from tools/editor/icons/icon_graph_comment.png) | bin | 125 -> 125 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_cube_uniform.png (renamed from tools/editor/icons/icon_graph_cube_uniform.png) | bin | 445 -> 445 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_curve_map.png (renamed from tools/editor/icons/icon_graph_curve_map.png) | bin | 330 -> 330 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_default_texture.png (renamed from tools/editor/icons/icon_graph_default_texture.png) | bin | 196 -> 196 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_edit.png (renamed from tools/editor/icons/icon_graph_edit.png) | bin | 467 -> 467 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_input.png (renamed from tools/editor/icons/icon_graph_input.png) | bin | 268 -> 268 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_node.png (renamed from tools/editor/icons/icon_graph_node.png) | bin | 397 -> 397 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_rgb.png (renamed from tools/editor/icons/icon_graph_rgb.png) | bin | 443 -> 443 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_rgb_op.png (renamed from tools/editor/icons/icon_graph_rgb_op.png) | bin | 165 -> 165 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_rgb_uniform.png (renamed from tools/editor/icons/icon_graph_rgb_uniform.png) | bin | 346 -> 346 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_scalar.png (renamed from tools/editor/icons/icon_graph_scalar.png) | bin | 269 -> 269 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_scalar_interp.png (renamed from tools/editor/icons/icon_graph_scalar_interp.png) | bin | 236 -> 236 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_scalar_op.png (renamed from tools/editor/icons/icon_graph_scalar_op.png) | bin | 266 -> 266 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_scalar_uniform.png (renamed from tools/editor/icons/icon_graph_scalar_uniform.png) | bin | 307 -> 307 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_scalars_to_vec.png (renamed from tools/editor/icons/icon_graph_scalars_to_vec.png) | bin | 172 -> 172 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_texscreen.png (renamed from tools/editor/icons/icon_graph_texscreen.png) | bin | 151 -> 151 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_texture_uniform.png (renamed from tools/editor/icons/icon_graph_texture_uniform.png) | bin | 237 -> 237 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_time.png (renamed from tools/editor/icons/icon_graph_time.png) | bin | 398 -> 398 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_vec_dp.png (renamed from tools/editor/icons/icon_graph_vec_dp.png) | bin | 258 -> 258 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_vec_interp.png (renamed from tools/editor/icons/icon_graph_vec_interp.png) | bin | 229 -> 229 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_vec_length.png (renamed from tools/editor/icons/icon_graph_vec_length.png) | bin | 305 -> 305 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_vec_op.png (renamed from tools/editor/icons/icon_graph_vec_op.png) | bin | 266 -> 266 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_vec_scalar_op.png (renamed from tools/editor/icons/icon_graph_vec_scalar_op.png) | bin | 299 -> 299 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_vec_to_scalars.png (renamed from tools/editor/icons/icon_graph_vec_to_scalars.png) | bin | 181 -> 181 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_vecs_to_xform.png (renamed from tools/editor/icons/icon_graph_vecs_to_xform.png) | bin | 178 -> 178 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_vector.png (renamed from tools/editor/icons/icon_graph_vector.png) | bin | 345 -> 345 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_vector_uniform.png (renamed from tools/editor/icons/icon_graph_vector_uniform.png) | bin | 390 -> 390 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_xform.png (renamed from tools/editor/icons/icon_graph_xform.png) | bin | 241 -> 241 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_xform_mult.png (renamed from tools/editor/icons/icon_graph_xform_mult.png) | bin | 223 -> 223 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_xform_scalar_func.png (renamed from tools/editor/icons/icon_graph_xform_scalar_func.png) | bin | 275 -> 275 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_xform_to_vecs.png (renamed from tools/editor/icons/icon_graph_xform_to_vecs.png) | bin | 195 -> 195 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_xform_uniform.png (renamed from tools/editor/icons/icon_graph_xform_uniform.png) | bin | 310 -> 310 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_xform_vec_func.png (renamed from tools/editor/icons/icon_graph_xform_vec_func.png) | bin | 277 -> 277 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_xform_vec_imult.png (renamed from tools/editor/icons/icon_graph_xform_vec_imult.png) | bin | 327 -> 327 bytes | |||
| -rw-r--r-- | editor/icons/icon_graph_xform_vec_mult.png (renamed from tools/editor/icons/icon_graph_xform_vec_mult.png) | bin | 336 -> 336 bytes | |||
| -rw-r--r-- | editor/icons/icon_grid.png (renamed from tools/editor/icons/icon_grid.png) | bin | 165 -> 165 bytes | |||
| -rw-r--r-- | editor/icons/icon_grid_container.png (renamed from tools/editor/icons/icon_grid_container.png) | bin | 216 -> 216 bytes | |||
| -rw-r--r-- | editor/icons/icon_grid_map.png (renamed from tools/editor/icons/icon_grid_map.png) | bin | 122 -> 122 bytes | |||
| -rw-r--r-- | editor/icons/icon_grid_map_floor.png (renamed from tools/editor/icons/icon_grid_map_floor.png) | bin | 169 -> 169 bytes | |||
| -rw-r--r-- | editor/icons/icon_groove_joint_2d.png (renamed from tools/editor/icons/icon_groove_joint_2d.png) | bin | 150 -> 150 bytes | |||
| -rw-r--r-- | editor/icons/icon_group.png (renamed from tools/editor/icons/icon_group.png) | bin | 177 -> 177 bytes | |||
| -rw-r--r-- | editor/icons/icon_groups.png (renamed from tools/editor/icons/icon_groups.png) | bin | 194 -> 194 bytes | |||
| -rw-r--r-- | editor/icons/icon_h_box_container.png (renamed from tools/editor/icons/icon_h_box_container.png) | bin | 201 -> 201 bytes | |||
| -rw-r--r-- | editor/icons/icon_h_button_array.png (renamed from tools/editor/icons/icon_h_button_array.png) | bin | 163 -> 163 bytes | |||
| -rw-r--r-- | editor/icons/icon_h_scroll_bar.png (renamed from tools/editor/icons/icon_h_scroll_bar.png) | bin | 205 -> 205 bytes | |||
| -rw-r--r-- | editor/icons/icon_h_separator.png (renamed from tools/editor/icons/icon_h_separator.png) | bin | 131 -> 131 bytes | |||
| -rw-r--r-- | editor/icons/icon_h_slider.png (renamed from tools/editor/icons/icon_h_slider.png) | bin | 204 -> 204 bytes | |||
| -rw-r--r-- | editor/icons/icon_h_split_container.png (renamed from tools/editor/icons/icon_h_split_container.png) | bin | 259 -> 259 bytes | |||
| -rw-r--r-- | editor/icons/icon_h_t_t_p_request.png (renamed from tools/editor/icons/icon_h_t_t_p_request.png) | bin | 301 -> 301 bytes | |||
| -rw-r--r-- | editor/icons/icon_headphones.png (renamed from tools/editor/icons/icon_headphones.png) | bin | 350 -> 350 bytes | |||
| -rw-r--r-- | editor/icons/icon_help.png (renamed from tools/editor/icons/icon_help.png) | bin | 578 -> 578 bytes | |||
| -rw-r--r-- | editor/icons/icon_hidden.png (renamed from tools/editor/icons/icon_hidden.png) | bin | 345 -> 345 bytes | |||
| -rw-r--r-- | editor/icons/icon_hinge_joint.png (renamed from tools/editor/icons/icon_hinge_joint.png) | bin | 353 -> 353 bytes | |||
| -rw-r--r-- | editor/icons/icon_history.png (renamed from tools/editor/icons/icon_history.png) | bin | 437 -> 437 bytes | |||
| -rw-r--r-- | editor/icons/icon_hsize.png (renamed from tools/editor/icons/icon_hsize.png) | bin | 166 -> 166 bytes | |||
| -rw-r--r-- | editor/icons/icon_iapi.png (renamed from tools/editor/icons/icon_iapi.png) | bin | 277 -> 277 bytes | |||
| -rw-r--r-- | editor/icons/icon_image.png (renamed from tools/editor/icons/icon_image.png) | bin | 263 -> 263 bytes | |||
| -rw-r--r-- | editor/icons/icon_image_sky_box.png (renamed from tools/editor/icons/icon_image_sky_box.png) | bin | 434 -> 434 bytes | |||
| -rw-r--r-- | editor/icons/icon_image_texture.png (renamed from tools/editor/icons/icon_image_texture.png) | bin | 200 -> 200 bytes | |||
| -rw-r--r-- | editor/icons/icon_immediate_geometry.png (renamed from tools/editor/icons/icon_immediate_geometry.png) | bin | 411 -> 411 bytes | |||
| -rw-r--r-- | editor/icons/icon_import_check.png (renamed from tools/editor/icons/icon_import_check.png) | bin | 266 -> 266 bytes | |||
| -rw-r--r-- | editor/icons/icon_import_fail.png (renamed from tools/editor/icons/icon_import_fail.png) | bin | 346 -> 346 bytes | |||
| -rw-r--r-- | editor/icons/icon_influence_zone.png (renamed from tools/editor/icons/icon_influence_zone.png) | bin | 303 -> 303 bytes | |||
| -rw-r--r-- | editor/icons/icon_instance.png (renamed from tools/editor/icons/icon_instance.png) | bin | 442 -> 442 bytes | |||
| -rw-r--r-- | editor/icons/icon_instance_options.png (renamed from tools/editor/icons/icon_instance_options.png) | bin | 365 -> 365 bytes | |||
| -rw-r--r-- | editor/icons/icon_integer.png (renamed from tools/editor/icons/icon_integer.png) | bin | 126 -> 126 bytes | |||
| -rw-r--r-- | editor/icons/icon_interp_cubic.png (renamed from tools/editor/icons/icon_interp_cubic.png) | bin | 281 -> 281 bytes | |||
| -rw-r--r-- | editor/icons/icon_interp_linear.png (renamed from tools/editor/icons/icon_interp_linear.png) | bin | 271 -> 271 bytes | |||
| -rw-r--r-- | editor/icons/icon_interp_raw.png (renamed from tools/editor/icons/icon_interp_raw.png) | bin | 156 -> 156 bytes | |||
| -rw-r--r-- | editor/icons/icon_interp_wrap_clamp.png (renamed from tools/editor/icons/icon_interp_wrap_clamp.png) | bin | 233 -> 233 bytes | |||
| -rw-r--r-- | editor/icons/icon_interp_wrap_loop.png (renamed from tools/editor/icons/icon_interp_wrap_loop.png) | bin | 309 -> 309 bytes | |||
| -rw-r--r-- | editor/icons/icon_interpolated_camera.png (renamed from tools/editor/icons/icon_interpolated_camera.png) | bin | 279 -> 279 bytes | |||
| -rw-r--r-- | editor/icons/icon_invalid_key.png (renamed from tools/editor/icons/icon_invalid_key.png) | bin | 205 -> 205 bytes | |||
| -rw-r--r-- | editor/icons/icon_inverse_kinematics.png (renamed from tools/editor/icons/icon_inverse_kinematics.png) | bin | 262 -> 262 bytes | |||
| -rw-r--r-- | editor/icons/icon_item_list.png (renamed from tools/editor/icons/icon_item_list.png) | bin | 216 -> 216 bytes | |||
| -rw-r--r-- | editor/icons/icon_joy_axis.png (renamed from tools/editor/icons/icon_joy_axis.png) | bin | 260 -> 260 bytes | |||
| -rw-r--r-- | editor/icons/icon_joy_button.png (renamed from tools/editor/icons/icon_joy_button.png) | bin | 272 -> 272 bytes | |||
| -rw-r--r-- | editor/icons/icon_joypad.png (renamed from tools/editor/icons/icon_joypad.png) | bin | 239 -> 239 bytes | |||
| -rw-r--r-- | editor/icons/icon_key.png (renamed from tools/editor/icons/icon_key.png) | bin | 285 -> 285 bytes | |||
| -rw-r--r-- | editor/icons/icon_key_call.png (renamed from tools/editor/icons/icon_key_call.png) | bin | 265 -> 265 bytes | |||
| -rw-r--r-- | editor/icons/icon_key_hover.png (renamed from tools/editor/icons/icon_key_hover.png) | bin | 206 -> 206 bytes | |||
| -rw-r--r-- | editor/icons/icon_key_invalid.png (renamed from tools/editor/icons/icon_key_invalid.png) | bin | 205 -> 205 bytes | |||
| -rw-r--r-- | editor/icons/icon_key_invalid_hover.png (renamed from tools/editor/icons/icon_key_invalid_hover.png) | bin | 239 -> 239 bytes | |||
| -rw-r--r-- | editor/icons/icon_key_next.png (renamed from tools/editor/icons/icon_key_next.png) | bin | 321 -> 321 bytes | |||
| -rw-r--r-- | editor/icons/icon_key_selected.png (renamed from tools/editor/icons/icon_key_selected.png) | bin | 203 -> 203 bytes | |||
| -rw-r--r-- | editor/icons/icon_key_value.png (renamed from tools/editor/icons/icon_key_value.png) | bin | 210 -> 210 bytes | |||
| -rw-r--r-- | editor/icons/icon_key_xform.png (renamed from tools/editor/icons/icon_key_xform.png) | bin | 213 -> 213 bytes | |||
| -rw-r--r-- | editor/icons/icon_keyboard.png (renamed from tools/editor/icons/icon_keyboard.png) | bin | 299 -> 299 bytes | |||
| -rw-r--r-- | editor/icons/icon_keying.png (renamed from tools/editor/icons/icon_keying.png) | bin | 1603 -> 1603 bytes | |||
| -rw-r--r-- | editor/icons/icon_kinematic_body.png (renamed from tools/editor/icons/icon_kinematic_body.png) | bin | 145 -> 145 bytes | |||
| -rw-r--r-- | editor/icons/icon_kinematic_body_2d.png (renamed from tools/editor/icons/icon_kinematic_body_2d.png) | bin | 147 -> 147 bytes | |||
| -rw-r--r-- | editor/icons/icon_label.png (renamed from tools/editor/icons/icon_label.png) | bin | 240 -> 240 bytes | |||
| -rw-r--r-- | editor/icons/icon_large_texture.png (renamed from tools/editor/icons/icon_large_texture.png) | bin | 156 -> 156 bytes | |||
| -rw-r--r-- | editor/icons/icon_light_2d.png (renamed from tools/editor/icons/icon_light_2d.png) | bin | 362 -> 362 bytes | |||
| -rw-r--r-- | editor/icons/icon_light_map.png (renamed from tools/editor/icons/icon_light_map.png) | bin | 406 -> 406 bytes | |||
| -rw-r--r-- | editor/icons/icon_light_occluder_2d.png (renamed from tools/editor/icons/icon_light_occluder_2d.png) | bin | 146 -> 146 bytes | |||
| -rw-r--r-- | editor/icons/icon_lightr.png (renamed from tools/editor/icons/icon_lightr.png) | bin | 272 -> 272 bytes | |||
| -rw-r--r-- | editor/icons/icon_line_2d.png | bin | 0 -> 474 bytes | |||
| -rw-r--r-- | editor/icons/icon_line_edit.png (renamed from tools/editor/icons/icon_line_edit.png) | bin | 201 -> 201 bytes | |||
| -rw-r--r-- | editor/icons/icon_line_shape_2d.png (renamed from tools/editor/icons/icon_line_shape_2d.png) | bin | 379 -> 379 bytes | |||
| -rw-r--r-- | editor/icons/icon_link_button.png (renamed from tools/editor/icons/icon_link_button.png) | bin | 409 -> 409 bytes | |||
| -rw-r--r-- | editor/icons/icon_list_select.png (renamed from tools/editor/icons/icon_list_select.png) | bin | 349 -> 349 bytes | |||
| -rw-r--r-- | editor/icons/icon_listener.png (renamed from tools/editor/icons/icon_listener.png) | bin | 448 -> 448 bytes | |||
| -rw-r--r-- | editor/icons/icon_live_debug.png (renamed from tools/editor/icons/icon_live_debug.png) | bin | 583 -> 583 bytes | |||
| -rw-r--r-- | editor/icons/icon_load.png (renamed from tools/editor/icons/icon_load.png) | bin | 271 -> 271 bytes | |||
| -rw-r--r-- | editor/icons/icon_lock.png (renamed from tools/editor/icons/icon_lock.png) | bin | 271 -> 271 bytes | |||
| -rw-r--r-- | editor/icons/icon_logo.png (renamed from tools/editor/icons/icon_logo.png) | bin | 6211 -> 6211 bytes | |||
| -rw-r--r-- | editor/icons/icon_logo_small.png (renamed from tools/editor/icons/icon_logo_small.png) | bin | 1825 -> 1825 bytes | |||
| -rw-r--r-- | editor/icons/icon_loop.png (renamed from tools/editor/icons/icon_loop.png) | bin | 412 -> 412 bytes | |||
| -rw-r--r-- | editor/icons/icon_loop_interpolation.png (renamed from tools/editor/icons/icon_loop_interpolation.png) | bin | 374 -> 374 bytes | |||
| -rw-r--r-- | editor/icons/icon_main_play.png (renamed from tools/editor/icons/icon_main_play.png) | bin | 234 -> 234 bytes | |||
| -rw-r--r-- | editor/icons/icon_main_stop.png (renamed from tools/editor/icons/icon_main_stop.png) | bin | 144 -> 144 bytes | |||
| -rw-r--r-- | editor/icons/icon_margin_container.png (renamed from tools/editor/icons/icon_margin_container.png) | bin | 233 -> 233 bytes | |||
| -rw-r--r-- | editor/icons/icon_material_preview_cube.png (renamed from tools/editor/icons/icon_material_preview_cube.png) | bin | 374 -> 374 bytes | |||
| -rw-r--r-- | editor/icons/icon_material_preview_cube_off.png (renamed from tools/editor/icons/icon_material_preview_cube_off.png) | bin | 401 -> 401 bytes | |||
| -rw-r--r-- | editor/icons/icon_material_preview_light_1.png (renamed from tools/editor/icons/icon_material_preview_light_1.png) | bin | 359 -> 359 bytes | |||
| -rw-r--r-- | editor/icons/icon_material_preview_light_1_off.png (renamed from tools/editor/icons/icon_material_preview_light_1_off.png) | bin | 305 -> 305 bytes | |||
| -rw-r--r-- | editor/icons/icon_material_preview_light_2.png (renamed from tools/editor/icons/icon_material_preview_light_2.png) | bin | 354 -> 354 bytes | |||
| -rw-r--r-- | editor/icons/icon_material_preview_light_2_off.png (renamed from tools/editor/icons/icon_material_preview_light_2_off.png) | bin | 443 -> 443 bytes | |||
| -rw-r--r-- | editor/icons/icon_material_preview_sphere.png (renamed from tools/editor/icons/icon_material_preview_sphere.png) | bin | 359 -> 359 bytes | |||
| -rw-r--r-- | editor/icons/icon_material_preview_sphere_off.png (renamed from tools/editor/icons/icon_material_preview_sphere_off.png) | bin | 283 -> 283 bytes | |||
| -rw-r--r-- | editor/icons/icon_material_shader.png (renamed from tools/editor/icons/icon_material_shader.png) | bin | 254 -> 254 bytes | |||
| -rw-r--r-- | editor/icons/icon_material_shader_graph.png (renamed from tools/editor/icons/icon_material_shader_graph.png) | bin | 440 -> 440 bytes | |||
| -rw-r--r-- | editor/icons/icon_matrix.png (renamed from tools/editor/icons/icon_matrix.png) | bin | 138 -> 138 bytes | |||
| -rw-r--r-- | editor/icons/icon_menu_button.png (renamed from tools/editor/icons/icon_menu_button.png) | bin | 213 -> 213 bytes | |||
| -rw-r--r-- | editor/icons/icon_mesh.png (renamed from tools/editor/icons/icon_mesh.png) | bin | 343 -> 343 bytes | |||
| -rw-r--r-- | editor/icons/icon_mesh_instance.png (renamed from tools/editor/icons/icon_mesh_instance.png) | bin | 314 -> 314 bytes | |||
| -rw-r--r-- | editor/icons/icon_mesh_library.png (renamed from tools/editor/icons/icon_mesh_library.png) | bin | 349 -> 349 bytes | |||
| -rw-r--r-- | editor/icons/icon_mesh_old.png (renamed from tools/editor/icons/icon_mesh_old.png) | bin | 615 -> 615 bytes | |||
| -rw-r--r-- | editor/icons/icon_meshr.png (renamed from tools/editor/icons/icon_meshr.png) | bin | 744 -> 744 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_aabb.png (renamed from tools/editor/icons/icon_mini_aabb.png) | bin | 360 -> 360 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_array.png (renamed from tools/editor/icons/icon_mini_array.png) | bin | 210 -> 210 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_boolean.png (renamed from tools/editor/icons/icon_mini_boolean.png) | bin | 256 -> 256 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_color.png (renamed from tools/editor/icons/icon_mini_color.png) | bin | 253 -> 253 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_color_array.png (renamed from tools/editor/icons/icon_mini_color_array.png) | bin | 337 -> 337 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_dictionary.png (renamed from tools/editor/icons/icon_mini_dictionary.png) | bin | 230 -> 230 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_float.png (renamed from tools/editor/icons/icon_mini_float.png) | bin | 233 -> 233 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_float_array.png (renamed from tools/editor/icons/icon_mini_float_array.png) | bin | 275 -> 275 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_image.png (renamed from tools/editor/icons/icon_mini_image.png) | bin | 257 -> 257 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_input.png (renamed from tools/editor/icons/icon_mini_input.png) | bin | 236 -> 236 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_int_array.png (renamed from tools/editor/icons/icon_mini_int_array.png) | bin | 262 -> 262 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_integer.png (renamed from tools/editor/icons/icon_mini_integer.png) | bin | 228 -> 228 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_matrix3.png (renamed from tools/editor/icons/icon_mini_matrix3.png) | bin | 236 -> 236 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_matrix32.png (renamed from tools/editor/icons/icon_mini_matrix32.png) | bin | 320 -> 320 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_object.png (renamed from tools/editor/icons/icon_mini_object.png) | bin | 289 -> 289 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_path.png (renamed from tools/editor/icons/icon_mini_path.png) | bin | 254 -> 254 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_plane.png (renamed from tools/editor/icons/icon_mini_plane.png) | bin | 249 -> 249 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_quat.png (renamed from tools/editor/icons/icon_mini_quat.png) | bin | 309 -> 309 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_raw_array.png (renamed from tools/editor/icons/icon_mini_raw_array.png) | bin | 248 -> 248 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_rect2.png (renamed from tools/editor/icons/icon_mini_rect2.png) | bin | 267 -> 267 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_rid.png (renamed from tools/editor/icons/icon_mini_rid.png) | bin | 222 -> 222 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_string.png (renamed from tools/editor/icons/icon_mini_string.png) | bin | 258 -> 258 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_string_array.png (renamed from tools/editor/icons/icon_mini_string_array.png) | bin | 296 -> 296 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_transform.png (renamed from tools/editor/icons/icon_mini_transform.png) | bin | 321 -> 321 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_variant.png (renamed from tools/editor/icons/icon_mini_variant.png) | bin | 240 -> 240 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_vector2.png (renamed from tools/editor/icons/icon_mini_vector2.png) | bin | 301 -> 301 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_vector2_array.png (renamed from tools/editor/icons/icon_mini_vector2_array.png) | bin | 284 -> 284 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_vector3.png (renamed from tools/editor/icons/icon_mini_vector3.png) | bin | 285 -> 285 bytes | |||
| -rw-r--r-- | editor/icons/icon_mini_vector3_array.png (renamed from tools/editor/icons/icon_mini_vector3_array.png) | bin | 264 -> 264 bytes | |||
| -rw-r--r-- | editor/icons/icon_mirror_x.png (renamed from tools/editor/icons/icon_mirror_x.png) | bin | 166 -> 166 bytes | |||
| -rw-r--r-- | editor/icons/icon_mirror_y.png (renamed from tools/editor/icons/icon_mirror_y.png) | bin | 168 -> 168 bytes | |||
| -rw-r--r-- | editor/icons/icon_mouse.png (renamed from tools/editor/icons/icon_mouse.png) | bin | 256 -> 256 bytes | |||
| -rw-r--r-- | editor/icons/icon_move_down.png (renamed from tools/editor/icons/icon_move_down.png) | bin | 268 -> 268 bytes | |||
| -rw-r--r-- | editor/icons/icon_move_down_hl.png (renamed from tools/editor/icons/icon_move_down_hl.png) | bin | 234 -> 234 bytes | |||
| -rw-r--r-- | editor/icons/icon_move_point.png (renamed from tools/editor/icons/icon_move_point.png) | bin | 542 -> 542 bytes | |||
| -rw-r--r-- | editor/icons/icon_move_up.png (renamed from tools/editor/icons/icon_move_up.png) | bin | 269 -> 269 bytes | |||
| -rw-r--r-- | editor/icons/icon_move_up_hl.png (renamed from tools/editor/icons/icon_move_up_hl.png) | bin | 224 -> 224 bytes | |||
| -rw-r--r-- | editor/icons/icon_multi_edit.png (renamed from tools/editor/icons/icon_multi_edit.png) | bin | 358 -> 358 bytes | |||
| -rw-r--r-- | editor/icons/icon_multi_line.png (renamed from tools/editor/icons/icon_multi_line.png) | bin | 140 -> 140 bytes | |||
| -rw-r--r-- | editor/icons/icon_multi_mesh.png (renamed from tools/editor/icons/icon_multi_mesh.png) | bin | 347 -> 347 bytes | |||
| -rw-r--r-- | editor/icons/icon_multi_mesh_instance.png (renamed from tools/editor/icons/icon_multi_mesh_instance.png) | bin | 376 -> 376 bytes | |||
| -rw-r--r-- | editor/icons/icon_multi_node_edit.png (renamed from tools/editor/icons/icon_multi_node_edit.png) | bin | 358 -> 358 bytes | |||
| -rw-r--r-- | editor/icons/icon_navigation.png (renamed from tools/editor/icons/icon_navigation.png) | bin | 344 -> 344 bytes | |||
| -rw-r--r-- | editor/icons/icon_navigation_2d.png (renamed from tools/editor/icons/icon_navigation_2d.png) | bin | 363 -> 363 bytes | |||
| -rw-r--r-- | editor/icons/icon_navigation_mesh.png (renamed from tools/editor/icons/icon_navigation_mesh.png) | bin | 450 -> 450 bytes | |||
| -rw-r--r-- | editor/icons/icon_navigation_mesh_instance.png (renamed from tools/editor/icons/icon_navigation_mesh_instance.png) | bin | 480 -> 480 bytes | |||
| -rw-r--r-- | editor/icons/icon_navigation_polygon.png (renamed from tools/editor/icons/icon_navigation_polygon.png) | bin | 384 -> 384 bytes | |||
| -rw-r--r-- | editor/icons/icon_navigation_polygon_instance.png (renamed from tools/editor/icons/icon_navigation_polygon_instance.png) | bin | 409 -> 409 bytes | |||
| -rw-r--r-- | editor/icons/icon_new.png (renamed from tools/editor/icons/icon_new.png) | bin | 157 -> 157 bytes | |||
| -rw-r--r-- | editor/icons/icon_nine_patch_rect.png (renamed from tools/editor/icons/icon_nine_patch_rect.png) | bin | 128 -> 128 bytes | |||
| -rw-r--r-- | editor/icons/icon_node.png (renamed from tools/editor/icons/icon_node.png) | bin | 403 -> 403 bytes | |||
| -rw-r--r-- | editor/icons/icon_node_2d.png (renamed from tools/editor/icons/icon_node_2d.png) | bin | 427 -> 427 bytes | |||
| -rw-r--r-- | editor/icons/icon_node_real_slot.png (renamed from tools/editor/icons/icon_node_real_slot.png) | bin | 239 -> 239 bytes | |||
| -rw-r--r-- | editor/icons/icon_node_vec_slot.png (renamed from tools/editor/icons/icon_node_vec_slot.png) | bin | 240 -> 240 bytes | |||
| -rw-r--r-- | editor/icons/icon_node_warning.png (renamed from tools/editor/icons/icon_node_warning.png) | bin | 320 -> 320 bytes | |||
| -rw-r--r-- | editor/icons/icon_non_favorite.png (renamed from tools/editor/icons/icon_non_favorite.png) | bin | 475 -> 475 bytes | |||
| -rw-r--r-- | editor/icons/icon_object.png (renamed from tools/editor/icons/icon_object.png) | bin | 354 -> 354 bytes | |||
| -rw-r--r-- | editor/icons/icon_occluder_polygon_2d.png (renamed from tools/editor/icons/icon_occluder_polygon_2d.png) | bin | 274 -> 274 bytes | |||
| -rw-r--r-- | editor/icons/icon_omni_light.png (renamed from tools/editor/icons/icon_omni_light.png) | bin | 347 -> 347 bytes | |||
| -rw-r--r-- | editor/icons/icon_open.png (renamed from tools/editor/icons/icon_open.png) | bin | 170 -> 170 bytes | |||
| -rw-r--r-- | editor/icons/icon_option_button.png (renamed from tools/editor/icons/icon_option_button.png) | bin | 218 -> 218 bytes | |||
| -rw-r--r-- | editor/icons/icon_override.png (renamed from tools/editor/icons/icon_override.png) | bin | 281 -> 281 bytes | |||
| -rw-r--r-- | editor/icons/icon_p_hash_translation.png (renamed from tools/editor/icons/icon_p_hash_translation.png) | bin | 194 -> 194 bytes | |||
| -rw-r--r-- | editor/icons/icon_packed_data_container.png (renamed from tools/editor/icons/icon_packed_data_container.png) | bin | 176 -> 176 bytes | |||
| -rw-r--r-- | editor/icons/icon_packed_scene.png (renamed from tools/editor/icons/icon_packed_scene.png) | bin | 289 -> 289 bytes | |||
| -rw-r--r-- | editor/icons/icon_pane_drag.png (renamed from tools/editor/icons/icon_pane_drag.png) | bin | 620 -> 620 bytes | |||
| -rw-r--r-- | editor/icons/icon_pane_drag_hover.png (renamed from tools/editor/icons/icon_pane_drag_hover.png) | bin | 637 -> 637 bytes | |||
| -rw-r--r-- | editor/icons/icon_panel.png (renamed from tools/editor/icons/icon_panel.png) | bin | 175 -> 175 bytes | |||
| -rw-r--r-- | editor/icons/icon_panel_container.png (renamed from tools/editor/icons/icon_panel_container.png) | bin | 198 -> 198 bytes | |||
| -rw-r--r-- | editor/icons/icon_panel_top.png (renamed from tools/editor/icons/icon_panel_top.png) | bin | 195 -> 195 bytes | |||
| -rw-r--r-- | editor/icons/icon_panels_1.png (renamed from tools/editor/icons/icon_panels_1.png) | bin | 100 -> 100 bytes | |||
| -rw-r--r-- | editor/icons/icon_panels_2.png (renamed from tools/editor/icons/icon_panels_2.png) | bin | 108 -> 108 bytes | |||
| -rw-r--r-- | editor/icons/icon_panels_2_alt.png (renamed from tools/editor/icons/icon_panels_2_alt.png) | bin | 116 -> 116 bytes | |||
| -rw-r--r-- | editor/icons/icon_panels_3.png (renamed from tools/editor/icons/icon_panels_3.png) | bin | 123 -> 123 bytes | |||
| -rw-r--r-- | editor/icons/icon_panels_3_alt.png (renamed from tools/editor/icons/icon_panels_3_alt.png) | bin | 130 -> 130 bytes | |||
| -rw-r--r-- | editor/icons/icon_panels_4.png (renamed from tools/editor/icons/icon_panels_4.png) | bin | 120 -> 120 bytes | |||
| -rw-r--r-- | editor/icons/icon_parallax_background.png (renamed from tools/editor/icons/icon_parallax_background.png) | bin | 218 -> 218 bytes | |||
| -rw-r--r-- | editor/icons/icon_parallax_layer.png (renamed from tools/editor/icons/icon_parallax_layer.png) | bin | 282 -> 282 bytes | |||
| -rw-r--r-- | editor/icons/icon_particle_attractor_2d.png (renamed from tools/editor/icons/icon_particle_attractor_2d.png) | bin | 629 -> 629 bytes | |||
| -rw-r--r-- | editor/icons/icon_particles.png (renamed from tools/editor/icons/icon_particles.png) | bin | 370 -> 370 bytes | |||
| -rw-r--r-- | editor/icons/icon_particles_2d.png (renamed from tools/editor/icons/icon_particles_2d.png) | bin | 391 -> 391 bytes | |||
| -rw-r--r-- | editor/icons/icon_particles_frame.png (renamed from tools/editor/icons/icon_particles_frame.png) | bin | 254 -> 254 bytes | |||
| -rw-r--r-- | editor/icons/icon_particles_shader.png (renamed from tools/editor/icons/icon_particles_shader.png) | bin | 367 -> 367 bytes | |||
| -rw-r--r-- | editor/icons/icon_patch_9_rect.png (renamed from tools/editor/icons/icon_patch_9_rect.png) | bin | 128 -> 128 bytes | |||
| -rw-r--r-- | editor/icons/icon_path.png (renamed from tools/editor/icons/icon_path.png) | bin | 353 -> 353 bytes | |||
| -rw-r--r-- | editor/icons/icon_path_2d.png (renamed from tools/editor/icons/icon_path_2d.png) | bin | 359 -> 359 bytes | |||
| -rw-r--r-- | editor/icons/icon_path_follow.png (renamed from tools/editor/icons/icon_path_follow.png) | bin | 387 -> 387 bytes | |||
| -rw-r--r-- | editor/icons/icon_path_follow_2d.png (renamed from tools/editor/icons/icon_path_follow_2d.png) | bin | 392 -> 392 bytes | |||
| -rw-r--r-- | editor/icons/icon_pause.png (renamed from tools/editor/icons/icon_pause.png) | bin | 147 -> 147 bytes | |||
| -rw-r--r-- | editor/icons/icon_pe_edit.png (renamed from tools/editor/icons/icon_pe_edit.png) | bin | 403 -> 403 bytes | |||
| -rw-r--r-- | editor/icons/icon_physics_joint_pin.png (renamed from tools/editor/icons/icon_physics_joint_pin.png) | bin | 454 -> 454 bytes | |||
| -rw-r--r-- | editor/icons/icon_pin.png (renamed from tools/editor/icons/icon_pin.png) | bin | 227 -> 227 bytes | |||
| -rw-r--r-- | editor/icons/icon_pin_joint.png (renamed from tools/editor/icons/icon_pin_joint.png) | bin | 418 -> 418 bytes | |||
| -rw-r--r-- | editor/icons/icon_pin_joint_2d.png (renamed from tools/editor/icons/icon_pin_joint_2d.png) | bin | 428 -> 428 bytes | |||
| -rw-r--r-- | editor/icons/icon_pin_pressed.png (renamed from tools/editor/icons/icon_pin_pressed.png) | bin | 227 -> 227 bytes | |||
| -rw-r--r-- | editor/icons/icon_plane.png (renamed from tools/editor/icons/icon_plane.png) | bin | 235 -> 235 bytes | |||
| -rw-r--r-- | editor/icons/icon_plane_shape.png (renamed from tools/editor/icons/icon_plane_shape.png) | bin | 229 -> 229 bytes | |||
| -rw-r--r-- | editor/icons/icon_play.png (renamed from tools/editor/icons/icon_play.png) | bin | 237 -> 237 bytes | |||
| -rw-r--r-- | editor/icons/icon_play_backwards.png (renamed from tools/editor/icons/icon_play_backwards.png) | bin | 245 -> 245 bytes | |||
| -rw-r--r-- | editor/icons/icon_play_custom.png (renamed from tools/editor/icons/icon_play_custom.png) | bin | 282 -> 282 bytes | |||
| -rw-r--r-- | editor/icons/icon_play_scene.png (renamed from tools/editor/icons/icon_play_scene.png) | bin | 350 -> 350 bytes | |||
| -rw-r--r-- | editor/icons/icon_play_start.png (renamed from tools/editor/icons/icon_play_start.png) | bin | 269 -> 269 bytes | |||
| -rw-r--r-- | editor/icons/icon_play_start_backwards.png (renamed from tools/editor/icons/icon_play_start_backwards.png) | bin | 279 -> 279 bytes | |||
| -rw-r--r-- | editor/icons/icon_polygon_2d.png (renamed from tools/editor/icons/icon_polygon_2d.png) | bin | 281 -> 281 bytes | |||
| -rw-r--r-- | editor/icons/icon_polygon_path_finder.png (renamed from tools/editor/icons/icon_polygon_path_finder.png) | bin | 307 -> 307 bytes | |||
| -rw-r--r-- | editor/icons/icon_popup.png (renamed from tools/editor/icons/icon_popup.png) | bin | 210 -> 210 bytes | |||
| -rw-r--r-- | editor/icons/icon_popup_dialog.png (renamed from tools/editor/icons/icon_popup_dialog.png) | bin | 221 -> 221 bytes | |||
| -rw-r--r-- | editor/icons/icon_popup_menu.png (renamed from tools/editor/icons/icon_popup_menu.png) | bin | 216 -> 216 bytes | |||
| -rw-r--r-- | editor/icons/icon_popup_panel.png (renamed from tools/editor/icons/icon_popup_panel.png) | bin | 198 -> 198 bytes | |||
| -rw-r--r-- | editor/icons/icon_portal.png (renamed from tools/editor/icons/icon_portal.png) | bin | 452 -> 452 bytes | |||
| -rw-r--r-- | editor/icons/icon_position_2d.png (renamed from tools/editor/icons/icon_position_2d.png) | bin | 132 -> 132 bytes | |||
| -rw-r--r-- | editor/icons/icon_position_3d.png (renamed from tools/editor/icons/icon_position_3d.png) | bin | 131 -> 131 bytes | |||
| -rw-r--r-- | editor/icons/icon_prev_scene.png (renamed from tools/editor/icons/icon_prev_scene.png) | bin | 229 -> 229 bytes | |||
| -rw-r--r-- | editor/icons/icon_progress_1.png (renamed from tools/editor/icons/icon_progress_1.png) | bin | 468 -> 468 bytes | |||
| -rw-r--r-- | editor/icons/icon_progress_2.png (renamed from tools/editor/icons/icon_progress_2.png) | bin | 455 -> 455 bytes | |||
| -rw-r--r-- | editor/icons/icon_progress_3.png (renamed from tools/editor/icons/icon_progress_3.png) | bin | 462 -> 462 bytes | |||
| -rw-r--r-- | editor/icons/icon_progress_4.png (renamed from tools/editor/icons/icon_progress_4.png) | bin | 475 -> 475 bytes | |||
| -rw-r--r-- | editor/icons/icon_progress_5.png (renamed from tools/editor/icons/icon_progress_5.png) | bin | 454 -> 454 bytes | |||
| -rw-r--r-- | editor/icons/icon_progress_6.png (renamed from tools/editor/icons/icon_progress_6.png) | bin | 465 -> 465 bytes | |||
| -rw-r--r-- | editor/icons/icon_progress_7.png (renamed from tools/editor/icons/icon_progress_7.png) | bin | 461 -> 461 bytes | |||
| -rw-r--r-- | editor/icons/icon_progress_8.png (renamed from tools/editor/icons/icon_progress_8.png) | bin | 463 -> 463 bytes | |||
| -rw-r--r-- | editor/icons/icon_progress_bar.png (renamed from tools/editor/icons/icon_progress_bar.png) | bin | 208 -> 208 bytes | |||
| -rw-r--r-- | editor/icons/icon_property_editor.png (renamed from tools/editor/icons/icon_property_editor.png) | bin | 248 -> 248 bytes | |||
| -rw-r--r-- | editor/icons/icon_proximity_group.png (renamed from tools/editor/icons/icon_proximity_group.png) | bin | 223 -> 223 bytes | |||
| -rw-r--r-- | editor/icons/icon_quad.png (renamed from tools/editor/icons/icon_quad.png) | bin | 251 -> 251 bytes | |||
| -rw-r--r-- | editor/icons/icon_quat.png (renamed from tools/editor/icons/icon_quat.png) | bin | 341 -> 341 bytes | |||
| -rw-r--r-- | editor/icons/icon_range.png (renamed from tools/editor/icons/icon_range.png) | bin | 151 -> 151 bytes | |||
| -rw-r--r-- | editor/icons/icon_rating_no_star.png (renamed from tools/editor/icons/icon_rating_no_star.png) | bin | 515 -> 515 bytes | |||
| -rw-r--r-- | editor/icons/icon_rating_star.png (renamed from tools/editor/icons/icon_rating_star.png) | bin | 383 -> 383 bytes | |||
| -rw-r--r-- | editor/icons/icon_ray_cast.png (renamed from tools/editor/icons/icon_ray_cast.png) | bin | 216 -> 216 bytes | |||
| -rw-r--r-- | editor/icons/icon_ray_cast_2d.png (renamed from tools/editor/icons/icon_ray_cast_2d.png) | bin | 214 -> 214 bytes | |||
| -rw-r--r-- | editor/icons/icon_ray_shape.png (renamed from tools/editor/icons/icon_ray_shape.png) | bin | 363 -> 363 bytes | |||
| -rw-r--r-- | editor/icons/icon_ray_shape_2d.png (renamed from tools/editor/icons/icon_ray_shape_2d.png) | bin | 233 -> 233 bytes | |||
| -rw-r--r-- | editor/icons/icon_rayito.png (renamed from tools/editor/icons/icon_rayito.png) | bin | 300 -> 300 bytes | |||
| -rw-r--r-- | editor/icons/icon_real.png (renamed from tools/editor/icons/icon_real.png) | bin | 265 -> 265 bytes | |||
| -rw-r--r-- | editor/icons/icon_rect2.png (renamed from tools/editor/icons/icon_rect2.png) | bin | 193 -> 193 bytes | |||
| -rw-r--r-- | editor/icons/icon_rect3.png (renamed from tools/editor/icons/icon_rect3.png) | bin | 202 -> 202 bytes | |||
| -rw-r--r-- | editor/icons/icon_rectangle_shape_2d.png (renamed from tools/editor/icons/icon_rectangle_shape_2d.png) | bin | 159 -> 159 bytes | |||
| -rw-r--r-- | editor/icons/icon_reference_rect.png (renamed from tools/editor/icons/icon_reference_rect.png) | bin | 128 -> 128 bytes | |||
| -rw-r--r-- | editor/icons/icon_reflection_probe.png (renamed from tools/editor/icons/icon_reflection_probe.png) | bin | 370 -> 370 bytes | |||
| -rw-r--r-- | editor/icons/icon_region_edit.png (renamed from tools/editor/icons/icon_region_edit.png) | bin | 141 -> 141 bytes | |||
| -rw-r--r-- | editor/icons/icon_reload.png (renamed from tools/editor/icons/icon_reload.png) | bin | 420 -> 420 bytes | |||
| -rw-r--r-- | editor/icons/icon_reload_empty.png (renamed from tools/editor/icons/icon_reload_empty.png) | bin | 251 -> 251 bytes | |||
| -rw-r--r-- | editor/icons/icon_reload_small.png (renamed from tools/editor/icons/icon_reload_small.png) | bin | 409 -> 409 bytes | |||
| -rw-r--r-- | editor/icons/icon_remote.png (renamed from tools/editor/icons/icon_remote.png) | bin | 394 -> 394 bytes | |||
| -rw-r--r-- | editor/icons/icon_remote_transform.png (renamed from tools/editor/icons/icon_remote_transform.png) | bin | 530 -> 530 bytes | |||
| -rw-r--r-- | editor/icons/icon_remote_transform_2d.png (renamed from tools/editor/icons/icon_remote_transform_2d.png) | bin | 552 -> 552 bytes | |||
| -rw-r--r-- | editor/icons/icon_remove.png (renamed from tools/editor/icons/icon_remove.png) | bin | 184 -> 184 bytes | |||
| -rw-r--r-- | editor/icons/icon_remove_hl.png (renamed from tools/editor/icons/icon_remove_hl.png) | bin | 385 -> 385 bytes | |||
| -rw-r--r-- | editor/icons/icon_remove_small.png (renamed from tools/editor/icons/icon_remove_small.png) | bin | 297 -> 297 bytes | |||
| -rw-r--r-- | editor/icons/icon_rename.png (renamed from tools/editor/icons/icon_rename.png) | bin | 160 -> 160 bytes | |||
| -rw-r--r-- | editor/icons/icon_reparent.png (renamed from tools/editor/icons/icon_reparent.png) | bin | 390 -> 390 bytes | |||
| -rw-r--r-- | editor/icons/icon_replace.png (renamed from tools/editor/icons/icon_replace.png) | bin | 435 -> 435 bytes | |||
| -rw-r--r-- | editor/icons/icon_resource_preloader.png (renamed from tools/editor/icons/icon_resource_preloader.png) | bin | 391 -> 391 bytes | |||
| -rw-r--r-- | editor/icons/icon_rich_text_label.png (renamed from tools/editor/icons/icon_rich_text_label.png) | bin | 236 -> 236 bytes | |||
| -rw-r--r-- | editor/icons/icon_rid.png (renamed from tools/editor/icons/icon_rid.png) | bin | 468 -> 468 bytes | |||
| -rw-r--r-- | editor/icons/icon_rigid_body.png (renamed from tools/editor/icons/icon_rigid_body.png) | bin | 531 -> 531 bytes | |||
| -rw-r--r-- | editor/icons/icon_rigid_body_2_d.png (renamed from tools/editor/icons/icon_rigid_body_2_d.png) | bin | 501 -> 501 bytes | |||
| -rw-r--r-- | editor/icons/icon_rigid_body_2d.png (renamed from tools/editor/icons/icon_rigid_body_2d.png) | bin | 559 -> 559 bytes | |||
| -rw-r--r-- | editor/icons/icon_room.png (renamed from tools/editor/icons/icon_room.png) | bin | 375 -> 375 bytes | |||
| -rw-r--r-- | editor/icons/icon_room_bounds.png (renamed from tools/editor/icons/icon_room_bounds.png) | bin | 363 -> 363 bytes | |||
| -rw-r--r-- | editor/icons/icon_room_instance.png (renamed from tools/editor/icons/icon_room_instance.png) | bin | 392 -> 392 bytes | |||
| -rw-r--r-- | editor/icons/icon_rotate_0.png (renamed from tools/editor/icons/icon_rotate_0.png) | bin | 436 -> 436 bytes | |||
| -rw-r--r-- | editor/icons/icon_rotate_180.png (renamed from tools/editor/icons/icon_rotate_180.png) | bin | 376 -> 376 bytes | |||
| -rw-r--r-- | editor/icons/icon_rotate_270.png (renamed from tools/editor/icons/icon_rotate_270.png) | bin | 357 -> 357 bytes | |||
| -rw-r--r-- | editor/icons/icon_rotate_90.png (renamed from tools/editor/icons/icon_rotate_90.png) | bin | 412 -> 412 bytes | |||
| -rw-r--r-- | editor/icons/icon_run.png (renamed from tools/editor/icons/icon_run.png) | bin | 800 -> 800 bytes | |||
| -rw-r--r-- | editor/icons/icon_s_s_a_o_f_x.png (renamed from tools/editor/icons/icon_s_s_a_o_f_x.png) | bin | 564 -> 564 bytes | |||
| -rw-r--r-- | editor/icons/icon_sample.png (renamed from tools/editor/icons/icon_sample.png) | bin | 152 -> 152 bytes | |||
| -rw-r--r-- | editor/icons/icon_sample_library.png (renamed from tools/editor/icons/icon_sample_library.png) | bin | 333 -> 333 bytes | |||
| -rw-r--r-- | editor/icons/icon_sample_player.png (renamed from tools/editor/icons/icon_sample_player.png) | bin | 234 -> 234 bytes | |||
| -rw-r--r-- | editor/icons/icon_sample_player_2d.png (renamed from tools/editor/icons/icon_sample_player_2d.png) | bin | 252 -> 252 bytes | |||
| -rw-r--r-- | editor/icons/icon_save.png (renamed from tools/editor/icons/icon_save.png) | bin | 252 -> 252 bytes | |||
| -rw-r--r-- | editor/icons/icon_scene.png (renamed from tools/editor/icons/icon_scene.png) | bin | 476 -> 476 bytes | |||
| -rw-r--r-- | editor/icons/icon_scene_instance.png (renamed from tools/editor/icons/icon_scene_instance.png) | bin | 488 -> 488 bytes | |||
| -rw-r--r-- | editor/icons/icon_scene_tree_editor.png (renamed from tools/editor/icons/icon_scene_tree_editor.png) | bin | 294 -> 294 bytes | |||
| -rw-r--r-- | editor/icons/icon_script.png (renamed from tools/editor/icons/icon_script.png) | bin | 262 -> 262 bytes | |||
| -rw-r--r-- | editor/icons/icon_script_control.png (renamed from tools/editor/icons/icon_script_control.png) | bin | 452 -> 452 bytes | |||
| -rw-r--r-- | editor/icons/icon_script_create.png (renamed from tools/editor/icons/icon_script_create.png) | bin | 288 -> 288 bytes | |||
| -rw-r--r-- | editor/icons/icon_script_error.png (renamed from tools/editor/icons/icon_script_error.png) | bin | 220 -> 220 bytes | |||
| -rw-r--r-- | editor/icons/icon_script_list.png (renamed from tools/editor/icons/icon_script_list.png) | bin | 213 -> 213 bytes | |||
| -rw-r--r-- | editor/icons/icon_script_node.png (renamed from tools/editor/icons/icon_script_node.png) | bin | 455 -> 455 bytes | |||
| -rw-r--r-- | editor/icons/icon_script_remove.png (renamed from tools/editor/icons/icon_script_remove.png) | bin | 411 -> 411 bytes | |||
| -rw-r--r-- | editor/icons/icon_scroll_bar.png (renamed from tools/editor/icons/icon_scroll_bar.png) | bin | 205 -> 205 bytes | |||
| -rw-r--r-- | editor/icons/icon_scroll_container.png (renamed from tools/editor/icons/icon_scroll_container.png) | bin | 304 -> 304 bytes | |||
| -rw-r--r-- | editor/icons/icon_segment_shape_2d.png (renamed from tools/editor/icons/icon_segment_shape_2d.png) | bin | 241 -> 241 bytes | |||
| -rw-r--r-- | editor/icons/icon_shader.png (renamed from tools/editor/icons/icon_shader.png) | bin | 254 -> 254 bytes | |||
| -rw-r--r-- | editor/icons/icon_shader_material.png (renamed from tools/editor/icons/icon_shader_material.png) | bin | 254 -> 254 bytes | |||
| -rw-r--r-- | editor/icons/icon_short_cut.png (renamed from tools/editor/icons/icon_short_cut.png) | bin | 272 -> 272 bytes | |||
| -rw-r--r-- | editor/icons/icon_signal.png (renamed from tools/editor/icons/icon_signal.png) | bin | 246 -> 246 bytes | |||
| -rw-r--r-- | editor/icons/icon_skeleton.png (renamed from tools/editor/icons/icon_skeleton.png) | bin | 346 -> 346 bytes | |||
| -rw-r--r-- | editor/icons/icon_skeletonr.png (renamed from tools/editor/icons/icon_skeletonr.png) | bin | 362 -> 362 bytes | |||
| -rw-r--r-- | editor/icons/icon_sky_box_f_x.png (renamed from tools/editor/icons/icon_sky_box_f_x.png) | bin | 740 -> 740 bytes | |||
| -rw-r--r-- | editor/icons/icon_slider_joint.png (renamed from tools/editor/icons/icon_slider_joint.png) | bin | 150 -> 150 bytes | |||
| -rw-r--r-- | editor/icons/icon_slot.png (renamed from tools/editor/icons/icon_slot.png) | bin | 246 -> 246 bytes | |||
| -rw-r--r-- | editor/icons/icon_small_next.png (renamed from tools/editor/icons/icon_small_next.png) | bin | 191 -> 191 bytes | |||
| -rw-r--r-- | editor/icons/icon_snap.png (renamed from tools/editor/icons/icon_snap.png) | bin | 269 -> 269 bytes | |||
| -rw-r--r-- | editor/icons/icon_sound_room_params.png (renamed from tools/editor/icons/icon_sound_room_params.png) | bin | 248 -> 248 bytes | |||
| -rw-r--r-- | editor/icons/icon_spatial.png (renamed from tools/editor/icons/icon_spatial.png) | bin | 419 -> 419 bytes | |||
| -rw-r--r-- | editor/icons/icon_spatial_add.png (renamed from tools/editor/icons/icon_spatial_add.png) | bin | 429 -> 429 bytes | |||
| -rw-r--r-- | editor/icons/icon_spatial_sample_player.png (renamed from tools/editor/icons/icon_spatial_sample_player.png) | bin | 239 -> 239 bytes | |||
| -rw-r--r-- | editor/icons/icon_spatial_shader.png (renamed from tools/editor/icons/icon_spatial_shader.png) | bin | 483 -> 483 bytes | |||
| -rw-r--r-- | editor/icons/icon_spatial_stream_player.png (renamed from tools/editor/icons/icon_spatial_stream_player.png) | bin | 183 -> 183 bytes | |||
| -rw-r--r-- | editor/icons/icon_sphere_shape.png (renamed from tools/editor/icons/icon_sphere_shape.png) | bin | 362 -> 362 bytes | |||
| -rw-r--r-- | editor/icons/icon_spin_box.png (renamed from tools/editor/icons/icon_spin_box.png) | bin | 289 -> 289 bytes | |||
| -rw-r--r-- | editor/icons/icon_spline.png (renamed from tools/editor/icons/icon_spline.png) | bin | 244 -> 244 bytes | |||
| -rw-r--r-- | editor/icons/icon_spot_light.png (renamed from tools/editor/icons/icon_spot_light.png) | bin | 341 -> 341 bytes | |||
| -rw-r--r-- | editor/icons/icon_sprite.png (renamed from tools/editor/icons/icon_sprite.png) | bin | 419 -> 419 bytes | |||
| -rw-r--r-- | editor/icons/icon_sprite_3d.png (renamed from tools/editor/icons/icon_sprite_3d.png) | bin | 408 -> 408 bytes | |||
| -rw-r--r-- | editor/icons/icon_sprite_frames.png (renamed from tools/editor/icons/icon_sprite_frames.png) | bin | 332 -> 332 bytes | |||
| -rw-r--r-- | editor/icons/icon_squirrel_script.png (renamed from tools/editor/icons/icon_squirrel_script.png) | bin | 283 -> 283 bytes | |||
| -rw-r--r-- | editor/icons/icon_static_body.png (renamed from tools/editor/icons/icon_static_body.png) | bin | 229 -> 229 bytes | |||
| -rw-r--r-- | editor/icons/icon_static_body_2_d.png (renamed from tools/editor/icons/icon_static_body_2_d.png) | bin | 368 -> 368 bytes | |||
| -rw-r--r-- | editor/icons/icon_static_body_2d.png (renamed from tools/editor/icons/icon_static_body_2d.png) | bin | 237 -> 237 bytes | |||
| -rw-r--r-- | editor/icons/icon_stop.png (renamed from tools/editor/icons/icon_stop.png) | bin | 236 -> 236 bytes | |||
| -rw-r--r-- | editor/icons/icon_stream_player.png (renamed from tools/editor/icons/icon_stream_player.png) | bin | 183 -> 183 bytes | |||
| -rw-r--r-- | editor/icons/icon_string.png (renamed from tools/editor/icons/icon_string.png) | bin | 160 -> 160 bytes | |||
| -rw-r--r-- | editor/icons/icon_style_box_empty.png (renamed from tools/editor/icons/icon_style_box_empty.png) | bin | 333 -> 333 bytes | |||
| -rw-r--r-- | editor/icons/icon_style_box_flat.png (renamed from tools/editor/icons/icon_style_box_flat.png) | bin | 398 -> 398 bytes | |||
| -rw-r--r-- | editor/icons/icon_style_box_texture.png (renamed from tools/editor/icons/icon_style_box_texture.png) | bin | 411 -> 411 bytes | |||
| -rw-r--r-- | editor/icons/icon_surface.png (renamed from tools/editor/icons/icon_surface.png) | bin | 212 -> 212 bytes | |||
| -rw-r--r-- | editor/icons/icon_tab_container.png (renamed from tools/editor/icons/icon_tab_container.png) | bin | 214 -> 214 bytes | |||
| -rw-r--r-- | editor/icons/icon_tab_menu.png (renamed from tools/editor/icons/icon_tab_menu.png) | bin | 251 -> 251 bytes | |||
| -rw-r--r-- | editor/icons/icon_tabs.png (renamed from tools/editor/icons/icon_tabs.png) | bin | 146 -> 146 bytes | |||
| -rw-r--r-- | editor/icons/icon_test_cube.png (renamed from tools/editor/icons/icon_test_cube.png) | bin | 435 -> 435 bytes | |||
| -rw-r--r-- | editor/icons/icon_text_edit.png (renamed from tools/editor/icons/icon_text_edit.png) | bin | 207 -> 207 bytes | |||
| -rw-r--r-- | editor/icons/icon_texture.png (renamed from tools/editor/icons/icon_texture.png) | bin | 200 -> 200 bytes | |||
| -rw-r--r-- | editor/icons/icon_texture_button.png (renamed from tools/editor/icons/icon_texture_button.png) | bin | 159 -> 159 bytes | |||
| -rw-r--r-- | editor/icons/icon_texture_progress.png (renamed from tools/editor/icons/icon_texture_progress.png) | bin | 213 -> 213 bytes | |||
| -rw-r--r-- | editor/icons/icon_texture_rect.png (renamed from tools/editor/icons/icon_texture_rect.png) | bin | 158 -> 158 bytes | |||
| -rw-r--r-- | editor/icons/icon_theme.png (renamed from tools/editor/icons/icon_theme.png) | bin | 451 -> 451 bytes | |||
| -rw-r--r-- | editor/icons/icon_thumbnail_wait.png (renamed from tools/editor/icons/icon_thumbnail_wait.png) | bin | 2616 -> 2616 bytes | |||
| -rw-r--r-- | editor/icons/icon_tile_map.png (renamed from tools/editor/icons/icon_tile_map.png) | bin | 113 -> 113 bytes | |||
| -rw-r--r-- | editor/icons/icon_tile_set.png (renamed from tools/editor/icons/icon_tile_set.png) | bin | 174 -> 174 bytes | |||
| -rw-r--r-- | editor/icons/icon_time.png (renamed from tools/editor/icons/icon_time.png) | bin | 557 -> 557 bytes | |||
| -rw-r--r-- | editor/icons/icon_timer.png (renamed from tools/editor/icons/icon_timer.png) | bin | 447 -> 447 bytes | |||
| -rw-r--r-- | editor/icons/icon_tool_button.png (renamed from tools/editor/icons/icon_tool_button.png) | bin | 263 -> 263 bytes | |||
| -rw-r--r-- | editor/icons/icon_tool_move.png (renamed from tools/editor/icons/icon_tool_move.png) | bin | 217 -> 217 bytes | |||
| -rw-r--r-- | editor/icons/icon_tool_pan.png (renamed from tools/editor/icons/icon_tool_pan.png) | bin | 281 -> 281 bytes | |||
| -rw-r--r-- | editor/icons/icon_tool_rotate.png (renamed from tools/editor/icons/icon_tool_rotate.png) | bin | 420 -> 420 bytes | |||
| -rw-r--r-- | editor/icons/icon_tool_scale.png (renamed from tools/editor/icons/icon_tool_scale.png) | bin | 349 -> 349 bytes | |||
| -rw-r--r-- | editor/icons/icon_tool_select.png (renamed from tools/editor/icons/icon_tool_select.png) | bin | 376 -> 376 bytes | |||
| -rw-r--r-- | editor/icons/icon_tools.png (renamed from tools/editor/icons/icon_tools.png) | bin | 392 -> 392 bytes | |||
| -rw-r--r-- | editor/icons/icon_touch_screen_button.png (renamed from tools/editor/icons/icon_touch_screen_button.png) | bin | 313 -> 313 bytes | |||
| -rw-r--r-- | editor/icons/icon_track_add_key.png (renamed from tools/editor/icons/icon_track_add_key.png) | bin | 113 -> 113 bytes | |||
| -rw-r--r-- | editor/icons/icon_track_add_key_hl.png (renamed from tools/editor/icons/icon_track_add_key_hl.png) | bin | 113 -> 113 bytes | |||
| -rw-r--r-- | editor/icons/icon_track_continuous.png (renamed from tools/editor/icons/icon_track_continuous.png) | bin | 265 -> 265 bytes | |||
| -rw-r--r-- | editor/icons/icon_track_discrete.png (renamed from tools/editor/icons/icon_track_discrete.png) | bin | 125 -> 125 bytes | |||
| -rw-r--r-- | editor/icons/icon_track_method.png (renamed from tools/editor/icons/icon_track_method.png) | bin | 283 -> 283 bytes | |||
| -rw-r--r-- | editor/icons/icon_track_prop.png (renamed from tools/editor/icons/icon_track_prop.png) | bin | 285 -> 285 bytes | |||
| -rw-r--r-- | editor/icons/icon_track_trigger.png (renamed from tools/editor/icons/icon_track_trigger.png) | bin | 158 -> 158 bytes | |||
| -rw-r--r-- | editor/icons/icon_track_value.png (renamed from tools/editor/icons/icon_track_value.png) | bin | 300 -> 300 bytes | |||
| -rw-r--r-- | editor/icons/icon_translation.png (renamed from tools/editor/icons/icon_translation.png) | bin | 194 -> 194 bytes | |||
| -rw-r--r-- | editor/icons/icon_transparent.png (renamed from tools/editor/icons/icon_transparent.png) | bin | 158 -> 158 bytes | |||
| -rw-r--r-- | editor/icons/icon_transpose.png (renamed from tools/editor/icons/icon_transpose.png) | bin | 165 -> 165 bytes | |||
| -rw-r--r-- | editor/icons/icon_tree.png (renamed from tools/editor/icons/icon_tree.png) | bin | 243 -> 243 bytes | |||
| -rw-r--r-- | editor/icons/icon_tween.png (renamed from tools/editor/icons/icon_tween.png) | bin | 248 -> 248 bytes | |||
| -rw-r--r-- | editor/icons/icon_unbone.png (renamed from tools/editor/icons/icon_unbone.png) | bin | 383 -> 383 bytes | |||
| -rw-r--r-- | editor/icons/icon_ungroup.png (renamed from tools/editor/icons/icon_ungroup.png) | bin | 170 -> 170 bytes | |||
| -rw-r--r-- | editor/icons/icon_uninstance.png (renamed from tools/editor/icons/icon_uninstance.png) | bin | 525 -> 525 bytes | |||
| -rw-r--r-- | editor/icons/icon_unlock.png (renamed from tools/editor/icons/icon_unlock.png) | bin | 262 -> 262 bytes | |||
| -rw-r--r-- | editor/icons/icon_up.png (renamed from tools/editor/icons/icon_up.png) | bin | 185 -> 185 bytes | |||
| -rw-r--r-- | editor/icons/icon_updown.png (renamed from tools/editor/icons/icon_updown.png) | bin | 180 -> 180 bytes | |||
| -rw-r--r-- | editor/icons/icon_uv.png (renamed from tools/editor/icons/icon_uv.png) | bin | 282 -> 282 bytes | |||
| -rw-r--r-- | editor/icons/icon_v_box_container.png (renamed from tools/editor/icons/icon_v_box_container.png) | bin | 207 -> 207 bytes | |||
| -rw-r--r-- | editor/icons/icon_v_button_array.png (renamed from tools/editor/icons/icon_v_button_array.png) | bin | 147 -> 147 bytes | |||
| -rw-r--r-- | editor/icons/icon_v_scroll_bar.png (renamed from tools/editor/icons/icon_v_scroll_bar.png) | bin | 218 -> 218 bytes | |||
| -rw-r--r-- | editor/icons/icon_v_separator.png (renamed from tools/editor/icons/icon_v_separator.png) | bin | 130 -> 130 bytes | |||
| -rw-r--r-- | editor/icons/icon_v_slider.png (renamed from tools/editor/icons/icon_v_slider.png) | bin | 231 -> 231 bytes | |||
| -rw-r--r-- | editor/icons/icon_v_split_container.png (renamed from tools/editor/icons/icon_v_split_container.png) | bin | 277 -> 277 bytes | |||
| -rw-r--r-- | editor/icons/icon_variant.png (renamed from tools/editor/icons/icon_variant.png) | bin | 240 -> 240 bytes | |||
| -rw-r--r-- | editor/icons/icon_vector.png (renamed from tools/editor/icons/icon_vector.png) | bin | 208 -> 208 bytes | |||
| -rw-r--r-- | editor/icons/icon_vector2.png (renamed from tools/editor/icons/icon_vector2.png) | bin | 122 -> 122 bytes | |||
| -rw-r--r-- | editor/icons/icon_vehicle_body.png (renamed from tools/editor/icons/icon_vehicle_body.png) | bin | 236 -> 236 bytes | |||
| -rw-r--r-- | editor/icons/icon_vehicle_wheel.png (renamed from tools/editor/icons/icon_vehicle_wheel.png) | bin | 537 -> 537 bytes | |||
| -rw-r--r-- | editor/icons/icon_video_player.png (renamed from tools/editor/icons/icon_video_player.png) | bin | 302 -> 302 bytes | |||
| -rw-r--r-- | editor/icons/icon_video_stream_theora.png (renamed from tools/editor/icons/icon_video_stream_theora.png) | bin | 925 -> 925 bytes | |||
| -rw-r--r-- | editor/icons/icon_view.png (renamed from tools/editor/icons/icon_view.png) | bin | 386 -> 386 bytes | |||
| -rw-r--r-- | editor/icons/icon_viewport.png (renamed from tools/editor/icons/icon_viewport.png) | bin | 198 -> 198 bytes | |||
| -rw-r--r-- | editor/icons/icon_viewport_container.png (renamed from tools/editor/icons/icon_viewport_container.png) | bin | 284 -> 284 bytes | |||
| -rw-r--r-- | editor/icons/icon_viewport_sprite.png (renamed from tools/editor/icons/icon_viewport_sprite.png) | bin | 239 -> 239 bytes | |||
| -rw-r--r-- | editor/icons/icon_viewport_texture.png (renamed from tools/editor/icons/icon_viewport_texture.png) | bin | 227 -> 227 bytes | |||
| -rw-r--r-- | editor/icons/icon_visibility_area.png (renamed from tools/editor/icons/icon_visibility_area.png) | bin | 422 -> 422 bytes | |||
| -rw-r--r-- | editor/icons/icon_visibility_enabler.png (renamed from tools/editor/icons/icon_visibility_enabler.png) | bin | 549 -> 549 bytes | |||
| -rw-r--r-- | editor/icons/icon_visibility_enabler_2d.png (renamed from tools/editor/icons/icon_visibility_enabler_2d.png) | bin | 550 -> 550 bytes | |||
| -rw-r--r-- | editor/icons/icon_visibility_notifier.png (renamed from tools/editor/icons/icon_visibility_notifier.png) | bin | 427 -> 427 bytes | |||
| -rw-r--r-- | editor/icons/icon_visibility_notifier_2d.png (renamed from tools/editor/icons/icon_visibility_notifier_2d.png) | bin | 431 -> 431 bytes | |||
| -rw-r--r-- | editor/icons/icon_visible.png (renamed from tools/editor/icons/icon_visible.png) | bin | 497 -> 497 bytes | |||
| -rw-r--r-- | editor/icons/icon_visual_script.png (renamed from tools/editor/icons/icon_visual_script.png) | bin | 388 -> 388 bytes | |||
| -rw-r--r-- | editor/icons/icon_visual_shader_port.png (renamed from tools/editor/icons/icon_visual_shader_port.png) | bin | 255 -> 255 bytes | |||
| -rw-r--r-- | editor/icons/icon_volume.png (renamed from tools/editor/icons/icon_volume.png) | bin | 295 -> 295 bytes | |||
| -rw-r--r-- | editor/icons/icon_vu_db.png (renamed from tools/editor/icons/icon_vu_db.png) | bin | 1015 -> 1015 bytes | |||
| -rw-r--r-- | editor/icons/icon_vu_empty.png (renamed from tools/editor/icons/icon_vu_empty.png) | bin | 283 -> 283 bytes | |||
| -rw-r--r-- | editor/icons/icon_vu_full.png (renamed from tools/editor/icons/icon_vu_full.png) | bin | 224 -> 224 bytes | |||
| -rw-r--r-- | editor/icons/icon_wait_no_preview.png (renamed from tools/editor/icons/icon_wait_no_preview.png) | bin | 1041 -> 1041 bytes | |||
| -rw-r--r-- | editor/icons/icon_wait_preview_1.png (renamed from tools/editor/icons/icon_wait_preview_1.png) | bin | 1208 -> 1208 bytes | |||
| -rw-r--r-- | editor/icons/icon_wait_preview_2.png (renamed from tools/editor/icons/icon_wait_preview_2.png) | bin | 1270 -> 1270 bytes | |||
| -rw-r--r-- | editor/icons/icon_wait_preview_3.png (renamed from tools/editor/icons/icon_wait_preview_3.png) | bin | 1190 -> 1190 bytes | |||
| -rw-r--r-- | editor/icons/icon_wait_preview_4.png (renamed from tools/editor/icons/icon_wait_preview_4.png) | bin | 1269 -> 1269 bytes | |||
| -rw-r--r-- | editor/icons/icon_wait_preview_5.png (renamed from tools/editor/icons/icon_wait_preview_5.png) | bin | 1191 -> 1191 bytes | |||
| -rw-r--r-- | editor/icons/icon_wait_preview_6.png (renamed from tools/editor/icons/icon_wait_preview_6.png) | bin | 1278 -> 1278 bytes | |||
| -rw-r--r-- | editor/icons/icon_wait_preview_7.png (renamed from tools/editor/icons/icon_wait_preview_7.png) | bin | 1192 -> 1192 bytes | |||
| -rw-r--r-- | editor/icons/icon_wait_preview_8.png (renamed from tools/editor/icons/icon_wait_preview_8.png) | bin | 1341 -> 1341 bytes | |||
| -rw-r--r-- | editor/icons/icon_warning.png (renamed from tools/editor/icons/icon_warning.png) | bin | 120 -> 120 bytes | |||
| -rw-r--r-- | editor/icons/icon_window_dialog.png (renamed from tools/editor/icons/icon_window_dialog.png) | bin | 200 -> 200 bytes | |||
| -rw-r--r-- | editor/icons/icon_world.png (renamed from tools/editor/icons/icon_world.png) | bin | 254 -> 254 bytes | |||
| -rw-r--r-- | editor/icons/icon_world_2d.png (renamed from tools/editor/icons/icon_world_2d.png) | bin | 328 -> 328 bytes | |||
| -rw-r--r-- | editor/icons/icon_world_environment.png (renamed from tools/editor/icons/icon_world_environment.png) | bin | 578 -> 578 bytes | |||
| -rw-r--r-- | editor/icons/icon_y_sort.png (renamed from tools/editor/icons/icon_y_sort.png) | bin | 230 -> 230 bytes | |||
| -rw-r--r-- | editor/icons/icon_zoom.png (renamed from tools/editor/icons/icon_zoom.png) | bin | 404 -> 404 bytes | |||
| -rw-r--r-- | editor/icons/icon_zoom_less.png (renamed from tools/editor/icons/icon_zoom_less.png) | bin | 149 -> 149 bytes | |||
| -rw-r--r-- | editor/icons/icon_zoom_more.png (renamed from tools/editor/icons/icon_zoom_more.png) | bin | 232 -> 232 bytes | |||
| -rw-r--r-- | editor/icons/icon_zoom_reset.png (renamed from tools/editor/icons/icon_zoom_reset.png) | bin | 430 -> 430 bytes | |||
| -rw-r--r-- | editor/icons/source/icon_accept_dialog.svg (renamed from tools/editor/icons/source/icon_accept_dialog.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_add_track.svg (renamed from tools/editor/icons/source/icon_add_track.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_anchor.svg (renamed from tools/editor/icons/source/icon_anchor.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_animated_sprite.svg (renamed from tools/editor/icons/source/icon_animated_sprite.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_animated_sprite_3d.svg (renamed from tools/editor/icons/source/icon_animated_sprite_3d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_animation.svg (renamed from tools/editor/icons/source/icon_animation.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_animation_player.svg (renamed from tools/editor/icons/source/icon_animation_player.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_animation_tree_player.svg (renamed from tools/editor/icons/source/icon_animation_tree_player.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_area.svg (renamed from tools/editor/icons/source/icon_area.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_area_2d.svg (renamed from tools/editor/icons/source/icon_area_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_arrow_left.svg (renamed from tools/editor/icons/source/icon_arrow_left.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_arrow_right.svg (renamed from tools/editor/icons/source/icon_arrow_right.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_arrow_up.svg (renamed from tools/editor/icons/source/icon_arrow_up.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_atlas_texture.svg (renamed from tools/editor/icons/source/icon_atlas_texture.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_audio_stream_gibberish.svg (renamed from tools/editor/icons/source/icon_audio_stream_gibberish.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_auto_play.svg (renamed from tools/editor/icons/source/icon_auto_play.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_back.svg (renamed from tools/editor/icons/source/icon_back.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_back_buffer_copy.svg (renamed from tools/editor/icons/source/icon_back_buffer_copy.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_bake.svg (renamed from tools/editor/icons/source/icon_bake.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_baked_light.svg (renamed from tools/editor/icons/source/icon_baked_light.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_baked_light_instance.svg (renamed from tools/editor/icons/source/icon_baked_light_instance.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_baked_light_sampler.svg (renamed from tools/editor/icons/source/icon_baked_light_sampler.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_bit_map.svg (renamed from tools/editor/icons/source/icon_bit_map.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_bitmap_font.svg (renamed from tools/editor/icons/source/icon_bitmap_font.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_blend.svg (renamed from tools/editor/icons/source/icon_blend.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_bone.svg (renamed from tools/editor/icons/source/icon_bone.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_bone_attachment.svg (renamed from tools/editor/icons/source/icon_bone_attachment.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_bone_track.svg (renamed from tools/editor/icons/source/icon_bone_track.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_bool.svg (renamed from tools/editor/icons/source/icon_bool.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_box_shape.svg (renamed from tools/editor/icons/source/icon_box_shape.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_button.svg (renamed from tools/editor/icons/source/icon_button.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_button_group.svg (renamed from tools/editor/icons/source/icon_button_group.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_camera.svg (renamed from tools/editor/icons/source/icon_camera.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_camera_2d.svg (renamed from tools/editor/icons/source/icon_camera_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_canvas_item.svg (renamed from tools/editor/icons/source/icon_canvas_item.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_canvas_item_material.svg (renamed from tools/editor/icons/source/icon_canvas_item_material.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_canvas_item_shader.svg (renamed from tools/editor/icons/source/icon_canvas_item_shader.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_canvas_item_shader_graph.svg (renamed from tools/editor/icons/source/icon_canvas_item_shader_graph.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_canvas_layer.svg (renamed from tools/editor/icons/source/icon_canvas_layer.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_canvas_modulate.svg (renamed from tools/editor/icons/source/icon_canvas_modulate.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_capsule_shape.svg (renamed from tools/editor/icons/source/icon_capsule_shape.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_capsule_shape_2d.svg (renamed from tools/editor/icons/source/icon_capsule_shape_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_center_container.svg (renamed from tools/editor/icons/source/icon_center_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_check_box.svg (renamed from tools/editor/icons/source/icon_check_box.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_check_button.svg (renamed from tools/editor/icons/source/icon_check_button.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_circle_shape_2d.svg (renamed from tools/editor/icons/source/icon_circle_shape_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_class_list.svg (renamed from tools/editor/icons/source/icon_class_list.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_close.svg (renamed from tools/editor/icons/source/icon_close.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_collapse.svg (renamed from tools/editor/icons/source/icon_collapse.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_collision_2d.svg (renamed from tools/editor/icons/source/icon_collision_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_collision_polygon.svg (renamed from tools/editor/icons/source/icon_collision_polygon.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_collision_shape.svg (renamed from tools/editor/icons/source/icon_collision_shape.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_collision_shape_2d.svg (renamed from tools/editor/icons/source/icon_collision_shape_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_color.svg (renamed from tools/editor/icons/source/icon_color.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_color_pick.svg (renamed from tools/editor/icons/source/icon_color_pick.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_color_picker.svg (renamed from tools/editor/icons/source/icon_color_picker.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_color_picker_button.svg (renamed from tools/editor/icons/source/icon_color_picker_button.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_color_ramp.svg (renamed from tools/editor/icons/source/icon_color_ramp.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_color_rect.svg (renamed from tools/editor/icons/source/icon_color_rect.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_concave_polygon_shape.svg (renamed from tools/editor/icons/source/icon_concave_polygon_shape.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_concave_polygon_shape_2d.svg (renamed from tools/editor/icons/source/icon_concave_polygon_shape_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_cone_twist_joint.svg (renamed from tools/editor/icons/source/icon_cone_twist_joint.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_confirmation_dialog.svg (renamed from tools/editor/icons/source/icon_confirmation_dialog.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_connect.svg (renamed from tools/editor/icons/source/icon_connect.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_connection_and_groups.svg (renamed from tools/editor/icons/source/icon_connection_and_groups.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_container.svg (renamed from tools/editor/icons/source/icon_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control.svg (renamed from tools/editor/icons/source/icon_control.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_bottom_center.svg (renamed from tools/editor/icons/source/icon_control_align_bottom_center.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_bottom_left.svg (renamed from tools/editor/icons/source/icon_control_align_bottom_left.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_bottom_right.svg (renamed from tools/editor/icons/source/icon_control_align_bottom_right.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_bottom_wide.svg (renamed from tools/editor/icons/source/icon_control_align_bottom_wide.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_center.svg (renamed from tools/editor/icons/source/icon_control_align_center.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_center_left.svg (renamed from tools/editor/icons/source/icon_control_align_center_left.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_center_right.svg (renamed from tools/editor/icons/source/icon_control_align_center_right.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_left_center.svg (renamed from tools/editor/icons/source/icon_control_align_left_center.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_left_wide.svg (renamed from tools/editor/icons/source/icon_control_align_left_wide.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_right_center.svg (renamed from tools/editor/icons/source/icon_control_align_right_center.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_right_wide.svg (renamed from tools/editor/icons/source/icon_control_align_right_wide.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_top_center.svg (renamed from tools/editor/icons/source/icon_control_align_top_center.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_top_left.svg (renamed from tools/editor/icons/source/icon_control_align_top_left.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_top_right.svg (renamed from tools/editor/icons/source/icon_control_align_top_right.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_top_wide.svg (renamed from tools/editor/icons/source/icon_control_align_top_wide.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_align_wide.svg (renamed from tools/editor/icons/source/icon_control_align_wide.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_hcenter_wide.svg (renamed from tools/editor/icons/source/icon_control_hcenter_wide.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_control_vcenter_wide.svg (renamed from tools/editor/icons/source/icon_control_vcenter_wide.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_convex_polygon_shape.svg (renamed from tools/editor/icons/source/icon_convex_polygon_shape.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_convex_polygon_shape_2d.svg (renamed from tools/editor/icons/source/icon_convex_polygon_shape_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_copy_node_path.svg (renamed from tools/editor/icons/source/icon_copy_node_path.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_create_new_scene_from.svg (renamed from tools/editor/icons/source/icon_create_new_scene_from.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_cube_map.svg (renamed from tools/editor/icons/source/icon_cube_map.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_2d.svg (renamed from tools/editor/icons/source/icon_curve_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_3d.svg (renamed from tools/editor/icons/source/icon_curve_3d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_close.svg (renamed from tools/editor/icons/source/icon_curve_close.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_constant.svg (renamed from tools/editor/icons/source/icon_curve_constant.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_create.svg (renamed from tools/editor/icons/source/icon_curve_create.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_curve.svg (renamed from tools/editor/icons/source/icon_curve_curve.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_delete.svg (renamed from tools/editor/icons/source/icon_curve_delete.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_edit.svg (renamed from tools/editor/icons/source/icon_curve_edit.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_in.svg (renamed from tools/editor/icons/source/icon_curve_in.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_in_out.svg (renamed from tools/editor/icons/source/icon_curve_in_out.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_linear.svg (renamed from tools/editor/icons/source/icon_curve_linear.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_out.svg (renamed from tools/editor/icons/source/icon_curve_out.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_curve_out_in.svg (renamed from tools/editor/icons/source/icon_curve_out_in.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_damped_spring_joint_2d.svg (renamed from tools/editor/icons/source/icon_damped_spring_joint_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_debug_continue.svg (renamed from tools/editor/icons/source/icon_debug_continue.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_debug_next.svg (renamed from tools/editor/icons/source/icon_debug_next.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_debug_step.svg (renamed from tools/editor/icons/source/icon_debug_step.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_dependency_changed.svg (renamed from tools/editor/icons/source/icon_dependency_changed.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_dependency_changed_hl.svg (renamed from tools/editor/icons/source/icon_dependency_changed_hl.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_dependency_local_changed.svg (renamed from tools/editor/icons/source/icon_dependency_local_changed.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_dependency_local_changed_hl.svg (renamed from tools/editor/icons/source/icon_dependency_local_changed_hl.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_dependency_ok.svg (renamed from tools/editor/icons/source/icon_dependency_ok.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_dependency_ok_hl.svg (renamed from tools/editor/icons/source/icon_dependency_ok_hl.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_directional_light.svg (renamed from tools/editor/icons/source/icon_directional_light.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_distraction_free.svg (renamed from tools/editor/icons/source/icon_distraction_free.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_duplicate.svg (renamed from tools/editor/icons/source/icon_duplicate.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_dynamic_font.svg (renamed from tools/editor/icons/source/icon_dynamic_font.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_dynamic_font_data.svg (renamed from tools/editor/icons/source/icon_dynamic_font_data.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_edit.svg (renamed from tools/editor/icons/source/icon_edit.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_edit_key.svg (renamed from tools/editor/icons/source/icon_edit_key.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_edit_pivot.svg (renamed from tools/editor/icons/source/icon_edit_pivot.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_edit_resource.svg (renamed from tools/editor/icons/source/icon_edit_resource.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_editor_3d_handle.svg (renamed from tools/editor/icons/source/icon_editor_3d_handle.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_editor_handle.svg (renamed from tools/editor/icons/source/icon_editor_handle.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_editor_pivot.svg (renamed from tools/editor/icons/source/icon_editor_pivot.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_editor_plugin.svg (renamed from tools/editor/icons/source/icon_editor_plugin.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_environment.svg (renamed from tools/editor/icons/source/icon_environment.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_error.svg (renamed from tools/editor/icons/source/icon_error.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_error_sign.svg (renamed from tools/editor/icons/source/icon_error_sign.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_event_player.svg (renamed from tools/editor/icons/source/icon_event_player.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_favorites.svg (renamed from tools/editor/icons/source/icon_favorites.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_file_big.svg (renamed from tools/editor/icons/source/icon_file_big.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_file_dialog.svg (renamed from tools/editor/icons/source/icon_file_dialog.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_file_list.svg (renamed from tools/editor/icons/source/icon_file_list.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_file_server.svg (renamed from tools/editor/icons/source/icon_file_server.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_file_server_active.svg (renamed from tools/editor/icons/source/icon_file_server_active.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_file_thumbnail.svg (renamed from tools/editor/icons/source/icon_file_thumbnail.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_fixed_material.svg (renamed from tools/editor/icons/source/icon_fixed_material.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_fixed_spatial_material.svg (renamed from tools/editor/icons/source/icon_fixed_spatial_material.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_folder.svg (renamed from tools/editor/icons/source/icon_folder.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_folder_big.svg (renamed from tools/editor/icons/source/icon_folder_big.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_font.svg (renamed from tools/editor/icons/source/icon_font.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_forward.svg (renamed from tools/editor/icons/source/icon_forward.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_g_d_script.svg (renamed from tools/editor/icons/source/icon_g_d_script.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_g_i_probe.svg (renamed from tools/editor/icons/source/icon_g_i_probe.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_g_i_probe_data.svg (renamed from tools/editor/icons/source/icon_g_i_probe_data.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_generic_6_d_o_f_joint.svg (renamed from tools/editor/icons/source/icon_generic_6_d_o_f_joint.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_gizmo_directional_light.svg (renamed from tools/editor/icons/source/icon_gizmo_directional_light.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_gizmo_light.svg (renamed from tools/editor/icons/source/icon_gizmo_light.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_gizmo_listener.svg (renamed from tools/editor/icons/source/icon_gizmo_listener.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_gizmo_spatial_sample_player.svg (renamed from tools/editor/icons/source/icon_gizmo_spatial_sample_player.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_gizmo_spatial_stream_player.svg (renamed from tools/editor/icons/source/icon_gizmo_spatial_stream_player.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_godot.svg (renamed from tools/editor/icons/source/icon_godot.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_comment.svg (renamed from tools/editor/icons/source/icon_graph_comment.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_cube_uniform.svg (renamed from tools/editor/icons/source/icon_graph_cube_uniform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_curve_map.svg (renamed from tools/editor/icons/source/icon_graph_curve_map.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_default_texture.svg (renamed from tools/editor/icons/source/icon_graph_default_texture.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_edit.svg (renamed from tools/editor/icons/source/icon_graph_edit.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_input.svg (renamed from tools/editor/icons/source/icon_graph_input.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_node.svg (renamed from tools/editor/icons/source/icon_graph_node.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_rgb.svg (renamed from tools/editor/icons/source/icon_graph_rgb.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_rgb_op.svg (renamed from tools/editor/icons/source/icon_graph_rgb_op.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_rgb_uniform.svg (renamed from tools/editor/icons/source/icon_graph_rgb_uniform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_scalar.svg (renamed from tools/editor/icons/source/icon_graph_scalar.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_scalar_interp.svg (renamed from tools/editor/icons/source/icon_graph_scalar_interp.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_scalar_op.svg (renamed from tools/editor/icons/source/icon_graph_scalar_op.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_scalar_uniform.svg (renamed from tools/editor/icons/source/icon_graph_scalar_uniform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_scalars_to_vec.svg (renamed from tools/editor/icons/source/icon_graph_scalars_to_vec.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_texscreen.svg (renamed from tools/editor/icons/source/icon_graph_texscreen.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_texture_uniform.svg (renamed from tools/editor/icons/source/icon_graph_texture_uniform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_time.svg (renamed from tools/editor/icons/source/icon_graph_time.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_vec_dp.svg (renamed from tools/editor/icons/source/icon_graph_vec_dp.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_vec_interp.svg (renamed from tools/editor/icons/source/icon_graph_vec_interp.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_vec_length.svg (renamed from tools/editor/icons/source/icon_graph_vec_length.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_vec_op.svg (renamed from tools/editor/icons/source/icon_graph_vec_op.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_vec_scalar_op.svg (renamed from tools/editor/icons/source/icon_graph_vec_scalar_op.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_vec_to_scalars.svg (renamed from tools/editor/icons/source/icon_graph_vec_to_scalars.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_vecs_to_xform.svg (renamed from tools/editor/icons/source/icon_graph_vecs_to_xform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_vector.svg (renamed from tools/editor/icons/source/icon_graph_vector.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_vector_uniform.svg (renamed from tools/editor/icons/source/icon_graph_vector_uniform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_xform.svg (renamed from tools/editor/icons/source/icon_graph_xform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_xform_mult.svg (renamed from tools/editor/icons/source/icon_graph_xform_mult.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_xform_scalar_func.svg (renamed from tools/editor/icons/source/icon_graph_xform_scalar_func.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_xform_to_vecs.svg (renamed from tools/editor/icons/source/icon_graph_xform_to_vecs.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_xform_uniform.svg (renamed from tools/editor/icons/source/icon_graph_xform_uniform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_xform_vec_func.svg (renamed from tools/editor/icons/source/icon_graph_xform_vec_func.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_xform_vec_imult.svg (renamed from tools/editor/icons/source/icon_graph_xform_vec_imult.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_graph_xform_vec_mult.svg (renamed from tools/editor/icons/source/icon_graph_xform_vec_mult.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_grid.svg (renamed from tools/editor/icons/source/icon_grid.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_grid_container.svg (renamed from tools/editor/icons/source/icon_grid_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_grid_map.svg (renamed from tools/editor/icons/source/icon_grid_map.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_groove_joint_2d.svg (renamed from tools/editor/icons/source/icon_groove_joint_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_group.svg (renamed from tools/editor/icons/source/icon_group.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_groups.svg (renamed from tools/editor/icons/source/icon_groups.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_h_box_container.svg (renamed from tools/editor/icons/source/icon_h_box_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_h_button_array.svg (renamed from tools/editor/icons/source/icon_h_button_array.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_h_scroll_bar.svg (renamed from tools/editor/icons/source/icon_h_scroll_bar.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_h_separator.svg (renamed from tools/editor/icons/source/icon_h_separator.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_h_slider.svg (renamed from tools/editor/icons/source/icon_h_slider.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_h_split_container.svg (renamed from tools/editor/icons/source/icon_h_split_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_h_t_t_p_request.svg (renamed from tools/editor/icons/source/icon_h_t_t_p_request.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_headphones.svg (renamed from tools/editor/icons/source/icon_headphones.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_help.svg (renamed from tools/editor/icons/source/icon_help.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_hidden.svg (renamed from tools/editor/icons/source/icon_hidden.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_hinge_joint.svg (renamed from tools/editor/icons/source/icon_hinge_joint.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_history.svg (renamed from tools/editor/icons/source/icon_history.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_hsize.svg (renamed from tools/editor/icons/source/icon_hsize.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_image.svg (renamed from tools/editor/icons/source/icon_image.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_image_sky_box.svg (renamed from tools/editor/icons/source/icon_image_sky_box.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_image_texture.svg (renamed from tools/editor/icons/source/icon_image_texture.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_immediate_geometry.svg (renamed from tools/editor/icons/source/icon_immediate_geometry.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_import_check.svg (renamed from tools/editor/icons/source/icon_import_check.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_import_fail.svg (renamed from tools/editor/icons/source/icon_import_fail.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_instance.svg (renamed from tools/editor/icons/source/icon_instance.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_instance_options.svg (renamed from tools/editor/icons/source/icon_instance_options.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_integer.svg (renamed from tools/editor/icons/source/icon_integer.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_interp_cubic.svg (renamed from tools/editor/icons/source/icon_interp_cubic.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_interp_linear.svg (renamed from tools/editor/icons/source/icon_interp_linear.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_interp_raw.svg (renamed from tools/editor/icons/source/icon_interp_raw.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_interp_wrap_clamp.svg (renamed from tools/editor/icons/source/icon_interp_wrap_clamp.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_interp_wrap_loop.svg (renamed from tools/editor/icons/source/icon_interp_wrap_loop.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_interpolated_camera.svg (renamed from tools/editor/icons/source/icon_interpolated_camera.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_invalid_key.svg (renamed from tools/editor/icons/source/icon_invalid_key.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_inverse_kinematics.svg (renamed from tools/editor/icons/source/icon_inverse_kinematics.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_item_list.svg (renamed from tools/editor/icons/source/icon_item_list.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_joy_axis.svg (renamed from tools/editor/icons/source/icon_joy_axis.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_joy_button.svg (renamed from tools/editor/icons/source/icon_joy_button.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_joypad.svg (renamed from tools/editor/icons/source/icon_joypad.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_key.svg (renamed from tools/editor/icons/source/icon_key.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_key_hover.svg (renamed from tools/editor/icons/source/icon_key_hover.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_key_invalid.svg (renamed from tools/editor/icons/source/icon_key_invalid.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_key_next.svg (renamed from tools/editor/icons/source/icon_key_next.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_key_selected.svg (renamed from tools/editor/icons/source/icon_key_selected.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_key_value.svg (renamed from tools/editor/icons/source/icon_key_value.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_key_xform.svg (renamed from tools/editor/icons/source/icon_key_xform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_keyboard.svg (renamed from tools/editor/icons/source/icon_keyboard.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_kinematic_body.svg (renamed from tools/editor/icons/source/icon_kinematic_body.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_kinematic_body_2d.svg (renamed from tools/editor/icons/source/icon_kinematic_body_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_label.svg (renamed from tools/editor/icons/source/icon_label.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_large_texture.svg (renamed from tools/editor/icons/source/icon_large_texture.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_light_2d.svg (renamed from tools/editor/icons/source/icon_light_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_light_occluder_2d.svg (renamed from tools/editor/icons/source/icon_light_occluder_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_line_2d.svg | 82 | ||||
| -rw-r--r-- | editor/icons/source/icon_line_edit.svg (renamed from tools/editor/icons/source/icon_line_edit.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_line_shape_2d.svg (renamed from tools/editor/icons/source/icon_line_shape_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_link_button.svg (renamed from tools/editor/icons/source/icon_link_button.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_list_select.svg (renamed from tools/editor/icons/source/icon_list_select.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_listener.svg (renamed from tools/editor/icons/source/icon_listener.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_load.svg (renamed from tools/editor/icons/source/icon_load.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_lock.svg (renamed from tools/editor/icons/source/icon_lock.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_loop.svg (renamed from tools/editor/icons/source/icon_loop.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_loop_interpolation.svg (renamed from tools/editor/icons/source/icon_loop_interpolation.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_main_play.svg (renamed from tools/editor/icons/source/icon_main_play.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_main_stop.svg (renamed from tools/editor/icons/source/icon_main_stop.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_margin_container.svg (renamed from tools/editor/icons/source/icon_margin_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_material_preview_cube.svg (renamed from tools/editor/icons/source/icon_material_preview_cube.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_material_preview_cube_off.svg (renamed from tools/editor/icons/source/icon_material_preview_cube_off.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_material_preview_light_1.svg (renamed from tools/editor/icons/source/icon_material_preview_light_1.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_material_preview_light_1_off.svg (renamed from tools/editor/icons/source/icon_material_preview_light_1_off.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_material_preview_light_2.svg (renamed from tools/editor/icons/source/icon_material_preview_light_2.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_material_preview_light_2_off.svg (renamed from tools/editor/icons/source/icon_material_preview_light_2_off.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_material_preview_sphere.svg (renamed from tools/editor/icons/source/icon_material_preview_sphere.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_material_preview_sphere_off.svg (renamed from tools/editor/icons/source/icon_material_preview_sphere_off.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_matrix.svg (renamed from tools/editor/icons/source/icon_matrix.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_menu_button.svg (renamed from tools/editor/icons/source/icon_menu_button.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mesh.svg (renamed from tools/editor/icons/source/icon_mesh.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mesh_instance.svg (renamed from tools/editor/icons/source/icon_mesh_instance.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mesh_library.svg (renamed from tools/editor/icons/source/icon_mesh_library.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_aabb.svg (renamed from tools/editor/icons/source/icon_mini_aabb.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_array.svg (renamed from tools/editor/icons/source/icon_mini_array.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_boolean.svg (renamed from tools/editor/icons/source/icon_mini_boolean.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_color.svg (renamed from tools/editor/icons/source/icon_mini_color.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_color_array.svg (renamed from tools/editor/icons/source/icon_mini_color_array.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_dictionary.svg (renamed from tools/editor/icons/source/icon_mini_dictionary.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_float.svg (renamed from tools/editor/icons/source/icon_mini_float.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_float_array.svg (renamed from tools/editor/icons/source/icon_mini_float_array.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_image.svg (renamed from tools/editor/icons/source/icon_mini_image.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_input.svg (renamed from tools/editor/icons/source/icon_mini_input.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_int_array.svg (renamed from tools/editor/icons/source/icon_mini_int_array.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_integer.svg (renamed from tools/editor/icons/source/icon_mini_integer.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_matrix3.svg (renamed from tools/editor/icons/source/icon_mini_matrix3.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_matrix32.svg (renamed from tools/editor/icons/source/icon_mini_matrix32.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_object.svg (renamed from tools/editor/icons/source/icon_mini_object.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_path.svg (renamed from tools/editor/icons/source/icon_mini_path.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_plane.svg (renamed from tools/editor/icons/source/icon_mini_plane.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_quat.svg (renamed from tools/editor/icons/source/icon_mini_quat.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_raw_array.svg (renamed from tools/editor/icons/source/icon_mini_raw_array.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_rect2.svg (renamed from tools/editor/icons/source/icon_mini_rect2.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_rid.svg (renamed from tools/editor/icons/source/icon_mini_rid.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_string.svg (renamed from tools/editor/icons/source/icon_mini_string.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_string_array.svg (renamed from tools/editor/icons/source/icon_mini_string_array.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_transform.svg (renamed from tools/editor/icons/source/icon_mini_transform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_variant.svg (renamed from tools/editor/icons/source/icon_mini_variant.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_vector2.svg (renamed from tools/editor/icons/source/icon_mini_vector2.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_vector2_array.svg (renamed from tools/editor/icons/source/icon_mini_vector2_array.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_vector3.svg (renamed from tools/editor/icons/source/icon_mini_vector3.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mini_vector3_array.svg (renamed from tools/editor/icons/source/icon_mini_vector3_array.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mirror_x.svg (renamed from tools/editor/icons/source/icon_mirror_x.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mirror_y.svg (renamed from tools/editor/icons/source/icon_mirror_y.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_mouse.svg (renamed from tools/editor/icons/source/icon_mouse.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_move_down.svg (renamed from tools/editor/icons/source/icon_move_down.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_move_point.svg (renamed from tools/editor/icons/source/icon_move_point.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_move_up.svg (renamed from tools/editor/icons/source/icon_move_up.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_multi_edit.svg (renamed from tools/editor/icons/source/icon_multi_edit.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_multi_line.svg (renamed from tools/editor/icons/source/icon_multi_line.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_multi_mesh.svg (renamed from tools/editor/icons/source/icon_multi_mesh.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_multi_mesh_instance.svg (renamed from tools/editor/icons/source/icon_multi_mesh_instance.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_navigation.svg (renamed from tools/editor/icons/source/icon_navigation.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_navigation_2d.svg (renamed from tools/editor/icons/source/icon_navigation_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_navigation_mesh.svg (renamed from tools/editor/icons/source/icon_navigation_mesh.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_navigation_mesh_instance.svg (renamed from tools/editor/icons/source/icon_navigation_mesh_instance.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_navigation_polygon.svg (renamed from tools/editor/icons/source/icon_navigation_polygon.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_navigation_polygon_instance.svg (renamed from tools/editor/icons/source/icon_navigation_polygon_instance.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_new.svg (renamed from tools/editor/icons/source/icon_new.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_nine_patch_rect.svg (renamed from tools/editor/icons/source/icon_nine_patch_rect.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_node.svg (renamed from tools/editor/icons/source/icon_node.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_node_2d.svg (renamed from tools/editor/icons/source/icon_node_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_node_warning.svg (renamed from tools/editor/icons/source/icon_node_warning.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_non_favorite.svg (renamed from tools/editor/icons/source/icon_non_favorite.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_object.svg (renamed from tools/editor/icons/source/icon_object.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_occluder_polygon_2d.svg (renamed from tools/editor/icons/source/icon_occluder_polygon_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_omni_light.svg (renamed from tools/editor/icons/source/icon_omni_light.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_option_button.svg (renamed from tools/editor/icons/source/icon_option_button.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_override.svg (renamed from tools/editor/icons/source/icon_override.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_packed_data_container.svg (renamed from tools/editor/icons/source/icon_packed_data_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_packed_scene.svg (renamed from tools/editor/icons/source/icon_packed_scene.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_panel.svg (renamed from tools/editor/icons/source/icon_panel.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_panel_container.svg (renamed from tools/editor/icons/source/icon_panel_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_panels_1.svg (renamed from tools/editor/icons/source/icon_panels_1.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_panels_2.svg (renamed from tools/editor/icons/source/icon_panels_2.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_panels_2_alt.svg (renamed from tools/editor/icons/source/icon_panels_2_alt.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_panels_3.svg (renamed from tools/editor/icons/source/icon_panels_3.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_panels_3_alt.svg (renamed from tools/editor/icons/source/icon_panels_3_alt.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_panels_4.svg (renamed from tools/editor/icons/source/icon_panels_4.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_parallax_background.svg (renamed from tools/editor/icons/source/icon_parallax_background.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_parallax_layer.svg (renamed from tools/editor/icons/source/icon_parallax_layer.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_particle_attractor_2d.svg (renamed from tools/editor/icons/source/icon_particle_attractor_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_particles.svg (renamed from tools/editor/icons/source/icon_particles.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_particles_2d.svg (renamed from tools/editor/icons/source/icon_particles_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_particles_shader.svg (renamed from tools/editor/icons/source/icon_particles_shader.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_patch_9_rect.svg (renamed from tools/editor/icons/source/icon_patch_9_rect.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_path.svg (renamed from tools/editor/icons/source/icon_path.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_path_2d.svg (renamed from tools/editor/icons/source/icon_path_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_path_follow.svg (renamed from tools/editor/icons/source/icon_path_follow.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_path_follow_2d.svg (renamed from tools/editor/icons/source/icon_path_follow_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_pause.svg (renamed from tools/editor/icons/source/icon_pause.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_pin.svg (renamed from tools/editor/icons/source/icon_pin.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_pin_joint.svg (renamed from tools/editor/icons/source/icon_pin_joint.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_pin_joint_2d.svg (renamed from tools/editor/icons/source/icon_pin_joint_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_pin_pressed.svg (renamed from tools/editor/icons/source/icon_pin_pressed.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_plane.svg (renamed from tools/editor/icons/source/icon_plane.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_plane_shape.svg (renamed from tools/editor/icons/source/icon_plane_shape.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_play.svg (renamed from tools/editor/icons/source/icon_play.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_play_backwards.svg (renamed from tools/editor/icons/source/icon_play_backwards.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_play_custom.svg (renamed from tools/editor/icons/source/icon_play_custom.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_play_scene.svg (renamed from tools/editor/icons/source/icon_play_scene.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_play_start.svg (renamed from tools/editor/icons/source/icon_play_start.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_play_start_backwards.svg (renamed from tools/editor/icons/source/icon_play_start_backwards.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_polygon_path_finder.svg (renamed from tools/editor/icons/source/icon_polygon_path_finder.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_popup.svg (renamed from tools/editor/icons/source/icon_popup.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_popup_dialog.svg (renamed from tools/editor/icons/source/icon_popup_dialog.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_popup_menu.svg (renamed from tools/editor/icons/source/icon_popup_menu.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_popup_panel.svg (renamed from tools/editor/icons/source/icon_popup_panel.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_portal.svg (renamed from tools/editor/icons/source/icon_portal.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_position_2d.svg (renamed from tools/editor/icons/source/icon_position_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_position_3d.svg (renamed from tools/editor/icons/source/icon_position_3d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_progress_1.svg (renamed from tools/editor/icons/source/icon_progress_1.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_progress_2.svg (renamed from tools/editor/icons/source/icon_progress_2.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_progress_3.svg (renamed from tools/editor/icons/source/icon_progress_3.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_progress_4.svg (renamed from tools/editor/icons/source/icon_progress_4.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_progress_5.svg (renamed from tools/editor/icons/source/icon_progress_5.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_progress_6.svg (renamed from tools/editor/icons/source/icon_progress_6.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_progress_7.svg (renamed from tools/editor/icons/source/icon_progress_7.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_progress_8.svg (renamed from tools/editor/icons/source/icon_progress_8.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_progress_bar.svg (renamed from tools/editor/icons/source/icon_progress_bar.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_proximity_group.svg (renamed from tools/editor/icons/source/icon_proximity_group.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_quad.svg (renamed from tools/editor/icons/source/icon_quad.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_quat.svg (renamed from tools/editor/icons/source/icon_quat.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_range.svg (renamed from tools/editor/icons/source/icon_range.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rating_no_star.svg (renamed from tools/editor/icons/source/icon_rating_no_star.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rating_star.svg (renamed from tools/editor/icons/source/icon_rating_star.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_ray_cast.svg (renamed from tools/editor/icons/source/icon_ray_cast.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_ray_cast_2d.svg (renamed from tools/editor/icons/source/icon_ray_cast_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_ray_shape.svg (renamed from tools/editor/icons/source/icon_ray_shape.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_ray_shape_2d.svg (renamed from tools/editor/icons/source/icon_ray_shape_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rayito.svg (renamed from tools/editor/icons/source/icon_rayito.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_real.svg (renamed from tools/editor/icons/source/icon_real.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rectangle_shape_2d.svg (renamed from tools/editor/icons/source/icon_rectangle_shape_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_reference_rect.svg (renamed from tools/editor/icons/source/icon_reference_rect.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_reflection_probe.svg (renamed from tools/editor/icons/source/icon_reflection_probe.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_region_edit.svg (renamed from tools/editor/icons/source/icon_region_edit.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_reload_small.svg (renamed from tools/editor/icons/source/icon_reload_small.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_remote.svg (renamed from tools/editor/icons/source/icon_remote.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_remote_transform.svg (renamed from tools/editor/icons/source/icon_remote_transform.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_remote_transform_2d.svg (renamed from tools/editor/icons/source/icon_remote_transform_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_remove.svg (renamed from tools/editor/icons/source/icon_remove.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rename.svg (renamed from tools/editor/icons/source/icon_rename.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_reparent.svg (renamed from tools/editor/icons/source/icon_reparent.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_resource_preloader.svg (renamed from tools/editor/icons/source/icon_resource_preloader.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rich_text_label.svg (renamed from tools/editor/icons/source/icon_rich_text_label.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rigid_body.svg (renamed from tools/editor/icons/source/icon_rigid_body.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rigid_body_2d.svg (renamed from tools/editor/icons/source/icon_rigid_body_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_room.svg (renamed from tools/editor/icons/source/icon_room.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_room_bounds.svg (renamed from tools/editor/icons/source/icon_room_bounds.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rotate_0.svg (renamed from tools/editor/icons/source/icon_rotate_0.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rotate_180.svg (renamed from tools/editor/icons/source/icon_rotate_180.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rotate_270.svg (renamed from tools/editor/icons/source/icon_rotate_270.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_rotate_90.svg (renamed from tools/editor/icons/source/icon_rotate_90.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_sample.svg (renamed from tools/editor/icons/source/icon_sample.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_sample_library.svg (renamed from tools/editor/icons/source/icon_sample_library.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_sample_player.svg (renamed from tools/editor/icons/source/icon_sample_player.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_sample_player_2d.svg (renamed from tools/editor/icons/source/icon_sample_player_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_save.svg (renamed from tools/editor/icons/source/icon_save.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_script.svg (renamed from tools/editor/icons/source/icon_script.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_script_create.svg (renamed from tools/editor/icons/source/icon_script_create.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_script_remove.svg (renamed from tools/editor/icons/source/icon_script_remove.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_scroll_bar.svg (renamed from tools/editor/icons/source/icon_scroll_bar.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_scroll_container.svg (renamed from tools/editor/icons/source/icon_scroll_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_segment_shape_2d.svg (renamed from tools/editor/icons/source/icon_segment_shape_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_shader.svg (renamed from tools/editor/icons/source/icon_shader.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_short_cut.svg (renamed from tools/editor/icons/source/icon_short_cut.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_signal.svg (renamed from tools/editor/icons/source/icon_signal.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_skeleton.svg (renamed from tools/editor/icons/source/icon_skeleton.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_slider_joint.svg (renamed from tools/editor/icons/source/icon_slider_joint.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_slot.svg (renamed from tools/editor/icons/source/icon_slot.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_snap.svg (renamed from tools/editor/icons/source/icon_snap.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_sound_room_params.svg (renamed from tools/editor/icons/source/icon_sound_room_params.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_spatial.svg (renamed from tools/editor/icons/source/icon_spatial.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_spatial_sample_player.svg (renamed from tools/editor/icons/source/icon_spatial_sample_player.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_spatial_shader.svg (renamed from tools/editor/icons/source/icon_spatial_shader.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_spatial_stream_player.svg (renamed from tools/editor/icons/source/icon_spatial_stream_player.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_sphere_shape.svg (renamed from tools/editor/icons/source/icon_sphere_shape.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_spin_box.svg (renamed from tools/editor/icons/source/icon_spin_box.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_spot_light.svg (renamed from tools/editor/icons/source/icon_spot_light.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_sprite.svg (renamed from tools/editor/icons/source/icon_sprite.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_sprite_3d.svg (renamed from tools/editor/icons/source/icon_sprite_3d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_sprite_frames.svg (renamed from tools/editor/icons/source/icon_sprite_frames.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_static_body.svg (renamed from tools/editor/icons/source/icon_static_body.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_static_body_2d.svg (renamed from tools/editor/icons/source/icon_static_body_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_stream_player.svg (renamed from tools/editor/icons/source/icon_stream_player.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_string.svg (renamed from tools/editor/icons/source/icon_string.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_style_box_empty.svg (renamed from tools/editor/icons/source/icon_style_box_empty.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_style_box_flat.svg (renamed from tools/editor/icons/source/icon_style_box_flat.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_style_box_texture.svg (renamed from tools/editor/icons/source/icon_style_box_texture.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tab_container.svg (renamed from tools/editor/icons/source/icon_tab_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tabs.svg (renamed from tools/editor/icons/source/icon_tabs.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_test_cube.svg (renamed from tools/editor/icons/source/icon_test_cube.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_text_edit.svg (renamed from tools/editor/icons/source/icon_text_edit.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_texture.svg (renamed from tools/editor/icons/source/icon_texture.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_texture_button.svg (renamed from tools/editor/icons/source/icon_texture_button.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_texture_progress.svg (renamed from tools/editor/icons/source/icon_texture_progress.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_texture_rect.svg (renamed from tools/editor/icons/source/icon_texture_rect.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_theme.svg (renamed from tools/editor/icons/source/icon_theme.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tile_map.svg (renamed from tools/editor/icons/source/icon_tile_map.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tile_set.svg (renamed from tools/editor/icons/source/icon_tile_set.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_timer.svg (renamed from tools/editor/icons/source/icon_timer.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tool_button.svg (renamed from tools/editor/icons/source/icon_tool_button.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tool_move.svg (renamed from tools/editor/icons/source/icon_tool_move.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tool_pan.svg (renamed from tools/editor/icons/source/icon_tool_pan.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tool_rotate.svg (renamed from tools/editor/icons/source/icon_tool_rotate.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tool_scale.svg (renamed from tools/editor/icons/source/icon_tool_scale.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tool_select.svg (renamed from tools/editor/icons/source/icon_tool_select.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tools.svg (renamed from tools/editor/icons/source/icon_tools.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_touch_screen_button.svg (renamed from tools/editor/icons/source/icon_touch_screen_button.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_track_add_key.svg (renamed from tools/editor/icons/source/icon_track_add_key.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_track_add_key_hl.svg (renamed from tools/editor/icons/source/icon_track_add_key_hl.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_track_continuous.svg (renamed from tools/editor/icons/source/icon_track_continuous.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_track_discrete.svg (renamed from tools/editor/icons/source/icon_track_discrete.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_track_trigger.svg (renamed from tools/editor/icons/source/icon_track_trigger.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_translation.svg (renamed from tools/editor/icons/source/icon_translation.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_transpose.svg (renamed from tools/editor/icons/source/icon_transpose.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tree.svg (renamed from tools/editor/icons/source/icon_tree.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_tween.svg (renamed from tools/editor/icons/source/icon_tween.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_unbone.svg (renamed from tools/editor/icons/source/icon_unbone.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_ungroup.svg (renamed from tools/editor/icons/source/icon_ungroup.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_unlock.svg (renamed from tools/editor/icons/source/icon_unlock.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_uv.svg (renamed from tools/editor/icons/source/icon_uv.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_v_box_container.svg (renamed from tools/editor/icons/source/icon_v_box_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_v_button_array.svg (renamed from tools/editor/icons/source/icon_v_button_array.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_v_scroll_bar.svg (renamed from tools/editor/icons/source/icon_v_scroll_bar.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_v_separator.svg (renamed from tools/editor/icons/source/icon_v_separator.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_v_slider.svg (renamed from tools/editor/icons/source/icon_v_slider.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_v_split_container.svg (renamed from tools/editor/icons/source/icon_v_split_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_vector.svg (renamed from tools/editor/icons/source/icon_vector.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_vector2.svg (renamed from tools/editor/icons/source/icon_vector2.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_vehicle_body.svg (renamed from tools/editor/icons/source/icon_vehicle_body.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_vehicle_wheel.svg (renamed from tools/editor/icons/source/icon_vehicle_wheel.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_video_player.svg (renamed from tools/editor/icons/source/icon_video_player.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_viewport.svg (renamed from tools/editor/icons/source/icon_viewport.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_viewport_container.svg (renamed from tools/editor/icons/source/icon_viewport_container.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_viewport_sprite.svg (renamed from tools/editor/icons/source/icon_viewport_sprite.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_viewport_texture.svg (renamed from tools/editor/icons/source/icon_viewport_texture.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_visibility_enabler.svg (renamed from tools/editor/icons/source/icon_visibility_enabler.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_visibility_enabler_2d.svg (renamed from tools/editor/icons/source/icon_visibility_enabler_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_visibility_notifier.svg (renamed from tools/editor/icons/source/icon_visibility_notifier.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_visibility_notifier_2d.svg (renamed from tools/editor/icons/source/icon_visibility_notifier_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_visible.svg (renamed from tools/editor/icons/source/icon_visible.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_visual_script.svg (renamed from tools/editor/icons/source/icon_visual_script.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_visual_shader_port.svg (renamed from tools/editor/icons/source/icon_visual_shader_port.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_vu_empty.svg (renamed from tools/editor/icons/source/icon_vu_empty.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_vu_full.svg (renamed from tools/editor/icons/source/icon_vu_full.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_warning.svg (renamed from tools/editor/icons/source/icon_warning.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_window_dialog.svg (renamed from tools/editor/icons/source/icon_window_dialog.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_world.svg (renamed from tools/editor/icons/source/icon_world.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_world_2d.svg (renamed from tools/editor/icons/source/icon_world_2d.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_world_environment.svg (renamed from tools/editor/icons/source/icon_world_environment.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_y_sort.svg (renamed from tools/editor/icons/source/icon_y_sort.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_zoom.svg (renamed from tools/editor/icons/source/icon_zoom.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_zoom_less.svg (renamed from tools/editor/icons/source/icon_zoom_less.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_zoom_more.svg (renamed from tools/editor/icons/source/icon_zoom_more.svg) | 0 | ||||
| -rw-r--r-- | editor/icons/source/icon_zoom_reset.svg (renamed from tools/editor/icons/source/icon_zoom_reset.svg) | 0 | ||||
| -rwxr-xr-x | editor/icons/xpmfix.sh (renamed from tools/editor/icons/xpmfix.sh) | 0 | ||||
| -rw-r--r-- | editor/import/SCsub (renamed from tools/editor/import/SCsub) | 0 | ||||
| -rw-r--r-- | editor/import/editor_import_collada.cpp (renamed from tools/editor/import/editor_import_collada.cpp) | 4 | ||||
| -rw-r--r-- | editor/import/editor_import_collada.h (renamed from tools/editor/import/editor_import_collada.h) | 2 | ||||
| -rw-r--r-- | editor/import/resource_importer_csv_translation.cpp (renamed from tools/editor/import/resource_importer_csv_translation.cpp) | 30 | ||||
| -rw-r--r-- | editor/import/resource_importer_csv_translation.h | 55 | ||||
| -rw-r--r-- | editor/import/resource_importer_obj.cpp (renamed from tools/editor/import/resource_importer_obj.cpp) | 30 | ||||
| -rw-r--r-- | editor/import/resource_importer_obj.h | 56 | ||||
| -rw-r--r-- | editor/import/resource_importer_scene.cpp (renamed from tools/editor/import/resource_importer_scene.cpp) | 32 | ||||
| -rw-r--r-- | editor/import/resource_importer_scene.h (renamed from tools/editor/import/resource_importer_scene.h) | 28 | ||||
| -rw-r--r-- | editor/import/resource_importer_texture.cpp (renamed from tools/editor/import/resource_importer_texture.cpp) | 31 | ||||
| -rw-r--r-- | editor/import/resource_importer_texture.h | 98 | ||||
| -rw-r--r-- | editor/import/resource_importer_wav.cpp (renamed from tools/editor/import/resource_importer_wav.cpp) | 28 | ||||
| -rw-r--r-- | editor/import/resource_importer_wav.h | 58 | ||||
| -rw-r--r-- | editor/import_dock.cpp (renamed from tools/editor/import_dock.cpp) | 32 | ||||
| -rw-r--r-- | editor/import_dock.h | 70 | ||||
| -rw-r--r-- | editor/inspector_dock.cpp (renamed from tools/editor/inspector_dock.cpp) | 0 | ||||
| -rw-r--r-- | editor/inspector_dock.h (renamed from tools/editor/inspector_dock.h) | 0 | ||||
| -rw-r--r-- | editor/io_plugins/SCsub (renamed from tools/editor/io_plugins/SCsub) | 0 | ||||
| -rw-r--r-- | editor/io_plugins/editor_atlas.cpp (renamed from tools/editor/io_plugins/editor_atlas.cpp) | 0 | ||||
| -rw-r--r-- | editor/io_plugins/editor_atlas.h (renamed from tools/editor/io_plugins/editor_atlas.h) | 0 | ||||
| -rw-r--r-- | editor/io_plugins/editor_bitmask_import_plugin.cpp (renamed from tools/editor/io_plugins/editor_bitmask_import_plugin.cpp) | 10 | ||||
| -rw-r--r-- | editor/io_plugins/editor_bitmask_import_plugin.h (renamed from tools/editor/io_plugins/editor_bitmask_import_plugin.h) | 2 | ||||
| -rw-r--r-- | editor/io_plugins/editor_export_scene.cpp (renamed from tools/editor/io_plugins/editor_export_scene.cpp) | 4 | ||||
| -rw-r--r-- | editor/io_plugins/editor_export_scene.h (renamed from tools/editor/io_plugins/editor_export_scene.h) | 2 | ||||
| -rw-r--r-- | editor/io_plugins/editor_font_import_plugin.cpp (renamed from tools/editor/io_plugins/editor_font_import_plugin.cpp) | 4 | ||||
| -rw-r--r-- | editor/io_plugins/editor_font_import_plugin.h (renamed from tools/editor/io_plugins/editor_font_import_plugin.h) | 2 | ||||
| -rw-r--r-- | editor/io_plugins/editor_mesh_import_plugin.cpp (renamed from tools/editor/io_plugins/editor_mesh_import_plugin.cpp) | 8 | ||||
| -rw-r--r-- | editor/io_plugins/editor_mesh_import_plugin.h (renamed from tools/editor/io_plugins/editor_mesh_import_plugin.h) | 2 | ||||
| -rw-r--r-- | editor/io_plugins/editor_sample_import_plugin.cpp (renamed from tools/editor/io_plugins/editor_sample_import_plugin.cpp) | 10 | ||||
| -rw-r--r-- | editor/io_plugins/editor_sample_import_plugin.h (renamed from tools/editor/io_plugins/editor_sample_import_plugin.h) | 2 | ||||
| -rw-r--r-- | editor/io_plugins/editor_scene_import_plugin.cpp (renamed from tools/editor/io_plugins/editor_scene_import_plugin.cpp) | 6 | ||||
| -rw-r--r-- | editor/io_plugins/editor_scene_import_plugin.h (renamed from tools/editor/io_plugins/editor_scene_import_plugin.h) | 8 | ||||
| -rw-r--r-- | editor/io_plugins/editor_scene_importer_fbxconv.cpp (renamed from tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp) | 2 | ||||
| -rw-r--r-- | editor/io_plugins/editor_scene_importer_fbxconv.h (renamed from tools/editor/io_plugins/editor_scene_importer_fbxconv.h) | 2 | ||||
| -rw-r--r-- | editor/io_plugins/editor_texture_import_plugin.cpp (renamed from tools/editor/io_plugins/editor_texture_import_plugin.cpp) | 6 | ||||
| -rw-r--r-- | editor/io_plugins/editor_texture_import_plugin.h (renamed from tools/editor/io_plugins/editor_texture_import_plugin.h) | 6 | ||||
| -rw-r--r-- | editor/io_plugins/editor_translation_import_plugin.cpp (renamed from tools/editor/io_plugins/editor_translation_import_plugin.cpp) | 8 | ||||
| -rw-r--r-- | editor/io_plugins/editor_translation_import_plugin.h (renamed from tools/editor/io_plugins/editor_translation_import_plugin.h) | 2 | ||||
| -rw-r--r-- | editor/multi_node_edit.cpp (renamed from tools/editor/multi_node_edit.cpp) | 33 | ||||
| -rw-r--r-- | editor/multi_node_edit.h (renamed from tools/editor/multi_node_edit.h) | 4 | ||||
| -rw-r--r-- | editor/node_dock.cpp (renamed from tools/editor/node_dock.cpp) | 4 | ||||
| -rw-r--r-- | editor/node_dock.h (renamed from tools/editor/node_dock.h) | 0 | ||||
| -rw-r--r-- | editor/output_strings.cpp (renamed from tools/editor/output_strings.cpp) | 0 | ||||
| -rw-r--r-- | editor/output_strings.h (renamed from tools/editor/output_strings.h) | 0 | ||||
| -rw-r--r-- | editor/pane_drag.cpp (renamed from tools/editor/pane_drag.cpp) | 0 | ||||
| -rw-r--r-- | editor/pane_drag.h (renamed from tools/editor/pane_drag.h) | 0 | ||||
| -rw-r--r-- | editor/plugins/SCsub (renamed from tools/editor/plugins/SCsub) | 0 | ||||
| -rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp (renamed from tools/editor/plugins/animation_player_editor_plugin.cpp) | 80 | ||||
| -rw-r--r-- | editor/plugins/animation_player_editor_plugin.h (renamed from tools/editor/plugins/animation_player_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/animation_tree_editor_plugin.cpp (renamed from tools/editor/plugins/animation_tree_editor_plugin.cpp) | 2 | ||||
| -rw-r--r-- | editor/plugins/animation_tree_editor_plugin.h (renamed from tools/editor/plugins/animation_tree_editor_plugin.h) | 6 | ||||
| -rw-r--r-- | editor/plugins/baked_light_baker.cpp (renamed from tools/editor/plugins/baked_light_baker.cpp) | 8 | ||||
| -rw-r--r-- | editor/plugins/baked_light_baker.h (renamed from tools/editor/plugins/baked_light_baker.h) | 0 | ||||
| -rw-r--r-- | editor/plugins/baked_light_baker_cmpxchg.cpp (renamed from tools/editor/plugins/baked_light_baker_cmpxchg.cpp) | 0 | ||||
| -rw-r--r-- | editor/plugins/baked_light_editor_plugin.cpp (renamed from tools/editor/plugins/baked_light_editor_plugin.cpp) | 0 | ||||
| -rw-r--r-- | editor/plugins/baked_light_editor_plugin.h (renamed from tools/editor/plugins/baked_light_editor_plugin.h) | 6 | ||||
| -rw-r--r-- | editor/plugins/camera_editor_plugin.cpp (renamed from tools/editor/plugins/camera_editor_plugin.cpp) | 2 | ||||
| -rw-r--r-- | editor/plugins/camera_editor_plugin.h (renamed from tools/editor/plugins/camera_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp (renamed from tools/editor/plugins/canvas_item_editor_plugin.cpp) | 24 | ||||
| -rw-r--r-- | editor/plugins/canvas_item_editor_plugin.h (renamed from tools/editor/plugins/canvas_item_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/collision_polygon_2d_editor_plugin.cpp (renamed from tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp) | 10 | ||||
| -rw-r--r-- | editor/plugins/collision_polygon_2d_editor_plugin.h (renamed from tools/editor/plugins/collision_polygon_2d_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/collision_polygon_editor_plugin.cpp (renamed from tools/editor/plugins/collision_polygon_editor_plugin.cpp) | 8 | ||||
| -rw-r--r-- | editor/plugins/collision_polygon_editor_plugin.h (renamed from tools/editor/plugins/collision_polygon_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/collision_shape_2d_editor_plugin.cpp (renamed from tools/editor/plugins/collision_shape_2d_editor_plugin.cpp) | 0 | ||||
| -rw-r--r-- | editor/plugins/collision_shape_2d_editor_plugin.h (renamed from tools/editor/plugins/collision_shape_2d_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/color_ramp_editor_plugin.cpp (renamed from tools/editor/plugins/color_ramp_editor_plugin.cpp) | 4 | ||||
| -rw-r--r-- | editor/plugins/color_ramp_editor_plugin.h (renamed from tools/editor/plugins/color_ramp_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/cube_grid_theme_editor_plugin.cpp (renamed from tools/editor/plugins/cube_grid_theme_editor_plugin.cpp) | 4 | ||||
| -rw-r--r-- | editor/plugins/cube_grid_theme_editor_plugin.h (renamed from tools/editor/plugins/cube_grid_theme_editor_plugin.h) | 2 | ||||
| -rw-r--r-- | editor/plugins/editor_preview_plugins.cpp (renamed from tools/editor/plugins/editor_preview_plugins.cpp) | 4 | ||||
| -rw-r--r-- | editor/plugins/editor_preview_plugins.h (renamed from tools/editor/plugins/editor_preview_plugins.h) | 2 | ||||
| -rw-r--r-- | editor/plugins/gi_probe_editor_plugin.cpp (renamed from tools/editor/plugins/gi_probe_editor_plugin.cpp) | 2 | ||||
| -rw-r--r-- | editor/plugins/gi_probe_editor_plugin.h (renamed from tools/editor/plugins/gi_probe_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/item_list_editor_plugin.cpp (renamed from tools/editor/plugins/item_list_editor_plugin.cpp) | 0 | ||||
| -rw-r--r-- | editor/plugins/item_list_editor_plugin.h (renamed from tools/editor/plugins/item_list_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/light_occluder_2d_editor_plugin.cpp (renamed from tools/editor/plugins/light_occluder_2d_editor_plugin.cpp) | 12 | ||||
| -rw-r--r-- | editor/plugins/light_occluder_2d_editor_plugin.h (renamed from tools/editor/plugins/light_occluder_2d_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/line_2d_editor_plugin.cpp | 311 | ||||
| -rw-r--r-- | editor/plugins/line_2d_editor_plugin.h | 118 | ||||
| -rw-r--r-- | editor/plugins/material_editor_plugin.cpp (renamed from tools/editor/plugins/material_editor_plugin.cpp) | 4 | ||||
| -rw-r--r-- | editor/plugins/material_editor_plugin.h (renamed from tools/editor/plugins/material_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/mesh_editor_plugin.cpp (renamed from tools/editor/plugins/mesh_editor_plugin.cpp) | 4 | ||||
| -rw-r--r-- | editor/plugins/mesh_editor_plugin.h (renamed from tools/editor/plugins/mesh_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/mesh_instance_editor_plugin.cpp (renamed from tools/editor/plugins/mesh_instance_editor_plugin.cpp) | 0 | ||||
| -rw-r--r-- | editor/plugins/mesh_instance_editor_plugin.h (renamed from tools/editor/plugins/mesh_instance_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/multimesh_editor_plugin.cpp (renamed from tools/editor/plugins/multimesh_editor_plugin.cpp) | 0 | ||||
| -rw-r--r-- | editor/plugins/multimesh_editor_plugin.h (renamed from tools/editor/plugins/multimesh_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/navigation_polygon_editor_plugin.cpp (renamed from tools/editor/plugins/navigation_polygon_editor_plugin.cpp) | 12 | ||||
| -rw-r--r-- | editor/plugins/navigation_polygon_editor_plugin.h (renamed from tools/editor/plugins/navigation_polygon_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/particles_2d_editor_plugin.cpp (renamed from tools/editor/plugins/particles_2d_editor_plugin.cpp) | 4 | ||||
| -rw-r--r-- | editor/plugins/particles_2d_editor_plugin.h (renamed from tools/editor/plugins/particles_2d_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/particles_editor_plugin.cpp (renamed from tools/editor/plugins/particles_editor_plugin.cpp) | 2 | ||||
| -rw-r--r-- | editor/plugins/particles_editor_plugin.h (renamed from tools/editor/plugins/particles_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/path_2d_editor_plugin.cpp (renamed from tools/editor/plugins/path_2d_editor_plugin.cpp) | 10 | ||||
| -rw-r--r-- | editor/plugins/path_2d_editor_plugin.h (renamed from tools/editor/plugins/path_2d_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/path_editor_plugin.cpp (renamed from tools/editor/plugins/path_editor_plugin.cpp) | 4 | ||||
| -rw-r--r-- | editor/plugins/path_editor_plugin.h (renamed from tools/editor/plugins/path_editor_plugin.h) | 2 | ||||
| -rw-r--r-- | editor/plugins/polygon_2d_editor_plugin.cpp (renamed from tools/editor/plugins/polygon_2d_editor_plugin.cpp) | 30 | ||||
| -rw-r--r-- | editor/plugins/polygon_2d_editor_plugin.h (renamed from tools/editor/plugins/polygon_2d_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/resource_preloader_editor_plugin.cpp (renamed from tools/editor/plugins/resource_preloader_editor_plugin.cpp) | 26 | ||||
| -rw-r--r-- | editor/plugins/resource_preloader_editor_plugin.h (renamed from tools/editor/plugins/resource_preloader_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/rich_text_editor_plugin.cpp (renamed from tools/editor/plugins/rich_text_editor_plugin.cpp) | 4 | ||||
| -rw-r--r-- | editor/plugins/rich_text_editor_plugin.h (renamed from tools/editor/plugins/rich_text_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/sample_editor_plugin.cpp (renamed from tools/editor/plugins/sample_editor_plugin.cpp) | 10 | ||||
| -rw-r--r-- | editor/plugins/sample_editor_plugin.h (renamed from tools/editor/plugins/sample_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/sample_library_editor_plugin.cpp (renamed from tools/editor/plugins/sample_library_editor_plugin.cpp) | 26 | ||||
| -rw-r--r-- | editor/plugins/sample_library_editor_plugin.h (renamed from tools/editor/plugins/sample_library_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/sample_player_editor_plugin.cpp (renamed from tools/editor/plugins/sample_player_editor_plugin.cpp) | 4 | ||||
| -rw-r--r-- | editor/plugins/sample_player_editor_plugin.h (renamed from tools/editor/plugins/sample_player_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/script_editor_plugin.cpp (renamed from tools/editor/plugins/script_editor_plugin.cpp) | 18 | ||||
| -rw-r--r-- | editor/plugins/script_editor_plugin.h (renamed from tools/editor/plugins/script_editor_plugin.h) | 8 | ||||
| -rw-r--r-- | editor/plugins/script_text_editor.cpp (renamed from tools/editor/plugins/script_text_editor.cpp) | 6 | ||||
| -rw-r--r-- | editor/plugins/script_text_editor.h (renamed from tools/editor/plugins/script_text_editor.h) | 0 | ||||
| -rw-r--r-- | editor/plugins/shader_editor_plugin.cpp (renamed from tools/editor/plugins/shader_editor_plugin.cpp) | 6 | ||||
| -rw-r--r-- | editor/plugins/shader_editor_plugin.h (renamed from tools/editor/plugins/shader_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/shader_graph_editor_plugin.cpp (renamed from tools/editor/plugins/shader_graph_editor_plugin.cpp) | 12 | ||||
| -rw-r--r-- | editor/plugins/shader_graph_editor_plugin.h (renamed from tools/editor/plugins/shader_graph_editor_plugin.h) | 6 | ||||
| -rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp (renamed from tools/editor/plugins/spatial_editor_plugin.cpp) | 30 | ||||
| -rw-r--r-- | editor/plugins/spatial_editor_plugin.h (renamed from tools/editor/plugins/spatial_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/sprite_frames_editor_plugin.cpp (renamed from tools/editor/plugins/sprite_frames_editor_plugin.cpp) | 46 | ||||
| -rw-r--r-- | editor/plugins/sprite_frames_editor_plugin.h (renamed from tools/editor/plugins/sprite_frames_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/stream_editor_plugin.cpp (renamed from tools/editor/plugins/stream_editor_plugin.cpp) | 4 | ||||
| -rw-r--r-- | editor/plugins/stream_editor_plugin.h (renamed from tools/editor/plugins/stream_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/style_box_editor_plugin.cpp (renamed from tools/editor/plugins/style_box_editor_plugin.cpp) | 0 | ||||
| -rw-r--r-- | editor/plugins/style_box_editor_plugin.h (renamed from tools/editor/plugins/style_box_editor_plugin.h) | 2 | ||||
| -rw-r--r-- | editor/plugins/texture_editor_plugin.cpp (renamed from tools/editor/plugins/texture_editor_plugin.cpp) | 6 | ||||
| -rw-r--r-- | editor/plugins/texture_editor_plugin.h (renamed from tools/editor/plugins/texture_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp (renamed from tools/editor/plugins/texture_region_editor_plugin.cpp) | 31 | ||||
| -rw-r--r-- | editor/plugins/texture_region_editor_plugin.h (renamed from tools/editor/plugins/texture_region_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/theme_editor_plugin.cpp (renamed from tools/editor/plugins/theme_editor_plugin.cpp) | 0 | ||||
| -rw-r--r-- | editor/plugins/theme_editor_plugin.h (renamed from tools/editor/plugins/theme_editor_plugin.h) | 2 | ||||
| -rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp (renamed from tools/editor/plugins/tile_map_editor_plugin.cpp) | 28 | ||||
| -rw-r--r-- | editor/plugins/tile_map_editor_plugin.h (renamed from tools/editor/plugins/tile_map_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp (renamed from tools/editor/plugins/tile_set_editor_plugin.cpp) | 0 | ||||
| -rw-r--r-- | editor/plugins/tile_set_editor_plugin.h (renamed from tools/editor/plugins/tile_set_editor_plugin.h) | 4 | ||||
| -rw-r--r-- | editor/progress_dialog.cpp (renamed from tools/editor/progress_dialog.cpp) | 0 | ||||
| -rw-r--r-- | editor/progress_dialog.h (renamed from tools/editor/progress_dialog.h) | 0 | ||||
| -rw-r--r-- | editor/project_export.cpp | 828 | ||||
| -rw-r--r-- | editor/project_export.h | 142 | ||||
| -rw-r--r-- | editor/project_manager.cpp (renamed from tools/editor/project_manager.cpp) | 8 | ||||
| -rw-r--r-- | editor/project_manager.h (renamed from tools/editor/project_manager.h) | 2 | ||||
| -rw-r--r-- | editor/project_settings.cpp (renamed from tools/editor/project_settings.cpp) | 143 | ||||
| -rw-r--r-- | editor/project_settings.h (renamed from tools/editor/project_settings.h) | 2 | ||||
| -rw-r--r-- | editor/property_editor.cpp (renamed from tools/editor/property_editor.cpp) | 232 | ||||
| -rw-r--r-- | editor/property_editor.h (renamed from tools/editor/property_editor.h) | 11 | ||||
| -rw-r--r-- | editor/property_selector.cpp (renamed from tools/editor/property_selector.cpp) | 8 | ||||
| -rw-r--r-- | editor/property_selector.h (renamed from tools/editor/property_selector.h) | 2 | ||||
| -rw-r--r-- | editor/pvrtc_compress.cpp (renamed from tools/editor/pvrtc_compress.cpp) | 0 | ||||
| -rw-r--r-- | editor/pvrtc_compress.h (renamed from tools/editor/pvrtc_compress.h) | 0 | ||||
| -rw-r--r-- | editor/quick_open.cpp (renamed from tools/editor/quick_open.cpp) | 6 | ||||
| -rw-r--r-- | editor/quick_open.h (renamed from tools/editor/quick_open.h) | 0 | ||||
| -rw-r--r-- | editor/register_exporters.h (renamed from tools/editor/register_exporters.h) | 0 | ||||
| -rw-r--r-- | editor/reparent_dialog.cpp (renamed from tools/editor/reparent_dialog.cpp) | 0 | ||||
| -rw-r--r-- | editor/reparent_dialog.h (renamed from tools/editor/reparent_dialog.h) | 2 | ||||
| -rw-r--r-- | editor/resources_dock.cpp (renamed from tools/editor/resources_dock.cpp) | 14 | ||||
| -rw-r--r-- | editor/resources_dock.h (renamed from tools/editor/resources_dock.h) | 0 | ||||
| -rw-r--r-- | editor/run_settings_dialog.cpp (renamed from tools/editor/run_settings_dialog.cpp) | 0 | ||||
| -rw-r--r-- | editor/run_settings_dialog.h (renamed from tools/editor/run_settings_dialog.h) | 0 | ||||
| -rw-r--r-- | editor/scene_tree_dock.cpp (renamed from tools/editor/scene_tree_dock.cpp) | 68 | ||||
| -rw-r--r-- | editor/scene_tree_dock.h (renamed from tools/editor/scene_tree_dock.h) | 0 | ||||
| -rw-r--r-- | editor/scene_tree_editor.cpp (renamed from tools/editor/scene_tree_editor.cpp) | 10 | ||||
| -rw-r--r-- | editor/scene_tree_editor.h (renamed from tools/editor/scene_tree_editor.h) | 0 | ||||
| -rw-r--r-- | editor/script_create_dialog.cpp (renamed from tools/editor/script_create_dialog.cpp) | 6 | ||||
| -rw-r--r-- | editor/script_create_dialog.h (renamed from tools/editor/script_create_dialog.h) | 4 | ||||
| -rw-r--r-- | editor/script_editor_debugger.cpp (renamed from tools/editor/script_editor_debugger.cpp) | 68 | ||||
| -rw-r--r-- | editor/script_editor_debugger.h (renamed from tools/editor/script_editor_debugger.h) | 0 | ||||
| -rw-r--r-- | editor/settings_config_dialog.cpp (renamed from tools/editor/settings_config_dialog.cpp) | 45 | ||||
| -rw-r--r-- | editor/settings_config_dialog.h (renamed from tools/editor/settings_config_dialog.h) | 0 | ||||
| -rw-r--r-- | editor/spatial_editor_gizmos.cpp (renamed from tools/editor/spatial_editor_gizmos.cpp) | 16 | ||||
| -rw-r--r-- | editor/spatial_editor_gizmos.h (renamed from tools/editor/spatial_editor_gizmos.h) | 2 | ||||
| -rw-r--r-- | editor/translations/Makefile (renamed from tools/editor/translations/Makefile) | 4 | ||||
| -rw-r--r-- | editor/translations/README.md (renamed from tools/editor/translations/README.md) | 0 | ||||
| -rw-r--r-- | editor/translations/ar.po (renamed from tools/editor/translations/ar.po) | 0 | ||||
| -rw-r--r-- | editor/translations/bg.po (renamed from tools/editor/translations/bg.po) | 0 | ||||
| -rw-r--r-- | editor/translations/bn.po (renamed from tools/editor/translations/bn.po) | 0 | ||||
| -rw-r--r-- | editor/translations/ca.po (renamed from tools/editor/translations/ca.po) | 0 | ||||
| -rw-r--r-- | editor/translations/cs.po (renamed from tools/editor/translations/cs.po) | 0 | ||||
| -rw-r--r-- | editor/translations/da.po (renamed from tools/editor/translations/da.po) | 0 | ||||
| -rw-r--r-- | editor/translations/de.po (renamed from tools/editor/translations/de.po) | 0 | ||||
| -rw-r--r-- | editor/translations/de_CH.po (renamed from tools/editor/translations/de_CH.po) | 0 | ||||
| -rw-r--r-- | editor/translations/editor.pot (renamed from tools/editor/translations/tools.pot) | 0 | ||||
| -rw-r--r-- | editor/translations/es.po (renamed from tools/editor/translations/es.po) | 0 | ||||
| -rw-r--r-- | editor/translations/es_AR.po (renamed from tools/editor/translations/es_AR.po) | 0 | ||||
| -rwxr-xr-x | editor/translations/extract.py (renamed from tools/editor/translations/extract.py) | 16 | ||||
| -rw-r--r-- | editor/translations/fa.po (renamed from tools/editor/translations/fa.po) | 0 | ||||
| -rw-r--r-- | editor/translations/fr.po (renamed from tools/editor/translations/fr.po) | 0 | ||||
| -rw-r--r-- | editor/translations/hu.po (renamed from tools/editor/translations/hu.po) | 0 | ||||
| -rw-r--r-- | editor/translations/id.po (renamed from tools/editor/translations/id.po) | 0 | ||||
| -rw-r--r-- | editor/translations/it.po (renamed from tools/editor/translations/it.po) | 0 | ||||
| -rw-r--r-- | editor/translations/ja.po (renamed from tools/editor/translations/ja.po) | 0 | ||||
| -rw-r--r-- | editor/translations/ko.po (renamed from tools/editor/translations/ko.po) | 0 | ||||
| -rw-r--r-- | editor/translations/nb.po (renamed from tools/editor/translations/nb.po) | 0 | ||||
| -rw-r--r-- | editor/translations/pl.po (renamed from tools/editor/translations/pl.po) | 0 | ||||
| -rw-r--r-- | editor/translations/pr.po (renamed from tools/editor/translations/pr.po) | 0 | ||||
| -rw-r--r-- | editor/translations/pt_BR.po (renamed from tools/editor/translations/pt_BR.po) | 0 | ||||
| -rw-r--r-- | editor/translations/pt_PT.po (renamed from tools/editor/translations/pt_PT.po) | 0 | ||||
| -rw-r--r-- | editor/translations/ru.po (renamed from tools/editor/translations/ru.po) | 0 | ||||
| -rw-r--r-- | editor/translations/sk.po (renamed from tools/editor/translations/sk.po) | 0 | ||||
| -rw-r--r-- | editor/translations/sl.po (renamed from tools/editor/translations/sl.po) | 0 | ||||
| -rw-r--r-- | editor/translations/tr.po (renamed from tools/editor/translations/tr.po) | 0 | ||||
| -rw-r--r-- | editor/translations/ur_PK.po (renamed from tools/editor/translations/ur_PK.po) | 0 | ||||
| -rw-r--r-- | editor/translations/zh_CN.po (renamed from tools/editor/translations/zh_CN.po) | 0 | ||||
| -rw-r--r-- | editor/translations/zh_HK.po (renamed from tools/editor/translations/zh_HK.po) | 0 | ||||
| -rw-r--r-- | editor/translations/zh_TW.po (renamed from tools/editor/translations/zh_TW.po) | 0 | ||||
| -rw-r--r-- | main/input_default.cpp | 9 | ||||
| -rw-r--r-- | main/input_default.h | 7 | ||||
| -rw-r--r-- | main/main.cpp | 19 | ||||
| -rw-r--r-- | main/performance.cpp | 2 | ||||
| -rw-r--r-- | main/tests/test_containers.cpp | 3 | ||||
| -rw-r--r-- | main/tests/test_containers.h | 2 | ||||
| -rw-r--r-- | main/tests/test_gdscript.cpp | 2 | ||||
| -rw-r--r-- | main/tests/test_gdscript.h | 2 | ||||
| -rw-r--r-- | main/tests/test_gui.cpp | 2 | ||||
| -rw-r--r-- | main/tests/test_gui.h | 2 | ||||
| -rw-r--r-- | main/tests/test_image.cpp | 4 | ||||
| -rw-r--r-- | main/tests/test_image.h | 2 | ||||
| -rw-r--r-- | main/tests/test_io.cpp | 4 | ||||
| -rw-r--r-- | main/tests/test_io.h | 2 | ||||
| -rw-r--r-- | main/tests/test_main.cpp | 2 | ||||
| -rw-r--r-- | main/tests/test_main.h | 2 | ||||
| -rw-r--r-- | main/tests/test_math.cpp | 7 | ||||
| -rw-r--r-- | main/tests/test_math.h | 2 | ||||
| -rw-r--r-- | main/tests/test_physics.cpp | 2 | ||||
| -rw-r--r-- | main/tests/test_physics.h | 2 | ||||
| -rw-r--r-- | main/tests/test_physics_2d.cpp | 7 | ||||
| -rw-r--r-- | main/tests/test_physics_2d.h | 2 | ||||
| -rw-r--r-- | main/tests/test_render.cpp | 3 | ||||
| -rw-r--r-- | main/tests/test_render.h | 2 | ||||
| -rw-r--r-- | main/tests/test_shader_lang.cpp | 2 | ||||
| -rw-r--r-- | main/tests/test_shader_lang.h | 2 | ||||
| -rw-r--r-- | main/tests/test_sound.cpp | 2 | ||||
| -rw-r--r-- | main/tests/test_sound.h | 2 | ||||
| -rw-r--r-- | main/tests/test_string.cpp | 3 | ||||
| -rw-r--r-- | main/tests/test_string.h | 2 | ||||
| -rwxr-xr-x | misc/dist/appimage/AppRun | 3 | ||||
| -rw-r--r-- | misc/dist/appimage/godot.desktop | 9 | ||||
| -rw-r--r-- | misc/dist/appimage/godot.png | bin | 0 -> 12525 bytes | |||
| -rw-r--r-- | modules/cscript/godot_c.cpp | 28 | ||||
| -rw-r--r-- | modules/cscript/godot_c.h | 28 | ||||
| -rw-r--r-- | modules/dds/texture_loader_dds.cpp | 10 | ||||
| -rw-r--r-- | modules/enet/networked_multiplayer_enet.cpp | 12 | ||||
| -rw-r--r-- | modules/etc1/texture_loader_pkm.cpp | 29 | ||||
| -rw-r--r-- | modules/etc1/texture_loader_pkm.h | 28 | ||||
| -rw-r--r-- | modules/gdscript/gd_compiler.h | 2 | ||||
| -rw-r--r-- | modules/gdscript/gd_editor.cpp | 13 | ||||
| -rw-r--r-- | modules/gdscript/gd_function.cpp | 37 | ||||
| -rw-r--r-- | modules/gdscript/gd_function.h | 28 | ||||
| -rw-r--r-- | modules/gdscript/gd_parser.cpp | 54 | ||||
| -rw-r--r-- | modules/gdscript/gd_script.cpp | 10 | ||||
| -rw-r--r-- | modules/gdscript/gd_tokenizer.cpp | 6 | ||||
| -rw-r--r-- | modules/gdscript/gd_tokenizer.h | 2 | ||||
| -rw-r--r-- | modules/gdscript/register_types.cpp | 6 | ||||
| -rw-r--r-- | modules/gridmap/config.py | 3 | ||||
| -rw-r--r-- | modules/gridmap/grid_map.cpp | 597 | ||||
| -rw-r--r-- | modules/gridmap/grid_map.h | 22 | ||||
| -rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 98 | ||||
| -rw-r--r-- | modules/gridmap/grid_map_editor_plugin.h | 15 | ||||
| -rw-r--r-- | modules/openssl/stream_peer_openssl.h | 2 | ||||
| -rw-r--r-- | modules/regex/regex.cpp | 36 | ||||
| -rw-r--r-- | modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 42 | ||||
| -rw-r--r-- | modules/stb_vorbis/audio_stream_ogg_vorbis.h | 28 | ||||
| -rw-r--r-- | modules/stb_vorbis/resource_importer_ogg_vorbis.cpp | 28 | ||||
| -rw-r--r-- | modules/stb_vorbis/resource_importer_ogg_vorbis.h | 28 | ||||
| -rw-r--r-- | modules/theora/video_stream_theora.cpp | 2 | ||||
| -rw-r--r-- | modules/theora/yuv2rgb.h | 3 | ||||
| -rw-r--r-- | modules/visual_script/visual_script.cpp | 145 | ||||
| -rw-r--r-- | modules/visual_script/visual_script.h | 28 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_builtin_funcs.cpp | 37 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_builtin_funcs.h | 28 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 33 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_editor.h | 44 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_expression.cpp | 34 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_expression.h | 28 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_flow_control.cpp | 61 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_flow_control.h | 28 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_func_nodes.cpp | 199 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_func_nodes.h | 28 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_nodes.cpp | 217 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_nodes.h | 32 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_yield_nodes.cpp | 65 | ||||
| -rw-r--r-- | modules/visual_script/visual_script_yield_nodes.h | 28 | ||||
| -rw-r--r-- | modules/webm/video_stream_webm.cpp | 2 | ||||
| -rw-r--r-- | modules/webp/SCsub | 188 | ||||
| -rw-r--r-- | platform/android/SCsub | 1 | ||||
| -rw-r--r-- | platform/android/audio_driver_jandroid.cpp | 2 | ||||
| -rw-r--r-- | platform/android/export/export.cpp | 14 | ||||
| -rw-r--r-- | platform/android/globals/global_defaults.cpp | 2 | ||||
| -rw-r--r-- | platform/android/godot_android.cpp | 2 | ||||
| -rw-r--r-- | platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java | 49 | ||||
| -rw-r--r-- | platform/android/java_class_wrapper.cpp | 2 | ||||
| -rw-r--r-- | platform/android/java_glue.cpp | 2 | ||||
| -rw-r--r-- | platform/android/os_android.cpp | 4 | ||||
| -rw-r--r-- | platform/android/os_android.h | 3 | ||||
| -rw-r--r-- | platform/android/power_android.cpp | 238 | ||||
| -rw-r--r-- | platform/android/power_android.h | 82 | ||||
| -rw-r--r-- | platform/bb10/export/export.cpp | 16 | ||||
| -rw-r--r-- | platform/bb10/os_bb10.cpp | 16 | ||||
| -rw-r--r-- | platform/bb10/os_bb10.h | 6 | ||||
| -rw-r--r-- | platform/bb10/payment_service.cpp | 8 | ||||
| -rw-r--r-- | platform/bb10/power_bb10.cpp | 76 | ||||
| -rw-r--r-- | platform/bb10/power_bb10.h | 49 | ||||
| -rw-r--r-- | platform/haiku/audio_driver_media_kit.cpp | 2 | ||||
| -rw-r--r-- | platform/haiku/os_haiku.cpp | 2 | ||||
| -rw-r--r-- | platform/haiku/os_haiku.h | 6 | ||||
| -rw-r--r-- | platform/haiku/power_haiku.cpp | 74 | ||||
| -rw-r--r-- | platform/haiku/power_haiku.h | 49 | ||||
| -rw-r--r-- | platform/iphone/Appirater.h | 200 | ||||
| -rw-r--r-- | platform/iphone/Appirater.m | 732 | ||||
| -rw-r--r-- | platform/iphone/AppiraterDelegate.h | 23 | ||||
| -rw-r--r-- | platform/iphone/SCsub | 5 | ||||
| -rw-r--r-- | platform/iphone/app_delegate.mm | 11 | ||||
| -rw-r--r-- | platform/iphone/detect.py | 1 | ||||
| -rw-r--r-- | platform/iphone/game_center.mm | 24 | ||||
| -rwxr-xr-x | platform/iphone/gl_view.mm | 2 | ||||
| -rwxr-xr-x | platform/iphone/globals/global_defaults.cpp | 2 | ||||
| -rw-r--r-- | platform/iphone/icloud.mm | 16 | ||||
| -rw-r--r-- | platform/iphone/in_app_store.mm | 12 | ||||
| -rw-r--r-- | platform/iphone/ios.mm | 2 | ||||
| -rw-r--r-- | platform/iphone/os_iphone.cpp | 2 | ||||
| -rw-r--r-- | platform/iphone/power_iphone.cpp | 71 | ||||
| -rw-r--r-- | platform/iphone/power_iphone.h | 50 | ||||
| -rw-r--r-- | platform/iphone/rasterizer_iphone.cpp | 2 | ||||
| -rw-r--r-- | platform/javascript/SCsub | 41 | ||||
| -rw-r--r-- | platform/javascript/audio_server_javascript.cpp | 3 | ||||
| -rw-r--r-- | platform/javascript/audio_server_javascript.h | 3 | ||||
| -rw-r--r-- | platform/javascript/detect.py | 52 | ||||
| -rw-r--r-- | platform/javascript/export/export.cpp | 16 | ||||
| -rw-r--r-- | platform/javascript/javascript_eval.cpp | 2 | ||||
| -rw-r--r-- | platform/javascript/javascript_main.cpp | 7 | ||||
| -rw-r--r-- | platform/javascript/os_javascript.cpp | 19 | ||||
| -rw-r--r-- | platform/javascript/os_javascript.h | 7 | ||||
| -rw-r--r-- | platform/javascript/power_javascript.cpp | 76 | ||||
| -rw-r--r-- | platform/javascript/power_javascript.h | 51 | ||||
| -rw-r--r-- | platform/osx/SCsub | 1 | ||||
| -rw-r--r-- | platform/osx/detect.py | 1 | ||||
| -rw-r--r-- | platform/osx/export/export.cpp | 16 | ||||
| -rw-r--r-- | platform/osx/joypad_osx.cpp | 17 | ||||
| -rw-r--r-- | platform/osx/joypad_osx.h | 3 | ||||
| -rw-r--r-- | platform/osx/os_osx.h | 7 | ||||
| -rw-r--r-- | platform/osx/os_osx.mm | 18 | ||||
| -rw-r--r-- | platform/osx/power_osx.cpp | 233 | ||||
| -rw-r--r-- | platform/osx/power_osx.h | 57 | ||||
| -rw-r--r-- | platform/server/os_server.cpp | 12 | ||||
| -rw-r--r-- | platform/server/os_server.h | 7 | ||||
| -rw-r--r-- | platform/uwp/export/export.cpp | 13 | ||||
| -rw-r--r-- | platform/uwp/os_uwp.cpp | 17 | ||||
| -rw-r--r-- | platform/uwp/os_uwp.h | 8 | ||||
| -rw-r--r-- | platform/windows/SCsub | 1 | ||||
| -rw-r--r-- | platform/windows/export/export.cpp | 9 | ||||
| -rw-r--r-- | platform/windows/joypad.cpp | 14 | ||||
| -rw-r--r-- | platform/windows/joypad.h | 1 | ||||
| -rw-r--r-- | platform/windows/os_windows.cpp | 45 | ||||
| -rw-r--r-- | platform/windows/os_windows.h | 10 | ||||
| -rw-r--r-- | platform/windows/packet_peer_udp_winsock.cpp | 35 | ||||
| -rw-r--r-- | platform/windows/packet_peer_udp_winsock.h | 3 | ||||
| -rw-r--r-- | platform/windows/power_windows.cpp | 108 | ||||
| -rw-r--r-- | platform/windows/power_windows.h | 57 | ||||
| -rw-r--r-- | platform/windows/stream_peer_winsock.cpp | 21 | ||||
| -rw-r--r-- | platform/windows/stream_peer_winsock.h | 4 | ||||
| -rw-r--r-- | platform/windows/tcp_server_winsock.cpp | 21 | ||||
| -rw-r--r-- | platform/windows/tcp_server_winsock.h | 3 | ||||
| -rw-r--r-- | platform/x11/SCsub | 1 | ||||
| -rw-r--r-- | platform/x11/export/export.cpp | 23 | ||||
| -rw-r--r-- | platform/x11/godot_x11.cpp | 10 | ||||
| -rw-r--r-- | platform/x11/joypad_linux.cpp | 11 | ||||
| -rw-r--r-- | platform/x11/joypad_linux.h | 1 | ||||
| -rw-r--r-- | platform/x11/os_x11.cpp | 19 | ||||
| -rw-r--r-- | platform/x11/os_x11.h | 7 | ||||
| -rw-r--r-- | platform/x11/power_x11.cpp | 575 | ||||
| -rw-r--r-- | platform/x11/power_x11.h | 68 | ||||
| -rw-r--r-- | prop_renames.txt | 524 | ||||
| -rw-r--r-- | scene/2d/animated_sprite.cpp | 98 | ||||
| -rw-r--r-- | scene/2d/area_2d.cpp | 113 | ||||
| -rw-r--r-- | scene/2d/back_buffer_copy.cpp | 12 | ||||
| -rw-r--r-- | scene/2d/camera_2d.cpp | 116 | ||||
| -rw-r--r-- | scene/2d/canvas_item.cpp | 194 | ||||
| -rw-r--r-- | scene/2d/canvas_modulate.cpp | 6 | ||||
| -rw-r--r-- | scene/2d/collision_object_2d.cpp | 32 | ||||
| -rw-r--r-- | scene/2d/collision_polygon_2d.cpp | 30 | ||||
| -rw-r--r-- | scene/2d/collision_shape_2d.cpp | 24 | ||||
| -rw-r--r-- | scene/2d/joints_2d.cpp | 66 | ||||
| -rw-r--r-- | scene/2d/light_2d.cpp | 120 | ||||
| -rw-r--r-- | scene/2d/light_occluder_2d.cpp | 30 | ||||
| -rw-r--r-- | scene/2d/line_2d.cpp | 336 | ||||
| -rw-r--r-- | scene/2d/line_2d.h | 108 | ||||
| -rw-r--r-- | scene/2d/line_builder.cpp | 591 | ||||
| -rw-r--r-- | scene/2d/line_builder.h | 104 | ||||
| -rw-r--r-- | scene/2d/navigation2d.cpp | 12 | ||||
| -rw-r--r-- | scene/2d/navigation_polygon.cpp | 66 | ||||
| -rw-r--r-- | scene/2d/node_2d.cpp | 94 | ||||
| -rw-r--r-- | scene/2d/parallax_background.cpp | 38 | ||||
| -rw-r--r-- | scene/2d/parallax_layer.cpp | 18 | ||||
| -rw-r--r-- | scene/2d/particles_2d.cpp | 250 | ||||
| -rw-r--r-- | scene/2d/particles_2d.h | 14 | ||||
| -rw-r--r-- | scene/2d/path_2d.cpp | 36 | ||||
| -rw-r--r-- | scene/2d/physics_body_2d.cpp | 230 | ||||
| -rw-r--r-- | scene/2d/polygon_2d.cpp | 70 | ||||
| -rw-r--r-- | scene/2d/ray_cast_2d.cpp | 52 | ||||
| -rw-r--r-- | scene/2d/remote_transform_2d.cpp | 6 | ||||
| -rw-r--r-- | scene/2d/screen_button.cpp | 249 | ||||
| -rw-r--r-- | scene/2d/screen_button.h | 15 | ||||
| -rw-r--r-- | scene/2d/sprite.cpp | 84 | ||||
| -rw-r--r-- | scene/2d/tile_map.cpp | 159 | ||||
| -rw-r--r-- | scene/2d/tile_map.h | 7 | ||||
| -rw-r--r-- | scene/2d/visibility_notifier_2d.cpp | 26 | ||||
| -rw-r--r-- | scene/2d/y_sort.cpp | 6 | ||||
| -rw-r--r-- | scene/3d/area.cpp | 100 | ||||
| -rw-r--r-- | scene/3d/baked_light_instance.cpp | 46 | ||||
| -rw-r--r-- | scene/3d/body_shape.cpp | 26 | ||||
| -rw-r--r-- | scene/3d/bone_attachment.cpp | 4 | ||||
| -rw-r--r-- | scene/3d/camera.cpp | 56 | ||||
| -rw-r--r-- | scene/3d/character_camera.cpp | 48 | ||||
| -rw-r--r-- | scene/3d/collision_object.cpp | 37 | ||||
| -rw-r--r-- | scene/3d/collision_polygon.cpp | 30 | ||||
| -rw-r--r-- | scene/3d/gi_probe.cpp | 267 | ||||
| -rw-r--r-- | scene/3d/gi_probe.h | 35 | ||||
| -rw-r--r-- | scene/3d/immediate_geometry.cpp | 20 | ||||
| -rw-r--r-- | scene/3d/interpolated_camera.cpp | 20 | ||||
| -rw-r--r-- | scene/3d/light.cpp | 98 | ||||
| -rw-r--r-- | scene/3d/listener.cpp | 36 | ||||
| -rw-r--r-- | scene/3d/listener.h | 28 | ||||
| -rw-r--r-- | scene/3d/mesh_instance.cpp | 18 | ||||
| -rw-r--r-- | scene/3d/multimesh_instance.cpp | 6 | ||||
| -rw-r--r-- | scene/3d/navigation.cpp | 22 | ||||
| -rw-r--r-- | scene/3d/navigation_mesh.cpp | 32 | ||||
| -rw-r--r-- | scene/3d/particles.cpp | 132 | ||||
| -rw-r--r-- | scene/3d/path.cpp | 36 | ||||
| -rw-r--r-- | scene/3d/physics_body.cpp | 214 | ||||
| -rw-r--r-- | scene/3d/physics_joint.cpp | 348 | ||||
| -rw-r--r-- | scene/3d/portal.cpp | 22 | ||||
| -rw-r--r-- | scene/3d/proximity_group.cpp | 16 | ||||
| -rw-r--r-- | scene/3d/quad.cpp | 24 | ||||
| -rw-r--r-- | scene/3d/ray_cast.cpp | 46 | ||||
| -rw-r--r-- | scene/3d/reflection_probe.cpp | 100 | ||||
| -rw-r--r-- | scene/3d/reflection_probe.h | 28 | ||||
| -rw-r--r-- | scene/3d/remote_transform.cpp | 6 | ||||
| -rw-r--r-- | scene/3d/remote_transform.h | 28 | ||||
| -rw-r--r-- | scene/3d/room_instance.cpp | 8 | ||||
| -rw-r--r-- | scene/3d/scenario_fx.cpp | 6 | ||||
| -rw-r--r-- | scene/3d/skeleton.cpp | 46 | ||||
| -rw-r--r-- | scene/3d/spatial.cpp | 110 | ||||
| -rw-r--r-- | scene/3d/spatial_indexer.cpp | 2 | ||||
| -rw-r--r-- | scene/3d/sprite_3d.cpp | 148 | ||||
| -rw-r--r-- | scene/3d/vehicle_body.cpp | 94 | ||||
| -rw-r--r-- | scene/3d/visibility_notifier.cpp | 18 | ||||
| -rw-r--r-- | scene/3d/visual_instance.cpp | 70 | ||||
| -rw-r--r-- | scene/animation/animation_cache.cpp | 4 | ||||
| -rw-r--r-- | scene/animation/animation_player.cpp | 111 | ||||
| -rw-r--r-- | scene/animation/animation_tree_player.cpp | 132 | ||||
| -rw-r--r-- | scene/animation/tween.cpp | 76 | ||||
| -rw-r--r-- | scene/animation/tween_interpolaters.cpp | 3 | ||||
| -rw-r--r-- | scene/audio/audio_player.cpp | 76 | ||||
| -rw-r--r-- | scene/audio/audio_player.h | 28 | ||||
| -rw-r--r-- | scene/gui/base_button.cpp | 56 | ||||
| -rw-r--r-- | scene/gui/box_container.cpp | 8 | ||||
| -rw-r--r-- | scene/gui/button.cpp | 30 | ||||
| -rw-r--r-- | scene/gui/button_array.cpp | 52 | ||||
| -rw-r--r-- | scene/gui/button_array.h | 1 | ||||
| -rw-r--r-- | scene/gui/button_group.cpp | 12 | ||||
| -rw-r--r-- | scene/gui/center_container.cpp | 6 | ||||
| -rw-r--r-- | scene/gui/color_picker.cpp | 52 | ||||
| -rw-r--r-- | scene/gui/color_ramp_edit.cpp | 4 | ||||
| -rw-r--r-- | scene/gui/color_rect.cpp | 6 | ||||
| -rw-r--r-- | scene/gui/container.cpp | 8 | ||||
| -rw-r--r-- | scene/gui/control.cpp | 242 | ||||
| -rw-r--r-- | scene/gui/dialogs.cpp | 285 | ||||
| -rw-r--r-- | scene/gui/dialogs.h | 20 | ||||
| -rw-r--r-- | scene/gui/file_dialog.cpp | 88 | ||||
| -rw-r--r-- | scene/gui/graph_edit.cpp | 56 | ||||
| -rw-r--r-- | scene/gui/graph_node.cpp | 90 | ||||
| -rw-r--r-- | scene/gui/grid_container.cpp | 6 | ||||
| -rw-r--r-- | scene/gui/input_action.cpp | 40 | ||||
| -rw-r--r-- | scene/gui/input_action.h | 28 | ||||
| -rw-r--r-- | scene/gui/item_list.cpp | 122 | ||||
| -rw-r--r-- | scene/gui/item_list.h | 1 | ||||
| -rw-r--r-- | scene/gui/label.cpp | 68 | ||||
| -rw-r--r-- | scene/gui/line_edit.cpp | 86 | ||||
| -rw-r--r-- | scene/gui/link_button.cpp | 12 | ||||
| -rw-r--r-- | scene/gui/menu_button.cpp | 10 | ||||
| -rw-r--r-- | scene/gui/option_button.cpp | 58 | ||||
| -rw-r--r-- | scene/gui/patch_9_rect.cpp | 30 | ||||
| -rw-r--r-- | scene/gui/popup.cpp | 22 | ||||
| -rw-r--r-- | scene/gui/popup.h | 4 | ||||
| -rw-r--r-- | scene/gui/popup_menu.cpp | 116 | ||||
| -rw-r--r-- | scene/gui/progress_bar.cpp | 6 | ||||
| -rw-r--r-- | scene/gui/range.cpp | 52 | ||||
| -rw-r--r-- | scene/gui/rich_text_label.cpp | 127 | ||||
| -rw-r--r-- | scene/gui/rich_text_label.h | 4 | ||||
| -rw-r--r-- | scene/gui/scroll_bar.cpp | 12 | ||||
| -rw-r--r-- | scene/gui/scroll_container.cpp | 26 | ||||
| -rw-r--r-- | scene/gui/slider.cpp | 16 | ||||
| -rw-r--r-- | scene/gui/spin_box.cpp | 38 | ||||
| -rw-r--r-- | scene/gui/split_container.cpp | 20 | ||||
| -rw-r--r-- | scene/gui/tab_container.cpp | 803 | ||||
| -rw-r--r-- | scene/gui/tab_container.h | 9 | ||||
| -rw-r--r-- | scene/gui/tabs.cpp | 70 | ||||
| -rw-r--r-- | scene/gui/tabs.h | 4 | ||||
| -rw-r--r-- | scene/gui/text_edit.cpp | 163 | ||||
| -rw-r--r-- | scene/gui/texture_button.cpp | 174 | ||||
| -rw-r--r-- | scene/gui/texture_button.h | 26 | ||||
| -rw-r--r-- | scene/gui/texture_progress.cpp | 42 | ||||
| -rw-r--r-- | scene/gui/texture_rect.cpp | 30 | ||||
| -rw-r--r-- | scene/gui/texture_rect.h | 2 | ||||
| -rw-r--r-- | scene/gui/tree.cpp | 188 | ||||
| -rw-r--r-- | scene/gui/tree.h | 1 | ||||
| -rw-r--r-- | scene/gui/video_player.cpp | 58 | ||||
| -rw-r--r-- | scene/gui/viewport_container.cpp | 37 | ||||
| -rw-r--r-- | scene/gui/viewport_container.h | 28 | ||||
| -rw-r--r-- | scene/io/resource_format_image.cpp | 2 | ||||
| -rw-r--r-- | scene/main/canvas_layer.cpp | 46 | ||||
| -rw-r--r-- | scene/main/http_request.cpp | 41 | ||||
| -rw-r--r-- | scene/main/http_request.h | 1 | ||||
| -rw-r--r-- | scene/main/instance_placeholder.cpp | 6 | ||||
| -rw-r--r-- | scene/main/node.cpp | 230 | ||||
| -rw-r--r-- | scene/main/node.h | 14 | ||||
| -rw-r--r-- | scene/main/resource_preloader.cpp | 18 | ||||
| -rw-r--r-- | scene/main/scene_main_loop.cpp | 113 | ||||
| -rw-r--r-- | scene/main/scene_main_loop.h | 7 | ||||
| -rw-r--r-- | scene/main/timer.cpp | 34 | ||||
| -rw-r--r-- | scene/main/viewport.cpp | 184 | ||||
| -rw-r--r-- | scene/register_scene_types.cpp | 5 | ||||
| -rw-r--r-- | scene/resources/animation.cpp | 80 | ||||
| -rw-r--r-- | scene/resources/audio_stream_resampled.cpp | 2 | ||||
| -rw-r--r-- | scene/resources/audio_stream_sample.cpp | 70 | ||||
| -rw-r--r-- | scene/resources/audio_stream_sample.h | 28 | ||||
| -rw-r--r-- | scene/resources/bit_mask.cpp | 20 | ||||
| -rw-r--r-- | scene/resources/bounds.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/box_shape.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/capsule_shape.cpp | 12 | ||||
| -rw-r--r-- | scene/resources/capsule_shape_2d.cpp | 12 | ||||
| -rw-r--r-- | scene/resources/circle_shape_2d.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/color_ramp.cpp | 36 | ||||
| -rw-r--r-- | scene/resources/concave_polygon_shape.cpp | 4 | ||||
| -rw-r--r-- | scene/resources/concave_polygon_shape_2d.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/convex_polygon_shape.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/convex_polygon_shape_2d.cpp | 8 | ||||
| -rw-r--r-- | scene/resources/curve.cpp | 162 | ||||
| -rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 33 | ||||
| -rw-r--r-- | scene/resources/default_theme/theme_data.h | 4 | ||||
| -rw-r--r-- | scene/resources/dynamic_font.cpp | 52 | ||||
| -rw-r--r-- | scene/resources/dynamic_font_stb.cpp | 40 | ||||
| -rw-r--r-- | scene/resources/dynamic_font_stb.h | 28 | ||||
| -rw-r--r-- | scene/resources/environment.cpp | 356 | ||||
| -rw-r--r-- | scene/resources/font.cpp | 70 | ||||
| -rw-r--r-- | scene/resources/gibberish_stream.cpp | 24 | ||||
| -rw-r--r-- | scene/resources/material.cpp | 248 | ||||
| -rw-r--r-- | scene/resources/mesh.cpp | 54 | ||||
| -rw-r--r-- | scene/resources/mesh_data_tool.cpp | 76 | ||||
| -rw-r--r-- | scene/resources/mesh_library.cpp | 26 | ||||
| -rw-r--r-- | scene/resources/multimesh.cpp | 56 | ||||
| -rw-r--r-- | scene/resources/packed_scene.cpp | 66 | ||||
| -rw-r--r-- | scene/resources/packed_scene.h | 4 | ||||
| -rw-r--r-- | scene/resources/plane_shape.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/polygon_path_finder.cpp | 26 | ||||
| -rw-r--r-- | scene/resources/ray_shape.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/rectangle_shape_2d.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/room.cpp | 8 | ||||
| -rw-r--r-- | scene/resources/scene_format_text.cpp | 2 | ||||
| -rw-r--r-- | scene/resources/segment_shape_2d.cpp | 18 | ||||
| -rw-r--r-- | scene/resources/shader.cpp | 16 | ||||
| -rw-r--r-- | scene/resources/shader_graph.cpp | 154 | ||||
| -rw-r--r-- | scene/resources/shape_2d.cpp | 16 | ||||
| -rw-r--r-- | scene/resources/shape_line_2d.cpp | 12 | ||||
| -rw-r--r-- | scene/resources/sky_box.cpp | 50 | ||||
| -rw-r--r-- | scene/resources/sky_box.h | 28 | ||||
| -rw-r--r-- | scene/resources/space_2d.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/sphere_shape.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/style_box.cpp | 114 | ||||
| -rw-r--r-- | scene/resources/surface_tool.cpp | 38 | ||||
| -rw-r--r-- | scene/resources/texture.cpp | 141 | ||||
| -rw-r--r-- | scene/resources/texture.h | 4 | ||||
| -rw-r--r-- | scene/resources/theme.cpp | 62 | ||||
| -rw-r--r-- | scene/resources/tile_set.cpp | 62 | ||||
| -rw-r--r-- | scene/resources/world.cpp | 12 | ||||
| -rw-r--r-- | scene/resources/world_2d.cpp | 12 | ||||
| -rw-r--r-- | scene/resources/world_2d.h | 2 | ||||
| -rw-r--r-- | scene/scene_string_names.cpp | 2 | ||||
| -rw-r--r-- | scene/scene_string_names.h | 1 | ||||
| -rw-r--r-- | servers/audio/audio_driver_dummy.cpp | 2 | ||||
| -rw-r--r-- | servers/audio/audio_effect.cpp | 28 | ||||
| -rw-r--r-- | servers/audio/audio_effect.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_amplify.cpp | 34 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_amplify.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_chorus.cpp | 118 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_chorus.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_compressor.cpp | 70 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_compressor.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_delay.cpp | 106 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_delay.h | 34 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_distortion.cpp | 58 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_distortion.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_eq.cpp | 34 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_eq.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_filter.cpp | 52 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_filter.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_limiter.cpp | 52 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_limiter.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_panner.cpp | 34 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_panner.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_phaser.cpp | 58 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_phaser.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_pitch_shift.cpp | 44 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_pitch_shift.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_reverb.cpp | 76 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_reverb.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_stereo_enhance.cpp | 46 | ||||
| -rw-r--r-- | servers/audio/effects/audio_effect_stereo_enhance.h | 28 | ||||
| -rw-r--r-- | servers/audio/effects/eq.cpp | 42 | ||||
| -rw-r--r-- | servers/audio/effects/eq.h | 40 | ||||
| -rw-r--r-- | servers/audio/effects/reverb.cpp | 39 | ||||
| -rw-r--r-- | servers/audio/effects/reverb.h | 40 | ||||
| -rw-r--r-- | servers/audio_server.cpp | 66 | ||||
| -rw-r--r-- | servers/physics/area_pair_sw.cpp | 8 | ||||
| -rw-r--r-- | servers/physics/area_pair_sw.h | 8 | ||||
| -rw-r--r-- | servers/physics/area_sw.h | 30 | ||||
| -rw-r--r-- | servers/physics/body_pair_sw.cpp | 18 | ||||
| -rw-r--r-- | servers/physics/body_pair_sw.h | 6 | ||||
| -rw-r--r-- | servers/physics/body_sw.cpp | 20 | ||||
| -rw-r--r-- | servers/physics/body_sw.h | 22 | ||||
| -rw-r--r-- | servers/physics/collision_solver_sat.cpp | 42 | ||||
| -rw-r--r-- | servers/physics/collision_solver_sat.h | 2 | ||||
| -rw-r--r-- | servers/physics/collision_solver_sw.cpp | 18 | ||||
| -rw-r--r-- | servers/physics/collision_solver_sw.h | 4 | ||||
| -rw-r--r-- | servers/physics/constraint_sw.h | 4 | ||||
| -rw-r--r-- | servers/physics/joints/cone_twist_joint_sw.cpp | 6 | ||||
| -rw-r--r-- | servers/physics/joints/cone_twist_joint_sw.h | 8 | ||||
| -rw-r--r-- | servers/physics/joints/generic_6dof_joint_sw.cpp | 56 | ||||
| -rw-r--r-- | servers/physics/joints/generic_6dof_joint_sw.h | 8 | ||||
| -rw-r--r-- | servers/physics/joints/hinge_joint_sw.cpp | 8 | ||||
| -rw-r--r-- | servers/physics/joints/hinge_joint_sw.h | 8 | ||||
| -rw-r--r-- | servers/physics/joints/pin_joint_sw.cpp | 8 | ||||
| -rw-r--r-- | servers/physics/joints/pin_joint_sw.h | 8 | ||||
| -rw-r--r-- | servers/physics/joints/slider_joint_sw.cpp | 6 | ||||
| -rw-r--r-- | servers/physics/joints/slider_joint_sw.h | 8 | ||||
| -rw-r--r-- | servers/physics/physics_server_sw.cpp | 36 | ||||
| -rw-r--r-- | servers/physics/physics_server_sw.h | 30 | ||||
| -rw-r--r-- | servers/physics/shape_sw.cpp | 108 | ||||
| -rw-r--r-- | servers/physics/shape_sw.h | 40 | ||||
| -rw-r--r-- | servers/physics/space_sw.cpp | 24 | ||||
| -rw-r--r-- | servers/physics/space_sw.h | 18 | ||||
| -rw-r--r-- | servers/physics/step_sw.cpp | 8 | ||||
| -rw-r--r-- | servers/physics/step_sw.h | 8 | ||||
| -rw-r--r-- | servers/physics_2d/area_2d_sw.h | 30 | ||||
| -rw-r--r-- | servers/physics_2d/area_pair_2d_sw.cpp | 8 | ||||
| -rw-r--r-- | servers/physics_2d/area_pair_2d_sw.h | 8 | ||||
| -rw-r--r-- | servers/physics_2d/body_2d_sw.cpp | 10 | ||||
| -rw-r--r-- | servers/physics_2d/body_2d_sw.h | 24 | ||||
| -rw-r--r-- | servers/physics_2d/body_pair_2d_sw.cpp | 12 | ||||
| -rw-r--r-- | servers/physics_2d/body_pair_2d_sw.h | 8 | ||||
| -rw-r--r-- | servers/physics_2d/broad_phase_2d_hash_grid.cpp | 2 | ||||
| -rw-r--r-- | servers/physics_2d/collision_solver_2d_sat.cpp | 42 | ||||
| -rw-r--r-- | servers/physics_2d/collision_solver_2d_sat.h | 2 | ||||
| -rw-r--r-- | servers/physics_2d/collision_solver_2d_sw.cpp | 8 | ||||
| -rw-r--r-- | servers/physics_2d/collision_solver_2d_sw.h | 4 | ||||
| -rw-r--r-- | servers/physics_2d/constraint_2d_sw.h | 4 | ||||
| -rw-r--r-- | servers/physics_2d/joints_2d_sw.cpp | 18 | ||||
| -rw-r--r-- | servers/physics_2d/joints_2d_sw.h | 16 | ||||
| -rw-r--r-- | servers/physics_2d/physics_2d_server_sw.cpp | 28 | ||||
| -rw-r--r-- | servers/physics_2d/physics_2d_server_sw.h | 22 | ||||
| -rw-r--r-- | servers/physics_2d/physics_2d_server_wrap_mt.cpp | 4 | ||||
| -rw-r--r-- | servers/physics_2d/physics_2d_server_wrap_mt.h | 24 | ||||
| -rw-r--r-- | servers/physics_2d/shape_2d_sw.cpp | 42 | ||||
| -rw-r--r-- | servers/physics_2d/shape_2d_sw.h | 26 | ||||
| -rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 60 | ||||
| -rw-r--r-- | servers/physics_2d/space_2d_sw.h | 18 | ||||
| -rw-r--r-- | servers/physics_2d/step_2d_sw.cpp | 8 | ||||
| -rw-r--r-- | servers/physics_2d/step_2d_sw.h | 8 | ||||
| -rw-r--r-- | servers/physics_2d_server.cpp | 310 | ||||
| -rw-r--r-- | servers/physics_server.cpp | 344 | ||||
| -rw-r--r-- | servers/register_server_types.cpp | 2 | ||||
| -rw-r--r-- | servers/visual/rasterizer.h | 5 | ||||
| -rw-r--r-- | servers/visual/shader_language.cpp | 4 | ||||
| -rw-r--r-- | servers/visual/shader_types.cpp | 28 | ||||
| -rw-r--r-- | servers/visual/shader_types.h | 28 | ||||
| -rw-r--r-- | servers/visual/visual_server_canvas.cpp | 28 | ||||
| -rw-r--r-- | servers/visual/visual_server_canvas.h | 28 | ||||
| -rw-r--r-- | servers/visual/visual_server_global.cpp | 28 | ||||
| -rw-r--r-- | servers/visual/visual_server_global.h | 28 | ||||
| -rw-r--r-- | servers/visual/visual_server_light_baker.cpp | 28 | ||||
| -rw-r--r-- | servers/visual/visual_server_light_baker.h | 28 | ||||
| -rw-r--r-- | servers/visual/visual_server_raster.cpp | 2 | ||||
| -rw-r--r-- | servers/visual/visual_server_raster.h | 3 | ||||
| -rw-r--r-- | servers/visual/visual_server_scene.cpp | 36 | ||||
| -rw-r--r-- | servers/visual/visual_server_scene.h | 28 | ||||
| -rw-r--r-- | servers/visual/visual_server_viewport.cpp | 30 | ||||
| -rw-r--r-- | servers/visual/visual_server_viewport.h | 28 | ||||
| -rw-r--r-- | servers/visual_server.cpp | 24 | ||||
| -rw-r--r-- | servers/visual_server.h | 3 | ||||
| -rw-r--r-- | thirdparty/README.md | 6 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/alpha_dec.c (renamed from thirdparty/libwebp/dec/alpha.c) | 8 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/alphai_dec.h (renamed from thirdparty/libwebp/dec/alphai.h) | 4 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/buffer_dec.c (renamed from thirdparty/libwebp/dec/buffer.c) | 4 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/common_dec.h (renamed from thirdparty/libwebp/dec/common.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/frame_dec.c (renamed from thirdparty/libwebp/dec/frame.c) | 4 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/idec_dec.c (renamed from thirdparty/libwebp/dec/idec.c) | 6 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/io_dec.c (renamed from thirdparty/libwebp/dec/io.c) | 113 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/quant_dec.c (renamed from thirdparty/libwebp/dec/quant.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/tree_dec.c (renamed from thirdparty/libwebp/dec/tree.c) | 7 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/vp8_dec.c (renamed from thirdparty/libwebp/dec/vp8.c) | 72 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/vp8_dec.h (renamed from thirdparty/libwebp/dec/decode_vp8.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/vp8i_dec.h (renamed from thirdparty/libwebp/dec/vp8i.h) | 14 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/vp8l_dec.c (renamed from thirdparty/libwebp/dec/vp8l.c) | 37 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/vp8li_dec.h (renamed from thirdparty/libwebp/dec/vp8li.h) | 8 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/webp_dec.c (renamed from thirdparty/libwebp/dec/webp.c) | 17 | ||||
| -rw-r--r-- | thirdparty/libwebp/dec/webpi_dec.h (renamed from thirdparty/libwebp/dec/webpi.h) | 17 | ||||
| -rw-r--r-- | thirdparty/libwebp/demux/demux.c | 5 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/alpha_processing.c | 38 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/alpha_processing_neon.c | 191 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/alpha_processing_sse2.c | 141 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/common_sse2.h | 85 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/cost.c | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/cost_mips32.c | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/cost_mips_dsp_r2.c | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/cost_sse2.c | 4 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/cpu.c | 45 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/dec.c | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/dec_clip_tables.c | 8 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/dec_msa.c | 847 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/dec_neon.c | 40 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/dec_sse2.c | 4 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/dec_sse41.c | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/dsp.h | 57 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/enc.c | 178 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/enc_mips32.c | 4 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/enc_mips_dsp_r2.c | 4 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/enc_msa.c | 892 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/enc_neon.c | 42 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/enc_sse2.c | 182 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/enc_sse41.c | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/filters.c | 12 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/filters_msa.c | 202 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/filters_neon.c | 327 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless.c | 186 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless.h | 225 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless_common.h | 210 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless_enc.c | 953 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless_enc_mips32.c | 47 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless_enc_msa.c | 147 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless_enc_sse2.c | 320 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless_enc_sse41.c | 4 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless_mips_dsp_r2.c | 79 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless_msa.c | 355 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless_neon.c | 395 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/lossless_sse2.c | 389 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/msa_macro.h | 1097 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/neon.h | 18 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/rescaler.c | 8 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/rescaler_mips32.c | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/rescaler_mips_dsp_r2.c | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/rescaler_msa.c | 444 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/rescaler_neon.c | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/rescaler_sse2.c | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/upsampling.c | 6 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/upsampling_msa.c | 678 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/upsampling_neon.c | 77 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/yuv.c | 57 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/yuv.h | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/yuv_sse2.c | 304 | ||||
| -rw-r--r-- | thirdparty/libwebp/dsp/yuv_tables_sse2.h | 536 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/alpha_enc.c (renamed from thirdparty/libwebp/enc/alpha.c) | 8 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/analysis_enc.c (renamed from thirdparty/libwebp/enc/analysis.c) | 47 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/backward_references_enc.c (renamed from thirdparty/libwebp/enc/backward_references.c) | 327 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/backward_references_enc.h (renamed from thirdparty/libwebp/enc/backward_references.h) | 3 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/config_enc.c (renamed from thirdparty/libwebp/enc/config.c) | 91 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/cost_enc.c (renamed from thirdparty/libwebp/enc/cost.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/cost_enc.h (renamed from thirdparty/libwebp/enc/cost.h) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/delta_palettization_enc.c (renamed from thirdparty/libwebp/enc/delta_palettization.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/delta_palettization_enc.h (renamed from thirdparty/libwebp/enc/delta_palettization.h) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/filter_enc.c (renamed from thirdparty/libwebp/enc/filter.c) | 107 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/frame_enc.c (renamed from thirdparty/libwebp/enc/frame.c) | 10 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/histogram_enc.c (renamed from thirdparty/libwebp/enc/histogram.c) | 304 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/histogram_enc.h (renamed from thirdparty/libwebp/enc/histogram.h) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/iterator_enc.c (renamed from thirdparty/libwebp/enc/iterator.c) | 19 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/near_lossless_enc.c (renamed from thirdparty/libwebp/enc/near_lossless.c) | 4 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/picture_csp_enc.c (renamed from thirdparty/libwebp/enc/picture_csp.c) | 269 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/picture_enc.c (renamed from thirdparty/libwebp/enc/picture.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/picture_psnr.c | 177 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/picture_psnr_enc.c | 213 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/picture_rescale_enc.c (renamed from thirdparty/libwebp/enc/picture_rescale.c) | 4 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/picture_tools_enc.c (renamed from thirdparty/libwebp/enc/picture_tools.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/predictor_enc.c | 750 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/quant_enc.c (renamed from thirdparty/libwebp/enc/quant.c) | 21 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/syntax_enc.c (renamed from thirdparty/libwebp/enc/syntax.c) | 5 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/token_enc.c (renamed from thirdparty/libwebp/enc/token.c) | 7 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/tree_enc.c (renamed from thirdparty/libwebp/enc/tree.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/vp8i_enc.h (renamed from thirdparty/libwebp/enc/vp8enci.h) | 19 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/vp8l_enc.c (renamed from thirdparty/libwebp/enc/vp8l.c) | 253 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/vp8li_enc.h (renamed from thirdparty/libwebp/enc/vp8li.h) | 22 | ||||
| -rw-r--r-- | thirdparty/libwebp/enc/webp_enc.c (renamed from thirdparty/libwebp/enc/webpenc.c) | 27 | ||||
| -rw-r--r-- | thirdparty/libwebp/mux/anim_encode.c | 51 | ||||
| -rw-r--r-- | thirdparty/libwebp/mux/animi.h | 43 | ||||
| -rw-r--r-- | thirdparty/libwebp/mux/muxedit.c | 157 | ||||
| -rw-r--r-- | thirdparty/libwebp/mux/muxi.h | 16 | ||||
| -rw-r--r-- | thirdparty/libwebp/mux/muxinternal.c | 21 | ||||
| -rw-r--r-- | thirdparty/libwebp/mux/muxread.c | 48 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/bit_reader_inl_utils.h (renamed from thirdparty/libwebp/utils/bit_reader_inl.h) | 79 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/bit_reader_utils.c (renamed from thirdparty/libwebp/utils/bit_reader.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/bit_reader_utils.h (renamed from thirdparty/libwebp/utils/bit_reader.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/bit_writer_utils.c (renamed from thirdparty/libwebp/utils/bit_writer.c) | 10 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/bit_writer_utils.h (renamed from thirdparty/libwebp/utils/bit_writer.h) | 3 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/color_cache_utils.c (renamed from thirdparty/libwebp/utils/color_cache.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/color_cache_utils.h (renamed from thirdparty/libwebp/utils/color_cache.h) | 15 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/endian_inl_utils.h (renamed from thirdparty/libwebp/utils/endian_inl.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/filters_utils.c (renamed from thirdparty/libwebp/utils/filters.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/filters_utils.h (renamed from thirdparty/libwebp/utils/filters.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/huffman_encode_utils.c (renamed from thirdparty/libwebp/utils/huffman_encode.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/huffman_encode_utils.h (renamed from thirdparty/libwebp/utils/huffman_encode.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/huffman_utils.c (renamed from thirdparty/libwebp/utils/huffman.c) | 48 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/huffman_utils.h (renamed from thirdparty/libwebp/utils/huffman.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/quant_levels_dec_utils.c (renamed from thirdparty/libwebp/utils/quant_levels_dec.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/quant_levels_dec_utils.h (renamed from thirdparty/libwebp/utils/quant_levels_dec.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/quant_levels_utils.c (renamed from thirdparty/libwebp/utils/quant_levels.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/quant_levels_utils.h (renamed from thirdparty/libwebp/utils/quant_levels.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/random_utils.c (renamed from thirdparty/libwebp/utils/random.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/random_utils.h (renamed from thirdparty/libwebp/utils/random.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/rescaler_utils.c (renamed from thirdparty/libwebp/utils/rescaler.c) | 2 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/rescaler_utils.h (renamed from thirdparty/libwebp/utils/rescaler.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/thread_utils.c (renamed from thirdparty/libwebp/utils/thread.c) | 8 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/thread_utils.h (renamed from thirdparty/libwebp/utils/thread.h) | 0 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/utils.c | 37 | ||||
| -rw-r--r-- | thirdparty/libwebp/utils/utils.h | 50 | ||||
| -rw-r--r-- | thirdparty/libwebp/webp/config.h | 150 | ||||
| -rw-r--r-- | thirdparty/libwebp/webp/encode.h | 35 | ||||
| -rw-r--r-- | thirdparty/libwebp/webp/format_constants.h | 3 | ||||
| -rw-r--r-- | thirdparty/libwebp/webp/mux.h | 50 | ||||
| -rw-r--r-- | thirdparty/libwebp/webp/mux_types.h | 5 | ||||
| -rw-r--r-- | tools/editor/editor_import_export.h | 425 | ||||
| -rw-r--r-- | tools/editor/import/resource_importer_csv_translation.h | 27 | ||||
| -rw-r--r-- | tools/editor/import/resource_importer_obj.h | 28 | ||||
| -rw-r--r-- | tools/editor/import/resource_importer_texture.h | 70 | ||||
| -rw-r--r-- | tools/editor/import/resource_importer_wav.h | 30 | ||||
| -rw-r--r-- | tools/editor/import_dock.h | 42 | ||||
| -rw-r--r-- | tools/editor/project_export.cpp | 2130 | ||||
| -rw-r--r-- | tools/editor/project_export.h | 246 |
2762 files changed, 30880 insertions, 18114 deletions
diff --git a/.gitignore b/.gitignore index f7eac1122d..cdf277dd71 100644 --- a/.gitignore +++ b/.gitignore @@ -16,12 +16,12 @@ core/method_bind_ext.inc core/script_encryption_key.cpp core/global_defaults.cpp drivers/unix/os_unix_global_settings_path.cpp -tools/editor/register_exporters.cpp -tools/editor/doc_data_compressed.h -tools/editor/certs_compressed.h -tools/editor/editor_icons.cpp -tools/editor/translations.h -tools/editor/builtin_fonts.h +editor/register_exporters.cpp +editor/doc_data_compressed.h +editor/certs_compressed.h +editor/editor_icons.cpp +editor/translations.h +editor/builtin_fonts.h .fscache make.bat log.txt @@ -246,6 +246,9 @@ node_modules/ #Kdevelop project files *.kdev4 +# xCode +xcuserdata + # RIA/Silverlight projects Generated_Code/ diff --git a/SConstruct b/SConstruct index 4c79304ef2..2e7683d17a 100644 --- a/SConstruct +++ b/SConstruct @@ -179,7 +179,7 @@ Help(opts.GenerateHelpText(env_base)) # generate help # add default include paths -env_base.Append(CPPPATH=['#core', '#core/math', '#tools', '#drivers', '#']) +env_base.Append(CPPPATH=['#core', '#core/math', '#editor', '#drivers', '#']) # configure ENV for platform env_base.platform_exporters = platform_exporters @@ -358,7 +358,7 @@ if selected_platform in platform_list: SConscript("core/SCsub") SConscript("servers/SCsub") SConscript("scene/SCsub") - SConscript("tools/editor/SCsub") + SConscript("editor/SCsub") SConscript("drivers/SCsub") SConscript("modules/SCsub") diff --git a/core/SCsub b/core/SCsub index 8d89f6427b..77c8288846 100644 --- a/core/SCsub +++ b/core/SCsub @@ -13,7 +13,7 @@ for x in env.global_defaults: gd_inc += '#include "platform/' + x + '/globals/global_defaults.h"\n' gd_call += "\tregister_" + x + "_global_defaults();\n" -gd_cpp = '#include "globals.h"\n' +gd_cpp = '#include "global_config.h"\n' gd_cpp += gd_inc gd_cpp += "void GlobalConfig::register_global_defaults() {\n" + gd_call + "\n}\n" @@ -45,7 +45,7 @@ if ("SCRIPT_AES256_ENCRYPTION_KEY" in os.environ): print("Invalid AES256 encryption key, not 64 bits hex: " + e) f = open("script_encryption_key.cpp", "wb") -f.write("#include \"globals.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n") +f.write("#include \"global_config.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n") f.close() @@ -61,6 +61,7 @@ SConscript('os/SCsub') SConscript('math/SCsub') SConscript('io/SCsub') SConscript('bind/SCsub') +SConscript('helper/SCsub') lib = env.Library("core", env.core_sources) diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 636a3f07c1..08e1a311fa 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -31,7 +31,7 @@ #include "geometry.h" #include "io/marshalls.h" #include "io/base64.h" -#include "core/globals.h" +#include "core/global_config.h" #include "io/file_access_encrypted.h" #include "os/keyboard.h" @@ -110,12 +110,12 @@ bool _ResourceLoader::has(const String &p_path) { void _ResourceLoader::_bind_methods() { - ClassDB::bind_method(_MD("load_interactive:ResourceInteractiveLoader","path","type_hint"),&_ResourceLoader::load_interactive,DEFVAL("")); - ClassDB::bind_method(_MD("load:Resource","path","type_hint", "p_no_cache"),&_ResourceLoader::load,DEFVAL(""), DEFVAL(false)); - ClassDB::bind_method(_MD("get_recognized_extensions_for_type","type"),&_ResourceLoader::get_recognized_extensions_for_type); - ClassDB::bind_method(_MD("set_abort_on_missing_resources","abort"),&_ResourceLoader::set_abort_on_missing_resources); - ClassDB::bind_method(_MD("get_dependencies","path"),&_ResourceLoader::get_dependencies); - ClassDB::bind_method(_MD("has","path"),&_ResourceLoader::has); + ClassDB::bind_method(D_METHOD("load_interactive:ResourceInteractiveLoader","path","type_hint"),&_ResourceLoader::load_interactive,DEFVAL("")); + ClassDB::bind_method(D_METHOD("load:Resource","path","type_hint", "p_no_cache"),&_ResourceLoader::load,DEFVAL(""), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_recognized_extensions_for_type","type"),&_ResourceLoader::get_recognized_extensions_for_type); + ClassDB::bind_method(D_METHOD("set_abort_on_missing_resources","abort"),&_ResourceLoader::set_abort_on_missing_resources); + ClassDB::bind_method(D_METHOD("get_dependencies","path"),&_ResourceLoader::get_dependencies); + ClassDB::bind_method(D_METHOD("has","path"),&_ResourceLoader::has); } _ResourceLoader::_ResourceLoader() { @@ -148,8 +148,8 @@ _ResourceSaver *_ResourceSaver::singleton=NULL; void _ResourceSaver::_bind_methods() { - ClassDB::bind_method(_MD("save","path","resource:Resource","flags"),&_ResourceSaver::save,DEFVAL(0)); - ClassDB::bind_method(_MD("get_recognized_extensions","type"),&_ResourceSaver::get_recognized_extensions); + ClassDB::bind_method(D_METHOD("save","path","resource:Resource","flags"),&_ResourceSaver::save,DEFVAL(0)); + ClassDB::bind_method(D_METHOD("get_recognized_extensions","type"),&_ResourceSaver::get_recognized_extensions); BIND_CONSTANT(FLAG_RELATIVE_PATHS); BIND_CONSTANT(FLAG_BUNDLE_RESOURCES); @@ -450,6 +450,17 @@ bool _OS::is_vsync_enabled() const { return OS::get_singleton()->is_vsync_enabled(); } +PowerState _OS::get_power_state() { + return OS::get_singleton()->get_power_state(); +} + +int _OS::get_power_seconds_left() { + return OS::get_singleton()->get_power_seconds_left(); +} + +int _OS::get_power_percent_left() { + return OS::get_singleton()->get_power_percent_left(); +} /* enum Weekday { @@ -973,145 +984,149 @@ _OS *_OS::singleton=NULL; void _OS::_bind_methods() { - //ClassDB::bind_method(_MD("get_mouse_pos"),&_OS::get_mouse_pos); - //ClassDB::bind_method(_MD("is_mouse_grab_enabled"),&_OS::is_mouse_grab_enabled); + //ClassDB::bind_method(D_METHOD("get_mouse_pos"),&_OS::get_mouse_pos); + //ClassDB::bind_method(D_METHOD("is_mouse_grab_enabled"),&_OS::is_mouse_grab_enabled); - ClassDB::bind_method(_MD("set_clipboard","clipboard"),&_OS::set_clipboard); - ClassDB::bind_method(_MD("get_clipboard"),&_OS::get_clipboard); + ClassDB::bind_method(D_METHOD("set_clipboard","clipboard"),&_OS::set_clipboard); + ClassDB::bind_method(D_METHOD("get_clipboard"),&_OS::get_clipboard); //will not delete for now, just unexpose - //ClassDB::bind_method(_MD("set_video_mode","size","fullscreen","resizable","screen"),&_OS::set_video_mode,DEFVAL(0)); - //ClassDB::bind_method(_MD("get_video_mode_size","screen"),&_OS::get_video_mode,DEFVAL(0)); - //ClassDB::bind_method(_MD("is_video_mode_fullscreen","screen"),&_OS::is_video_mode_fullscreen,DEFVAL(0)); - //ClassDB::bind_method(_MD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0)); - //ClassDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0)); - - - ClassDB::bind_method(_MD("get_screen_count"),&_OS::get_screen_count); - ClassDB::bind_method(_MD("get_current_screen"),&_OS::get_current_screen); - ClassDB::bind_method(_MD("set_current_screen","screen"),&_OS::set_current_screen); - ClassDB::bind_method(_MD("get_screen_position","screen"),&_OS::get_screen_position,DEFVAL(0)); - ClassDB::bind_method(_MD("get_screen_size","screen"),&_OS::get_screen_size,DEFVAL(0)); - ClassDB::bind_method(_MD("get_screen_dpi","screen"),&_OS::get_screen_dpi,DEFVAL(0)); - ClassDB::bind_method(_MD("get_window_position"),&_OS::get_window_position); - ClassDB::bind_method(_MD("set_window_position","position"),&_OS::set_window_position); - ClassDB::bind_method(_MD("get_window_size"),&_OS::get_window_size); - ClassDB::bind_method(_MD("set_window_size","size"),&_OS::set_window_size); - ClassDB::bind_method(_MD("set_window_fullscreen","enabled"),&_OS::set_window_fullscreen); - ClassDB::bind_method(_MD("is_window_fullscreen"),&_OS::is_window_fullscreen); - ClassDB::bind_method(_MD("set_window_resizable","enabled"),&_OS::set_window_resizable); - ClassDB::bind_method(_MD("is_window_resizable"),&_OS::is_window_resizable); - ClassDB::bind_method(_MD("set_window_minimized", "enabled"),&_OS::set_window_minimized); - ClassDB::bind_method(_MD("is_window_minimized"),&_OS::is_window_minimized); - ClassDB::bind_method(_MD("set_window_maximized", "enabled"),&_OS::set_window_maximized); - ClassDB::bind_method(_MD("is_window_maximized"),&_OS::is_window_maximized); - ClassDB::bind_method(_MD("request_attention"), &_OS::request_attention); - - ClassDB::bind_method(_MD("set_borderless_window", "borderless"), &_OS::set_borderless_window); - ClassDB::bind_method(_MD("get_borderless_window"), &_OS::get_borderless_window); - - ClassDB::bind_method(_MD("set_screen_orientation","orientation"),&_OS::set_screen_orientation); - ClassDB::bind_method(_MD("get_screen_orientation"),&_OS::get_screen_orientation); - - ClassDB::bind_method(_MD("set_keep_screen_on","enabled"),&_OS::set_keep_screen_on); - ClassDB::bind_method(_MD("is_keep_screen_on"),&_OS::is_keep_screen_on); - - - ClassDB::bind_method(_MD("has_touchscreen_ui_hint"),&_OS::has_touchscreen_ui_hint); - - ClassDB::bind_method(_MD("set_window_title","title"),&_OS::set_window_title); - - ClassDB::bind_method(_MD("set_low_processor_usage_mode","enable"),&_OS::set_low_processor_usage_mode); - ClassDB::bind_method(_MD("is_in_low_processor_usage_mode"),&_OS::is_in_low_processor_usage_mode); - - ClassDB::bind_method(_MD("get_processor_count"),&_OS::get_processor_count); - - ClassDB::bind_method(_MD("get_executable_path"),&_OS::get_executable_path); - ClassDB::bind_method(_MD("execute","path","arguments","blocking","output"),&_OS::execute,DEFVAL(Array())); - ClassDB::bind_method(_MD("kill","pid"),&_OS::kill); - ClassDB::bind_method(_MD("shell_open","uri"),&_OS::shell_open); - ClassDB::bind_method(_MD("get_process_ID"),&_OS::get_process_ID); - - ClassDB::bind_method(_MD("get_environment","environment"),&_OS::get_environment); - ClassDB::bind_method(_MD("has_environment","environment"),&_OS::has_environment); - - ClassDB::bind_method(_MD("get_name"),&_OS::get_name); - ClassDB::bind_method(_MD("get_cmdline_args"),&_OS::get_cmdline_args); - - ClassDB::bind_method(_MD("get_datetime","utc"),&_OS::get_datetime,DEFVAL(false)); - ClassDB::bind_method(_MD("get_date","utc"),&_OS::get_date,DEFVAL(false)); - ClassDB::bind_method(_MD("get_time","utc"),&_OS::get_time,DEFVAL(false)); - ClassDB::bind_method(_MD("get_time_zone_info"),&_OS::get_time_zone_info); - ClassDB::bind_method(_MD("get_unix_time"),&_OS::get_unix_time); - ClassDB::bind_method(_MD("get_datetime_from_unix_time", "unix_time_val"), + //ClassDB::bind_method(D_METHOD("set_video_mode","size","fullscreen","resizable","screen"),&_OS::set_video_mode,DEFVAL(0)); + //ClassDB::bind_method(D_METHOD("get_video_mode_size","screen"),&_OS::get_video_mode,DEFVAL(0)); + //ClassDB::bind_method(D_METHOD("is_video_mode_fullscreen","screen"),&_OS::is_video_mode_fullscreen,DEFVAL(0)); + //ClassDB::bind_method(D_METHOD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0)); + //ClassDB::bind_method(D_METHOD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0)); + + + ClassDB::bind_method(D_METHOD("get_screen_count"),&_OS::get_screen_count); + ClassDB::bind_method(D_METHOD("get_current_screen"),&_OS::get_current_screen); + ClassDB::bind_method(D_METHOD("set_current_screen","screen"),&_OS::set_current_screen); + ClassDB::bind_method(D_METHOD("get_screen_position","screen"),&_OS::get_screen_position,DEFVAL(0)); + ClassDB::bind_method(D_METHOD("get_screen_size","screen"),&_OS::get_screen_size,DEFVAL(0)); + ClassDB::bind_method(D_METHOD("get_screen_dpi","screen"),&_OS::get_screen_dpi,DEFVAL(0)); + ClassDB::bind_method(D_METHOD("get_window_position"),&_OS::get_window_position); + ClassDB::bind_method(D_METHOD("set_window_position","position"),&_OS::set_window_position); + ClassDB::bind_method(D_METHOD("get_window_size"),&_OS::get_window_size); + ClassDB::bind_method(D_METHOD("set_window_size","size"),&_OS::set_window_size); + ClassDB::bind_method(D_METHOD("set_window_fullscreen","enabled"),&_OS::set_window_fullscreen); + ClassDB::bind_method(D_METHOD("is_window_fullscreen"),&_OS::is_window_fullscreen); + ClassDB::bind_method(D_METHOD("set_window_resizable","enabled"),&_OS::set_window_resizable); + ClassDB::bind_method(D_METHOD("is_window_resizable"),&_OS::is_window_resizable); + ClassDB::bind_method(D_METHOD("set_window_minimized", "enabled"),&_OS::set_window_minimized); + ClassDB::bind_method(D_METHOD("is_window_minimized"),&_OS::is_window_minimized); + ClassDB::bind_method(D_METHOD("set_window_maximized", "enabled"),&_OS::set_window_maximized); + ClassDB::bind_method(D_METHOD("is_window_maximized"),&_OS::is_window_maximized); + ClassDB::bind_method(D_METHOD("request_attention"), &_OS::request_attention); + + ClassDB::bind_method(D_METHOD("set_borderless_window", "borderless"), &_OS::set_borderless_window); + ClassDB::bind_method(D_METHOD("get_borderless_window"), &_OS::get_borderless_window); + + ClassDB::bind_method(D_METHOD("set_screen_orientation","orientation"),&_OS::set_screen_orientation); + ClassDB::bind_method(D_METHOD("get_screen_orientation"),&_OS::get_screen_orientation); + + ClassDB::bind_method(D_METHOD("set_keep_screen_on","enabled"),&_OS::set_keep_screen_on); + ClassDB::bind_method(D_METHOD("is_keep_screen_on"),&_OS::is_keep_screen_on); + + + ClassDB::bind_method(D_METHOD("has_touchscreen_ui_hint"),&_OS::has_touchscreen_ui_hint); + + ClassDB::bind_method(D_METHOD("set_window_title","title"),&_OS::set_window_title); + + ClassDB::bind_method(D_METHOD("set_low_processor_usage_mode","enable"),&_OS::set_low_processor_usage_mode); + ClassDB::bind_method(D_METHOD("is_in_low_processor_usage_mode"),&_OS::is_in_low_processor_usage_mode); + + ClassDB::bind_method(D_METHOD("get_processor_count"),&_OS::get_processor_count); + + ClassDB::bind_method(D_METHOD("get_executable_path"),&_OS::get_executable_path); + ClassDB::bind_method(D_METHOD("execute","path","arguments","blocking","output"),&_OS::execute,DEFVAL(Array())); + ClassDB::bind_method(D_METHOD("kill","pid"),&_OS::kill); + ClassDB::bind_method(D_METHOD("shell_open","uri"),&_OS::shell_open); + ClassDB::bind_method(D_METHOD("get_process_ID"),&_OS::get_process_ID); + + ClassDB::bind_method(D_METHOD("get_environment","environment"),&_OS::get_environment); + ClassDB::bind_method(D_METHOD("has_environment","environment"),&_OS::has_environment); + + ClassDB::bind_method(D_METHOD("get_name"),&_OS::get_name); + ClassDB::bind_method(D_METHOD("get_cmdline_args"),&_OS::get_cmdline_args); + + ClassDB::bind_method(D_METHOD("get_datetime","utc"),&_OS::get_datetime,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_date","utc"),&_OS::get_date,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_time","utc"),&_OS::get_time,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_time_zone_info"),&_OS::get_time_zone_info); + ClassDB::bind_method(D_METHOD("get_unix_time"),&_OS::get_unix_time); + ClassDB::bind_method(D_METHOD("get_datetime_from_unix_time", "unix_time_val"), &_OS::get_datetime_from_unix_time); - ClassDB::bind_method(_MD("get_unix_time_from_datetime", "datetime"), + ClassDB::bind_method(D_METHOD("get_unix_time_from_datetime", "datetime"), &_OS::get_unix_time_from_datetime); - ClassDB::bind_method(_MD("get_system_time_secs"), &_OS::get_system_time_secs); + ClassDB::bind_method(D_METHOD("get_system_time_secs"), &_OS::get_system_time_secs); + + ClassDB::bind_method(D_METHOD("set_icon","icon"),&_OS::set_icon); - ClassDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon); + ClassDB::bind_method(D_METHOD("get_exit_code"),&_OS::get_exit_code); + ClassDB::bind_method(D_METHOD("set_exit_code","code"),&_OS::set_exit_code); - ClassDB::bind_method(_MD("get_exit_code"),&_OS::get_exit_code); - ClassDB::bind_method(_MD("set_exit_code","code"),&_OS::set_exit_code); + ClassDB::bind_method(D_METHOD("delay_usec","usec"),&_OS::delay_usec); + ClassDB::bind_method(D_METHOD("delay_msec","msec"),&_OS::delay_msec); + ClassDB::bind_method(D_METHOD("get_ticks_msec"),&_OS::get_ticks_msec); + ClassDB::bind_method(D_METHOD("get_splash_tick_msec"),&_OS::get_splash_tick_msec); + ClassDB::bind_method(D_METHOD("get_locale"),&_OS::get_locale); + ClassDB::bind_method(D_METHOD("get_latin_keyboard_variant"),&_OS::get_latin_keyboard_variant); + ClassDB::bind_method(D_METHOD("get_model_name"),&_OS::get_model_name); - ClassDB::bind_method(_MD("delay_usec","usec"),&_OS::delay_usec); - ClassDB::bind_method(_MD("delay_msec","msec"),&_OS::delay_msec); - ClassDB::bind_method(_MD("get_ticks_msec"),&_OS::get_ticks_msec); - ClassDB::bind_method(_MD("get_splash_tick_msec"),&_OS::get_splash_tick_msec); - ClassDB::bind_method(_MD("get_locale"),&_OS::get_locale); - ClassDB::bind_method(_MD("get_latin_keyboard_variant"),&_OS::get_latin_keyboard_variant); - ClassDB::bind_method(_MD("get_model_name"),&_OS::get_model_name); + ClassDB::bind_method(D_METHOD("can_draw"),&_OS::can_draw); + ClassDB::bind_method(D_METHOD("is_stdout_verbose"),&_OS::is_stdout_verbose); - ClassDB::bind_method(_MD("can_draw"),&_OS::can_draw); - ClassDB::bind_method(_MD("is_stdout_verbose"),&_OS::is_stdout_verbose); + ClassDB::bind_method(D_METHOD("can_use_threads"),&_OS::can_use_threads); - ClassDB::bind_method(_MD("can_use_threads"),&_OS::can_use_threads); + ClassDB::bind_method(D_METHOD("is_debug_build"),&_OS::is_debug_build); - ClassDB::bind_method(_MD("is_debug_build"),&_OS::is_debug_build); + //ClassDB::bind_method(D_METHOD("get_mouse_button_state"),&_OS::get_mouse_button_state); - //ClassDB::bind_method(_MD("get_mouse_button_state"),&_OS::get_mouse_button_state); + ClassDB::bind_method(D_METHOD("dump_memory_to_file","file"),&_OS::dump_memory_to_file); + ClassDB::bind_method(D_METHOD("dump_resources_to_file","file"),&_OS::dump_resources_to_file); + ClassDB::bind_method(D_METHOD("has_virtual_keyboard"),&_OS::has_virtual_keyboard); + ClassDB::bind_method(D_METHOD("show_virtual_keyboard", "existing_text"),&_OS::show_virtual_keyboard,DEFVAL("")); + ClassDB::bind_method(D_METHOD("hide_virtual_keyboard"),&_OS::hide_virtual_keyboard); + ClassDB::bind_method(D_METHOD("print_resources_in_use","short"),&_OS::print_resources_in_use,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("print_all_resources","tofile"),&_OS::print_all_resources,DEFVAL("")); - ClassDB::bind_method(_MD("dump_memory_to_file","file"),&_OS::dump_memory_to_file); - ClassDB::bind_method(_MD("dump_resources_to_file","file"),&_OS::dump_resources_to_file); - ClassDB::bind_method(_MD("has_virtual_keyboard"),&_OS::has_virtual_keyboard); - ClassDB::bind_method(_MD("show_virtual_keyboard", "existing_text"),&_OS::show_virtual_keyboard,DEFVAL("")); - ClassDB::bind_method(_MD("hide_virtual_keyboard"),&_OS::hide_virtual_keyboard); - ClassDB::bind_method(_MD("print_resources_in_use","short"),&_OS::print_resources_in_use,DEFVAL(false)); - ClassDB::bind_method(_MD("print_all_resources","tofile"),&_OS::print_all_resources,DEFVAL("")); + ClassDB::bind_method(D_METHOD("get_static_memory_usage"),&_OS::get_static_memory_usage); + ClassDB::bind_method(D_METHOD("get_static_memory_peak_usage"),&_OS::get_static_memory_peak_usage); + ClassDB::bind_method(D_METHOD("get_dynamic_memory_usage"),&_OS::get_dynamic_memory_usage); - ClassDB::bind_method(_MD("get_static_memory_usage"),&_OS::get_static_memory_usage); - ClassDB::bind_method(_MD("get_static_memory_peak_usage"),&_OS::get_static_memory_peak_usage); - ClassDB::bind_method(_MD("get_dynamic_memory_usage"),&_OS::get_dynamic_memory_usage); + ClassDB::bind_method(D_METHOD("get_data_dir"),&_OS::get_data_dir); + ClassDB::bind_method(D_METHOD("get_system_dir","dir"),&_OS::get_system_dir); + ClassDB::bind_method(D_METHOD("get_unique_ID"),&_OS::get_unique_ID); - ClassDB::bind_method(_MD("get_data_dir"),&_OS::get_data_dir); - ClassDB::bind_method(_MD("get_system_dir","dir"),&_OS::get_system_dir); - ClassDB::bind_method(_MD("get_unique_ID"),&_OS::get_unique_ID); + ClassDB::bind_method(D_METHOD("is_ok_left_and_cancel_right"),&_OS::is_ok_left_and_cancel_right); - ClassDB::bind_method(_MD("is_ok_left_and_cancel_right"),&_OS::is_ok_left_and_cancel_right); + ClassDB::bind_method(D_METHOD("print_all_textures_by_size"),&_OS::print_all_textures_by_size); + ClassDB::bind_method(D_METHOD("print_resources_by_type","types"),&_OS::print_resources_by_type); - ClassDB::bind_method(_MD("print_all_textures_by_size"),&_OS::print_all_textures_by_size); - ClassDB::bind_method(_MD("print_resources_by_type","types"),&_OS::print_resources_by_type); + ClassDB::bind_method(D_METHOD("native_video_play","path","volume","audio_track","subtitle_track"),&_OS::native_video_play); + ClassDB::bind_method(D_METHOD("native_video_is_playing"),&_OS::native_video_is_playing); + ClassDB::bind_method(D_METHOD("native_video_stop"),&_OS::native_video_stop); + ClassDB::bind_method(D_METHOD("native_video_pause"),&_OS::native_video_pause); + ClassDB::bind_method(D_METHOD("native_video_unpause"),&_OS::native_video_unpause); - ClassDB::bind_method(_MD("native_video_play","path","volume","audio_track","subtitle_track"),&_OS::native_video_play); - ClassDB::bind_method(_MD("native_video_is_playing"),&_OS::native_video_is_playing); - ClassDB::bind_method(_MD("native_video_stop"),&_OS::native_video_stop); - ClassDB::bind_method(_MD("native_video_pause"),&_OS::native_video_pause); - ClassDB::bind_method(_MD("native_video_unpause"),&_OS::native_video_unpause); + ClassDB::bind_method(D_METHOD("get_scancode_string","code"),&_OS::get_scancode_string); + ClassDB::bind_method(D_METHOD("is_scancode_unicode","code"),&_OS::is_scancode_unicode); + ClassDB::bind_method(D_METHOD("find_scancode_from_string","string"),&_OS::find_scancode_from_string); - ClassDB::bind_method(_MD("get_scancode_string","code"),&_OS::get_scancode_string); - ClassDB::bind_method(_MD("is_scancode_unicode","code"),&_OS::is_scancode_unicode); - ClassDB::bind_method(_MD("find_scancode_from_string","string"),&_OS::find_scancode_from_string); + ClassDB::bind_method(D_METHOD("set_use_file_access_save_and_swap","enabled"),&_OS::set_use_file_access_save_and_swap); - ClassDB::bind_method(_MD("set_use_file_access_save_and_swap","enabled"),&_OS::set_use_file_access_save_and_swap); + ClassDB::bind_method(D_METHOD("alert","text","title"),&_OS::alert,DEFVAL("Alert!")); - ClassDB::bind_method(_MD("alert","text","title"),&_OS::alert,DEFVAL("Alert!")); + ClassDB::bind_method(D_METHOD("set_thread_name","name"),&_OS::set_thread_name); - ClassDB::bind_method(_MD("set_thread_name","name"),&_OS::set_thread_name); + ClassDB::bind_method(D_METHOD("set_use_vsync","enable"),&_OS::set_use_vsync); + ClassDB::bind_method(D_METHOD("is_vsync_enabled"),&_OS::is_vsync_enabled); - ClassDB::bind_method(_MD("set_use_vsync","enable"),&_OS::set_use_vsync); - ClassDB::bind_method(_MD("is_vsync_enabled"),&_OS::is_vsync_enabled); + ClassDB::bind_method(D_METHOD("get_power_state"),&_OS::get_power_state); + ClassDB::bind_method(D_METHOD("get_power_seconds_left"),&_OS::get_power_seconds_left); + ClassDB::bind_method(D_METHOD("get_power_percent_left"),&_OS::get_power_percent_left); BIND_CONSTANT( DAY_SUNDAY ); BIND_CONSTANT( DAY_MONDAY ); @@ -1150,6 +1165,12 @@ void _OS::_bind_methods() { BIND_CONSTANT( SYSTEM_DIR_MUSIC ); BIND_CONSTANT( SYSTEM_DIR_PICTURES ); BIND_CONSTANT( SYSTEM_DIR_RINGTONES ); + + BIND_CONSTANT( POWERSTATE_UNKNOWN ); + BIND_CONSTANT( POWERSTATE_ON_BATTERY ); + BIND_CONSTANT( POWERSTATE_NO_BATTERY ); + BIND_CONSTANT( POWERSTATE_CHARGING ); + BIND_CONSTANT( POWERSTATE_CHARGED ); } @@ -1221,11 +1242,26 @@ PoolVector<Vector3> _Geometry::get_closest_points_between_segments(const Vector3 return r; } +Vector2 _Geometry::get_closest_point_to_segment_2d(const Vector2& p_point, const Vector2& p_a,const Vector2& p_b) { + + Vector2 s[2]={p_a,p_b}; + return Geometry::get_closest_point_to_segment_2d(p_point,s); +} Vector3 _Geometry::get_closest_point_to_segment(const Vector3& p_point, const Vector3& p_a,const Vector3& p_b) { Vector3 s[2]={p_a,p_b}; return Geometry::get_closest_point_to_segment(p_point,s); } +Vector2 _Geometry::get_closest_point_to_segment_uncapped_2d(const Vector2& p_point, const Vector2& p_a,const Vector2& p_b) { + + Vector2 s[2]={p_a,p_b}; + return Geometry::get_closest_point_to_segment_uncapped_2d(p_point,s); +} +Vector3 _Geometry::get_closest_point_to_segment_uncapped(const Vector3& p_point, const Vector3& p_a,const Vector3& p_b) { + + Vector3 s[2]={p_a,p_b}; + return Geometry::get_closest_point_to_segment_uncapped(p_point,s); +} Variant _Geometry::ray_intersects_triangle( const Vector3& p_from, const Vector3& p_dir, const Vector3& p_v0,const Vector3& p_v1,const Vector3& p_v2) { Vector3 res; @@ -1333,29 +1369,33 @@ int _Geometry::get_uv84_normal_bit(const Vector3& p_vector) { void _Geometry::_bind_methods() { - ClassDB::bind_method(_MD("build_box_planes","extents"),&_Geometry::build_box_planes); - ClassDB::bind_method(_MD("build_cylinder_planes","radius","height","sides","axis"),&_Geometry::build_cylinder_planes,DEFVAL(Vector3::AXIS_Z)); - ClassDB::bind_method(_MD("build_capsule_planes","radius","height","sides","lats","axis"),&_Geometry::build_capsule_planes,DEFVAL(Vector3::AXIS_Z)); - ClassDB::bind_method(_MD("segment_intersects_circle","segment_from","segment_to","circle_pos","circle_radius"),&_Geometry::segment_intersects_circle); - ClassDB::bind_method(_MD("segment_intersects_segment_2d","from_a","to_a","from_b","to_b"),&_Geometry::segment_intersects_segment_2d); + ClassDB::bind_method(D_METHOD("build_box_planes","extents"),&_Geometry::build_box_planes); + ClassDB::bind_method(D_METHOD("build_cylinder_planes","radius","height","sides","axis"),&_Geometry::build_cylinder_planes,DEFVAL(Vector3::AXIS_Z)); + ClassDB::bind_method(D_METHOD("build_capsule_planes","radius","height","sides","lats","axis"),&_Geometry::build_capsule_planes,DEFVAL(Vector3::AXIS_Z)); + ClassDB::bind_method(D_METHOD("segment_intersects_circle","segment_from","segment_to","circle_pos","circle_radius"),&_Geometry::segment_intersects_circle); + ClassDB::bind_method(D_METHOD("segment_intersects_segment_2d","from_a","to_a","from_b","to_b"),&_Geometry::segment_intersects_segment_2d); + + ClassDB::bind_method(D_METHOD("get_closest_points_between_segments_2d","p1","q1","p2","q2"),&_Geometry::get_closest_points_between_segments_2d); + ClassDB::bind_method(D_METHOD("get_closest_points_between_segments","p1","p2","q1","q2"),&_Geometry::get_closest_points_between_segments); - ClassDB::bind_method(_MD("get_closest_points_between_segments_2d","p1","q1","p2","q2"),&_Geometry::get_closest_points_between_segments_2d); - ClassDB::bind_method(_MD("get_closest_points_between_segments","p1","p2","q1","q2"),&_Geometry::get_closest_points_between_segments); + ClassDB::bind_method(D_METHOD("get_closest_point_to_segment_2d","point","s1","s2"),&_Geometry::get_closest_point_to_segment_2d); + ClassDB::bind_method(D_METHOD("get_closest_point_to_segment","point","s1","s2"),&_Geometry::get_closest_point_to_segment); - ClassDB::bind_method(_MD("get_closest_point_to_segment","point","s1","s2"),&_Geometry::get_closest_point_to_segment); + ClassDB::bind_method(D_METHOD("get_closest_point_to_segment_uncapped_2d","point","s1","s2"),&_Geometry::get_closest_point_to_segment_uncapped_2d); + ClassDB::bind_method(D_METHOD("get_closest_point_to_segment_uncapped","point","s1","s2"),&_Geometry::get_closest_point_to_segment_uncapped); - ClassDB::bind_method(_MD("get_uv84_normal_bit","normal"),&_Geometry::get_uv84_normal_bit); + ClassDB::bind_method(D_METHOD("get_uv84_normal_bit","normal"),&_Geometry::get_uv84_normal_bit); - ClassDB::bind_method(_MD("ray_intersects_triangle","from","dir","a","b","c"),&_Geometry::ray_intersects_triangle); - ClassDB::bind_method(_MD("segment_intersects_triangle","from","to","a","b","c"),&_Geometry::segment_intersects_triangle); - ClassDB::bind_method(_MD("segment_intersects_sphere","from","to","spos","sradius"),&_Geometry::segment_intersects_sphere); - ClassDB::bind_method(_MD("segment_intersects_cylinder","from","to","height","radius"),&_Geometry::segment_intersects_cylinder); - ClassDB::bind_method(_MD("segment_intersects_convex","from","to","planes"),&_Geometry::segment_intersects_convex); - ClassDB::bind_method(_MD("point_is_inside_triangle","point","a","b","c"),&_Geometry::point_is_inside_triangle); + ClassDB::bind_method(D_METHOD("ray_intersects_triangle","from","dir","a","b","c"),&_Geometry::ray_intersects_triangle); + ClassDB::bind_method(D_METHOD("segment_intersects_triangle","from","to","a","b","c"),&_Geometry::segment_intersects_triangle); + ClassDB::bind_method(D_METHOD("segment_intersects_sphere","from","to","spos","sradius"),&_Geometry::segment_intersects_sphere); + ClassDB::bind_method(D_METHOD("segment_intersects_cylinder","from","to","height","radius"),&_Geometry::segment_intersects_cylinder); + ClassDB::bind_method(D_METHOD("segment_intersects_convex","from","to","planes"),&_Geometry::segment_intersects_convex); + ClassDB::bind_method(D_METHOD("point_is_inside_triangle","point","a","b","c"),&_Geometry::point_is_inside_triangle); - ClassDB::bind_method(_MD("triangulate_polygon","polygon"),&_Geometry::triangulate_polygon); + ClassDB::bind_method(D_METHOD("triangulate_polygon","polygon"),&_Geometry::triangulate_polygon); - ClassDB::bind_method(_MD("make_atlas","sizes"),&_Geometry::make_atlas); + ClassDB::bind_method(D_METHOD("make_atlas","sizes"),&_Geometry::make_atlas); } @@ -1735,52 +1775,52 @@ uint64_t _File::get_modified_time(const String &p_file) const { void _File::_bind_methods() { - ClassDB::bind_method(_MD("open_encrypted","path","mode_flags","key"),&_File::open_encrypted); - ClassDB::bind_method(_MD("open_encrypted_with_pass","path","mode_flags","pass"),&_File::open_encrypted_pass); - - ClassDB::bind_method(_MD("open","path","flags"),&_File::open); - ClassDB::bind_method(_MD("close"),&_File::close); - ClassDB::bind_method(_MD("is_open"),&_File::is_open); - ClassDB::bind_method(_MD("seek","pos"),&_File::seek); - ClassDB::bind_method(_MD("seek_end","pos"),&_File::seek_end,DEFVAL(0)); - ClassDB::bind_method(_MD("get_pos"),&_File::get_pos); - ClassDB::bind_method(_MD("get_len"),&_File::get_len); - ClassDB::bind_method(_MD("eof_reached"),&_File::eof_reached); - ClassDB::bind_method(_MD("get_8"),&_File::get_8); - ClassDB::bind_method(_MD("get_16"),&_File::get_16); - ClassDB::bind_method(_MD("get_32"),&_File::get_32); - ClassDB::bind_method(_MD("get_64"),&_File::get_64); - ClassDB::bind_method(_MD("get_float"),&_File::get_float); - ClassDB::bind_method(_MD("get_double"),&_File::get_double); - ClassDB::bind_method(_MD("get_real"),&_File::get_real); - ClassDB::bind_method(_MD("get_buffer","len"),&_File::get_buffer); - ClassDB::bind_method(_MD("get_line"),&_File::get_line); - ClassDB::bind_method(_MD("get_as_text"),&_File::get_as_text); - ClassDB::bind_method(_MD("get_md5","path"),&_File::get_md5); - ClassDB::bind_method(_MD("get_sha256","path"),&_File::get_sha256); - ClassDB::bind_method(_MD("get_endian_swap"),&_File::get_endian_swap); - ClassDB::bind_method(_MD("set_endian_swap","enable"),&_File::set_endian_swap); - ClassDB::bind_method(_MD("get_error:Error"),&_File::get_error); - ClassDB::bind_method(_MD("get_var"),&_File::get_var); - ClassDB::bind_method(_MD("get_csv_line","delim"),&_File::get_csv_line,DEFVAL(",")); - - ClassDB::bind_method(_MD("store_8","value"),&_File::store_8); - ClassDB::bind_method(_MD("store_16","value"),&_File::store_16); - ClassDB::bind_method(_MD("store_32","value"),&_File::store_32); - ClassDB::bind_method(_MD("store_64","value"),&_File::store_64); - ClassDB::bind_method(_MD("store_float","value"),&_File::store_float); - ClassDB::bind_method(_MD("store_double","value"),&_File::store_double); - ClassDB::bind_method(_MD("store_real","value"),&_File::store_real); - ClassDB::bind_method(_MD("store_buffer","buffer"),&_File::store_buffer); - ClassDB::bind_method(_MD("store_line","line"),&_File::store_line); - ClassDB::bind_method(_MD("store_string","string"),&_File::store_string); - ClassDB::bind_method(_MD("store_var","value"),&_File::store_var); - - ClassDB::bind_method(_MD("store_pascal_string","string"),&_File::store_pascal_string); - ClassDB::bind_method(_MD("get_pascal_string"),&_File::get_pascal_string); - - ClassDB::bind_method(_MD("file_exists","path"),&_File::file_exists); - ClassDB::bind_method(_MD("get_modified_time", "file"),&_File::get_modified_time); + ClassDB::bind_method(D_METHOD("open_encrypted","path","mode_flags","key"),&_File::open_encrypted); + ClassDB::bind_method(D_METHOD("open_encrypted_with_pass","path","mode_flags","pass"),&_File::open_encrypted_pass); + + ClassDB::bind_method(D_METHOD("open","path","flags"),&_File::open); + ClassDB::bind_method(D_METHOD("close"),&_File::close); + ClassDB::bind_method(D_METHOD("is_open"),&_File::is_open); + ClassDB::bind_method(D_METHOD("seek","pos"),&_File::seek); + ClassDB::bind_method(D_METHOD("seek_end","pos"),&_File::seek_end,DEFVAL(0)); + ClassDB::bind_method(D_METHOD("get_pos"),&_File::get_pos); + ClassDB::bind_method(D_METHOD("get_len"),&_File::get_len); + ClassDB::bind_method(D_METHOD("eof_reached"),&_File::eof_reached); + ClassDB::bind_method(D_METHOD("get_8"),&_File::get_8); + ClassDB::bind_method(D_METHOD("get_16"),&_File::get_16); + ClassDB::bind_method(D_METHOD("get_32"),&_File::get_32); + ClassDB::bind_method(D_METHOD("get_64"),&_File::get_64); + ClassDB::bind_method(D_METHOD("get_float"),&_File::get_float); + ClassDB::bind_method(D_METHOD("get_double"),&_File::get_double); + ClassDB::bind_method(D_METHOD("get_real"),&_File::get_real); + ClassDB::bind_method(D_METHOD("get_buffer","len"),&_File::get_buffer); + ClassDB::bind_method(D_METHOD("get_line"),&_File::get_line); + ClassDB::bind_method(D_METHOD("get_as_text"),&_File::get_as_text); + ClassDB::bind_method(D_METHOD("get_md5","path"),&_File::get_md5); + ClassDB::bind_method(D_METHOD("get_sha256","path"),&_File::get_sha256); + ClassDB::bind_method(D_METHOD("get_endian_swap"),&_File::get_endian_swap); + ClassDB::bind_method(D_METHOD("set_endian_swap","enable"),&_File::set_endian_swap); + ClassDB::bind_method(D_METHOD("get_error:Error"),&_File::get_error); + ClassDB::bind_method(D_METHOD("get_var"),&_File::get_var); + ClassDB::bind_method(D_METHOD("get_csv_line","delim"),&_File::get_csv_line,DEFVAL(",")); + + ClassDB::bind_method(D_METHOD("store_8","value"),&_File::store_8); + ClassDB::bind_method(D_METHOD("store_16","value"),&_File::store_16); + ClassDB::bind_method(D_METHOD("store_32","value"),&_File::store_32); + ClassDB::bind_method(D_METHOD("store_64","value"),&_File::store_64); + ClassDB::bind_method(D_METHOD("store_float","value"),&_File::store_float); + ClassDB::bind_method(D_METHOD("store_double","value"),&_File::store_double); + ClassDB::bind_method(D_METHOD("store_real","value"),&_File::store_real); + ClassDB::bind_method(D_METHOD("store_buffer","buffer"),&_File::store_buffer); + ClassDB::bind_method(D_METHOD("store_line","line"),&_File::store_line); + ClassDB::bind_method(D_METHOD("store_string","string"),&_File::store_string); + ClassDB::bind_method(D_METHOD("store_var","value"),&_File::store_var); + + ClassDB::bind_method(D_METHOD("store_pascal_string","string"),&_File::store_pascal_string); + ClassDB::bind_method(D_METHOD("get_pascal_string"),&_File::get_pascal_string); + + ClassDB::bind_method(D_METHOD("file_exists","path"),&_File::file_exists); + ClassDB::bind_method(D_METHOD("get_modified_time", "file"),&_File::get_modified_time); BIND_CONSTANT( READ ); BIND_CONSTANT( WRITE ); @@ -1970,25 +2010,25 @@ Error _Directory::remove(String p_name){ void _Directory::_bind_methods() { - ClassDB::bind_method(_MD("open:Error","path"),&_Directory::open); - ClassDB::bind_method(_MD("list_dir_begin", "skip_navigational", "skip_hidden"), &_Directory::list_dir_begin, DEFVAL(false), DEFVAL(false)); - ClassDB::bind_method(_MD("get_next"),&_Directory::get_next); - ClassDB::bind_method(_MD("current_is_dir"),&_Directory::current_is_dir); - ClassDB::bind_method(_MD("list_dir_end"),&_Directory::list_dir_end); - ClassDB::bind_method(_MD("get_drive_count"),&_Directory::get_drive_count); - ClassDB::bind_method(_MD("get_drive","idx"),&_Directory::get_drive); - ClassDB::bind_method(_MD("get_current_drive"),&_Directory::get_current_drive); - ClassDB::bind_method(_MD("change_dir:Error","todir"),&_Directory::change_dir); - ClassDB::bind_method(_MD("get_current_dir"),&_Directory::get_current_dir); - ClassDB::bind_method(_MD("make_dir:Error","path"),&_Directory::make_dir); - ClassDB::bind_method(_MD("make_dir_recursive:Error","path"),&_Directory::make_dir_recursive); - ClassDB::bind_method(_MD("file_exists","path"),&_Directory::file_exists); - ClassDB::bind_method(_MD("dir_exists","path"),&_Directory::dir_exists); - //ClassDB::bind_method(_MD("get_modified_time","file"),&_Directory::get_modified_time); - ClassDB::bind_method(_MD("get_space_left"),&_Directory::get_space_left); - ClassDB::bind_method(_MD("copy:Error","from","to"),&_Directory::copy); - ClassDB::bind_method(_MD("rename:Error","from","to"),&_Directory::rename); - ClassDB::bind_method(_MD("remove:Error","path"),&_Directory::remove); + ClassDB::bind_method(D_METHOD("open:Error","path"),&_Directory::open); + ClassDB::bind_method(D_METHOD("list_dir_begin", "skip_navigational", "skip_hidden"), &_Directory::list_dir_begin, DEFVAL(false), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_next"),&_Directory::get_next); + ClassDB::bind_method(D_METHOD("current_is_dir"),&_Directory::current_is_dir); + ClassDB::bind_method(D_METHOD("list_dir_end"),&_Directory::list_dir_end); + ClassDB::bind_method(D_METHOD("get_drive_count"),&_Directory::get_drive_count); + ClassDB::bind_method(D_METHOD("get_drive","idx"),&_Directory::get_drive); + ClassDB::bind_method(D_METHOD("get_current_drive"),&_Directory::get_current_drive); + ClassDB::bind_method(D_METHOD("change_dir:Error","todir"),&_Directory::change_dir); + ClassDB::bind_method(D_METHOD("get_current_dir"),&_Directory::get_current_dir); + ClassDB::bind_method(D_METHOD("make_dir:Error","path"),&_Directory::make_dir); + ClassDB::bind_method(D_METHOD("make_dir_recursive:Error","path"),&_Directory::make_dir_recursive); + ClassDB::bind_method(D_METHOD("file_exists","path"),&_Directory::file_exists); + ClassDB::bind_method(D_METHOD("dir_exists","path"),&_Directory::dir_exists); + //ClassDB::bind_method(D_METHOD("get_modified_time","file"),&_Directory::get_modified_time); + ClassDB::bind_method(D_METHOD("get_space_left"),&_Directory::get_space_left); + ClassDB::bind_method(D_METHOD("copy:Error","from","to"),&_Directory::copy); + ClassDB::bind_method(D_METHOD("rename:Error","from","to"),&_Directory::rename); + ClassDB::bind_method(D_METHOD("remove:Error","path"),&_Directory::remove); } @@ -2128,14 +2168,14 @@ String _Marshalls::base64_to_utf8(const String& p_str) { void _Marshalls::_bind_methods() { - ClassDB::bind_method(_MD("variant_to_base64:String","variant"),&_Marshalls::variant_to_base64); - ClassDB::bind_method(_MD("base64_to_variant:Variant","base64_str"),&_Marshalls::base64_to_variant); + ClassDB::bind_method(D_METHOD("variant_to_base64:String","variant"),&_Marshalls::variant_to_base64); + ClassDB::bind_method(D_METHOD("base64_to_variant:Variant","base64_str"),&_Marshalls::base64_to_variant); - ClassDB::bind_method(_MD("raw_to_base64:String","array"),&_Marshalls::raw_to_base64); - ClassDB::bind_method(_MD("base64_to_raw:RawArray","base64_str"),&_Marshalls::base64_to_raw); + ClassDB::bind_method(D_METHOD("raw_to_base64:String","array"),&_Marshalls::raw_to_base64); + ClassDB::bind_method(D_METHOD("base64_to_raw:RawArray","base64_str"),&_Marshalls::base64_to_raw); - ClassDB::bind_method(_MD("utf8_to_base64:String","utf8_str"),&_Marshalls::utf8_to_base64); - ClassDB::bind_method(_MD("base64_to_utf8:String","base64_str"),&_Marshalls::base64_to_utf8); + ClassDB::bind_method(D_METHOD("utf8_to_base64:String","utf8_str"),&_Marshalls::utf8_to_base64); + ClassDB::bind_method(D_METHOD("base64_to_utf8:String","base64_str"),&_Marshalls::base64_to_utf8); }; @@ -2159,8 +2199,8 @@ Error _Semaphore::post() { void _Semaphore::_bind_methods() { - ClassDB::bind_method(_MD("wait:Error"),&_Semaphore::wait); - ClassDB::bind_method(_MD("post:Error"),&_Semaphore::post); + ClassDB::bind_method(D_METHOD("wait:Error"),&_Semaphore::wait); + ClassDB::bind_method(D_METHOD("post:Error"),&_Semaphore::post); } @@ -2196,9 +2236,9 @@ void _Mutex::unlock(){ void _Mutex::_bind_methods() { - ClassDB::bind_method(_MD("lock"),&_Mutex::lock); - ClassDB::bind_method(_MD("try_lock:Error"),&_Mutex::try_lock); - ClassDB::bind_method(_MD("unlock"),&_Mutex::unlock); + ClassDB::bind_method(D_METHOD("lock"),&_Mutex::lock); + ClassDB::bind_method(D_METHOD("try_lock:Error"),&_Mutex::try_lock); + ClassDB::bind_method(D_METHOD("unlock"),&_Mutex::unlock); } @@ -2318,10 +2358,10 @@ Variant _Thread::wait_to_finish() { void _Thread::_bind_methods() { - ClassDB::bind_method(_MD("start:Error","instance","method","userdata","priority"),&_Thread::start,DEFVAL(Variant()),DEFVAL(PRIORITY_NORMAL)); - ClassDB::bind_method(_MD("get_id"),&_Thread::get_id); - ClassDB::bind_method(_MD("is_active"),&_Thread::is_active); - ClassDB::bind_method(_MD("wait_to_finish:Variant"),&_Thread::wait_to_finish); + ClassDB::bind_method(D_METHOD("start:Error","instance","method","userdata","priority"),&_Thread::start,DEFVAL(Variant()),DEFVAL(PRIORITY_NORMAL)); + ClassDB::bind_method(D_METHOD("get_id"),&_Thread::get_id); + ClassDB::bind_method(D_METHOD("is_active"),&_Thread::is_active); + ClassDB::bind_method(D_METHOD("wait_to_finish:Variant"),&_Thread::wait_to_finish); BIND_CONSTANT( PRIORITY_LOW ); BIND_CONSTANT( PRIORITY_NORMAL ); @@ -2506,31 +2546,31 @@ bool _ClassDB::is_class_enabled(StringName p_class) const { void _ClassDB::_bind_methods() { - ClassDB::bind_method(_MD("get_class_list"),&_ClassDB::get_class_list); - ClassDB::bind_method(_MD("get_inheriters_from_class","class"),&_ClassDB::get_inheriters_from_class); - ClassDB::bind_method(_MD("get_parent_class","class"),&_ClassDB::get_parent_class); - ClassDB::bind_method(_MD("class_exists","class"),&_ClassDB::class_exists); - ClassDB::bind_method(_MD("is_parent_class","class","inherits"),&_ClassDB::is_parent_class); - ClassDB::bind_method(_MD("can_instance","class"),&_ClassDB::can_instance); - ClassDB::bind_method(_MD("instance:Variant","class"),&_ClassDB::instance); + ClassDB::bind_method(D_METHOD("get_class_list"),&_ClassDB::get_class_list); + ClassDB::bind_method(D_METHOD("get_inheriters_from_class","class"),&_ClassDB::get_inheriters_from_class); + ClassDB::bind_method(D_METHOD("get_parent_class","class"),&_ClassDB::get_parent_class); + ClassDB::bind_method(D_METHOD("class_exists","class"),&_ClassDB::class_exists); + ClassDB::bind_method(D_METHOD("is_parent_class","class","inherits"),&_ClassDB::is_parent_class); + ClassDB::bind_method(D_METHOD("can_instance","class"),&_ClassDB::can_instance); + ClassDB::bind_method(D_METHOD("instance:Variant","class"),&_ClassDB::instance); - ClassDB::bind_method(_MD("class_has_signal","class","signal"),&_ClassDB::has_signal); - ClassDB::bind_method(_MD("class_get_signal","class","signal"),&_ClassDB::get_signal); - ClassDB::bind_method(_MD("class_get_signal_list","class","no_inheritance"),&_ClassDB::get_signal_list,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("class_has_signal","class","signal"),&_ClassDB::has_signal); + ClassDB::bind_method(D_METHOD("class_get_signal","class","signal"),&_ClassDB::get_signal); + ClassDB::bind_method(D_METHOD("class_get_signal_list","class","no_inheritance"),&_ClassDB::get_signal_list,DEFVAL(false)); - ClassDB::bind_method(_MD("class_get_property_list","class","no_inheritance"),&_ClassDB::get_property_list,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("class_get_property_list","class","no_inheritance"),&_ClassDB::get_property_list,DEFVAL(false)); - ClassDB::bind_method(_MD("class_has_method","class","method","no_inheritance"),&_ClassDB::has_method,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("class_has_method","class","method","no_inheritance"),&_ClassDB::has_method,DEFVAL(false)); - ClassDB::bind_method(_MD("class_get_method_list","class","no_inheritance"),&_ClassDB::get_method_list,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("class_get_method_list","class","no_inheritance"),&_ClassDB::get_method_list,DEFVAL(false)); - ClassDB::bind_method(_MD("class_get_integer_constant_list","class","no_inheritance"),&_ClassDB::get_integer_constant_list,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("class_get_integer_constant_list","class","no_inheritance"),&_ClassDB::get_integer_constant_list,DEFVAL(false)); - ClassDB::bind_method(_MD("class_has_integer_constant","class","name"),&_ClassDB::has_integer_constant); - ClassDB::bind_method(_MD("class_get_integer_constant","class","name"),&_ClassDB::get_integer_constant); + ClassDB::bind_method(D_METHOD("class_has_integer_constant","class","name"),&_ClassDB::has_integer_constant); + ClassDB::bind_method(D_METHOD("class_get_integer_constant","class","name"),&_ClassDB::get_integer_constant); - ClassDB::bind_method(_MD("class_get_category","class"),&_ClassDB::get_category); - ClassDB::bind_method(_MD("is_class_enabled","class"),&_ClassDB::is_class_enabled); + ClassDB::bind_method(D_METHOD("class_get_category","class"),&_ClassDB::get_category); + ClassDB::bind_method(D_METHOD("is_class_enabled","class"),&_ClassDB::is_class_enabled); } @@ -2604,22 +2644,22 @@ Dictionary _Engine::get_version_info() const { void _Engine::_bind_methods() { - ClassDB::bind_method(_MD("set_iterations_per_second","iterations_per_second"),&_Engine::set_iterations_per_second); - ClassDB::bind_method(_MD("get_iterations_per_second"),&_Engine::get_iterations_per_second); - ClassDB::bind_method(_MD("set_target_fps","target_fps"),&_Engine::set_target_fps); - ClassDB::bind_method(_MD("get_target_fps"),&_Engine::get_target_fps); + ClassDB::bind_method(D_METHOD("set_iterations_per_second","iterations_per_second"),&_Engine::set_iterations_per_second); + ClassDB::bind_method(D_METHOD("get_iterations_per_second"),&_Engine::get_iterations_per_second); + ClassDB::bind_method(D_METHOD("set_target_fps","target_fps"),&_Engine::set_target_fps); + ClassDB::bind_method(D_METHOD("get_target_fps"),&_Engine::get_target_fps); - ClassDB::bind_method(_MD("set_time_scale","time_scale"),&_Engine::set_time_scale); - ClassDB::bind_method(_MD("get_time_scale"),&_Engine::get_time_scale); + ClassDB::bind_method(D_METHOD("set_time_scale","time_scale"),&_Engine::set_time_scale); + ClassDB::bind_method(D_METHOD("get_time_scale"),&_Engine::get_time_scale); - ClassDB::bind_method(_MD("get_custom_level"),&_Engine::get_custom_level); + ClassDB::bind_method(D_METHOD("get_custom_level"),&_Engine::get_custom_level); - ClassDB::bind_method(_MD("get_frames_drawn"),&_Engine::get_frames_drawn); - ClassDB::bind_method(_MD("get_frames_per_second"),&_Engine::get_frames_per_second); + ClassDB::bind_method(D_METHOD("get_frames_drawn"),&_Engine::get_frames_drawn); + ClassDB::bind_method(D_METHOD("get_frames_per_second"),&_Engine::get_frames_per_second); - ClassDB::bind_method(_MD("get_main_loop:MainLoop"),&_Engine::get_main_loop); + ClassDB::bind_method(D_METHOD("get_main_loop:MainLoop"),&_Engine::get_main_loop); - ClassDB::bind_method(_MD("get_version_info"),&_Engine::get_version_info); + ClassDB::bind_method(D_METHOD("get_version_info"),&_Engine::get_version_info); } diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 00cbb254d6..6b9ae198ef 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -35,6 +35,7 @@ #include "os/dir_access.h" #include "os/thread.h" #include "os/semaphore.h" +#include "os/power.h" class _ResourceLoader : public Object { @@ -308,6 +309,10 @@ public: void set_use_vsync(bool p_enable); bool is_vsync_enabled() const; + PowerState get_power_state(); + int get_power_seconds_left(); + int get_power_percent_left(); + static _OS *get_singleton() { return singleton; } _OS(); @@ -334,7 +339,10 @@ public: Variant segment_intersects_segment_2d(const Vector2& p_from_a,const Vector2& p_to_a,const Vector2& p_from_b,const Vector2& p_to_b); PoolVector<Vector2> get_closest_points_between_segments_2d( const Vector2& p1,const Vector2& q1, const Vector2& p2,const Vector2& q2); PoolVector<Vector3> get_closest_points_between_segments(const Vector3& p1,const Vector3& p2,const Vector3& q1,const Vector3& q2); + Vector2 get_closest_point_to_segment_2d(const Vector2& p_point, const Vector2& p_a,const Vector2& p_b); Vector3 get_closest_point_to_segment(const Vector3& p_point, const Vector3& p_a,const Vector3& p_b); + Vector2 get_closest_point_to_segment_uncapped_2d(const Vector2& p_point, const Vector2& p_a,const Vector2& p_b); + Vector3 get_closest_point_to_segment_uncapped(const Vector3& p_point, const Vector3& p_a,const Vector3& p_b); Variant ray_intersects_triangle( const Vector3& p_from, const Vector3& p_dir, const Vector3& p_v0,const Vector3& p_v1,const Vector3& p_v2); Variant segment_intersects_triangle( const Vector3& p_from, const Vector3& p_to, const Vector3& p_v0,const Vector3& p_v1,const Vector3& p_v2); bool point_is_inside_triangle(const Vector2& s, const Vector2& a, const Vector2& b, const Vector2& c) const; diff --git a/core/class_db.cpp b/core/class_db.cpp index 2a3a12b127..4bdae45fb9 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -47,14 +47,14 @@ ParamDef::ParamDef(const Variant& p_variant) { used=true; val=p_variant; } -MethodDefinition _MD(const char* p_name) { +MethodDefinition D_METHOD(const char* p_name) { MethodDefinition md; md.name=StaticCString::create(p_name); return md; } -MethodDefinition _MD(const char* p_name,const char *p_arg1) { +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1) { MethodDefinition md; md.name=StaticCString::create(p_name); @@ -62,7 +62,7 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1) { return md; } -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2) { +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2) { MethodDefinition md; md.name=StaticCString::create(p_name); @@ -72,7 +72,7 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2) { return md; } -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3) { +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3) { MethodDefinition md; md.name=StaticCString::create(p_name); @@ -83,7 +83,7 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,co return md; } -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4) { +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4) { MethodDefinition md; md.name=StaticCString::create(p_name); @@ -95,7 +95,7 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,co return md; } -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5) { +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5) { MethodDefinition md; md.name=StaticCString::create(p_name); @@ -109,7 +109,7 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,co } -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6) { +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6) { MethodDefinition md; md.name=StaticCString::create(p_name); @@ -123,7 +123,7 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,co return md; } -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7) { +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7) { MethodDefinition md; md.name=StaticCString::create(p_name); @@ -138,7 +138,7 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,co return md; } -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8) { +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8) { MethodDefinition md; md.name=StaticCString::create(p_name); @@ -154,7 +154,7 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,co return md; } -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8,const char *p_arg9) { +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8,const char *p_arg9) { MethodDefinition md; md.name=StaticCString::create(p_name); @@ -171,7 +171,7 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,co return md; } -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8,const char *p_arg9,const char *p_arg10) { +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8,const char *p_arg9,const char *p_arg10) { MethodDefinition md; md.name=StaticCString::create(p_name); @@ -295,7 +295,7 @@ uint64_t ClassDB::get_api_hash(APIType p_api) { OBJTYPE_RLOCK; #ifdef DEBUG_METHODS_ENABLED - uint64_t hash = hash_djb2_one_64(HashMapHahserDefault::hash(VERSION_FULL_NAME)); + uint64_t hash = hash_djb2_one_64(HashMapHasherDefault::hash(VERSION_FULL_NAME)); List<StringName> names; @@ -1256,7 +1256,7 @@ void ClassDB::get_extensions_for_type(const StringName& p_class,List<String> *p_ while((K=resource_base_extensions.next(K))) { StringName cmp = resource_base_extensions[*K]; - if (is_parent_class(cmp,p_class)) + if (is_parent_class(p_class,cmp)) p_extensions->push_back(*K); } } diff --git a/core/class_db.h b/core/class_db.h index a09a42423b..6e02d0bf46 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -81,17 +81,17 @@ struct MethodDefinition { -MethodDefinition _MD(const char* p_name); -MethodDefinition _MD(const char* p_name,const char *p_arg1); -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2); -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3); -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4); -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5); -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6); -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7); -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8); -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8,const char *p_arg9); -MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8,const char *p_arg9,const char *p_arg10); +MethodDefinition D_METHOD(const char* p_name); +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1); +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2); +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3); +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4); +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5); +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6); +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7); +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8); +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8,const char *p_arg9); +MethodDefinition D_METHOD(const char* p_name,const char *p_arg1,const char *p_arg2,const char *p_arg3,const char *p_arg4,const char *p_arg5,const char *p_arg6,const char *p_arg7,const char *p_arg8,const char *p_arg9,const char *p_arg10); #else @@ -99,11 +99,13 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,co #ifdef NO_VARIADIC_MACROS -static _FORCE_INLINE_ const char* _MD(const char* m_name, ...) { return m_name; } +static _FORCE_INLINE_ const char* D_METHOD(const char* m_name, ...) { return m_name; } #else -#define _MD(m_c, ...) m_c +// When DEBUG_METHODS_ENABLED is set this will let the engine know +// the argument names for easier debugging. +#define D_METHOD(m_c, ...) m_c #endif diff --git a/core/compressed_translation.cpp b/core/compressed_translation.cpp index d39db5044b..570cf114f7 100644 --- a/core/compressed_translation.cpp +++ b/core/compressed_translation.cpp @@ -527,7 +527,7 @@ void PHashTranslation::_get_property_list( List<PropertyInfo> *p_list) const{ } void PHashTranslation::_bind_methods() { - ClassDB::bind_method(_MD("generate","from:Translation"),&PHashTranslation::generate); + ClassDB::bind_method(D_METHOD("generate","from:Translation"),&PHashTranslation::generate); } PHashTranslation::PHashTranslation() diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp index a173f98602..f8c6f47797 100644 --- a/core/core_string_names.cpp +++ b/core/core_string_names.cpp @@ -35,7 +35,7 @@ CoreStringNames::CoreStringNames() { _free=StaticCString::create("free"); changed=StaticCString::create("changed"); _meta=StaticCString::create("__meta__"); - _script=StaticCString::create("script/script"); + _script=StaticCString::create("script"); script_changed=StaticCString::create("script_changed"); ___pdcdata=StaticCString::create("___pdcdata"); __getvar=StaticCString::create("__getvar"); diff --git a/core/dvector.h b/core/dvector.h index 53a29738f7..456be41289 100644 --- a/core/dvector.h +++ b/core/dvector.h @@ -34,6 +34,7 @@ #include "pool_allocator.h" #include "safe_refcount.h" #include "os/rw_lock.h" +#include "ustring.h" struct MemoryPool { @@ -466,6 +467,16 @@ public: return OK; } + String join(String delimiter) { + String rs = ""; + int s = size(); + Read r = read(); + for(int i=0;i<s;i++) { + rs += r[i] + delimiter; + } + rs.erase( rs.length()-delimiter.length(), delimiter.length()); + return rs; + } bool is_locked() const { return alloc && alloc->lock>0; } diff --git a/core/func_ref.cpp b/core/func_ref.cpp index 1e8c229810..2233615e25 100644 --- a/core/func_ref.cpp +++ b/core/func_ref.cpp @@ -65,8 +65,8 @@ void FuncRef::_bind_methods() { } - ClassDB::bind_method(_MD("set_instance","instance"),&FuncRef::set_instance); - ClassDB::bind_method(_MD("set_function","name"),&FuncRef::set_function); + ClassDB::bind_method(D_METHOD("set_instance","instance"),&FuncRef::set_instance); + ClassDB::bind_method(D_METHOD("set_function","name"),&FuncRef::set_function); } diff --git a/core/globals.cpp b/core/global_config.cpp index ed0b6f6d8b..b76991c04e 100644 --- a/core/globals.cpp +++ b/core/global_config.cpp @@ -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. */ /*************************************************************************/ -#include "globals.h" +#include "global_config.h" #include "os/dir_access.h" #include "os/file_access.h" @@ -247,9 +247,22 @@ bool GlobalConfig::_load_resource_pack(const String& p_pack) { Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { - //an absolute mess of a function, must be cleaned up and reorganized somehow at some point + //If looking for files in network, just use network! - //_load_settings(p_path+"/override.cfg"); + if (FileAccessNetworkClient::get_singleton()) { + + if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { + + _load_settings("res://override.cfg"); + + } + + return OK; + } + + String exec_path = OS::get_singleton()->get_executable_path(); + + //Attempt with a passed main pack first if (p_main_pack!="") { @@ -257,8 +270,8 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { ERR_FAIL_COND_V(!ok,ERR_CANT_OPEN); if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { - - _load_settings("res://override.cfg"); + //load override from location of the main pack + _load_settings(p_main_pack.get_base_dir().plus_file("override.cfg")); } @@ -266,21 +279,15 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { } - if (OS::get_singleton()->get_executable_path()!="") { + //Attempt with execname.pck + if (exec_path!="") { - if (_load_resource_pack(OS::get_singleton()->get_executable_path())) { - if (p_path!="") { - resource_path=p_path; - } else { - DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - resource_path=d->get_current_dir(); - memdelete(d); + if (_load_resource_pack(exec_path.get_basename()+".pck")) { - } if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { - - _load_settings("res://override.cfg"); + //load override from location of executable + _load_settings(exec_path.get_base_dir().plus_file("override.cfg")); } @@ -292,31 +299,19 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { } - if (FileAccessNetworkClient::get_singleton()) { - - if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { - - _load_settings("res://override.cfg"); - - } - - return OK; - } - + //Try to use the filesystem for files, according to OS. (only Android -when reading from pck- and iOS use this) if (OS::get_singleton()->get_resource_dir()!="") { - //OS will call Globals->get_resource_path which will be empty if not overriden! + //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. + resource_path=OS::get_singleton()->get_resource_dir().replace("\\","/"); if (resource_path.length() && resource_path[ resource_path.length()-1]=='/') resource_path=resource_path.substr(0,resource_path.length()-1); // chop end - print_line("has res dir: "+resource_path); - if (!_load_resource_pack("res://data.pck")) - _load_resource_pack("res://data.zip"); - // make sure this is load from the resource path - print_line("exists engine cfg? "+itos(FileAccess::exists("/godot.cfg"))); + // data.pck and data.zip are deprecated and no longer supported, apologies. + // make sure this is loaded from the resource path + if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { - print_line("loaded godot.cfg"); _load_settings("res://override.cfg"); } @@ -324,67 +319,41 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { return OK; } - DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - if (!d) { - - resource_path = p_path; - - } else { - - d->change_dir(p_path); - - String candidate = d->get_current_dir(); - String current_dir = d->get_current_dir(); - String exec_name = OS::get_singleton()->get_executable_path().get_file().get_basename(); - bool found = false; - bool first_time=true; - - while(true) { - //try to load settings in ascending through dirs shape! - - //tries to open pack, but only first time - if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".zip") )) { - if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { + //Nothing was found, try to find a godot.cfg somewhere! - _load_settings("res://override.cfg"); - found=true; - - - } - break; - } else if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.zip") )) { - if (_load_settings("res://godot.cfg")==OK || _load_settings_binary("res://godot.cfb")==OK) { + DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + ERR_FAIL_COND_V(!d,ERR_CANT_CREATE); - _load_settings("res://override.cfg"); - found=true; + d->change_dir(p_path); + String candidate = d->get_current_dir(); + String current_dir = d->get_current_dir(); + bool found = false; - } - break; - } else if (_load_settings(current_dir+"/godot.cfg")==OK || _load_settings_binary(current_dir+"/godot.cfb")==OK) { + while(true) { + //try to load settings in ascending through dirs shape! - _load_settings(current_dir+"/override.cfg"); - candidate=current_dir; - found=true; - break; - } + if (_load_settings(current_dir+"/godot.cfg")==OK || _load_settings_binary(current_dir+"/godot.cfb")==OK) { - d->change_dir(".."); - if (d->get_current_dir()==current_dir) - break; //not doing anything useful - current_dir=d->get_current_dir(); - first_time=false; + _load_settings(current_dir+"/override.cfg"); + candidate=current_dir; + found=true; + break; } + d->change_dir(".."); + if (d->get_current_dir()==current_dir) + break; //not doing anything useful + current_dir=d->get_current_dir(); + } - resource_path=candidate; - resource_path = resource_path.replace("\\","/"); // windows path to unix path just in case - memdelete(d); - if (!found) - return ERR_FILE_NOT_FOUND; - }; + resource_path=candidate; + resource_path = resource_path.replace("\\","/"); // windows path to unix path just in case + memdelete(d); + if (!found) + return ERR_FILE_NOT_FOUND; if (resource_path.length() && resource_path[ resource_path.length()-1]=='/') resource_path=resource_path.substr(0,resource_path.length()-1); // chop end @@ -900,22 +869,22 @@ Variant GlobalConfig::property_get_revert(const String& p_name) { void GlobalConfig::_bind_methods() { - ClassDB::bind_method(_MD("has","name"),&GlobalConfig::has); - ClassDB::bind_method(_MD("set_order","name","pos"),&GlobalConfig::set_order); - ClassDB::bind_method(_MD("get_order","name"),&GlobalConfig::get_order); - ClassDB::bind_method(_MD("set_initial_value","name","value"),&GlobalConfig::set_initial_value); - ClassDB::bind_method(_MD("add_property_info", "hint"),&GlobalConfig::_add_property_info_bind); - ClassDB::bind_method(_MD("clear","name"),&GlobalConfig::clear); - ClassDB::bind_method(_MD("localize_path","path"),&GlobalConfig::localize_path); - ClassDB::bind_method(_MD("globalize_path","path"),&GlobalConfig::globalize_path); - ClassDB::bind_method(_MD("save"),&GlobalConfig::save); - ClassDB::bind_method(_MD("has_singleton","name"),&GlobalConfig::has_singleton); - ClassDB::bind_method(_MD("get_singleton","name"),&GlobalConfig::get_singleton_object); - ClassDB::bind_method(_MD("load_resource_pack","pack"),&GlobalConfig::_load_resource_pack); - ClassDB::bind_method(_MD("property_can_revert","name"),&GlobalConfig::property_can_revert); - ClassDB::bind_method(_MD("property_get_revert","name"),&GlobalConfig::property_get_revert); - - ClassDB::bind_method(_MD("save_custom","file"),&GlobalConfig::_save_custom_bnd); + ClassDB::bind_method(D_METHOD("has","name"),&GlobalConfig::has); + ClassDB::bind_method(D_METHOD("set_order","name","pos"),&GlobalConfig::set_order); + ClassDB::bind_method(D_METHOD("get_order","name"),&GlobalConfig::get_order); + ClassDB::bind_method(D_METHOD("set_initial_value","name","value"),&GlobalConfig::set_initial_value); + ClassDB::bind_method(D_METHOD("add_property_info", "hint"),&GlobalConfig::_add_property_info_bind); + ClassDB::bind_method(D_METHOD("clear","name"),&GlobalConfig::clear); + ClassDB::bind_method(D_METHOD("localize_path","path"),&GlobalConfig::localize_path); + ClassDB::bind_method(D_METHOD("globalize_path","path"),&GlobalConfig::globalize_path); + ClassDB::bind_method(D_METHOD("save"),&GlobalConfig::save); + ClassDB::bind_method(D_METHOD("has_singleton","name"),&GlobalConfig::has_singleton); + ClassDB::bind_method(D_METHOD("get_singleton","name"),&GlobalConfig::get_singleton_object); + ClassDB::bind_method(D_METHOD("load_resource_pack","pack"),&GlobalConfig::_load_resource_pack); + ClassDB::bind_method(D_METHOD("property_can_revert","name"),&GlobalConfig::property_can_revert); + ClassDB::bind_method(D_METHOD("property_get_revert","name"),&GlobalConfig::property_get_revert); + + ClassDB::bind_method(D_METHOD("save_custom","file"),&GlobalConfig::_save_custom_bnd); } diff --git a/core/globals.h b/core/global_config.h index faf077f2a5..471f1ff885 100644 --- a/core/globals.h +++ b/core/global_config.h @@ -26,8 +26,8 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef GLOBALS_H -#define GLOBALS_H +#ifndef GLOBAL_CONFIG_H +#define GLOBAL_CONFIG_H #include "object.h" #include "set.h" diff --git a/core/hash_map.h b/core/hash_map.h index 0d55206935..515fc6c4fe 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -30,40 +30,45 @@ #define HASH_MAP_H #include "hashfuncs.h" +#include "math_funcs.h" #include "error_macros.h" #include "ustring.h" #include "os/memory.h" #include "list.h" - -class HashMapHahserDefault { -public: - +struct HashMapHasherDefault { static _FORCE_INLINE_ uint32_t hash(const String &p_string) { return p_string.hash(); } static _FORCE_INLINE_ uint32_t hash(const char *p_cstr) { return hash_djb2(p_cstr); } - static _FORCE_INLINE_ uint32_t hash(const uint64_t p_int) { - uint64_t v=p_int; - v = (~v) + (v << 18); // v = (v << 18) - v - 1; - v = v ^ (v >> 31); - v = v * 21; // v = (v + (v << 2)) + (v << 4); - v = v ^ (v >> 11); - v = v + (v << 6); - v = v ^ (v >> 22); - return (int) v; - } - static _FORCE_INLINE_ uint32_t hash(const int64_t p_int) { return hash(uint64_t(p_int)); } + static _FORCE_INLINE_ uint32_t hash(const uint64_t p_int) { return hash_one_uint64(p_int); } - - static _FORCE_INLINE_ uint32_t hash(const uint32_t p_int) { return p_int; } + static _FORCE_INLINE_ uint32_t hash(const int64_t p_int) { return hash(uint64_t(p_int)); } + static _FORCE_INLINE_ uint32_t hash(const float p_float) { return hash_djb2_one_float(p_float); } + static _FORCE_INLINE_ uint32_t hash(const double p_double){ return hash_djb2_one_float(p_double); } + static _FORCE_INLINE_ uint32_t hash(const uint32_t p_int) { return p_int; } static _FORCE_INLINE_ uint32_t hash(const int32_t p_int) { return (uint32_t)p_int; } - static _FORCE_INLINE_ uint32_t hash(const uint16_t p_int) { return p_int; } + static _FORCE_INLINE_ uint32_t hash(const uint16_t p_int) { return p_int; } static _FORCE_INLINE_ uint32_t hash(const int16_t p_int) { return (uint32_t)p_int; } static _FORCE_INLINE_ uint32_t hash(const uint8_t p_int) { return p_int; } - static _FORCE_INLINE_ uint32_t hash(const int8_t p_int) { return (uint32_t)p_int; } - static _FORCE_INLINE_ uint32_t hash(const wchar_t p_wchar) { return (uint32_t)p_wchar; } + static _FORCE_INLINE_ uint32_t hash(const int8_t p_int) { return (uint32_t)p_int; } + static _FORCE_INLINE_ uint32_t hash(const wchar_t p_wchar){ return (uint32_t)p_wchar; } //static _FORCE_INLINE_ uint32_t hash(const void* p_ptr) { return uint32_t(uint64_t(p_ptr))*(0x9e3779b1L); } }; +template <typename T> +struct HashMapComparatorDefault { + static bool compare(const T& p_lhs, const T& p_rhs) { + return p_lhs == p_rhs; + } + + bool compare(const float& p_lhs, const float& p_rhs) { + return (p_lhs == p_rhs) || (Math::is_nan(p_lhs) && Math::is_nan(p_rhs)); + } + + bool compare(const double& p_lhs, const double& p_rhs) { + return (p_lhs == p_rhs) || (Math::is_nan(p_lhs) && Math::is_nan(p_rhs)); + } +}; + /** * @class HashMap * @author Juan Linietsky <reduzio@gmail.com> @@ -74,13 +79,14 @@ public: * @param TKey Key, search is based on it, needs to be hasheable. It is unique in this container. * @param TData Data, data associated with the key * @param Hasher Hasher object, needs to provide a valid static hash function for TKey + * @param Comparator comparator object, needs to be able to safely compare two TKey values. It needs to ensure that x == x for any items inserted in the map. Bear in mind that nan != nan when implementing an equality check. * @param MIN_HASH_TABLE_POWER Miminum size of the hash table, as a power of two. You rarely need to change this parameter. * @param RELATIONSHIP Relationship at which the hash table is resized. if amount of elements is RELATIONSHIP * times bigger than the hash table, table is resized to solve this condition. if RELATIONSHIP is zero, table is always MIN_HASH_TABLE_POWER. * */ -template<class TKey, class TData, class Hasher=HashMapHahserDefault,uint8_t MIN_HASH_TABLE_POWER=3,uint8_t RELATIONSHIP=8> +template<class TKey, class TData, class Hasher=HashMapHasherDefault, class Comparator=HashMapComparatorDefault<TKey>, uint8_t MIN_HASH_TABLE_POWER=3,uint8_t RELATIONSHIP=8> class HashMap { public: @@ -194,7 +200,6 @@ private: } - /* I want to have only one function.. */ _FORCE_INLINE_ const Entry * get_entry( const TKey& p_key ) const { @@ -206,7 +211,7 @@ private: while (e) { /* checking hash first avoids comparing key, which may take longer */ - if (e->hash == hash && e->pair.key == p_key ) { + if (e->hash == hash && Comparator::compare(e->pair.key,p_key) ) { /* the pair exists in this hashtable, so just update data */ return e; @@ -253,7 +258,6 @@ private: for (int i=0;i<( 1<<p_t.hash_table_power );i++) { hash_table[i]=NULL; - /* elements will be in the reverse order, but it doesn't matter */ const Entry *e = p_t.hash_table[i]; @@ -385,7 +389,7 @@ public: while (e) { /* checking hash first avoids comparing key, which may take longer */ - if (e->hash == hash && e->pair.key == p_custom_key ) { + if (e->hash == hash && Comparator::compare(e->pair.key,p_custom_key) ) { /* the pair exists in this hashtable, so just update data */ return &e->pair.data; @@ -411,7 +415,7 @@ public: while (e) { /* checking hash first avoids comparing key, which may take longer */ - if (e->hash == hash && e->pair.key == p_custom_key ) { + if (e->hash == hash && Comparator::compare(e->pair.key,p_custom_key) ) { /* the pair exists in this hashtable, so just update data */ return &e->pair.data; @@ -442,7 +446,7 @@ public: while (e) { /* checking hash first avoids comparing key, which may take longer */ - if (e->hash == hash && e->pair.key == p_key ) { + if (e->hash == hash && Comparator::compare(e->pair.key,p_key) ) { if (p) { @@ -637,7 +641,8 @@ public: clear(); } - }; + + #endif diff --git a/core/hashfuncs.h b/core/hashfuncs.h index e9e57d8b42..121d7e8c59 100644 --- a/core/hashfuncs.h +++ b/core/hashfuncs.h @@ -29,7 +29,8 @@ #ifndef HASHFUNCS_H #define HASHFUNCS_H - +#include "math_funcs.h" +#include "math_defs.h" #include "typedefs.h" /** @@ -69,19 +70,52 @@ static inline uint32_t hash_djb2_one_32(uint32_t p_in,uint32_t p_prev=5381) { return ((p_prev<<5)+p_prev)+p_in; } +static inline uint32_t hash_one_uint64(const uint64_t p_int) { + uint64_t v=p_int; + v = (~v) + (v << 18); // v = (v << 18) - v - 1; + v = v ^ (v >> 31); + v = v * 21; // v = (v + (v << 2)) + (v << 4); + v = v ^ (v >> 11); + v = v + (v << 6); + v = v ^ (v >> 22); + return (int) v; +} + static inline uint32_t hash_djb2_one_float(float p_in,uint32_t p_prev=5381) { union { float f; uint32_t i; } u; - // handle -0 case - if (p_in==0.0f) u.f=0.0f; - else u.f=p_in; + // Normalize +/- 0.0 and NaN values so they hash the same. + if (p_in==0.0f) + u.f=0.0; + else if (Math::is_nan(p_in)) + u.f=Math_NAN; + else + u.f=p_in; return ((p_prev<<5)+p_prev)+u.i; } +// Overload for real_t size changes +static inline uint32_t hash_djb2_one_float(double p_in,uint32_t p_prev=5381) { + union { + double d; + uint64_t i; + } u; + + // Normalize +/- 0.0 and NaN values so they hash the same. + if (p_in==0.0f) + u.d=0.0; + else if (Math::is_nan(p_in)) + u.d=Math_NAN; + else + u.d=p_in; + + return ((p_prev<<5)+p_prev) + hash_one_uint64(u.i); +} + template<class T> static inline uint32_t make_uint32_t(T p_in) { diff --git a/core/helper/SCsub b/core/helper/SCsub new file mode 100644 index 0000000000..4efc902717 --- /dev/null +++ b/core/helper/SCsub @@ -0,0 +1,7 @@ +#!/usr/bin/env python + +Import('env') + +env.add_source_files(env.core_sources, "*.cpp") + +Export('env') diff --git a/core/helper/math_fieldwise.cpp b/core/helper/math_fieldwise.cpp new file mode 100644 index 0000000000..204c431e1d --- /dev/null +++ b/core/helper/math_fieldwise.cpp @@ -0,0 +1,171 @@ +/*************************************************************************/ +/* fieldwise.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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. */ +/*************************************************************************/ + +#ifdef TOOLS_ENABLED + +#include "core/helper/math_fieldwise.h" + +#define SETUP_TYPE(m_type) m_type source=p_source; m_type target=p_target; +#define TRY_TRANSFER_FIELD(m_name,m_member) if (p_field==m_name) { target.m_member=source.m_member; } + +Variant fieldwise_assign(const Variant& p_target, const Variant& p_source, const String& p_field) { + + ERR_FAIL_COND_V(p_target.get_type()!=p_source.get_type(),p_target); + + switch (p_source.get_type()) { + + case Variant::VECTOR2: { + + SETUP_TYPE(Vector2) + + /**/ TRY_TRANSFER_FIELD("x",x) + else TRY_TRANSFER_FIELD("y",y) + + return target; + } + + case Variant::RECT2: { + + SETUP_TYPE(Rect2) + + /**/ TRY_TRANSFER_FIELD("x",pos.x) + else TRY_TRANSFER_FIELD("y",pos.y) + else TRY_TRANSFER_FIELD("w",size.x) + else TRY_TRANSFER_FIELD("h",size.y) + + return target; + } + + case Variant::VECTOR3: { + + SETUP_TYPE(Vector3) + + /**/ TRY_TRANSFER_FIELD("x",x) + else TRY_TRANSFER_FIELD("y",y) + else TRY_TRANSFER_FIELD("z",z) + + return target; + } + + case Variant::PLANE: { + + SETUP_TYPE(Plane) + + /**/ TRY_TRANSFER_FIELD("x",normal.x) + else TRY_TRANSFER_FIELD("y",normal.y) + else TRY_TRANSFER_FIELD("z",normal.z) + else TRY_TRANSFER_FIELD("d",d) + + return target; + } + + case Variant::QUAT: { + + SETUP_TYPE(Quat) + + /**/ TRY_TRANSFER_FIELD("x",x) + else TRY_TRANSFER_FIELD("y",y) + else TRY_TRANSFER_FIELD("z",z) + else TRY_TRANSFER_FIELD("w",w) + + return target; + } + + case Variant::RECT3: { + + SETUP_TYPE(Rect3) + + /**/ TRY_TRANSFER_FIELD("px",pos.x) + else TRY_TRANSFER_FIELD("py",pos.y) + else TRY_TRANSFER_FIELD("pz",pos.z) + else TRY_TRANSFER_FIELD("sx",size.x) + else TRY_TRANSFER_FIELD("sy",size.y) + else TRY_TRANSFER_FIELD("sz",size.z) + + return target; + } + + case Variant::TRANSFORM2D: { + + SETUP_TYPE(Transform2D) + + /**/ TRY_TRANSFER_FIELD("xx",elements[0][0]) + else TRY_TRANSFER_FIELD("xy",elements[0][1]) + else TRY_TRANSFER_FIELD("yx",elements[1][0]) + else TRY_TRANSFER_FIELD("yy",elements[1][1]) + else TRY_TRANSFER_FIELD("ox",elements[2][0]) + else TRY_TRANSFER_FIELD("oy",elements[2][1]) + + return target; + } + + case Variant::BASIS: { + + SETUP_TYPE(Basis) + + /**/ TRY_TRANSFER_FIELD("xx",elements[0][0]) + else TRY_TRANSFER_FIELD("xy",elements[0][1]) + else TRY_TRANSFER_FIELD("xz",elements[0][2]) + else TRY_TRANSFER_FIELD("yx",elements[1][0]) + else TRY_TRANSFER_FIELD("yy",elements[1][1]) + else TRY_TRANSFER_FIELD("yz",elements[1][2]) + else TRY_TRANSFER_FIELD("zx",elements[2][0]) + else TRY_TRANSFER_FIELD("zy",elements[2][1]) + else TRY_TRANSFER_FIELD("zz",elements[2][2]) + + return target; + } + + case Variant::TRANSFORM: { + + SETUP_TYPE(Transform) + + /**/ TRY_TRANSFER_FIELD("xx",basis.elements[0][0]) + else TRY_TRANSFER_FIELD("xy",basis.elements[0][1]) + else TRY_TRANSFER_FIELD("xz",basis.elements[0][2]) + else TRY_TRANSFER_FIELD("yx",basis.elements[1][0]) + else TRY_TRANSFER_FIELD("yy",basis.elements[1][1]) + else TRY_TRANSFER_FIELD("yz",basis.elements[1][2]) + else TRY_TRANSFER_FIELD("zx",basis.elements[2][0]) + else TRY_TRANSFER_FIELD("zy",basis.elements[2][1]) + else TRY_TRANSFER_FIELD("zz",basis.elements[2][2]) + else TRY_TRANSFER_FIELD("xo",origin.x) + else TRY_TRANSFER_FIELD("yo",origin.y) + else TRY_TRANSFER_FIELD("zo",origin.z) + + return target; + } + + default: { + ERR_FAIL_V(p_target); + } + } +} + +#endif // TOOLS_ENABLED diff --git a/core/helper/math_fieldwise.h b/core/helper/math_fieldwise.h new file mode 100644 index 0000000000..31f9af8d0b --- /dev/null +++ b/core/helper/math_fieldwise.h @@ -0,0 +1,40 @@ +/*************************************************************************/ +/* fieldwise.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 MATH_FIELDWISE_H +#define MATH_FIELDWISE_H + +#ifdef TOOLS_ENABLED + +#include "core/variant.h" + +Variant fieldwise_assign(const Variant& p_target, const Variant& p_source, const String& p_field); + +#endif // TOOLS_ENABLED + +#endif // MATH_FIELDWISE_H diff --git a/core/input_map.cpp b/core/input_map.cpp index dcce13ba1b..444c55cac6 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -28,26 +28,26 @@ /*************************************************************************/ #include "input_map.h" -#include "globals.h" +#include "global_config.h" #include "os/keyboard.h" InputMap *InputMap::singleton=NULL; void InputMap::_bind_methods() { - ClassDB::bind_method(_MD("has_action","action"),&InputMap::has_action); - ClassDB::bind_method(_MD("get_action_id","action"),&InputMap::get_action_id); - ClassDB::bind_method(_MD("get_action_from_id","id"),&InputMap::get_action_from_id); - ClassDB::bind_method(_MD("get_actions"),&InputMap::_get_actions); - ClassDB::bind_method(_MD("add_action","action"),&InputMap::add_action); - ClassDB::bind_method(_MD("erase_action","action"),&InputMap::erase_action); - - ClassDB::bind_method(_MD("action_add_event","action","event"),&InputMap::action_add_event); - ClassDB::bind_method(_MD("action_has_event","action","event"),&InputMap::action_has_event); - ClassDB::bind_method(_MD("action_erase_event","action","event"),&InputMap::action_erase_event); - ClassDB::bind_method(_MD("get_action_list","action"),&InputMap::_get_action_list); - ClassDB::bind_method(_MD("event_is_action","event","action"),&InputMap::event_is_action); - ClassDB::bind_method(_MD("load_from_globals"),&InputMap::load_from_globals); + ClassDB::bind_method(D_METHOD("has_action","action"),&InputMap::has_action); + ClassDB::bind_method(D_METHOD("get_action_id","action"),&InputMap::get_action_id); + ClassDB::bind_method(D_METHOD("get_action_from_id","id"),&InputMap::get_action_from_id); + ClassDB::bind_method(D_METHOD("get_actions"),&InputMap::_get_actions); + ClassDB::bind_method(D_METHOD("add_action","action"),&InputMap::add_action); + ClassDB::bind_method(D_METHOD("erase_action","action"),&InputMap::erase_action); + + ClassDB::bind_method(D_METHOD("action_add_event","action","event"),&InputMap::action_add_event); + ClassDB::bind_method(D_METHOD("action_has_event","action","event"),&InputMap::action_has_event); + ClassDB::bind_method(D_METHOD("action_erase_event","action","event"),&InputMap::action_erase_event); + ClassDB::bind_method(D_METHOD("get_action_list","action"),&InputMap::_get_action_list); + ClassDB::bind_method(D_METHOD("event_is_action","event","action"),&InputMap::event_is_action); + ClassDB::bind_method(D_METHOD("load_from_globals"),&InputMap::load_from_globals); } diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index b944906e78..fdfcc3ae3a 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -209,19 +209,19 @@ Error ConfigFile::load(const String& p_path) { void ConfigFile::_bind_methods(){ - ClassDB::bind_method(_MD("set_value","section","key","value"),&ConfigFile::set_value); - ClassDB::bind_method(_MD("get_value:Variant","section","key","default"),&ConfigFile::get_value,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("set_value","section","key","value"),&ConfigFile::set_value); + ClassDB::bind_method(D_METHOD("get_value:Variant","section","key","default"),&ConfigFile::get_value,DEFVAL(Variant())); - ClassDB::bind_method(_MD("has_section","section"),&ConfigFile::has_section); - ClassDB::bind_method(_MD("has_section_key","section","key"),&ConfigFile::has_section_key); + ClassDB::bind_method(D_METHOD("has_section","section"),&ConfigFile::has_section); + ClassDB::bind_method(D_METHOD("has_section_key","section","key"),&ConfigFile::has_section_key); - ClassDB::bind_method(_MD("get_sections"),&ConfigFile::_get_sections); - ClassDB::bind_method(_MD("get_section_keys","section"),&ConfigFile::_get_section_keys); + ClassDB::bind_method(D_METHOD("get_sections"),&ConfigFile::_get_sections); + ClassDB::bind_method(D_METHOD("get_section_keys","section"),&ConfigFile::_get_section_keys); - ClassDB::bind_method(_MD("erase_section","section"),&ConfigFile::erase_section); + ClassDB::bind_method(D_METHOD("erase_section","section"),&ConfigFile::erase_section); - ClassDB::bind_method(_MD("load:Error","path"),&ConfigFile::load); - ClassDB::bind_method(_MD("save:Error","path"),&ConfigFile::save); + ClassDB::bind_method(D_METHOD("load:Error","path"),&ConfigFile::load); + ClassDB::bind_method(D_METHOD("save:Error","path"),&ConfigFile::save); } diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp index 32eb003228..b4ba14ddc9 100644 --- a/core/io/file_access_memory.cpp +++ b/core/io/file_access_memory.cpp @@ -30,7 +30,7 @@ #include "os/dir_access.h" #include "os/copymem.h" -#include "globals.h" +#include "global_config.h" #include "map.h" static Map<String, Vector<uint8_t> >* files = NULL; diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index 7bf750f6e1..d9fdc9cedc 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "file_access_network.h" #include "marshalls.h" -#include "globals.h" +#include "global_config.h" #include "os/os.h" #include "io/ip.h" diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index d63539a7a5..fa1bebde16 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -31,7 +31,7 @@ #include <stdio.h> -#define PACK_VERSION 0 +#define PACK_VERSION 1 Error PackedData::add_pack(const String& p_path) { @@ -167,8 +167,8 @@ bool PackedSourcePCK::try_open_pack(const String& p_path) { uint32_t ver_minor = f->get_32(); uint32_t ver_rev = f->get_32(); - ERR_EXPLAIN("Pack version newer than supported by engine: "+itos(version)); - ERR_FAIL_COND_V( version > PACK_VERSION, ERR_INVALID_DATA); + ERR_EXPLAIN("Pack version unsupported: "+itos(version)); + ERR_FAIL_COND_V( version != PACK_VERSION, ERR_INVALID_DATA); ERR_EXPLAIN("Pack created with a newer version of the engine: "+itos(ver_major)+"."+itos(ver_minor)+"."+itos(ver_rev)); ERR_FAIL_COND_V( ver_major > VERSION_MAJOR || (ver_major == VERSION_MAJOR && ver_minor > VERSION_MINOR), ERR_INVALID_DATA); diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 63c8abbbad..ae14f8fa38 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -29,14 +29,9 @@ #include "http_client.h" #include "io/stream_peer_ssl.h" -void HTTPClient::set_ip_type(IP::Type p_type) { - ip_type = p_type; -} - Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl,bool p_verify_host){ close(); - tcp_connection->set_ip_type(ip_type); conn_port=p_port; conn_host=p_host; @@ -66,7 +61,7 @@ Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl,b status=STATUS_CONNECTING; } else { //is hostname - resolving=IP::get_singleton()->resolve_hostname_queue_item(conn_host, ip_type); + resolving=IP::get_singleton()->resolve_hostname_queue_item(conn_host); status=STATUS_RESOLVING; } @@ -345,7 +340,7 @@ Error HTTPClient::poll(){ int rs = response_str.size(); if ( (rs>=2 && response_str[rs-2]=='\n' && response_str[rs-1]=='\n') || - (rs>=4 && response_str[rs-4]=='\r' && response_str[rs-3]=='\n' && rs>=4 && response_str[rs-2]=='\r' && response_str[rs-1]=='\n') + (rs>=4 && response_str[rs-4]=='\r' && response_str[rs-3]=='\n' && response_str[rs-2]=='\r' && response_str[rs-1]=='\n') ) { @@ -566,11 +561,13 @@ PoolByteArray HTTPClient::read_response_body_chunk() { int to_read = MIN(body_left,read_chunk_size); PoolByteArray ret; ret.resize(to_read); - PoolByteArray::Write w = ret.write(); int _offset = 0; while (to_read > 0) { int rec=0; - err = _get_http_data(w.ptr()+_offset,to_read,rec); + { + PoolByteArray::Write w = ret.write(); + err = _get_http_data(w.ptr()+_offset,to_read,rec); + } if (rec>0) { body_left-=rec; to_read-=rec; @@ -639,32 +636,31 @@ Error HTTPClient::_get_http_data(uint8_t* p_buffer, int p_bytes,int &r_received) void HTTPClient::_bind_methods() { - ClassDB::bind_method(_MD("set_ip_type","ip_type"),&HTTPClient::set_ip_type); - ClassDB::bind_method(_MD("connect_to_host:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect_to_host,DEFVAL(false),DEFVAL(true)); - ClassDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection); - ClassDB::bind_method(_MD("get_connection:StreamPeer"),&HTTPClient::get_connection); - ClassDB::bind_method(_MD("request_raw","method","url","headers","body"),&HTTPClient::request_raw); - ClassDB::bind_method(_MD("request","method","url","headers","body"),&HTTPClient::request,DEFVAL(String())); - ClassDB::bind_method(_MD("send_body_text","body"),&HTTPClient::send_body_text); - ClassDB::bind_method(_MD("send_body_data","body"),&HTTPClient::send_body_data); - ClassDB::bind_method(_MD("close"),&HTTPClient::close); + ClassDB::bind_method(D_METHOD("connect_to_host:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect_to_host,DEFVAL(false),DEFVAL(true)); + ClassDB::bind_method(D_METHOD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection); + ClassDB::bind_method(D_METHOD("get_connection:StreamPeer"),&HTTPClient::get_connection); + ClassDB::bind_method(D_METHOD("request_raw","method","url","headers","body"),&HTTPClient::request_raw); + ClassDB::bind_method(D_METHOD("request","method","url","headers","body"),&HTTPClient::request,DEFVAL(String())); + ClassDB::bind_method(D_METHOD("send_body_text","body"),&HTTPClient::send_body_text); + ClassDB::bind_method(D_METHOD("send_body_data","body"),&HTTPClient::send_body_data); + ClassDB::bind_method(D_METHOD("close"),&HTTPClient::close); - ClassDB::bind_method(_MD("has_response"),&HTTPClient::has_response); - ClassDB::bind_method(_MD("is_response_chunked"),&HTTPClient::is_response_chunked); - ClassDB::bind_method(_MD("get_response_code"),&HTTPClient::get_response_code); - ClassDB::bind_method(_MD("get_response_headers"),&HTTPClient::_get_response_headers); - ClassDB::bind_method(_MD("get_response_headers_as_dictionary"),&HTTPClient::_get_response_headers_as_dictionary); - ClassDB::bind_method(_MD("get_response_body_length"),&HTTPClient::get_response_body_length); - ClassDB::bind_method(_MD("read_response_body_chunk"),&HTTPClient::read_response_body_chunk); - ClassDB::bind_method(_MD("set_read_chunk_size","bytes"),&HTTPClient::set_read_chunk_size); + ClassDB::bind_method(D_METHOD("has_response"),&HTTPClient::has_response); + ClassDB::bind_method(D_METHOD("is_response_chunked"),&HTTPClient::is_response_chunked); + ClassDB::bind_method(D_METHOD("get_response_code"),&HTTPClient::get_response_code); + ClassDB::bind_method(D_METHOD("get_response_headers"),&HTTPClient::_get_response_headers); + ClassDB::bind_method(D_METHOD("get_response_headers_as_dictionary"),&HTTPClient::_get_response_headers_as_dictionary); + ClassDB::bind_method(D_METHOD("get_response_body_length"),&HTTPClient::get_response_body_length); + ClassDB::bind_method(D_METHOD("read_response_body_chunk"),&HTTPClient::read_response_body_chunk); + ClassDB::bind_method(D_METHOD("set_read_chunk_size","bytes"),&HTTPClient::set_read_chunk_size); - ClassDB::bind_method(_MD("set_blocking_mode","enabled"),&HTTPClient::set_blocking_mode); - ClassDB::bind_method(_MD("is_blocking_mode_enabled"),&HTTPClient::is_blocking_mode_enabled); + ClassDB::bind_method(D_METHOD("set_blocking_mode","enabled"),&HTTPClient::set_blocking_mode); + ClassDB::bind_method(D_METHOD("is_blocking_mode_enabled"),&HTTPClient::is_blocking_mode_enabled); - ClassDB::bind_method(_MD("get_status"),&HTTPClient::get_status); - ClassDB::bind_method(_MD("poll:Error"),&HTTPClient::poll); + ClassDB::bind_method(D_METHOD("get_status"),&HTTPClient::get_status); + ClassDB::bind_method(D_METHOD("poll:Error"),&HTTPClient::poll); - ClassDB::bind_method(_MD("query_string_from_dict:String","fields"),&HTTPClient::query_string_from_dict); + ClassDB::bind_method(D_METHOD("query_string_from_dict:String","fields"),&HTTPClient::query_string_from_dict); BIND_CONSTANT( METHOD_GET ); @@ -766,7 +762,6 @@ String HTTPClient::query_string_from_dict(const Dictionary& p_dict) { HTTPClient::HTTPClient(){ - ip_type = IP::TYPE_ANY; tcp_connection = StreamPeerTCP::create_ref(); resolving = IP::RESOLVER_INVALID_ID; status=STATUS_DISCONNECTED; diff --git a/core/io/http_client.h b/core/io/http_client.h index 496d22530b..4b0c1b730f 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -132,7 +132,6 @@ public: private: - IP::Type ip_type; Status status; IP::ResolverID resolving; int conn_port; @@ -165,7 +164,6 @@ private: public: - void set_ip_type(IP::Type p_type); //Error connect_and_get(const String& p_url,bool p_verify_host=true); //connects to a full url and perform request Error connect_to_host(const String &p_host,int p_port,bool p_ssl=false,bool p_verify_host=true); diff --git a/core/io/ip.cpp b/core/io/ip.cpp index 0eb1f221c9..d820273a14 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -82,7 +82,7 @@ struct _IP_ResolverPrivate { continue; queue[i].response=IP::get_singleton()->resolve_hostname(queue[i].hostname, queue[i].type); - if (queue[i].response==IP_Address()) + if (!queue[i].response.is_valid()) queue[i].status=IP::RESOLVER_STATUS_ERROR; else queue[i].status=IP::RESOLVER_STATUS_DONE; @@ -218,13 +218,13 @@ Array IP::_get_local_addresses() const { void IP::_bind_methods() { - ClassDB::bind_method(_MD("resolve_hostname","host","ip_type"),&IP::resolve_hostname,DEFVAL(IP::TYPE_ANY)); - ClassDB::bind_method(_MD("resolve_hostname_queue_item","host","ip_type"),&IP::resolve_hostname_queue_item,DEFVAL(IP::TYPE_ANY)); - ClassDB::bind_method(_MD("get_resolve_item_status","id"),&IP::get_resolve_item_status); - ClassDB::bind_method(_MD("get_resolve_item_address","id"),&IP::get_resolve_item_address); - ClassDB::bind_method(_MD("erase_resolve_item","id"),&IP::erase_resolve_item); - ClassDB::bind_method(_MD("get_local_addresses"),&IP::_get_local_addresses); - ClassDB::bind_method(_MD("clear_cache"),&IP::clear_cache, DEFVAL("")); + ClassDB::bind_method(D_METHOD("resolve_hostname","host","ip_type"),&IP::resolve_hostname,DEFVAL(IP::TYPE_ANY)); + ClassDB::bind_method(D_METHOD("resolve_hostname_queue_item","host","ip_type"),&IP::resolve_hostname_queue_item,DEFVAL(IP::TYPE_ANY)); + ClassDB::bind_method(D_METHOD("get_resolve_item_status","id"),&IP::get_resolve_item_status); + ClassDB::bind_method(D_METHOD("get_resolve_item_address","id"),&IP::get_resolve_item_address); + ClassDB::bind_method(D_METHOD("erase_resolve_item","id"),&IP::erase_resolve_item); + ClassDB::bind_method(D_METHOD("get_local_addresses"),&IP::_get_local_addresses); + ClassDB::bind_method(D_METHOD("clear_cache"),&IP::clear_cache, DEFVAL("")); BIND_CONSTANT( RESOLVER_STATUS_NONE ); BIND_CONSTANT( RESOLVER_STATUS_WAITING ); diff --git a/core/io/ip_address.cpp b/core/io/ip_address.cpp index 1fda7fed7b..69c7df619d 100644 --- a/core/io/ip_address.cpp +++ b/core/io/ip_address.cpp @@ -38,6 +38,9 @@ IP_Address::operator Variant() const { IP_Address::operator String() const { + if(!valid) + return ""; + if(is_ipv4()) // IPv4 address mapped to IPv6 return itos(field8[12])+"."+itos(field8[13])+"."+itos(field8[14])+"."+itos(field8[15]); @@ -171,6 +174,8 @@ void IP_Address::_parse_ipv4(const String& p_string, int p_start, uint8_t* p_ret void IP_Address::clear() { memset(&field8[0], 0, sizeof(field8)); + valid = false; + wildcard = false; }; bool IP_Address::is_ipv4() const{ @@ -184,6 +189,7 @@ const uint8_t *IP_Address::get_ipv4() const{ void IP_Address::set_ipv4(const uint8_t *p_ip) { clear(); + valid = true; field16[5]=0xffff; field32[3]=*((const uint32_t *)p_ip); } @@ -194,6 +200,7 @@ const uint8_t *IP_Address::get_ipv6() const{ void IP_Address::set_ipv6(const uint8_t *p_buf) { clear(); + valid = true; for (int i=0; i<16; i++) field8[i] = p_buf[i]; } @@ -201,14 +208,25 @@ void IP_Address::set_ipv6(const uint8_t *p_buf) { IP_Address::IP_Address(const String& p_string) { clear(); - if (p_string.find(":") >= 0) { + if (p_string == "*") { + // Wildcard (not a vaild IP) + wildcard = true; + + } else if (p_string.find(":") >= 0) { + // IPv6 _parse_ipv6(p_string); - } else { - // Mapped to IPv6 + valid = true; + + } else if (p_string.get_slice_count(".") == 4) { + // IPv4 (mapped to IPv6 internally) field16[5] = 0xffff; _parse_ipv4(p_string, 0, &field8[12]); - }; + valid = true; + + } else { + ERR_PRINT("Invalid IP address"); + } } _FORCE_INLINE_ static void _32_to_buf(uint8_t* p_dst, uint32_t p_n) { @@ -222,6 +240,7 @@ _FORCE_INLINE_ static void _32_to_buf(uint8_t* p_dst, uint32_t p_n) { IP_Address::IP_Address(uint32_t p_a,uint32_t p_b,uint32_t p_c,uint32_t p_d, bool is_v6) { clear(); + valid = true; if (!is_v6) { // Mapped to IPv6 field16[5]=0xffff; diff --git a/core/io/ip_address.h b/core/io/ip_address.h index 87f32b0ac2..257836601a 100644 --- a/core/io/ip_address.h +++ b/core/io/ip_address.h @@ -41,6 +41,9 @@ private: uint32_t field32[4]; }; + bool valid; + bool wildcard; + protected: void _parse_ipv6(const String& p_string); void _parse_ipv4(const String& p_string, int p_start, uint8_t* p_ret); @@ -48,12 +51,16 @@ protected: public: //operator Variant() const; bool operator==(const IP_Address& p_ip) const { + if (p_ip.valid != valid) return false; + if (!valid) return false; for (int i=0; i<4; i++) if (field32[i] != p_ip.field32[i]) return false; return true; } bool operator!=(const IP_Address& p_ip) const { + if (p_ip.valid != valid) return true; + if (!valid) return true; for (int i=0; i<4; i++) if (field32[i] != p_ip.field32[i]) return true; @@ -61,6 +68,8 @@ public: } void clear(); + bool is_wildcard() const {return wildcard;} + bool is_valid() const {return valid;} bool is_ipv4() const; const uint8_t *get_ipv4() const; void set_ipv4(const uint8_t *p_ip); diff --git a/core/io/json.cpp b/core/io/json.cpp index ac5b8f1e5f..5ade25aab4 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -374,7 +374,7 @@ Error JSON::_parse_array(Array &array,const CharType *p_str,int &index, int p_le } - return OK; + return ERR_PARSE_ERROR; } @@ -446,7 +446,7 @@ Error JSON::_parse_object(Dictionary &object,const CharType *p_str,int &index, i } } - return OK; + return ERR_PARSE_ERROR; } diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index e958edc93e..a8c1cd0a10 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -641,7 +641,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); - ERR_FAIL_COND_V(count<0,ERR_INVALID_DATA); PoolVector<String> strings; buf+=4; @@ -691,7 +690,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); - ERR_FAIL_COND_V(count<0,ERR_INVALID_DATA); buf+=4; len-=4; @@ -729,7 +727,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); - ERR_FAIL_COND_V(count<0,ERR_INVALID_DATA); buf+=4; len-=4; @@ -768,7 +765,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); - ERR_FAIL_COND_V(count<0,ERR_INVALID_DATA); buf+=4; len-=4; diff --git a/core/io/networked_multiplayer_peer.cpp b/core/io/networked_multiplayer_peer.cpp index 2981307af6..fb81a806e2 100644 --- a/core/io/networked_multiplayer_peer.cpp +++ b/core/io/networked_multiplayer_peer.cpp @@ -31,18 +31,18 @@ void NetworkedMultiplayerPeer::_bind_methods() { - ClassDB::bind_method(_MD("set_transfer_mode","mode"), &NetworkedMultiplayerPeer::set_transfer_mode ); - ClassDB::bind_method(_MD("set_target_peer","id"), &NetworkedMultiplayerPeer::set_target_peer ); + ClassDB::bind_method(D_METHOD("set_transfer_mode","mode"), &NetworkedMultiplayerPeer::set_transfer_mode ); + ClassDB::bind_method(D_METHOD("set_target_peer","id"), &NetworkedMultiplayerPeer::set_target_peer ); - ClassDB::bind_method(_MD("get_packet_peer"), &NetworkedMultiplayerPeer::get_packet_peer ); + ClassDB::bind_method(D_METHOD("get_packet_peer"), &NetworkedMultiplayerPeer::get_packet_peer ); - ClassDB::bind_method(_MD("poll"), &NetworkedMultiplayerPeer::poll ); + ClassDB::bind_method(D_METHOD("poll"), &NetworkedMultiplayerPeer::poll ); - ClassDB::bind_method(_MD("get_connection_status"), &NetworkedMultiplayerPeer::get_connection_status ); - ClassDB::bind_method(_MD("get_unique_id"), &NetworkedMultiplayerPeer::get_unique_id ); + ClassDB::bind_method(D_METHOD("get_connection_status"), &NetworkedMultiplayerPeer::get_connection_status ); + ClassDB::bind_method(D_METHOD("get_unique_id"), &NetworkedMultiplayerPeer::get_unique_id ); - ClassDB::bind_method(_MD("set_refuse_new_connections","enable"), &NetworkedMultiplayerPeer::set_refuse_new_connections ); - ClassDB::bind_method(_MD("is_refusing_new_connections"), &NetworkedMultiplayerPeer::is_refusing_new_connections ); + ClassDB::bind_method(D_METHOD("set_refuse_new_connections","enable"), &NetworkedMultiplayerPeer::set_refuse_new_connections ); + ClassDB::bind_method(D_METHOD("is_refusing_new_connections"), &NetworkedMultiplayerPeer::is_refusing_new_connections ); BIND_CONSTANT( TRANSFER_MODE_UNRELIABLE ); BIND_CONSTANT( TRANSFER_MODE_UNRELIABLE_ORDERED ); diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index 5ff09f9fb0..cf5883121f 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -29,7 +29,7 @@ #include "packet_peer.h" #include "io/marshalls.h" -#include "globals.h" +#include "global_config.h" /* helpers / binders */ @@ -126,12 +126,12 @@ Error PacketPeer::_get_packet_error() const { void PacketPeer::_bind_methods() { - ClassDB::bind_method(_MD("get_var:Variant"),&PacketPeer::_bnd_get_var); - ClassDB::bind_method(_MD("put_var", "var:Variant"),&PacketPeer::put_var); - ClassDB::bind_method(_MD("get_packet"),&PacketPeer::_get_packet); - ClassDB::bind_method(_MD("put_packet:Error", "buffer"),&PacketPeer::_put_packet); - ClassDB::bind_method(_MD("get_packet_error:Error"),&PacketPeer::_get_packet_error); - ClassDB::bind_method(_MD("get_available_packet_count"),&PacketPeer::get_available_packet_count); + ClassDB::bind_method(D_METHOD("get_var:Variant"),&PacketPeer::_bnd_get_var); + ClassDB::bind_method(D_METHOD("put_var", "var:Variant"),&PacketPeer::put_var); + ClassDB::bind_method(D_METHOD("get_packet"),&PacketPeer::_get_packet); + ClassDB::bind_method(D_METHOD("put_packet:Error", "buffer"),&PacketPeer::_put_packet); + ClassDB::bind_method(D_METHOD("get_packet_error:Error"),&PacketPeer::_get_packet_error); + ClassDB::bind_method(D_METHOD("get_available_packet_count"),&PacketPeer::get_available_packet_count); }; /***************/ @@ -145,7 +145,7 @@ void PacketPeerStream::_set_stream_peer(REF p_peer) { void PacketPeerStream::_bind_methods() { - ClassDB::bind_method(_MD("set_stream_peer","peer:StreamPeer"),&PacketPeerStream::_set_stream_peer); + ClassDB::bind_method(D_METHOD("set_stream_peer","peer:StreamPeer"),&PacketPeerStream::_set_stream_peer); } Error PacketPeerStream::_poll_buffer() const { diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index 9fec807bfb..c4a6fd79a8 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -42,8 +42,8 @@ Error PacketPeerUDP::_set_dest_address(const String& p_address, int p_port) { if (p_address.is_valid_ip_address()) { ip=p_address; } else { - ip=IP::get_singleton()->resolve_hostname(p_address, ip_type); - if (ip==IP_Address()) + ip=IP::get_singleton()->resolve_hostname(p_address); + if (!ip.is_valid()) return ERR_CANT_RESOLVE; } @@ -51,22 +51,16 @@ Error PacketPeerUDP::_set_dest_address(const String& p_address, int p_port) { return OK; } -void PacketPeerUDP::set_ip_type(IP::Type p_type) { - close(); - ip_type = p_type; -} - void PacketPeerUDP::_bind_methods() { - ClassDB::bind_method(_MD("set_ip_type","ip_type"),&PacketPeerUDP::set_ip_type); - ClassDB::bind_method(_MD("listen:Error","port", "recv_buf_size"),&PacketPeerUDP::listen,DEFVAL(65536)); - ClassDB::bind_method(_MD("close"),&PacketPeerUDP::close); - ClassDB::bind_method(_MD("wait:Error"),&PacketPeerUDP::wait); - ClassDB::bind_method(_MD("is_listening"),&PacketPeerUDP::is_listening); - ClassDB::bind_method(_MD("get_packet_ip"),&PacketPeerUDP::_get_packet_ip); - //ClassDB::bind_method(_MD("get_packet_address"),&PacketPeerUDP::_get_packet_address); - ClassDB::bind_method(_MD("get_packet_port"),&PacketPeerUDP::get_packet_port); - ClassDB::bind_method(_MD("set_dest_address","host","port"),&PacketPeerUDP::_set_dest_address); + ClassDB::bind_method(D_METHOD("listen:Error","port", "bind_address", "recv_buf_size"),&PacketPeerUDP::listen,DEFVAL("*"),DEFVAL(65536)); + ClassDB::bind_method(D_METHOD("close"),&PacketPeerUDP::close); + ClassDB::bind_method(D_METHOD("wait:Error"),&PacketPeerUDP::wait); + ClassDB::bind_method(D_METHOD("is_listening"),&PacketPeerUDP::is_listening); + ClassDB::bind_method(D_METHOD("get_packet_ip"),&PacketPeerUDP::_get_packet_ip); + //ClassDB::bind_method(D_METHOD("get_packet_address"),&PacketPeerUDP::_get_packet_address); + ClassDB::bind_method(D_METHOD("get_packet_port"),&PacketPeerUDP::get_packet_port); + ClassDB::bind_method(D_METHOD("set_dest_address","host","port"),&PacketPeerUDP::_set_dest_address); } @@ -87,5 +81,5 @@ PacketPeerUDP* PacketPeerUDP::create() { PacketPeerUDP::PacketPeerUDP() { - ip_type = IP::TYPE_ANY; + } diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h index 17952b4ac1..726406887c 100644 --- a/core/io/packet_peer_udp.h +++ b/core/io/packet_peer_udp.h @@ -38,19 +38,16 @@ class PacketPeerUDP : public PacketPeer { protected: - IP::Type ip_type; - static PacketPeerUDP* (*_create)(); static void _bind_methods(); String _get_packet_ip() const; - virtual Error _set_dest_address(const String& p_address,int p_port); + Error _set_dest_address(const String& p_address,int p_port); public: - virtual void set_ip_type(IP::Type p_type); - virtual Error listen(int p_port, int p_recv_buffer_size=65536)=0; + virtual Error listen(int p_port, IP_Address p_bind_address=IP_Address("*"), int p_recv_buffer_size=65536)=0; virtual void close()=0; virtual Error wait()=0; virtual bool is_listening() const=0; diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp index fb5875e4cc..2cd46843e8 100644 --- a/core/io/pck_packer.cpp +++ b/core/io/pck_packer.cpp @@ -52,9 +52,9 @@ static void _pad(FileAccess* p_file, int p_bytes) { void PCKPacker::_bind_methods() { - ClassDB::bind_method(_MD("pck_start","pck_name","alignment"),&PCKPacker::pck_start); - ClassDB::bind_method(_MD("add_file","pck_path","source_path"),&PCKPacker::add_file); - ClassDB::bind_method(_MD("flush","verbose"),&PCKPacker::flush); + ClassDB::bind_method(D_METHOD("pck_start","pck_name","alignment"),&PCKPacker::pck_start); + ClassDB::bind_method(D_METHOD("add_file","pck_path","source_path"),&PCKPacker::add_file); + ClassDB::bind_method(D_METHOD("flush","verbose"),&PCKPacker::flush); }; diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index c75e476764..2d733842fa 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "version.h" #include "resource_format_binary.h" -#include "globals.h" +#include "global_config.h" #include "io/file_access_compressed.h" #include "io/marshalls.h" #include "os/dir_access.h" @@ -98,6 +98,27 @@ void ResourceInteractiveLoaderBinary::_advance_padding(uint32_t p_len) { } + +StringName ResourceInteractiveLoaderBinary::_get_string() { + + uint32_t id = f->get_32(); + if (id&0x80000000) { + uint32_t len = id&0x7FFFFFFF; + if (len>str_buf.size()) { + str_buf.resize(len); + } + if (len==0) + return StringName(); + f->get_buffer((uint8_t*)&str_buf[0],len); + String s; + s.parse_utf8(&str_buf[0]); + return s; + } + + return string_map[id]; + +} + Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { @@ -272,8 +293,8 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { Image::Format fmt=Image::Format(format&format_version_mask); //if format changes, we can add a compatibility bit on top - uint32_t datalen = f->get_32(); + print_line("image format: "+String(Image::get_format_name(fmt))+" datalen "+itos(datalen)); PoolVector<uint8_t> imgdata; imgdata.resize(datalen); @@ -282,6 +303,14 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { _advance_padding(datalen); w=PoolVector<uint8_t>::Write(); +#ifdef TOOLS_ENABLED +//compatibility + int correct_size = Image::get_image_data_size(width,height,fmt,mipmaps?-1:0); + if (correct_size < datalen) { + WARN_PRINT("Image data was too large, shrinking for compatibility") + imgdata.resize(correct_size); + } +#endif r_v=Image(width,height,mipmaps,fmt,imgdata); } else { @@ -323,10 +352,10 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { for(int i=0;i<name_count;i++) - names.push_back(string_map[f->get_32()]); + names.push_back(_get_string()); for(uint32_t i=0;i<subname_count;i++) - subnames.push_back(string_map[f->get_32()]); - property=string_map[f->get_32()]; + subnames.push_back(_get_string()); + property=_get_string(); NodePath np = NodePath(names,subnames,absolute,property); //print_line("got path: "+String(np)); @@ -641,6 +670,8 @@ Error ResourceInteractiveLoaderBinary::poll(){ if (s<external_resources.size()) { String path = external_resources[s].path; + + print_line("load external res: "+path); if (remaps.has(path)) { path=remaps[path]; } @@ -711,6 +742,8 @@ Error ResourceInteractiveLoaderBinary::poll(){ String t = get_unicode_string(); +// print_line("loading resource of type "+t+" path is "+path); + Object *obj = ClassDB::instance(t); if (!obj) { error=ERR_FILE_CORRUPT; @@ -737,8 +770,8 @@ Error ResourceInteractiveLoaderBinary::poll(){ for(int i=0;i<pc;i++) { - uint32_t name_idx = f->get_32(); - if (name_idx>=(uint32_t)string_map.size()) { + StringName name = _get_string(); + if (name==StringName()) { error=ERR_FILE_CORRUPT; ERR_FAIL_V(ERR_FILE_CORRUPT); } @@ -749,7 +782,7 @@ Error ResourceInteractiveLoaderBinary::poll(){ if (error) return error; - res->set(string_map[name_idx],value); + res->set(name,value); } #ifdef TOOLS_ENABLED res->set_edited(false); @@ -2143,6 +2176,8 @@ void ResourceFormatSaverBinary::get_recognized_extensions(const RES& p_resource, String base = p_resource->get_base_extension().to_lower(); p_extensions->push_back(base); + if (base!="res") + p_extensions->push_back("res"); } diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h index 1dac51cc5c..1fab6144d5 100644 --- a/core/io/resource_format_binary.h +++ b/core/io/resource_format_binary.h @@ -54,6 +54,8 @@ class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader { //Map<int,StringName> string_map; Vector<StringName> string_map; + StringName _get_string(); + struct ExtResoucre { String path; String type; diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp index 556dff3125..41245db173 100644 --- a/core/io/resource_import.cpp +++ b/core/io/resource_import.cpp @@ -1,4 +1,33 @@ +/*************************************************************************/ +/* resource_import.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "resource_import.h" + #include "variant_parser.h" #include "os/os.h" @@ -81,8 +110,10 @@ RES ResourceFormatImporter::load(const String &p_path,const String& p_original_p RES res = ResourceLoader::load(pat.path,pat.type,false,r_error); #ifdef TOOLS_ENABLED - res->set_import_last_modified_time( res->get_last_modified_time() ); //pass this, if used - res->set_import_path(pat.path); + if (res.is_valid()) { + res->set_import_last_modified_time( res->get_last_modified_time() ); //pass this, if used + res->set_import_path(pat.path); + } #endif return res; diff --git a/core/io/resource_import.h b/core/io/resource_import.h index 387b3902fe..dd7a82fe75 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* resource_import.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RESOURCE_IMPORT_H #define RESOURCE_IMPORT_H diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index fbf6a2cea2..c14389eefa 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "resource_loader.h" #include "print_string.h" -#include "globals.h" +#include "global_config.h" #include "path_remap.h" #include "os/file_access.h" #include "os/os.h" @@ -61,6 +61,7 @@ bool ResourceFormatLoader::recognize_path(const String& p_path,const String& p_f for (List<String>::Element *E=extensions.front();E;E=E->next()) { + if (E->get().nocasecmp_to(extension)==0) return true; } @@ -86,11 +87,11 @@ void ResourceLoader::get_recognized_extensions_for_type(const String& p_type,Lis void ResourceInteractiveLoader::_bind_methods() { - ClassDB::bind_method(_MD("get_resource"),&ResourceInteractiveLoader::get_resource); - ClassDB::bind_method(_MD("poll"),&ResourceInteractiveLoader::poll); - ClassDB::bind_method(_MD("wait"),&ResourceInteractiveLoader::wait); - ClassDB::bind_method(_MD("get_stage"),&ResourceInteractiveLoader::get_stage); - ClassDB::bind_method(_MD("get_stage_count"),&ResourceInteractiveLoader::get_stage_count); + ClassDB::bind_method(D_METHOD("get_resource"),&ResourceInteractiveLoader::get_resource); + ClassDB::bind_method(D_METHOD("poll"),&ResourceInteractiveLoader::poll); + ClassDB::bind_method(D_METHOD("wait"),&ResourceInteractiveLoader::wait); + ClassDB::bind_method(D_METHOD("get_stage"),&ResourceInteractiveLoader::get_stage); + ClassDB::bind_method(D_METHOD("get_stage_count"),&ResourceInteractiveLoader::get_stage_count); } class ResourceInteractiveLoaderDefault : public ResourceInteractiveLoader { @@ -191,12 +192,15 @@ RES ResourceLoader::load(const String &p_path, const String& p_type_hint, bool p for (int i=0;i<loader_count;i++) { - if (!loader[i]->recognize_path(local_path,p_type_hint)) + if (!loader[i]->recognize_path(local_path,p_type_hint)) { + print_line("path not recognized"); continue; + } found=true; RES res = loader[i]->load(local_path,local_path,r_error); - if (res.is_null()) + if (res.is_null()) { continue; + } if (!p_no_cache) res->set_path(local_path); #ifdef TOOLS_ENABLED diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 222d3e6bc0..f0bea30051 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "resource_saver.h" -#include "globals.h" +#include "global_config.h" #include "os/file_access.h" #include "script_language.h" #include "resource_loader.h" diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index a2812edb81..3c4719269f 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -389,57 +389,57 @@ Variant StreamPeer::get_var(){ void StreamPeer::_bind_methods() { - ClassDB::bind_method(_MD("put_data","data"),&StreamPeer::_put_data); - ClassDB::bind_method(_MD("put_partial_data","data"),&StreamPeer::_put_partial_data); - - ClassDB::bind_method(_MD("get_data","bytes"),&StreamPeer::_get_data); - ClassDB::bind_method(_MD("get_partial_data","bytes"),&StreamPeer::_get_partial_data); - - ClassDB::bind_method(_MD("get_available_bytes"),&StreamPeer::get_available_bytes); - - ClassDB::bind_method(_MD("set_big_endian","enable"),&StreamPeer::set_big_endian); - ClassDB::bind_method(_MD("is_big_endian_enabled"),&StreamPeer::is_big_endian_enabled); - - ClassDB::bind_method(_MD("put_8","val"),&StreamPeer::put_8); - ClassDB::bind_method(_MD("put_u8","val"),&StreamPeer::put_u8); - ClassDB::bind_method(_MD("put_16","val"),&StreamPeer::put_16); - ClassDB::bind_method(_MD("put_u16","val"),&StreamPeer::put_u16); - ClassDB::bind_method(_MD("put_32","val"),&StreamPeer::put_32); - ClassDB::bind_method(_MD("put_u32","val"),&StreamPeer::put_u32); - ClassDB::bind_method(_MD("put_64","val"),&StreamPeer::put_64); - ClassDB::bind_method(_MD("put_u64","val"),&StreamPeer::put_u64); - ClassDB::bind_method(_MD("put_float","val"),&StreamPeer::put_float); - ClassDB::bind_method(_MD("put_double","val"),&StreamPeer::put_double); - ClassDB::bind_method(_MD("put_utf8_string","val"),&StreamPeer::put_utf8_string); - ClassDB::bind_method(_MD("put_var","val:Variant"),&StreamPeer::put_var); - - ClassDB::bind_method(_MD("get_8"),&StreamPeer::get_8); - ClassDB::bind_method(_MD("get_u8"),&StreamPeer::get_u8); - ClassDB::bind_method(_MD("get_16"),&StreamPeer::get_16); - ClassDB::bind_method(_MD("get_u16"),&StreamPeer::get_u16); - ClassDB::bind_method(_MD("get_32"),&StreamPeer::get_32); - ClassDB::bind_method(_MD("get_u32"),&StreamPeer::get_u32); - ClassDB::bind_method(_MD("get_64"),&StreamPeer::get_64); - ClassDB::bind_method(_MD("get_u64"),&StreamPeer::get_u64); - ClassDB::bind_method(_MD("get_float"),&StreamPeer::get_float); - ClassDB::bind_method(_MD("get_double"),&StreamPeer::get_double); - ClassDB::bind_method(_MD("get_string","bytes"),&StreamPeer::get_string); - ClassDB::bind_method(_MD("get_utf8_string","bytes"),&StreamPeer::get_utf8_string); - ClassDB::bind_method(_MD("get_var:Variant"),&StreamPeer::get_var); + ClassDB::bind_method(D_METHOD("put_data","data"),&StreamPeer::_put_data); + ClassDB::bind_method(D_METHOD("put_partial_data","data"),&StreamPeer::_put_partial_data); + + ClassDB::bind_method(D_METHOD("get_data","bytes"),&StreamPeer::_get_data); + ClassDB::bind_method(D_METHOD("get_partial_data","bytes"),&StreamPeer::_get_partial_data); + + ClassDB::bind_method(D_METHOD("get_available_bytes"),&StreamPeer::get_available_bytes); + + ClassDB::bind_method(D_METHOD("set_big_endian","enable"),&StreamPeer::set_big_endian); + ClassDB::bind_method(D_METHOD("is_big_endian_enabled"),&StreamPeer::is_big_endian_enabled); + + ClassDB::bind_method(D_METHOD("put_8","val"),&StreamPeer::put_8); + ClassDB::bind_method(D_METHOD("put_u8","val"),&StreamPeer::put_u8); + ClassDB::bind_method(D_METHOD("put_16","val"),&StreamPeer::put_16); + ClassDB::bind_method(D_METHOD("put_u16","val"),&StreamPeer::put_u16); + ClassDB::bind_method(D_METHOD("put_32","val"),&StreamPeer::put_32); + ClassDB::bind_method(D_METHOD("put_u32","val"),&StreamPeer::put_u32); + ClassDB::bind_method(D_METHOD("put_64","val"),&StreamPeer::put_64); + ClassDB::bind_method(D_METHOD("put_u64","val"),&StreamPeer::put_u64); + ClassDB::bind_method(D_METHOD("put_float","val"),&StreamPeer::put_float); + ClassDB::bind_method(D_METHOD("put_double","val"),&StreamPeer::put_double); + ClassDB::bind_method(D_METHOD("put_utf8_string","val"),&StreamPeer::put_utf8_string); + ClassDB::bind_method(D_METHOD("put_var","val:Variant"),&StreamPeer::put_var); + + ClassDB::bind_method(D_METHOD("get_8"),&StreamPeer::get_8); + ClassDB::bind_method(D_METHOD("get_u8"),&StreamPeer::get_u8); + ClassDB::bind_method(D_METHOD("get_16"),&StreamPeer::get_16); + ClassDB::bind_method(D_METHOD("get_u16"),&StreamPeer::get_u16); + ClassDB::bind_method(D_METHOD("get_32"),&StreamPeer::get_32); + ClassDB::bind_method(D_METHOD("get_u32"),&StreamPeer::get_u32); + ClassDB::bind_method(D_METHOD("get_64"),&StreamPeer::get_64); + ClassDB::bind_method(D_METHOD("get_u64"),&StreamPeer::get_u64); + ClassDB::bind_method(D_METHOD("get_float"),&StreamPeer::get_float); + ClassDB::bind_method(D_METHOD("get_double"),&StreamPeer::get_double); + ClassDB::bind_method(D_METHOD("get_string","bytes"),&StreamPeer::get_string); + ClassDB::bind_method(D_METHOD("get_utf8_string","bytes"),&StreamPeer::get_utf8_string); + ClassDB::bind_method(D_METHOD("get_var:Variant"),&StreamPeer::get_var); } //////////////////////////////// void StreamPeerBuffer::_bind_methods() { - ClassDB::bind_method(_MD("seek","pos"),&StreamPeerBuffer::seek); - ClassDB::bind_method(_MD("get_size"),&StreamPeerBuffer::get_size); - ClassDB::bind_method(_MD("get_pos"),&StreamPeerBuffer::get_pos); - ClassDB::bind_method(_MD("resize","size"),&StreamPeerBuffer::resize); - ClassDB::bind_method(_MD("set_data_array","data"),&StreamPeerBuffer::set_data_array); - ClassDB::bind_method(_MD("get_data_array"),&StreamPeerBuffer::get_data_array); - ClassDB::bind_method(_MD("clear"),&StreamPeerBuffer::clear); - ClassDB::bind_method(_MD("duplicate:StreamPeerBuffer"),&StreamPeerBuffer::duplicate); + ClassDB::bind_method(D_METHOD("seek","pos"),&StreamPeerBuffer::seek); + ClassDB::bind_method(D_METHOD("get_size"),&StreamPeerBuffer::get_size); + ClassDB::bind_method(D_METHOD("get_pos"),&StreamPeerBuffer::get_pos); + ClassDB::bind_method(D_METHOD("resize","size"),&StreamPeerBuffer::resize); + ClassDB::bind_method(D_METHOD("set_data_array","data"),&StreamPeerBuffer::set_data_array); + ClassDB::bind_method(D_METHOD("get_data_array"),&StreamPeerBuffer::get_data_array); + ClassDB::bind_method(D_METHOD("clear"),&StreamPeerBuffer::clear); + ClassDB::bind_method(D_METHOD("duplicate:StreamPeerBuffer"),&StreamPeerBuffer::duplicate); } @@ -492,6 +492,8 @@ Error StreamPeerBuffer::get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_r PoolVector<uint8_t>::Read r = data.read(); copymem(p_buffer,r.ptr(),r_received); + + // FIXME: return what? OK or ERR_* } int StreamPeerBuffer::get_available_bytes() const { diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp index fc535e94b0..5f7247bd7a 100644 --- a/core/io/stream_peer_ssl.cpp +++ b/core/io/stream_peer_ssl.cpp @@ -57,10 +57,10 @@ bool StreamPeerSSL::is_available() { void StreamPeerSSL::_bind_methods() { - ClassDB::bind_method(_MD("accept_stream:Error","stream:StreamPeer"),&StreamPeerSSL::accept_stream); - ClassDB::bind_method(_MD("connect_to_stream:Error","stream:StreamPeer","validate_certs","for_hostname"),&StreamPeerSSL::connect_to_stream,DEFVAL(false),DEFVAL(String())); - ClassDB::bind_method(_MD("get_status"),&StreamPeerSSL::get_status); - ClassDB::bind_method(_MD("disconnect_from_stream"),&StreamPeerSSL::disconnect_from_stream); + ClassDB::bind_method(D_METHOD("accept_stream:Error","stream:StreamPeer"),&StreamPeerSSL::accept_stream); + ClassDB::bind_method(D_METHOD("connect_to_stream:Error","stream:StreamPeer","validate_certs","for_hostname"),&StreamPeerSSL::connect_to_stream,DEFVAL(false),DEFVAL(String())); + ClassDB::bind_method(D_METHOD("get_status"),&StreamPeerSSL::get_status); + ClassDB::bind_method(D_METHOD("disconnect_from_stream"),&StreamPeerSSL::disconnect_from_stream); BIND_CONSTANT( STATUS_DISCONNECTED ); BIND_CONSTANT( STATUS_CONNECTED ); BIND_CONSTANT( STATUS_ERROR_NO_CERTIFICATE ); diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp index 0a59c32995..cedc33079e 100644 --- a/core/io/stream_peer_tcp.cpp +++ b/core/io/stream_peer_tcp.cpp @@ -36,8 +36,8 @@ Error StreamPeerTCP::_connect(const String& p_address,int p_port) { if (p_address.is_valid_ip_address()) { ip=p_address; } else { - ip=IP::get_singleton()->resolve_hostname(p_address, ip_type); - if (ip==IP_Address()) + ip=IP::get_singleton()->resolve_hostname(p_address); + if (!ip.is_valid()) return ERR_CANT_RESOLVE; } @@ -45,20 +45,14 @@ Error StreamPeerTCP::_connect(const String& p_address,int p_port) { return OK; } -void StreamPeerTCP::set_ip_type(IP::Type p_type) { - disconnect_from_host(); - ip_type = p_type; -} - void StreamPeerTCP::_bind_methods() { - ClassDB::bind_method(_MD("set_ip_type","ip_type"),&StreamPeerTCP::set_ip_type); - ClassDB::bind_method(_MD("connect_to_host","host","port"),&StreamPeerTCP::_connect); - ClassDB::bind_method(_MD("is_connected_to_host"),&StreamPeerTCP::is_connected_to_host); - ClassDB::bind_method(_MD("get_status"),&StreamPeerTCP::get_status); - ClassDB::bind_method(_MD("get_connected_host"),&StreamPeerTCP::get_connected_host); - ClassDB::bind_method(_MD("get_connected_port"),&StreamPeerTCP::get_connected_port); - ClassDB::bind_method(_MD("disconnect_from_host"),&StreamPeerTCP::disconnect_from_host); + ClassDB::bind_method(D_METHOD("connect_to_host","host","port"),&StreamPeerTCP::_connect); + ClassDB::bind_method(D_METHOD("is_connected_to_host"),&StreamPeerTCP::is_connected_to_host); + ClassDB::bind_method(D_METHOD("get_status"),&StreamPeerTCP::get_status); + ClassDB::bind_method(D_METHOD("get_connected_host"),&StreamPeerTCP::get_connected_host); + ClassDB::bind_method(D_METHOD("get_connected_port"),&StreamPeerTCP::get_connected_port); + ClassDB::bind_method(D_METHOD("disconnect_from_host"),&StreamPeerTCP::disconnect_from_host); BIND_CONSTANT( STATUS_NONE ); BIND_CONSTANT( STATUS_CONNECTING ); @@ -83,7 +77,6 @@ StreamPeerTCP* StreamPeerTCP::create() { StreamPeerTCP::StreamPeerTCP() { - ip_type = IP::TYPE_ANY; } StreamPeerTCP::~StreamPeerTCP() { diff --git a/core/io/stream_peer_tcp.h b/core/io/stream_peer_tcp.h index 2b25f31739..4401378743 100644 --- a/core/io/stream_peer_tcp.h +++ b/core/io/stream_peer_tcp.h @@ -51,15 +51,12 @@ public: protected: - IP::Type ip_type; - virtual Error _connect(const String& p_address, int p_port); static StreamPeerTCP* (*_create)(); static void _bind_methods(); public: - virtual void set_ip_type(IP::Type p_type); virtual Error connect_to_host(const IP_Address& p_host, uint16_t p_port)=0; //read/write from streampeer diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index bfa5dce58f..5127bd6e3b 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -44,33 +44,17 @@ TCP_Server* TCP_Server::create() { return _create(); } -Error TCP_Server::_listen(uint16_t p_port, PoolVector<String> p_accepted_hosts) { - - List<String> hosts; - for(int i=0;i<p_accepted_hosts.size();i++) - hosts.push_back(p_accepted_hosts.get(i)); - - return listen(p_port, hosts.size()?&hosts:NULL); - -} - -void TCP_Server::set_ip_type(IP::Type p_type) { - stop(); - ip_type = p_type; -} - void TCP_Server::_bind_methods() { - ClassDB::bind_method(_MD("set_ip_type","ip_type"),&TCP_Server::set_ip_type); - ClassDB::bind_method(_MD("listen","port","accepted_hosts"),&TCP_Server::_listen,DEFVAL(PoolVector<String>())); - ClassDB::bind_method(_MD("is_connection_available"),&TCP_Server::is_connection_available); - ClassDB::bind_method(_MD("take_connection"),&TCP_Server::take_connection); - ClassDB::bind_method(_MD("stop"),&TCP_Server::stop); + ClassDB::bind_method(D_METHOD("listen","port","bind_address"),&TCP_Server::listen,DEFVAL("*")); + ClassDB::bind_method(D_METHOD("is_connection_available"),&TCP_Server::is_connection_available); + ClassDB::bind_method(D_METHOD("take_connection"),&TCP_Server::take_connection); + ClassDB::bind_method(D_METHOD("stop"),&TCP_Server::stop); } TCP_Server::TCP_Server() { - ip_type = IP::TYPE_ANY; + } diff --git a/core/io/tcp_server.h b/core/io/tcp_server.h index 3d7b3ddd8d..3cbd8c58cf 100644 --- a/core/io/tcp_server.h +++ b/core/io/tcp_server.h @@ -38,17 +38,13 @@ class TCP_Server : public Reference { GDCLASS( TCP_Server, Reference ); protected: - IP::Type ip_type; - static TCP_Server* (*_create)(); //bind helper - Error _listen(uint16_t p_port, PoolVector<String> p_accepted_hosts=PoolVector<String>()); static void _bind_methods(); public: - virtual void set_ip_type(IP::Type p_type); - virtual Error listen(uint16_t p_port, const List<String> *p_accepted_hosts=NULL)=0; + virtual Error listen(uint16_t p_port, const IP_Address p_bind_address=IP_Address("*"))=0; virtual bool is_connection_available() const=0; virtual Ref<StreamPeerTCP> take_connection()=0; diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index 0322f23056..1a4ff1a8d4 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -379,23 +379,23 @@ Error XMLParser::seek(uint64_t p_pos) { void XMLParser::_bind_methods() { - ClassDB::bind_method(_MD("read"),&XMLParser::read); - ClassDB::bind_method(_MD("get_node_type"),&XMLParser::get_node_type); - ClassDB::bind_method(_MD("get_node_name"),&XMLParser::get_node_name); - ClassDB::bind_method(_MD("get_node_data"),&XMLParser::get_node_data); - ClassDB::bind_method(_MD("get_node_offset"),&XMLParser::get_node_offset); - ClassDB::bind_method(_MD("get_attribute_count"),&XMLParser::get_attribute_count); - ClassDB::bind_method(_MD("get_attribute_name","idx"),&XMLParser::get_attribute_name); - ClassDB::bind_method(_MD("get_attribute_value","idx"),(String (XMLParser::*)(int) const) &XMLParser::get_attribute_value); - ClassDB::bind_method(_MD("has_attribute","name"),&XMLParser::has_attribute); - ClassDB::bind_method(_MD("get_named_attribute_value","name"), (String (XMLParser::*)(const String&) const) &XMLParser::get_attribute_value); - ClassDB::bind_method(_MD("get_named_attribute_value_safe","name"), &XMLParser::get_attribute_value_safe); - ClassDB::bind_method(_MD("is_empty"),&XMLParser::is_empty); - ClassDB::bind_method(_MD("get_current_line"),&XMLParser::get_current_line); - ClassDB::bind_method(_MD("skip_section"),&XMLParser::skip_section); - ClassDB::bind_method(_MD("seek","pos"),&XMLParser::seek); - ClassDB::bind_method(_MD("open","file"),&XMLParser::open); - ClassDB::bind_method(_MD("open_buffer","buffer"),&XMLParser::open_buffer); + ClassDB::bind_method(D_METHOD("read"),&XMLParser::read); + ClassDB::bind_method(D_METHOD("get_node_type"),&XMLParser::get_node_type); + ClassDB::bind_method(D_METHOD("get_node_name"),&XMLParser::get_node_name); + ClassDB::bind_method(D_METHOD("get_node_data"),&XMLParser::get_node_data); + ClassDB::bind_method(D_METHOD("get_node_offset"),&XMLParser::get_node_offset); + ClassDB::bind_method(D_METHOD("get_attribute_count"),&XMLParser::get_attribute_count); + ClassDB::bind_method(D_METHOD("get_attribute_name","idx"),&XMLParser::get_attribute_name); + ClassDB::bind_method(D_METHOD("get_attribute_value","idx"),(String (XMLParser::*)(int) const) &XMLParser::get_attribute_value); + ClassDB::bind_method(D_METHOD("has_attribute","name"),&XMLParser::has_attribute); + ClassDB::bind_method(D_METHOD("get_named_attribute_value","name"), (String (XMLParser::*)(const String&) const) &XMLParser::get_attribute_value); + ClassDB::bind_method(D_METHOD("get_named_attribute_value_safe","name"), &XMLParser::get_attribute_value_safe); + ClassDB::bind_method(D_METHOD("is_empty"),&XMLParser::is_empty); + ClassDB::bind_method(D_METHOD("get_current_line"),&XMLParser::get_current_line); + ClassDB::bind_method(D_METHOD("skip_section"),&XMLParser::skip_section); + ClassDB::bind_method(D_METHOD("seek","pos"),&XMLParser::seek); + ClassDB::bind_method(D_METHOD("open","file"),&XMLParser::open); + ClassDB::bind_method(D_METHOD("open_buffer","buffer"),&XMLParser::open_buffer); BIND_CONSTANT( NODE_NONE ); BIND_CONSTANT( NODE_ELEMENT ); diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index a1f471ebe3..7e31957e3e 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -407,23 +407,23 @@ PoolVector<int> AStar::get_id_path(int p_from_id, int p_to_id) { void AStar::_bind_methods() { - ClassDB::bind_method(_MD("get_available_point_id"),&AStar::get_available_point_id); - ClassDB::bind_method(_MD("add_point","id","pos","weight_scale"),&AStar::add_point,DEFVAL(1.0)); - ClassDB::bind_method(_MD("get_point_pos","id"),&AStar::get_point_pos); - ClassDB::bind_method(_MD("get_point_weight_scale","id"),&AStar::get_point_weight_scale); - ClassDB::bind_method(_MD("remove_point","id"),&AStar::remove_point); + ClassDB::bind_method(D_METHOD("get_available_point_id"),&AStar::get_available_point_id); + ClassDB::bind_method(D_METHOD("add_point","id","pos","weight_scale"),&AStar::add_point,DEFVAL(1.0)); + ClassDB::bind_method(D_METHOD("get_point_pos","id"),&AStar::get_point_pos); + ClassDB::bind_method(D_METHOD("get_point_weight_scale","id"),&AStar::get_point_weight_scale); + ClassDB::bind_method(D_METHOD("remove_point","id"),&AStar::remove_point); - ClassDB::bind_method(_MD("connect_points","id","to_id"),&AStar::connect_points); - ClassDB::bind_method(_MD("disconnect_points","id","to_id"),&AStar::disconnect_points); - ClassDB::bind_method(_MD("are_points_connected","id","to_id"),&AStar::are_points_connected); + ClassDB::bind_method(D_METHOD("connect_points","id","to_id"),&AStar::connect_points); + ClassDB::bind_method(D_METHOD("disconnect_points","id","to_id"),&AStar::disconnect_points); + ClassDB::bind_method(D_METHOD("are_points_connected","id","to_id"),&AStar::are_points_connected); - ClassDB::bind_method(_MD("clear"),&AStar::clear); + ClassDB::bind_method(D_METHOD("clear"),&AStar::clear); - ClassDB::bind_method(_MD("get_closest_point","to_pos"),&AStar::get_closest_point); - ClassDB::bind_method(_MD("get_closest_pos_in_segment","to_pos"),&AStar::get_closest_pos_in_segment); + ClassDB::bind_method(D_METHOD("get_closest_point","to_pos"),&AStar::get_closest_point); + ClassDB::bind_method(D_METHOD("get_closest_pos_in_segment","to_pos"),&AStar::get_closest_pos_in_segment); - ClassDB::bind_method(_MD("get_point_path","from_id","to_id"),&AStar::get_point_path); - ClassDB::bind_method(_MD("get_id_path","from_id","to_id"),&AStar::get_id_path); + ClassDB::bind_method(D_METHOD("get_point_path","from_id","to_id"),&AStar::get_point_path); + ClassDB::bind_method(D_METHOD("get_id_path","from_id","to_id"),&AStar::get_id_path); } diff --git a/core/math/audio_frame.cpp b/core/math/audio_frame.cpp index 566ba23992..aae1561a84 100644 --- a/core/math/audio_frame.cpp +++ b/core/math/audio_frame.cpp @@ -1,2 +1,30 @@ +/*************************************************************************/ +/* audio_frame.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_frame.h" diff --git a/core/math/audio_frame.h b/core/math/audio_frame.h index acd74903bb..e4e93f34fa 100644 --- a/core/math/audio_frame.h +++ b/core/math/audio_frame.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_frame.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOFRAME_H #define AUDIOFRAME_H diff --git a/core/math/geometry.h b/core/math/geometry.h index 13cbbdce6f..1dd7df038d 100644 --- a/core/math/geometry.h +++ b/core/math/geometry.h @@ -109,6 +109,7 @@ public: static void get_closest_points_between_segments(const Vector3& p1,const Vector3& p2,const Vector3& q1,const Vector3& q2,Vector3& c1, Vector3& c2) { +#if 0 //do the function 'd' as defined by pb. I think is is dot product of some sort #define d_of(m,n,o,p) ( (m.x - n.x) * (o.x - p.x) + (m.y - n.y) * (o.y - p.y) + (m.z - n.z) * (o.z - p.z) ) @@ -123,6 +124,33 @@ public: if (mub > 1) mub = 1; c1 = p1.linear_interpolate(p2,mua); c2 = q1.linear_interpolate(q2,mub); +#endif + + Vector3 u = p2 - p1; + Vector3 v = q2 - q1; + Vector3 w = p1 - q1; + float a = u.dot(u); + float b = u.dot(v); + float c = v.dot(v); // always >= 0 + float d = u.dot(w); + float e = v.dot(w); + float D = a*c - b*b; // always >= 0 + float sc, tc; + + // compute the line parameters of the two closest points + if (D < CMP_EPSILON) { // the lines are almost parallel + sc = 0.0; + tc = (b>c ? d/b : e/c); // use the largest denominator + } + else { + sc = (b*e - c*d) / D; + tc = (a*e - b*d) / D; + } + + c1 = w + sc * u; + c2 = w + tc * v; + // get the difference of the two closest points + //Vector dP = w + (sc * u) - (tc * v); // = L1(sc) - L2(tc) } static real_t get_closest_distance_between_segments( const Vector3& p_from_a,const Vector3& p_to_a, const Vector3& p_from_b,const Vector3& p_to_b) { diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index 511af91835..ae461eda2e 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -39,6 +39,8 @@ #define Math_PI 3.14159265358979323846 #define Math_SQRT12 0.7071067811865475244008443621048490 #define Math_LN2 0.693147180559945309417 +#define Math_INF INFINITY +#define Math_NAN NAN class Math { @@ -48,7 +50,7 @@ public: Math() {} // useless to instance enum { - RANDOM_MAX=2147483647L + RANDOM_MAX=4294967295L }; diff --git a/core/message_queue.cpp b/core/message_queue.cpp index 668d321e05..50b52e4970 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "message_queue.h" -#include "globals.h" +#include "global_config.h" #include "script_language.h" MessageQueue *MessageQueue::singleton=NULL; diff --git a/core/method_ptrcall.h b/core/method_ptrcall.h index a35e44b66c..e175a10156 100644 --- a/core/method_ptrcall.h +++ b/core/method_ptrcall.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* method_ptrcall.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 METHOD_PTRCALL_H #define METHOD_PTRCALL_H diff --git a/core/object.cpp b/core/object.cpp index 26308dc64f..79905a6be6 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -383,7 +383,7 @@ void Object::set(const String& p_name, const Variant& p_value) { if (p_name=="__meta__") { metadata=p_value; - } else if (p_name=="script/script") { + } else if (p_name=="script") { set_script(p_value); } else if (script_instance) { script_instance->set(p_name,p_value); @@ -516,7 +516,7 @@ Variant Object::get(const String& p_name) const { if (p_name=="__meta__") return metadata; - else if (p_name=="script/script") + else if (p_name=="script") return script; if (script_instance) { @@ -539,7 +539,7 @@ void Object::get_property_list(List<PropertyInfo> *p_list,bool p_reversed) const if (!is_class("Script")) // can still be set, but this is for userfriendlyness - p_list->push_back( PropertyInfo( Variant::OBJECT, "script/script", PROPERTY_HINT_RESOURCE_TYPE, "Script",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_STORE_IF_NONZERO)); + p_list->push_back( PropertyInfo( Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_STORE_IF_NONZERO)); if (!metadata.empty()) p_list->push_back( PropertyInfo( Variant::DICTIONARY, "__meta__", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR|PROPERTY_USAGE_STORE_IF_NONZERO)); if (script_instance && !p_reversed) { @@ -1041,7 +1041,7 @@ void Object::set_script(const RefPtr& p_script) { } - _change_notify("script/script"); + _change_notify("script"); emit_signal(CoreStringNames::get_singleton()->script_changed); } @@ -1675,31 +1675,31 @@ void Object::clear_internal_resource_paths() { void Object::_bind_methods() { - ClassDB::bind_method(_MD("get_class"),&Object::get_class); - ClassDB::bind_method(_MD("is_class","type"),&Object::is_class); - ClassDB::bind_method(_MD("set","property","value"),&Object::_set_bind); - ClassDB::bind_method(_MD("get","property"),&Object::_get_bind); - ClassDB::bind_method(_MD("get_property_list"),&Object::_get_property_list_bind); - ClassDB::bind_method(_MD("get_method_list"),&Object::_get_method_list_bind); - ClassDB::bind_method(_MD("notification","what","reversed"),&Object::notification,DEFVAL(false)); - ClassDB::bind_method(_MD("get_instance_ID"),&Object::get_instance_ID); + ClassDB::bind_method(D_METHOD("get_class"),&Object::get_class); + ClassDB::bind_method(D_METHOD("is_class","type"),&Object::is_class); + ClassDB::bind_method(D_METHOD("set","property","value"),&Object::_set_bind); + ClassDB::bind_method(D_METHOD("get","property"),&Object::_get_bind); + ClassDB::bind_method(D_METHOD("get_property_list"),&Object::_get_property_list_bind); + ClassDB::bind_method(D_METHOD("get_method_list"),&Object::_get_method_list_bind); + ClassDB::bind_method(D_METHOD("notification","what","reversed"),&Object::notification,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_instance_ID"),&Object::get_instance_ID); - ClassDB::bind_method(_MD("set_script","script:Script"),&Object::set_script); - ClassDB::bind_method(_MD("get_script:Script"),&Object::get_script); + ClassDB::bind_method(D_METHOD("set_script","script:Script"),&Object::set_script); + ClassDB::bind_method(D_METHOD("get_script:Script"),&Object::get_script); - ClassDB::bind_method(_MD("set_meta","name","value"),&Object::set_meta); - ClassDB::bind_method(_MD("get_meta","name","value"),&Object::get_meta); - ClassDB::bind_method(_MD("has_meta","name"),&Object::has_meta); - ClassDB::bind_method(_MD("get_meta_list"),&Object::_get_meta_list_bind); + ClassDB::bind_method(D_METHOD("set_meta","name","value"),&Object::set_meta); + ClassDB::bind_method(D_METHOD("get_meta","name","value"),&Object::get_meta); + ClassDB::bind_method(D_METHOD("has_meta","name"),&Object::has_meta); + ClassDB::bind_method(D_METHOD("get_meta_list"),&Object::_get_meta_list_bind); //todo reimplement this per language so all 5 arguments can be called - //ClassDB::bind_method(_MD("call","method","arg1","arg2","arg3","arg4"),&Object::_call_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); - //ClassDB::bind_method(_MD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); + //ClassDB::bind_method(D_METHOD("call","method","arg1","arg2","arg3","arg4"),&Object::_call_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); + //ClassDB::bind_method(D_METHOD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); - ClassDB::bind_method(_MD("add_user_signal","signal","arguments"),&Object::_add_user_signal,DEFVAL(Array())); - ClassDB::bind_method(_MD("has_user_signal","signal"),&Object::_has_user_signal); - //ClassDB::bind_method(_MD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array())); + ClassDB::bind_method(D_METHOD("add_user_signal","signal","arguments"),&Object::_add_user_signal,DEFVAL(Array())); + ClassDB::bind_method(D_METHOD("has_user_signal","signal"),&Object::_has_user_signal); + //ClassDB::bind_method(D_METHOD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array())); { @@ -1728,27 +1728,27 @@ void Object::_bind_methods() { ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_deferred",&Object::_call_deferred_bind,mi); } - ClassDB::bind_method(_MD("callv:Variant","method","arg_array"),&Object::callv); + ClassDB::bind_method(D_METHOD("callv:Variant","method","arg_array"),&Object::callv); - ClassDB::bind_method(_MD("has_method","method"),&Object::has_method); + ClassDB::bind_method(D_METHOD("has_method","method"),&Object::has_method); - ClassDB::bind_method(_MD("get_signal_list"),&Object::_get_signal_list); - ClassDB::bind_method(_MD("get_signal_connection_list","signal"),&Object::_get_signal_connection_list); + ClassDB::bind_method(D_METHOD("get_signal_list"),&Object::_get_signal_list); + ClassDB::bind_method(D_METHOD("get_signal_connection_list","signal"),&Object::_get_signal_connection_list); - ClassDB::bind_method(_MD("connect","signal","target:Object","method","binds","flags"),&Object::connect,DEFVAL(Array()),DEFVAL(0)); - ClassDB::bind_method(_MD("disconnect","signal","target:Object","method"),&Object::disconnect); - ClassDB::bind_method(_MD("is_connected","signal","target:Object","method"),&Object::is_connected); + ClassDB::bind_method(D_METHOD("connect","signal","target:Object","method","binds","flags"),&Object::connect,DEFVAL(Array()),DEFVAL(0)); + ClassDB::bind_method(D_METHOD("disconnect","signal","target:Object","method"),&Object::disconnect); + ClassDB::bind_method(D_METHOD("is_connected","signal","target:Object","method"),&Object::is_connected); - ClassDB::bind_method(_MD("set_block_signals","enable"),&Object::set_block_signals); - ClassDB::bind_method(_MD("is_blocking_signals"),&Object::is_blocking_signals); - ClassDB::bind_method(_MD("set_message_translation","enable"),&Object::set_message_translation); - ClassDB::bind_method(_MD("can_translate_messages"),&Object::can_translate_messages); - ClassDB::bind_method(_MD("property_list_changed_notify"),&Object::property_list_changed_notify); + ClassDB::bind_method(D_METHOD("set_block_signals","enable"),&Object::set_block_signals); + ClassDB::bind_method(D_METHOD("is_blocking_signals"),&Object::is_blocking_signals); + ClassDB::bind_method(D_METHOD("set_message_translation","enable"),&Object::set_message_translation); + ClassDB::bind_method(D_METHOD("can_translate_messages"),&Object::can_translate_messages); + ClassDB::bind_method(D_METHOD("property_list_changed_notify"),&Object::property_list_changed_notify); - ClassDB::bind_method(_MD("XL_MESSAGE","message"),&Object::XL_MESSAGE); - ClassDB::bind_method(_MD("tr","message"),&Object::tr); + ClassDB::bind_method(D_METHOD("XL_MESSAGE","message"),&Object::XL_MESSAGE); + ClassDB::bind_method(D_METHOD("tr","message"),&Object::tr); - ClassDB::bind_method(_MD("is_queued_for_deletion"),&Object::is_queued_for_deletion); + ClassDB::bind_method(D_METHOD("is_queued_for_deletion"),&Object::is_queued_for_deletion); ClassDB::add_virtual_method("Object",MethodInfo("free"),false); diff --git a/core/object.h b/core/object.h index 3032452ccf..3fe31bee6b 100644 --- a/core/object.h +++ b/core/object.h @@ -114,12 +114,12 @@ enum PropertyUsageFlags { #define ADD_SIGNAL( m_signal ) ClassDB::add_signal( get_class_static(), m_signal ) -#define ADD_PROPERTY( m_property, m_setter, m_getter ) ClassDB::add_property( get_class_static(), m_property, m_setter, m_getter ) -#define ADD_PROPERTYI( m_property, m_setter, m_getter, m_index ) ClassDB::add_property( get_class_static(), m_property, m_setter, m_getter, m_index ) -#define ADD_PROPERTYNZ( m_property, m_setter, m_getter ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONZERO), m_setter, m_getter ) -#define ADD_PROPERTYINZ( m_property, m_setter, m_getter, m_index ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONZERO), m_setter, m_getter, m_index ) -#define ADD_PROPERTYNO( m_property, m_setter, m_getter ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONONE), m_setter, m_getter ) -#define ADD_PROPERTYINO( m_property, m_setter, m_getter, m_index ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONONE), m_setter, m_getter, m_index ) +#define ADD_PROPERTY( m_property, m_setter, m_getter ) ClassDB::add_property( get_class_static(), m_property, _scs_create(m_setter), _scs_create(m_getter) ) +#define ADD_PROPERTYI( m_property, m_setter, m_getter, m_index ) ClassDB::add_property( get_class_static(), m_property, _scs_create(m_setter), _scs_create(m_getter), m_index ) +#define ADD_PROPERTYNZ( m_property, m_setter, m_getter ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONZERO), _scs_create(m_setter), _scs_create(m_getter) ) +#define ADD_PROPERTYINZ( m_property, m_setter, m_getter, m_index ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONZERO), _scs_create(m_setter), _scs_create(m_getter), m_index ) +#define ADD_PROPERTYNO( m_property, m_setter, m_getter ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONONE), _scs_create(m_setter), _scs_create(m_getter) ) +#define ADD_PROPERTYINO( m_property, m_setter, m_getter, m_index ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONONE), _scs_create(m_setter), _scs_create(m_getter), m_index ) #define ADD_GROUP( m_name, m_prefix ) ClassDB::add_property_group( get_class_static(), m_name, m_prefix ) struct PropertyInfo { @@ -680,7 +680,7 @@ class ObjectDB { unsigned long i; } u; u.p=p_obj; - return HashMapHahserDefault::hash((uint64_t)u.i); + return HashMapHasherDefault::hash((uint64_t)u.i); } }; diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index 804fe15c39..974225a3e8 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -30,7 +30,7 @@ #include "os/file_access.h" #include "os/memory.h" #include "os/os.h" -#include "globals.h" +#include "global_config.h" String DirAccess::_get_root_path() const { diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index 06723c5131..ae592720e8 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "file_access.h" -#include "globals.h" +#include "global_config.h" #include "os/os.h" #include "core/io/marshalls.h" #include "io/md5.h" diff --git a/core/os/input.cpp b/core/os/input.cpp index 4e7b037453..34883e63ba 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -29,7 +29,7 @@ #include "input.h" #include "input_map.h" #include "os/os.h" -#include "globals.h" +#include "global_config.h" Input *Input::singleton=NULL; Input *Input::get_singleton() { @@ -49,40 +49,40 @@ Input::MouseMode Input::get_mouse_mode() const { void Input::_bind_methods() { - ClassDB::bind_method(_MD("is_key_pressed","scancode"),&Input::is_key_pressed); - ClassDB::bind_method(_MD("is_mouse_button_pressed","button"),&Input::is_mouse_button_pressed); - ClassDB::bind_method(_MD("is_joy_button_pressed","device","button"),&Input::is_joy_button_pressed); - ClassDB::bind_method(_MD("is_action_pressed","action"),&Input::is_action_pressed); - ClassDB::bind_method(_MD("is_action_just_pressed","action"),&Input::is_action_just_pressed); - ClassDB::bind_method(_MD("is_action_just_released","action"),&Input::is_action_just_released); - ClassDB::bind_method(_MD("add_joy_mapping","mapping", "update_existing"),&Input::add_joy_mapping, DEFVAL(false)); - ClassDB::bind_method(_MD("remove_joy_mapping","guid"),&Input::remove_joy_mapping); - ClassDB::bind_method(_MD("is_joy_known","device"),&Input::is_joy_known); - ClassDB::bind_method(_MD("get_joy_axis","device","axis"),&Input::get_joy_axis); - ClassDB::bind_method(_MD("get_joy_name","device"),&Input::get_joy_name); - ClassDB::bind_method(_MD("get_joy_guid","device"),&Input::get_joy_guid); - ClassDB::bind_method(_MD("get_connected_joypads"),&Input::get_connected_joypads); - ClassDB::bind_method(_MD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength); - ClassDB::bind_method(_MD("get_joy_vibration_duration", "device"), &Input::get_joy_vibration_duration); - ClassDB::bind_method(_MD("get_joy_button_string", "button_index"), &Input::get_joy_button_string); - ClassDB::bind_method(_MD("get_joy_button_index_from_string", "button"), &Input::get_joy_button_index_from_string); - ClassDB::bind_method(_MD("get_joy_axis_string", "axis_index"), &Input::get_joy_axis_string); - ClassDB::bind_method(_MD("get_joy_axis_index_from_string", "axis"), &Input::get_joy_axis_index_from_string); - ClassDB::bind_method(_MD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0)); - ClassDB::bind_method(_MD("stop_joy_vibration", "device"), &Input::stop_joy_vibration); - ClassDB::bind_method(_MD("get_gravity"),&Input::get_gravity); - ClassDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer); - ClassDB::bind_method(_MD("get_magnetometer"),&Input::get_magnetometer); - ClassDB::bind_method(_MD("get_gyroscope"),&Input::get_gyroscope); - //ClassDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want - ClassDB::bind_method(_MD("get_last_mouse_speed"),&Input::get_last_mouse_speed); - ClassDB::bind_method(_MD("get_mouse_button_mask"),&Input::get_mouse_button_mask); - ClassDB::bind_method(_MD("set_mouse_mode","mode"),&Input::set_mouse_mode); - ClassDB::bind_method(_MD("get_mouse_mode"),&Input::get_mouse_mode); - ClassDB::bind_method(_MD("warp_mouse_pos","to"),&Input::warp_mouse_pos); - ClassDB::bind_method(_MD("action_press","action"),&Input::action_press); - ClassDB::bind_method(_MD("action_release","action"),&Input::action_release); - ClassDB::bind_method(_MD("set_custom_mouse_cursor","image:Texture","hotspot"),&Input::set_custom_mouse_cursor,DEFVAL(Vector2())); + ClassDB::bind_method(D_METHOD("is_key_pressed","scancode"),&Input::is_key_pressed); + ClassDB::bind_method(D_METHOD("is_mouse_button_pressed","button"),&Input::is_mouse_button_pressed); + ClassDB::bind_method(D_METHOD("is_joy_button_pressed","device","button"),&Input::is_joy_button_pressed); + ClassDB::bind_method(D_METHOD("is_action_pressed","action"),&Input::is_action_pressed); + ClassDB::bind_method(D_METHOD("is_action_just_pressed","action"),&Input::is_action_just_pressed); + ClassDB::bind_method(D_METHOD("is_action_just_released","action"),&Input::is_action_just_released); + ClassDB::bind_method(D_METHOD("add_joy_mapping","mapping", "update_existing"),&Input::add_joy_mapping, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("remove_joy_mapping","guid"),&Input::remove_joy_mapping); + ClassDB::bind_method(D_METHOD("is_joy_known","device"),&Input::is_joy_known); + ClassDB::bind_method(D_METHOD("get_joy_axis","device","axis"),&Input::get_joy_axis); + ClassDB::bind_method(D_METHOD("get_joy_name","device"),&Input::get_joy_name); + ClassDB::bind_method(D_METHOD("get_joy_guid","device"),&Input::get_joy_guid); + ClassDB::bind_method(D_METHOD("get_connected_joypads"),&Input::get_connected_joypads); + ClassDB::bind_method(D_METHOD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength); + ClassDB::bind_method(D_METHOD("get_joy_vibration_duration", "device"), &Input::get_joy_vibration_duration); + ClassDB::bind_method(D_METHOD("get_joy_button_string", "button_index"), &Input::get_joy_button_string); + ClassDB::bind_method(D_METHOD("get_joy_button_index_from_string", "button"), &Input::get_joy_button_index_from_string); + ClassDB::bind_method(D_METHOD("get_joy_axis_string", "axis_index"), &Input::get_joy_axis_string); + ClassDB::bind_method(D_METHOD("get_joy_axis_index_from_string", "axis"), &Input::get_joy_axis_index_from_string); + ClassDB::bind_method(D_METHOD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0)); + ClassDB::bind_method(D_METHOD("stop_joy_vibration", "device"), &Input::stop_joy_vibration); + ClassDB::bind_method(D_METHOD("get_gravity"),&Input::get_gravity); + ClassDB::bind_method(D_METHOD("get_accelerometer"),&Input::get_accelerometer); + ClassDB::bind_method(D_METHOD("get_magnetometer"),&Input::get_magnetometer); + ClassDB::bind_method(D_METHOD("get_gyroscope"),&Input::get_gyroscope); + //ClassDB::bind_method(D_METHOD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want + ClassDB::bind_method(D_METHOD("get_last_mouse_speed"),&Input::get_last_mouse_speed); + ClassDB::bind_method(D_METHOD("get_mouse_button_mask"),&Input::get_mouse_button_mask); + ClassDB::bind_method(D_METHOD("set_mouse_mode","mode"),&Input::set_mouse_mode); + ClassDB::bind_method(D_METHOD("get_mouse_mode"),&Input::get_mouse_mode); + ClassDB::bind_method(D_METHOD("warp_mouse_pos","to"),&Input::warp_mouse_pos); + ClassDB::bind_method(D_METHOD("action_press","action"),&Input::action_press); + ClassDB::bind_method(D_METHOD("action_release","action"),&Input::action_release); + ClassDB::bind_method(D_METHOD("set_custom_mouse_cursor","image:Texture","hotspot"),&Input::set_custom_mouse_cursor,DEFVAL(Vector2())); BIND_CONSTANT( MOUSE_MODE_VISIBLE ); BIND_CONSTANT( MOUSE_MODE_HIDDEN ); diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 11396666d2..dcda8e8952 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -31,12 +31,12 @@ void MainLoop::_bind_methods() { - ClassDB::bind_method(_MD("input_event","ev"),&MainLoop::input_event); - ClassDB::bind_method(_MD("input_text","text"),&MainLoop::input_text); - ClassDB::bind_method(_MD("init"),&MainLoop::init); - ClassDB::bind_method(_MD("iteration","delta"),&MainLoop::iteration); - ClassDB::bind_method(_MD("idle","delta"),&MainLoop::idle); - ClassDB::bind_method(_MD("finish"),&MainLoop::finish); + ClassDB::bind_method(D_METHOD("input_event","ev"),&MainLoop::input_event); + ClassDB::bind_method(D_METHOD("input_text","text"),&MainLoop::input_text); + ClassDB::bind_method(D_METHOD("init"),&MainLoop::init); + ClassDB::bind_method(D_METHOD("iteration","delta"),&MainLoop::iteration); + ClassDB::bind_method(D_METHOD("idle","delta"),&MainLoop::idle); + ClassDB::bind_method(D_METHOD("finish"),&MainLoop::finish); BIND_VMETHOD( MethodInfo("_input_event",PropertyInfo(Variant::INPUT_EVENT,"ev")) ); BIND_VMETHOD( MethodInfo("_input_text",PropertyInfo(Variant::STRING,"text")) ); diff --git a/core/os/os.cpp b/core/os/os.cpp index 3a8e15a692..1d670b4466 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -29,7 +29,7 @@ #include "os.h" #include "dir_access.h" -#include "globals.h" +#include "global_config.h" #include "input.h" #include "os/file_access.h" @@ -513,6 +513,16 @@ bool OS::is_vsync_enabled() const{ } +PowerState OS::get_power_state() { + return POWERSTATE_UNKNOWN; +} +int OS::get_power_seconds_left() { + return -1; +} +int OS::get_power_percent_left() { + return -1; +} + OS::OS() { last_error=NULL; singleton=this; diff --git a/core/os/os.h b/core/os/os.h index e179b82dae..7c8100679a 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -34,8 +34,10 @@ #include "vector.h" #include "engine.h" #include "os/main_loop.h" +#include "power.h" #include <stdarg.h> + /** @author Juan Linietsky <reduzio@gmail.com> */ @@ -402,6 +404,10 @@ public: virtual void set_use_vsync(bool p_enable); virtual bool is_vsync_enabled() const; + + virtual PowerState get_power_state(); + virtual int get_power_seconds_left(); + virtual int get_power_percent_left(); virtual bool check_feature_support(const String& p_feature)=0; diff --git a/core/os/power.h b/core/os/power.h new file mode 100644 index 0000000000..c92348ff50 --- /dev/null +++ b/core/os/power.h @@ -0,0 +1,44 @@ +/*************************************************************************/ +/* power.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 CORE_OS_POWER_H_ +#define CORE_OS_POWER_H_ + + +typedef enum +{ + POWERSTATE_UNKNOWN, /**< cannot determine power status */ + POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ + POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ + POWERSTATE_CHARGING, /**< Plugged in, charging battery */ + POWERSTATE_CHARGED /**< Plugged in, battery charged */ +} PowerState; + + +#endif /* CORE_OS_POWER_H_ */ diff --git a/core/os/rw_lock.cpp b/core/os/rw_lock.cpp index 9b2d1f8a46..3af62aa8da 100644 --- a/core/os/rw_lock.cpp +++ b/core/os/rw_lock.cpp @@ -1,7 +1,36 @@ +/*************************************************************************/ +/* rw_lock.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "rw_lock.h" + #include "error_macros.h" -#include <stddef.h> +#include <stddef.h> RWLock* (*RWLock::create_func)()=0; diff --git a/core/os/rw_lock.h b/core/os/rw_lock.h index c513e6d636..6b4af83bf9 100644 --- a/core/os/rw_lock.h +++ b/core/os/rw_lock.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* rw_lock.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RWLOCK_H #define RWLOCK_H diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp index d3bb03ab5e..803a217fca 100644 --- a/core/packed_data_container.cpp +++ b/core/packed_data_container.cpp @@ -382,15 +382,15 @@ Variant PackedDataContainer::_iter_get(const Variant& p_iter){ void PackedDataContainer::_bind_methods() { - ClassDB::bind_method(_MD("_set_data"),&PackedDataContainer::_set_data); - ClassDB::bind_method(_MD("_get_data"),&PackedDataContainer::_get_data); - ClassDB::bind_method(_MD("_iter_init"),&PackedDataContainer::_iter_init); - ClassDB::bind_method(_MD("_iter_get"),&PackedDataContainer::_iter_get); - ClassDB::bind_method(_MD("_iter_next"),&PackedDataContainer::_iter_next); - ClassDB::bind_method(_MD("pack:Error","value"),&PackedDataContainer::pack); - ClassDB::bind_method(_MD("size"),&PackedDataContainer::size); - - ADD_PROPERTY( PropertyInfo(Variant::POOL_BYTE_ARRAY,"__data__"),_SCS("_set_data"),_SCS("_get_data")); + ClassDB::bind_method(D_METHOD("_set_data"),&PackedDataContainer::_set_data); + ClassDB::bind_method(D_METHOD("_get_data"),&PackedDataContainer::_get_data); + ClassDB::bind_method(D_METHOD("_iter_init"),&PackedDataContainer::_iter_init); + ClassDB::bind_method(D_METHOD("_iter_get"),&PackedDataContainer::_iter_get); + ClassDB::bind_method(D_METHOD("_iter_next"),&PackedDataContainer::_iter_next); + ClassDB::bind_method(D_METHOD("pack:Error","value"),&PackedDataContainer::pack); + ClassDB::bind_method(D_METHOD("size"),&PackedDataContainer::size); + + ADD_PROPERTY( PropertyInfo(Variant::POOL_BYTE_ARRAY,"__data__"),"_set_data","_get_data"); } @@ -426,11 +426,11 @@ bool PackedDataContainerRef::_is_dictionary() const { void PackedDataContainerRef::_bind_methods() { - ClassDB::bind_method(_MD("size"),&PackedDataContainerRef::size); - ClassDB::bind_method(_MD("_iter_init"),&PackedDataContainerRef::_iter_init); - ClassDB::bind_method(_MD("_iter_get"),&PackedDataContainerRef::_iter_get); - ClassDB::bind_method(_MD("_iter_next"),&PackedDataContainerRef::_iter_next); - ClassDB::bind_method(_MD("_is_dictionary"),&PackedDataContainerRef::_is_dictionary); + ClassDB::bind_method(D_METHOD("size"),&PackedDataContainerRef::size); + ClassDB::bind_method(D_METHOD("_iter_init"),&PackedDataContainerRef::_iter_init); + ClassDB::bind_method(D_METHOD("_iter_get"),&PackedDataContainerRef::_iter_get); + ClassDB::bind_method(D_METHOD("_iter_next"),&PackedDataContainerRef::_iter_next); + ClassDB::bind_method(D_METHOD("_is_dictionary"),&PackedDataContainerRef::_is_dictionary); } diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp index b1417dd107..3260225ac3 100644 --- a/core/pool_allocator.cpp +++ b/core/pool_allocator.cpp @@ -504,7 +504,7 @@ const void *PoolAllocator::get(ID p_mem) const { return NULL; } - if (e->pos<0 || (int)e->pos>=pool_size) { + if ((int)e->pos>=pool_size) { mt_unlock(); ERR_PRINT("e->pos<0 || e->pos>=pool_size"); @@ -546,7 +546,7 @@ void *PoolAllocator::get(ID p_mem) { return NULL; } - if (e->pos<0 || (int)e->pos>=pool_size) { + if ((int)e->pos>=pool_size) { mt_unlock(); ERR_PRINT("e->pos<0 || e->pos>=pool_size"); diff --git a/core/reference.cpp b/core/reference.cpp index d21caf0839..5e8244d2ca 100644 --- a/core/reference.cpp +++ b/core/reference.cpp @@ -55,9 +55,9 @@ bool Reference::init_ref() { void Reference::_bind_methods() { - ClassDB::bind_method(_MD("init_ref"),&Reference::init_ref); - ClassDB::bind_method(_MD("reference"),&Reference::reference); - ClassDB::bind_method(_MD("unreference"),&Reference::unreference); + ClassDB::bind_method(D_METHOD("init_ref"),&Reference::init_ref); + ClassDB::bind_method(D_METHOD("reference"),&Reference::reference); + ClassDB::bind_method(D_METHOD("unreference"),&Reference::unreference); } int Reference::reference_get_count() const { @@ -127,7 +127,7 @@ WeakRef::WeakRef() { void WeakRef::_bind_methods() { - ClassDB::bind_method(_MD("get_ref:Object"),&WeakRef::get_ref); + ClassDB::bind_method(D_METHOD("get_ref:Object"),&WeakRef::get_ref); } #if 0 diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index ab94b56cdc..00f6f8662f 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -35,7 +35,7 @@ #include "io/packet_peer.h" #include "math/a_star.h" #include "math/triangle_mesh.h" -#include "globals.h" +#include "global_config.h" #include "class_db.h" #include "geometry.h" #include "bind/core_bind.h" diff --git a/core/resource.cpp b/core/resource.cpp index 9b5bac5f32..fe3cb2df92 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -327,23 +327,23 @@ Node* (*Resource::_get_local_scene_func)()=NULL; void Resource::_bind_methods() { - ClassDB::bind_method(_MD("set_path","path"),&Resource::_set_path); - ClassDB::bind_method(_MD("take_over_path","path"),&Resource::_take_over_path); - ClassDB::bind_method(_MD("get_path"),&Resource::get_path); - ClassDB::bind_method(_MD("set_name","name"),&Resource::set_name); - ClassDB::bind_method(_MD("get_name"),&Resource::get_name); - ClassDB::bind_method(_MD("get_rid"),&Resource::get_rid); - ClassDB::bind_method(_MD("set_local_to_scene","enable"),&Resource::set_local_to_scene); - ClassDB::bind_method(_MD("is_local_to_scene"),&Resource::is_local_to_scene); - ClassDB::bind_method(_MD("get_local_scene:Node"),&Resource::get_local_scene); - ClassDB::bind_method(_MD("setup_local_to_scene"),&Resource::setup_local_to_scene); - - ClassDB::bind_method(_MD("duplicate","subresources"),&Resource::duplicate,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("set_path","path"),&Resource::_set_path); + ClassDB::bind_method(D_METHOD("take_over_path","path"),&Resource::_take_over_path); + ClassDB::bind_method(D_METHOD("get_path"),&Resource::get_path); + ClassDB::bind_method(D_METHOD("set_name","name"),&Resource::set_name); + ClassDB::bind_method(D_METHOD("get_name"),&Resource::get_name); + ClassDB::bind_method(D_METHOD("get_rid"),&Resource::get_rid); + ClassDB::bind_method(D_METHOD("set_local_to_scene","enable"),&Resource::set_local_to_scene); + ClassDB::bind_method(D_METHOD("is_local_to_scene"),&Resource::is_local_to_scene); + ClassDB::bind_method(D_METHOD("get_local_scene:Node"),&Resource::get_local_scene); + ClassDB::bind_method(D_METHOD("setup_local_to_scene"),&Resource::setup_local_to_scene); + + ClassDB::bind_method(D_METHOD("duplicate","subresources"),&Resource::duplicate,DEFVAL(false)); ADD_SIGNAL( MethodInfo("changed") ); ADD_GROUP("Resource","resource_"); - ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"resource_local_to_scene" ), _SCS("set_local_to_scene"),_SCS("is_local_to_scene")); - 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")); + ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"resource_local_to_scene" ), "set_local_to_scene","is_local_to_scene"); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"resource_path",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR ), "set_path","get_path"); + ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"resource_name"), "set_name","get_name"); BIND_VMETHOD( MethodInfo("_setup_local_to_scene") ); diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 62d14c4e5a..b14eb51b6c 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -30,7 +30,7 @@ #include "os/os.h" #include "io/ip.h" -#include "globals.h" +#include "global_config.h" #include "os/input.h" void ScriptDebuggerRemote::_send_video_memory() { diff --git a/core/script_language.cpp b/core/script_language.cpp index 52ae181c32..32db35d018 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -46,13 +46,13 @@ void Script::_notification( int p_what) { void Script::_bind_methods() { - ClassDB::bind_method(_MD("can_instance"),&Script::can_instance); - //ClassDB::bind_method(_MD("instance_create","base_object"),&Script::instance_create); - ClassDB::bind_method(_MD("instance_has","base_object"),&Script::instance_has); - ClassDB::bind_method(_MD("has_source_code"),&Script::has_source_code); - ClassDB::bind_method(_MD("get_source_code"),&Script::get_source_code); - ClassDB::bind_method(_MD("set_source_code","source"),&Script::set_source_code); - ClassDB::bind_method(_MD("reload","keep_state"),&Script::reload,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("can_instance"),&Script::can_instance); + //ClassDB::bind_method(D_METHOD("instance_create","base_object"),&Script::instance_create); + ClassDB::bind_method(D_METHOD("instance_has","base_object"),&Script::instance_has); + ClassDB::bind_method(D_METHOD("has_source_code"),&Script::has_source_code); + ClassDB::bind_method(D_METHOD("get_source_code"),&Script::get_source_code); + ClassDB::bind_method(D_METHOD("set_source_code","source"),&Script::set_source_code); + ClassDB::bind_method(D_METHOD("reload","keep_state"),&Script::reload,DEFVAL(false)); } diff --git a/core/string_db.h b/core/string_db.h index a14cdbc7ba..2c5262adaa 100644 --- a/core/string_db.h +++ b/core/string_db.h @@ -155,7 +155,4 @@ struct StringNameHasher { StringName _scs_create(const char *p_chr); -//#define _SCS(m_cstr) (m_cstr[0]?StringName(StaticCString::create(m_cstr)):StringName()) -#define _SCS(m_cstr) _scs_create(m_cstr) - #endif diff --git a/core/translation.cpp b/core/translation.cpp index 2fee0e6550..d9d4fe7784 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "translation.h" -#include "globals.h" +#include "global_config.h" #include "io/resource_loader.h" #include "os/os.h" @@ -915,18 +915,18 @@ int Translation::get_message_count() const { void Translation::_bind_methods() { - ClassDB::bind_method(_MD("set_locale","locale"),&Translation::set_locale); - ClassDB::bind_method(_MD("get_locale"),&Translation::get_locale); - ClassDB::bind_method(_MD("add_message","src_message","xlated_message"),&Translation::add_message); - ClassDB::bind_method(_MD("get_message","src_message"),&Translation::get_message); - ClassDB::bind_method(_MD("erase_message","src_message"),&Translation::erase_message); - ClassDB::bind_method(_MD("get_message_list"),&Translation::_get_message_list); - ClassDB::bind_method(_MD("get_message_count"),&Translation::get_message_count); - ClassDB::bind_method(_MD("_set_messages"),&Translation::_set_messages); - ClassDB::bind_method(_MD("_get_messages"),&Translation::_get_messages); - - ADD_PROPERTY( PropertyInfo(Variant::POOL_STRING_ARRAY,"messages",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_messages"), _SCS("_get_messages") ); - ADD_PROPERTY( PropertyInfo(Variant::STRING,"locale"), _SCS("set_locale"), _SCS("get_locale") ); + ClassDB::bind_method(D_METHOD("set_locale","locale"),&Translation::set_locale); + ClassDB::bind_method(D_METHOD("get_locale"),&Translation::get_locale); + ClassDB::bind_method(D_METHOD("add_message","src_message","xlated_message"),&Translation::add_message); + ClassDB::bind_method(D_METHOD("get_message","src_message"),&Translation::get_message); + ClassDB::bind_method(D_METHOD("erase_message","src_message"),&Translation::erase_message); + ClassDB::bind_method(D_METHOD("get_message_list"),&Translation::_get_message_list); + ClassDB::bind_method(D_METHOD("get_message_count"),&Translation::get_message_count); + ClassDB::bind_method(D_METHOD("_set_messages"),&Translation::_set_messages); + ClassDB::bind_method(D_METHOD("_get_messages"),&Translation::_get_messages); + + ADD_PROPERTY( PropertyInfo(Variant::POOL_STRING_ARRAY,"messages",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_messages", "_get_messages") ; + ADD_PROPERTY( PropertyInfo(Variant::STRING,"locale"), "set_locale", "get_locale") ; } Translation::Translation() { @@ -1137,15 +1137,15 @@ StringName TranslationServer::tool_translate(const StringName& p_message) const void TranslationServer::_bind_methods() { - ClassDB::bind_method(_MD("set_locale","locale"),&TranslationServer::set_locale); - ClassDB::bind_method(_MD("get_locale"),&TranslationServer::get_locale); + ClassDB::bind_method(D_METHOD("set_locale","locale"),&TranslationServer::set_locale); + ClassDB::bind_method(D_METHOD("get_locale"),&TranslationServer::get_locale); - ClassDB::bind_method(_MD("translate","message"),&TranslationServer::translate); + ClassDB::bind_method(D_METHOD("translate","message"),&TranslationServer::translate); - ClassDB::bind_method(_MD("add_translation","translation:Translation"),&TranslationServer::add_translation); - ClassDB::bind_method(_MD("remove_translation","translation:Translation"),&TranslationServer::remove_translation); + ClassDB::bind_method(D_METHOD("add_translation","translation:Translation"),&TranslationServer::add_translation); + ClassDB::bind_method(D_METHOD("remove_translation","translation:Translation"),&TranslationServer::remove_translation); - ClassDB::bind_method(_MD("clear"),&TranslationServer::clear); + ClassDB::bind_method(D_METHOD("clear"),&TranslationServer::clear); } diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index 1a0ccc4a7e..f91f1aa14b 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -485,11 +485,11 @@ Variant UndoRedo::_add_undo_method(const Variant** p_args, int p_argcount, Varia void UndoRedo::_bind_methods() { - ClassDB::bind_method(_MD("create_action","name","merge_mode"),&UndoRedo::create_action, DEFVAL(MERGE_DISABLE) ); - ClassDB::bind_method(_MD("commit_action"),&UndoRedo::commit_action); + ClassDB::bind_method(D_METHOD("create_action","name","merge_mode"),&UndoRedo::create_action, DEFVAL(MERGE_DISABLE) ); + ClassDB::bind_method(D_METHOD("commit_action"),&UndoRedo::commit_action); - //ClassDB::bind_method(_MD("add_do_method","p_object", "p_method", "VARIANT_ARG_LIST"),&UndoRedo::add_do_method); - //ClassDB::bind_method(_MD("add_undo_method","p_object", "p_method", "VARIANT_ARG_LIST"),&UndoRedo::add_undo_method); + //ClassDB::bind_method(D_METHOD("add_do_method","p_object", "p_method", "VARIANT_ARG_LIST"),&UndoRedo::add_do_method); + //ClassDB::bind_method(D_METHOD("add_undo_method","p_object", "p_method", "VARIANT_ARG_LIST"),&UndoRedo::add_undo_method); { MethodInfo mi; @@ -511,13 +511,13 @@ void UndoRedo::_bind_methods() { ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"add_undo_method",&UndoRedo::_add_undo_method,mi); } - ClassDB::bind_method(_MD("add_do_property","object", "property", "value:Variant"),&UndoRedo::add_do_property); - ClassDB::bind_method(_MD("add_undo_property","object", "property", "value:Variant"),&UndoRedo::add_undo_property); - ClassDB::bind_method(_MD("add_do_reference","object"),&UndoRedo::add_do_reference); - ClassDB::bind_method(_MD("add_undo_reference","object"),&UndoRedo::add_undo_reference); - ClassDB::bind_method(_MD("clear_history"),&UndoRedo::clear_history); - ClassDB::bind_method(_MD("get_current_action_name"),&UndoRedo::get_current_action_name); - ClassDB::bind_method(_MD("get_version"),&UndoRedo::get_version); + ClassDB::bind_method(D_METHOD("add_do_property","object", "property", "value:Variant"),&UndoRedo::add_do_property); + ClassDB::bind_method(D_METHOD("add_undo_property","object", "property", "value:Variant"),&UndoRedo::add_undo_property); + ClassDB::bind_method(D_METHOD("add_do_reference","object"),&UndoRedo::add_do_reference); + ClassDB::bind_method(D_METHOD("add_undo_reference","object"),&UndoRedo::add_undo_reference); + ClassDB::bind_method(D_METHOD("clear_history"),&UndoRedo::clear_history); + ClassDB::bind_method(D_METHOD("get_current_action_name"),&UndoRedo::get_current_action_name); + ClassDB::bind_method(D_METHOD("get_version"),&UndoRedo::get_version); BIND_CONSTANT(MERGE_DISABLE); BIND_CONSTANT(MERGE_ENDS); diff --git a/core/ustring.cpp b/core/ustring.cpp index a0d26ea0af..7d88989d04 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -52,8 +52,40 @@ #define UPPERCASE(m_c) (((m_c)>='a' && (m_c)<='z')?((m_c)-('a'-'A')):(m_c)) #define LOWERCASE(m_c) (((m_c)>='A' && (m_c)<='Z')?((m_c)+('a'-'A')):(m_c)) + + + /** STRING **/ +bool CharString::operator<(const CharString& p_right) const { + + if (length()==0) { + return p_right.length()!=0; + } + + + const char *this_str=get_data(); + const char *that_str=get_data(); + while (true) { + + if (*that_str==0 && *this_str==0) + return false; //this can't be equal, sadly + else if (*this_str==0) + return true; //if this is empty, and the other one is not, then we're less.. I think? + else if (*that_str==0) + return false; //otherwise the other one is smaller.. + else if (*this_str < *that_str ) //more than + return true; + else if (*this_str > *that_str ) //less than + return false; + + this_str++; + that_str++; + } + + return false; //should never reach here anyway +} + const char *CharString::get_data() const { if (size()) @@ -4069,12 +4101,8 @@ String String::sprintf(const Array& values, bool* error) const { case 'X': base = 16; capitalize = true; break; } // Get basic number. - String str = String::num_int64(value, base, capitalize); - - // Sign. - if (show_sign && value >= 0) { - str = str.insert(0, "+"); - } + String str = String::num_int64(ABS(value), base, capitalize); + int number_len = str.length(); // Padding. String pad_char = pad_with_zeroes ? String("0") : String(" "); @@ -4084,6 +4112,13 @@ String String::sprintf(const Array& values, bool* error) const { str = str.lpad(min_chars, pad_char); } + // Sign. + if (show_sign && value >= 0) { + str = str.insert(pad_with_zeroes?0:str.length()-number_len, "+"); + } else if (value < 0) { + str = str.insert(pad_with_zeroes?0:str.length()-number_len, "-"); + } + formatted += str; ++value_index; in_format = false; diff --git a/core/ustring.h b/core/ustring.h index 5665a23112..87289f9e16 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -41,6 +41,8 @@ class CharString : public Vector<char> { public: + + bool operator<(const CharString& p_right) const; int length() const { return size() ? size()-1 : 0; } const char *get_data() const; operator const char*() {return get_data();}; diff --git a/core/variant.cpp b/core/variant.cpp index 103c8f6746..f19dacf26b 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -28,6 +28,7 @@ /*************************************************************************/ #include "variant.h" +#include "math_funcs.h" #include "resource.h" #include "print_string.h" #include "scene/main/node.h" @@ -2177,6 +2178,11 @@ Variant::operator IP_Address() const { return IP_Address( operator String() ); } +Variant::operator PowerState() const +{ + return (PowerState) operator int(); +} + Variant::Variant(bool p_bool) { type=BOOL; @@ -2674,14 +2680,10 @@ uint32_t Variant::hash() const { case INT: { return _data._int; - } break; case REAL: { - MarshallFloat mf; - mf.f=_data._real; - return mf.i; - + return hash_djb2_one_float(_data._real); } break; case STRING: { @@ -2921,6 +2923,186 @@ uint32_t Variant::hash() const { } +#define hash_compare_scalar(p_lhs, p_rhs)\ + ((p_lhs) == (p_rhs)) || (Math::is_nan(p_lhs) == Math::is_nan(p_rhs)) + +#define hash_compare_vector2(p_lhs, p_rhs)\ + (hash_compare_scalar((p_lhs).x, (p_rhs).x)) && \ + (hash_compare_scalar((p_lhs).y, (p_rhs).y)) + +#define hash_compare_vector3(p_lhs, p_rhs)\ + (hash_compare_scalar((p_lhs).x, (p_rhs).x)) && \ + (hash_compare_scalar((p_lhs).y, (p_rhs).y)) && \ + (hash_compare_scalar((p_lhs).z, (p_rhs).z)) + +#define hash_compare_quat(p_lhs, p_rhs)\ + (hash_compare_scalar((p_lhs).x, (p_rhs).x)) && \ + (hash_compare_scalar((p_lhs).y, (p_rhs).y)) && \ + (hash_compare_scalar((p_lhs).z, (p_rhs).z)) && \ + (hash_compare_scalar((p_lhs).w, (p_rhs).w)) + +#define hash_compare_color(p_lhs, p_rhs)\ + (hash_compare_scalar((p_lhs).r, (p_rhs).r)) && \ + (hash_compare_scalar((p_lhs).g, (p_rhs).g)) && \ + (hash_compare_scalar((p_lhs).b, (p_rhs).b)) && \ + (hash_compare_scalar((p_lhs).a, (p_rhs).a)) + +#define hash_compare_pool_array(p_lhs, p_rhs, p_type, p_compare_func)\ + const PoolVector<p_type>& l = *reinterpret_cast<const PoolVector<p_type>*>(p_lhs);\ + const PoolVector<p_type>& r = *reinterpret_cast<const PoolVector<p_type>*>(p_rhs);\ + \ + if(l.size() != r.size()) \ + return false; \ + \ + PoolVector<p_type>::Read lr = l.read(); \ + PoolVector<p_type>::Read rr = r.read(); \ + \ + for(int i = 0; i < l.size(); ++i) { \ + if(! p_compare_func((lr[i]), (rr[i]))) \ + return false; \ + }\ + \ + return true + +bool Variant::hash_compare(const Variant& p_variant) const { + if (type != p_variant.type) + return false; + + switch( type ) { + case REAL: { + return hash_compare_scalar(_data._real, p_variant._data._real); + } break; + + case VECTOR2: { + const Vector2* l = reinterpret_cast<const Vector2*>(_data._mem); + const Vector2* r = reinterpret_cast<const Vector2*>(p_variant._data._mem); + + return hash_compare_vector2(*l, *r); + } break; + + case RECT2: { + const Rect2* l = reinterpret_cast<const Rect2*>(_data._mem); + const Rect2* r = reinterpret_cast<const Rect2*>(p_variant._data._mem); + + return (hash_compare_vector2(l->pos, r->pos)) && + (hash_compare_vector2(l->size, r->size)); + } break; + + case TRANSFORM2D: { + Transform2D* l = _data._transform2d; + Transform2D* r = p_variant._data._transform2d; + + for(int i=0;i<3;i++) { + if (! (hash_compare_vector2(l->elements[i], r->elements[i]))) + return false; + } + + return true; + } break; + + case VECTOR3: { + const Vector3* l = reinterpret_cast<const Vector3*>(_data._mem); + const Vector3* r = reinterpret_cast<const Vector3*>(p_variant._data._mem); + + return hash_compare_vector3(*l, *r); + } break; + + case PLANE: { + const Plane* l = reinterpret_cast<const Plane*>(_data._mem); + const Plane* r = reinterpret_cast<const Plane*>(p_variant._data._mem); + + return (hash_compare_vector3(l->normal, r->normal)) && + (hash_compare_scalar(l->d, r->d)); + } break; + + case RECT3: { + const Rect3* l = _data._rect3; + const Rect3* r = p_variant._data._rect3; + + return (hash_compare_vector3(l->pos, r->pos) && + (hash_compare_vector3(l->size, r->size))); + + } break; + + case QUAT: { + const Quat* l = reinterpret_cast<const Quat*>(_data._mem); + const Quat* r = reinterpret_cast<const Quat*>(p_variant._data._mem); + + return hash_compare_quat(*l, *r); + } break; + + case BASIS: { + const Basis* l = _data._basis; + const Basis* r = p_variant._data._basis; + + for(int i=0;i<3;i++) { + if (! (hash_compare_vector3(l->elements[i], r->elements[i]))) + return false; + } + + return true; + } break; + + case TRANSFORM: { + const Transform* l = _data._transform; + const Transform* r = p_variant._data._transform; + + for(int i=0;i<3;i++) { + if (! (hash_compare_vector3(l->basis.elements[i], r->basis.elements[i]))) + return false; + } + + return hash_compare_vector3(l->origin, r->origin); + } break; + + case COLOR: { + const Color* l = reinterpret_cast<const Color*>(_data._mem); + const Color* r = reinterpret_cast<const Color*>(p_variant._data._mem); + + return hash_compare_color(*l, *r); + } break; + + case ARRAY: { + const Array& l = *(reinterpret_cast<const Array*>(_data._mem)); + const Array& r = *(reinterpret_cast<const Array*>(p_variant._data._mem)); + + if(l.size() != r.size()) + return false; + + for(int i = 0; i < l.size(); ++i) { + if(! l[i].hash_compare(r[i])) + return false; + } + + return true; + } break; + + case POOL_REAL_ARRAY: { + hash_compare_pool_array(_data._mem, p_variant._data._mem, real_t, hash_compare_scalar); + } break; + + case POOL_VECTOR2_ARRAY: { + hash_compare_pool_array(_data._mem, p_variant._data._mem, Vector2, hash_compare_vector2); + } break; + + case POOL_VECTOR3_ARRAY: { + hash_compare_pool_array(_data._mem, p_variant._data._mem, Vector3, hash_compare_vector3); + } break; + + case POOL_COLOR_ARRAY: { + hash_compare_pool_array(_data._mem, p_variant._data._mem, Color, hash_compare_color); + } break; + + default: + bool v; + Variant r; + evaluate(OP_EQUAL,*this,p_variant,r,v); + return r; + } + + return false; +} + bool Variant::is_ref() const { diff --git a/core/variant.h b/core/variant.h index 5936325c1b..1251189314 100644 --- a/core/variant.h +++ b/core/variant.h @@ -45,6 +45,7 @@ #include "path_db.h" #include "simple_type.h" #include "os/input_event.h" +#include "os/power.h" #include "color.h" #include "face3.h" #include "ref_ptr.h" @@ -254,6 +255,7 @@ public: operator Orientation() const; operator IP_Address() const; + operator PowerState() const; Variant(bool p_bool); @@ -421,6 +423,7 @@ public: bool operator<(const Variant& p_variant) const; uint32_t hash() const; + bool hash_compare(const Variant& p_variant) const; bool booleanize(bool &valid) const; void static_assign(const Variant& p_variant); @@ -459,6 +462,10 @@ struct VariantHasher { static _FORCE_INLINE_ uint32_t hash(const Variant &p_variant) { return p_variant.hash(); } }; +struct VariantComparator { + + static _FORCE_INLINE_ bool compare(const Variant &p_lhs, const Variant &p_rhs) { return p_lhs.hash_compare(p_rhs); } +}; Variant::ObjData& Variant::_get_obj() { diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 022faede1e..376e646fc2 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -564,6 +564,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM1(PoolStringArray,append); VCALL_LOCALMEM1(PoolStringArray,append_array); VCALL_LOCALMEM0(PoolStringArray,invert); + VCALL_LOCALMEM1R(PoolStringArray,join); VCALL_LOCALMEM0R(PoolVector2Array,size); VCALL_LOCALMEM2(PoolVector2Array,set); @@ -1362,15 +1363,15 @@ void register_variant_methods() { _VariantCall::constant_data = memnew_arr(_VariantCall::ConstantData, Variant::VARIANT_MAX); #define ADDFUNC0(m_vtype,m_ret,m_class,m_method,m_defarg)\ -_VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_class,m_method),m_defarg); +_VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_scs_create(#m_method),VCALL(m_class,m_method),m_defarg); #define ADDFUNC1(m_vtype,m_ret,m_class,m_method,m_arg1,m_argname1,m_defarg)\ -_VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_class,m_method),m_defarg,_VariantCall::Arg(Variant::m_arg1,_SCS(m_argname1)) ); +_VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_scs_create(#m_method),VCALL(m_class,m_method),m_defarg,_VariantCall::Arg(Variant::m_arg1,_scs_create(m_argname1)) ); #define ADDFUNC2(m_vtype,m_ret,m_class,m_method,m_arg1,m_argname1,m_arg2,m_argname2,m_defarg)\ -_VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_class,m_method),m_defarg,_VariantCall::Arg(Variant::m_arg1,_SCS(m_argname1)),_VariantCall::Arg(Variant::m_arg2,_SCS(m_argname2))); +_VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_scs_create(#m_method),VCALL(m_class,m_method),m_defarg,_VariantCall::Arg(Variant::m_arg1,_scs_create(m_argname1)),_VariantCall::Arg(Variant::m_arg2,_scs_create(m_argname2))); #define ADDFUNC3(m_vtype,m_ret,m_class,m_method,m_arg1,m_argname1,m_arg2,m_argname2,m_arg3,m_argname3,m_defarg)\ -_VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_class,m_method),m_defarg,_VariantCall::Arg(Variant::m_arg1,_SCS(m_argname1)),_VariantCall::Arg(Variant::m_arg2,_SCS(m_argname2)),_VariantCall::Arg(Variant::m_arg3,_SCS(m_argname3))); +_VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_scs_create(#m_method),VCALL(m_class,m_method),m_defarg,_VariantCall::Arg(Variant::m_arg1,_scs_create(m_argname1)),_VariantCall::Arg(Variant::m_arg2,_scs_create(m_argname2)),_VariantCall::Arg(Variant::m_arg3,_scs_create(m_argname3))); #define ADDFUNC4(m_vtype,m_ret,m_class,m_method,m_arg1,m_argname1,m_arg2,m_argname2,m_arg3,m_argname3,m_arg4,m_argname4,m_defarg)\ -_VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_class,m_method),m_defarg,_VariantCall::Arg(Variant::m_arg1,_SCS(m_argname1)),_VariantCall::Arg(Variant::m_arg2,_SCS(m_argname2)),_VariantCall::Arg(Variant::m_arg3,_SCS(m_argname3)),_VariantCall::Arg(Variant::m_arg4,_SCS(m_argname4))); +_VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_scs_create(#m_method),VCALL(m_class,m_method),m_defarg,_VariantCall::Arg(Variant::m_arg1,_scs_create(m_argname1)),_VariantCall::Arg(Variant::m_arg2,_scs_create(m_argname2)),_VariantCall::Arg(Variant::m_arg3,_scs_create(m_argname3)),_VariantCall::Arg(Variant::m_arg4,_scs_create(m_argname4))); /* STRING */ @@ -1637,6 +1638,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC2(POOL_STRING_ARRAY,INT,PoolStringArray,insert,INT,"idx",STRING,"string",varray()); ADDFUNC1(POOL_STRING_ARRAY,NIL,PoolStringArray,resize,INT,"idx",varray()); ADDFUNC0(POOL_STRING_ARRAY,NIL,PoolStringArray,invert,varray()); + ADDFUNC1(POOL_STRING_ARRAY,STRING,PoolStringArray,join,STRING,"string",varray()); ADDFUNC0(POOL_VECTOR2_ARRAY,INT,PoolVector2Array,size,varray()); ADDFUNC2(POOL_VECTOR2_ARRAY,NIL,PoolVector2Array,set,INT,"idx",VECTOR2,"vector2",varray()); diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 6ed8a3dd85..28e804b5bf 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -1393,7 +1393,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) v->basis.set_axis(index,p_value); return; } - } if (p_index.get_type()==Variant::STRING) { + } else if (p_index.get_type()==Variant::STRING) { Transform *v=_data._transform; const String *str=reinterpret_cast<const String*>(p_index._data._mem); @@ -2150,7 +2150,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { valid=true; return index==3?v->origin:v->basis.get_axis(index); } - } if (p_index.get_type()==Variant::STRING) { + } else if (p_index.get_type()==Variant::STRING) { const Transform *v=_data._transform; const String *str=reinterpret_cast<const String*>(p_index._data._mem); diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 3507501f27..a2ecb1516d 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -1414,7 +1414,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; } else if (id=="img") { // compatibility with godot.cfg - Token token; + Token token; // FIXME: no need for this declaration? the first argument in line 509 is a Token& token. get_token(p_stream,token,line,r_err_str); if (token.type!=TK_PARENTHESIS_OPEN) { r_err_str="Expected '(' in old-style godot.cfg construct"; diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 8204af9fd4..71594887fc 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -25394,10 +25394,15 @@ </return> <argument index="0" name="port" type="int"> </argument> - <argument index="1" name="recv_buf_size" type="int" default="65536"> + <argument index="1" name="bind_address" type="String" default="*"> + </argument> + <argument index="2" name="recv_buf_size" type="int" default="65536"> </argument> <description> - Make this [PacketPeerUDP] listen on the "port" with a buffer size "recv_buf_size". Listens on all available addresses. + Make this [PacketPeerUDP] listen on the "port" binding to "bind_address" with a buffer size "recv_buf_size". + If "bind_address" is set as "*" (default), the peer will listen on all available addresses (both IPv4 and IPv6). + If "bind_address" is set as "0.0.0.0" (for IPv4) or "::" (for IPv6), the peer will listen on all available addresses matching that IP type. + If "bind_address" is set to any valid address (e.g. "192.168.1.101", "::1", etc), the peer will only listen on the interface with that addresses (or fail if no interface with the given address exists). </description> </method> <method name="set_send_address"> @@ -35446,6 +35451,13 @@ Returns true if this SceneTree's [NetworkedMultiplayerPeer] is in server mode (listening for connections). </description> </method> + <method name="has_network_peer" qualifiers="const"> + <return type="bool"> + </return> + <description> + Returns true if there is a [NetworkedMultiplayerPeer] set (with [method SceneTree.set_network_peer]). + </description> + </method> <method name="is_paused" qualifiers="const"> <return type="bool"> </return> @@ -40576,10 +40588,13 @@ </return> <argument index="0" name="port" type="int"> </argument> - <argument index="1" name="accepted_hosts" type="StringArray" default="StringArray([])"> + <argument index="1" name="bind_address" type="String" default="*"> </argument> <description> - Listen on a port using protocol, alternatively give a white-list of accepted hosts. + Listen on the "port" binding to "bind_address". + If "bind_address" is set as "*" (default), the server will listen on all available addresses (both IPv4 and IPv6). + If "bind_address" is set as "0.0.0.0" (for IPv4) or "::" (for IPv6), the server will listen on all available addresses matching that IP type. + If "bind_address" is set to any valid address (e.g. "192.168.1.101", "::1", etc), the server will only listen on the interface with that addresses (or fail if no interface with the given address exists). </description> </method> <method name="stop"> @@ -40618,9 +40633,16 @@ <return type="int"> </return> <description> - Return the current tab that is being showed. + Return the current tab index that is being shown. </description> </method> + <method name="get_previous_tab" qualifiers="const"> + <return type="int"> + </return> + <description> + Return the previous tab index that was being shown. + </description> + </method> <method name="get_current_tab_control" qualifiers="const"> <return type="Control"> </return> @@ -40646,6 +40668,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> + Return the current tab control that is being shown. </description> </method> <method name="get_tab_count" qualifiers="const"> @@ -40727,7 +40750,14 @@ <argument index="0" name="tab" type="int"> </argument> <description> - Emitted when the current tab changes. + Emitted only when the current tab changes. + </description> + </signal> + <signal name="tab_selected"> + <argument index="0" name="tab" type="int"> + </argument> + <description> + Emitted when a tab is being selected, even if it is the same tab. </description> </signal> </signals> diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp index 8984d412a3..f2616b11b8 100644 --- a/drivers/alsa/audio_driver_alsa.cpp +++ b/drivers/alsa/audio_driver_alsa.cpp @@ -30,7 +30,7 @@ #ifdef ALSA_ENABLED -#include "globals.h" +#include "global_config.h" #include <errno.h> diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 1486e85a04..94c5ecdec1 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -30,7 +30,7 @@ #include "rasterizer_gles2.h" #include "os/os.h" -#include "globals.h" +#include "global_config.h" #include <stdio.h> #include "servers/visual/shader_language.h" #include "servers/visual/particle_system_sw.h" diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h index 509f9a82b4..004d636c1e 100644 --- a/drivers/gles2/shader_gles2.h +++ b/drivers/gles2/shader_gles2.h @@ -134,7 +134,7 @@ private: struct VersionKeyHash { - static _FORCE_INLINE_ uint32_t hash( const VersionKey& p_key) { return HashMapHahserDefault::hash(p_key.key); }; + static _FORCE_INLINE_ uint32_t hash( const VersionKey& p_key) { return HashMapHasherDefault::hash(p_key.key); }; }; //this should use a way more cachefriendly version.. diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 2923dfff9f..2526aad074 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -1,4 +1,33 @@ +/*************************************************************************/ +/* rasterizer_canvas_gles3.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "rasterizer_canvas_gles3.h" + #include "os/os.h" #ifndef GLES_OVER_GL @@ -382,7 +411,7 @@ void RasterizerCanvasGLES3::_draw_gui_primitive(int p_points, const Vector2 *p_v } - float b[(2+2+4)]; + float b[(2+2+4)*4]; for(int i=0;i<p_points;i++) { @@ -646,7 +675,7 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item,Item *curr state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE,texpixel_size); } - _draw_polygon(polygon->count,polygon->indices.ptr(),polygon->points.ptr(),polygon->uvs.ptr(),polygon->colors.ptr(),polygon->texture,polygon->colors.size()==1); + //_draw_polygon(polygon->count,polygon->indices.ptr(),polygon->points.ptr(),polygon->uvs.ptr(),polygon->colors.ptr(),polygon->texture,polygon->colors.size()==1); } break; case Item::Command::TYPE_CIRCLE: { @@ -666,7 +695,7 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item,Item *curr indices[i*3+1]=(i+1)%numpoints; indices[i*3+2]=numpoints; } - _draw_polygon(numpoints*3,indices,points,NULL,&circle->color,RID(),true); + //_draw_polygon(numpoints*3,indices,points,NULL,&circle->color,RID(),true); //canvas_draw_circle(circle->indices.size(),circle->indices.ptr(),circle->points.ptr(),circle->uvs.ptr(),circle->colors.ptr(),circle->texture,circle->colors.size()==1); } break; case Item::Command::TYPE_TRANSFORM: { @@ -1010,7 +1039,7 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list,int p_z,const if (unshaded || (state.canvas_item_modulate.a>0.001 && (!shader_cache || shader_cache->canvas_item.light_mode!=RasterizerStorageGLES3::Shader::CanvasItem::LIGHT_MODE_LIGHT_ONLY) && !ci->light_masked )) _canvas_item_render_commands(ci,current_clip,reclip); - if ((blend_mode==RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MIX || RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_PMALPHA) && p_light && !unshaded) { + if ((blend_mode==RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MIX || blend_mode==RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_PMALPHA) && p_light && !unshaded) { Light *light = p_light; bool light_used=false; @@ -1459,7 +1488,7 @@ void RasterizerCanvasGLES3::initialize() { glGenBuffers(1,&data.primitive_quad_buffer); glBindBuffer(GL_ARRAY_BUFFER,data.primitive_quad_buffer); - glBufferData(GL_ARRAY_BUFFER,sizeof(float)*2+sizeof(float)*2+sizeof(float)*4,NULL,GL_DYNAMIC_DRAW); //allocate max size + glBufferData(GL_ARRAY_BUFFER,(2+2+4)*4*sizeof(float),NULL,GL_DYNAMIC_DRAW); //allocate max size glBindBuffer(GL_ARRAY_BUFFER,0); diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h index 6630ec38c4..1273e5f35d 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.h +++ b/drivers/gles3/rasterizer_canvas_gles3.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* rasterizer_canvas_gles3.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RASTERIZERCANVASGLES3_H #define RASTERIZERCANVASGLES3_H diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index e1ddad0dc9..05558a39ba 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -1,6 +1,35 @@ +/*************************************************************************/ +/* rasterizer_gles3.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "rasterizer_gles3.h" + #include "os/os.h" -#include "globals.h" +#include "global_config.h" #include "gl_context/context_gl.h" #include <string.h> RasterizerStorage *RasterizerGLES3::get_storage() { @@ -167,7 +196,6 @@ void RasterizerGLES3::initialize() { void RasterizerGLES3::begin_frame(){ - uint64_t tick = OS::get_singleton()->get_ticks_usec(); double time_total = double(tick)/1000000.0; @@ -186,12 +214,8 @@ void RasterizerGLES3::begin_frame(){ storage->frame.prev_tick=tick; + storage->update_dirty_resources(); - storage->update_dirty_multimeshes(); - storage->update_dirty_skeletons(); - storage->update_dirty_shaders(); - storage->update_dirty_materials(); - storage->update_particles(); storage->info.render_object_count=0; storage->info.render_material_switch_count=0; diff --git a/drivers/gles3/rasterizer_gles3.h b/drivers/gles3/rasterizer_gles3.h index f70dac506d..21e16b3bba 100644 --- a/drivers/gles3/rasterizer_gles3.h +++ b/drivers/gles3/rasterizer_gles3.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* rasterizer_gles3.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RASTERIZERGLES3_H #define RASTERIZERGLES3_H diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index b504ef819f..f09e6ce904 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -1,5 +1,34 @@ +/*************************************************************************/ +/* rasterizer_storage_gles3.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "rasterizer_scene_gles3.h" -#include "globals.h" + +#include "global_config.h" #include "os/os.h" #include "rasterizer_canvas_gles3.h" @@ -133,7 +162,7 @@ void RasterizerSceneGLES3::shadow_atlas_set_size(RID p_atlas,int p_size){ glActiveTexture(GL_TEXTURE0); glGenTextures(1, &shadow_atlas->depth); glBindTexture(GL_TEXTURE_2D, shadow_atlas->depth); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, shadow_atlas->size, shadow_atlas->size, 0, + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, shadow_atlas->size, shadow_atlas->size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -1386,6 +1415,8 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) { int amount = MAX(multi_mesh->size,multi_mesh->visible_instances); + + if (s->index_array_len>0) { glDrawElementsInstanced(gl_primitive[s->primitive],s->index_array_len, (s->array_len>=(1<<16))?GL_UNSIGNED_INT:GL_UNSIGNED_SHORT,0,amount); @@ -1609,6 +1640,7 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e,const Transform& state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_XFORM1, gipi->transform_to_data * p_view_transform); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BOUNDS1, gipi->bounds); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_MULTIPLIER1, gipi->probe?gipi->probe->dynamic_range*gipi->probe->energy:0.0); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BIAS1, gipi->probe?gipi->probe->bias:0.0); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BLEND_AMBIENT1, gipi->probe?!gipi->probe->interior:false); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_CELL_SIZE1, gipi->cell_size_cache); if (gi_probe_count>1) { @@ -1621,6 +1653,7 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e,const Transform& state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BOUNDS2, gipi2->bounds); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_CELL_SIZE2, gipi2->cell_size_cache); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_MULTIPLIER2, gipi2->probe?gipi2->probe->dynamic_range*gipi2->probe->energy:0.0); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BIAS2, gipi2->probe?gipi2->probe->bias:0.0); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BLEND_AMBIENT2, gipi2->probe?!gipi2->probe->interior:false); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE2_ENABLED, true ); } else { @@ -1746,6 +1779,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements,int p_e RasterizerStorageGLES3::Material* prev_material=NULL; RasterizerStorageGLES3::Geometry* prev_geometry=NULL; + RasterizerStorageGLES3::GeometryOwner* prev_owner=NULL; VS::InstanceType prev_base_type = VS::INSTANCE_MAX; int current_blend_mode=-1; @@ -1765,6 +1799,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements,int p_e RasterizerStorageGLES3::Material* material= e->material; RID skeleton = e->instance->skeleton; + bool rebind=first; int shading = (e->sort_key>>RenderList::SORT_KEY_SHADING_SHIFT)&RenderList::SORT_KEY_SHADING_MASK; @@ -1934,7 +1969,8 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements,int p_e } - if (prev_base_type != e->instance->base_type || prev_geometry!=e->geometry) { + if (e->owner != prev_owner || prev_base_type != e->instance->base_type || prev_geometry!=e->geometry) { + _setup_geometry(e); storage->info.render_surface_switch_count++; @@ -1952,6 +1988,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements,int p_e prev_material=material; prev_base_type=e->instance->base_type; prev_geometry=e->geometry; + prev_owner=e->owner; prev_shading=shading; prev_skeleton=skeleton; first=false; @@ -2654,19 +2691,19 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result,int p_light_cu glBindBuffer(GL_UNIFORM_BUFFER, state.omni_array_ubo); glBufferSubData(GL_UNIFORM_BUFFER, 0, state.omni_light_count*state.ubo_light_size, state.omni_array_tmp); glBindBuffer(GL_UNIFORM_BUFFER, 0); - - glBindBufferBase(GL_UNIFORM_BUFFER,4,state.omni_array_ubo); } + glBindBufferBase(GL_UNIFORM_BUFFER,4,state.omni_array_ubo); + if (state.spot_light_count) { glBindBuffer(GL_UNIFORM_BUFFER, state.spot_array_ubo); glBufferSubData(GL_UNIFORM_BUFFER, 0, state.spot_light_count*state.ubo_light_size, state.spot_array_tmp); glBindBuffer(GL_UNIFORM_BUFFER, 0); - glBindBufferBase(GL_UNIFORM_BUFFER,5,state.spot_array_ubo); } + glBindBufferBase(GL_UNIFORM_BUFFER,5,state.spot_array_ubo); } @@ -2762,9 +2799,10 @@ void RasterizerSceneGLES3::_setup_reflections(RID *p_reflection_probe_cull_resul glBufferSubData(GL_UNIFORM_BUFFER, 0, state.reflection_probe_count*sizeof(ReflectionProbeDataUBO), state.reflection_array_tmp); glBindBuffer(GL_UNIFORM_BUFFER, 0); - glBindBufferBase(GL_UNIFORM_BUFFER,6,state.reflection_array_ubo); } + glBindBufferBase(GL_UNIFORM_BUFFER,6,state.reflection_array_ubo); + } @@ -2797,6 +2835,7 @@ void RasterizerSceneGLES3::_copy_to_front_buffer(Environment *env) { //no environment, simply convert from linear to srgb storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB,true); } else { + /* FIXME: Why are both statements equal? */ storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB,true); } @@ -2877,6 +2916,7 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase** p_cull_result,int p_ RasterizerStorageGLES3::MultiMesh *multi_mesh = storage->multimesh_owner.getptr(inst->base); ERR_CONTINUE(!multi_mesh); + if (multi_mesh->size==0 || multi_mesh->visible_instances==0) continue; @@ -2892,6 +2932,7 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase** p_cull_result,int p_ _add_geometry(s,inst,multi_mesh,-1,p_shadow); } + } break; case VS::INSTANCE_IMMEDIATE: { @@ -3773,7 +3814,7 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C state.used_contact_shadows=true; - if (storage->frame.current_rt && true) { //detect with state.used_contact_shadows too + if ( storage->frame.current_rt && true) { //detect with state.used_contact_shadows too //pre z pass @@ -4092,11 +4133,11 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C if (false && env_radiance_tex) { - //_copy_texture_to_front_buffer(shadow_atlas->depth); - storage->canvas->canvas_begin(); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D,env_radiance_tex); - storage->canvas->draw_generic_textured_rect(Rect2(0,0,storage->frame.current_rt->width/2,storage->frame.current_rt->height/2),Rect2(0,0,1,1)); + //_copy_texture_to_front_buffer(shadow_atlas->depth); + storage->canvas->canvas_begin(); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,env_radiance_tex); + storage->canvas->draw_generic_textured_rect(Rect2(0,0,storage->frame.current_rt->width/2,storage->frame.current_rt->height/2),Rect2(0,0,1,1)); } @@ -4794,7 +4835,7 @@ void RasterizerSceneGLES3::initialize() { //gen cubemap first for(int i=0;i<6;i++) { - glTexImage2D(_cube_side_enum[i], 0, GL_DEPTH_COMPONENT, cube.size, cube.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexImage2D(_cube_side_enum[i], 0, GL_DEPTH_COMPONENT24, cube.size, cube.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); } glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -4828,7 +4869,7 @@ void RasterizerSceneGLES3::initialize() { glBindFramebuffer(GL_FRAMEBUFFER,directional_shadow.fbo); glGenTextures(1,&directional_shadow.depth); glBindTexture(GL_TEXTURE_2D,directional_shadow.depth); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, directional_shadow.size, directional_shadow.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, directional_shadow.size, directional_shadow.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); @@ -4918,7 +4959,7 @@ void RasterizerSceneGLES3::initialize() { glGenTextures(1,&cube.depth); glBindTexture(GL_TEXTURE_2D,cube.depth); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, cube.size, cube.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, cube.size, cube.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 81dfa1bf46..b21ef8317f 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* rasterizer_scene_gles3.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RASTERIZERSCENEGLES3_H #define RASTERIZERSCENEGLES3_H diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 06daebbf82..4fea28ddb7 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -1,7 +1,35 @@ +/*************************************************************************/ +/* rasterizer_storage_gles3.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "rasterizer_storage_gles3.h" #include "rasterizer_canvas_gles3.h" #include "rasterizer_scene_gles3.h" -#include "globals.h" +#include "global_config.h" /* TEXTURE API */ @@ -93,16 +121,26 @@ Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image& p_image, Ima switch(p_format) { case Image::FORMAT_L8: { +#ifdef GLES_OVER_GL r_gl_internal_format=GL_R8; r_gl_format=GL_RED; r_gl_type=GL_UNSIGNED_BYTE; - +#else + r_gl_internal_format=GL_LUMINANCE; + r_gl_format=GL_LUMINANCE; + r_gl_type=GL_UNSIGNED_BYTE; +#endif } break; case Image::FORMAT_LA8: { - +#ifdef GLES_OVER_GL r_gl_internal_format=GL_RG8; r_gl_format=GL_RG; r_gl_type=GL_UNSIGNED_BYTE; +#else + r_gl_internal_format=GL_LUMINANCE_ALPHA; + r_gl_format=GL_LUMINANCE_ALPHA; + r_gl_type=GL_UNSIGNED_BYTE; +#endif } break; case Image::FORMAT_R8: { @@ -734,6 +772,7 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture,const Image& p_image } //set swizle for older format compatibility +#ifdef GLES_OVER_GL switch(texture->format) { case Image::FORMAT_L8: { @@ -759,6 +798,7 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture,const Image& p_image } break; } +#endif if (config.use_anisotropic_filter) { if (texture->flags&VS::TEXTURE_FLAG_ANISOTROPIC_FILTER) { @@ -1096,7 +1136,7 @@ RID RasterizerStorageGLES3::texture_create_radiance_cubemap(RID p_source,int p_r ERR_FAIL_COND_V(!texture,RID()); ERR_FAIL_COND_V(!(texture->flags&VS::TEXTURE_FLAG_CUBEMAP),RID()); - bool use_float=true; + bool use_float=config.hdr_supported; if (p_resolution<0) { p_resolution=texture->width; @@ -1316,7 +1356,7 @@ void RasterizerStorageGLES3::skybox_set_texture(RID p_skybox, RID p_cube_map, in int mm_level=mipmaps; - bool use_float=true; + bool use_float=config.hdr_supported; GLenum internal_format = use_float?GL_RGBA16F:GL_RGB10_A2; GLenum format = GL_RGBA; @@ -2320,6 +2360,7 @@ void RasterizerStorageGLES3::_update_material(Material* material) { bool is_animated = false; if (material->shader && material->shader->mode==VS::SHADER_SPATIAL) { + if (!material->shader->spatial.uses_alpha && material->shader->spatial.blend_mode==Shader::Spatial::BLEND_MODE_MIX) { can_cast_shadow=true; } @@ -2332,20 +2373,19 @@ void RasterizerStorageGLES3::_update_material(Material* material) { is_animated=true; } - } + if (can_cast_shadow!=material->can_cast_shadow_cache || is_animated!=material->is_animated_cache) { + material->can_cast_shadow_cache=can_cast_shadow; + material->is_animated_cache=is_animated; - if (can_cast_shadow!=material->can_cast_shadow_cache || is_animated!=material->is_animated_cache) { - material->can_cast_shadow_cache=can_cast_shadow; - material->is_animated_cache=is_animated; + for(Map<Geometry*,int>::Element *E=material->geometry_owners.front();E;E=E->next()) { + E->key()->material_changed_notify(); + } - for(Map<Geometry*,int>::Element *E=material->geometry_owners.front();E;E=E->next()) { - E->key()->material_changed_notify(); - } + for(Map<RasterizerScene::InstanceBase*,int>::Element *E=material->instance_owners.front();E;E=E->next()) { + E->key()->base_material_changed(); + } - for(Map<RasterizerScene::InstanceBase*,int>::Element *E=material->instance_owners.front();E;E=E->next()) { - E->key()->base_material_changed(); } - } } @@ -3619,8 +3659,23 @@ void RasterizerStorageGLES3::multimesh_set_mesh(RID p_multimesh,RID p_mesh){ MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); ERR_FAIL_COND(!multimesh); + if (multimesh->mesh.is_valid()) { + Mesh *mesh = mesh_owner.getornull(multimesh->mesh); + if (mesh) { + mesh->multimeshes.remove(&multimesh->mesh_list); + } + } + multimesh->mesh=p_mesh; + + if (multimesh->mesh.is_valid()) { + Mesh *mesh = mesh_owner.getornull(multimesh->mesh); + if (mesh) { + mesh->multimeshes.add(&multimesh->mesh_list); + } + } + multimesh->dirty_aabb=true; if (!multimesh->update_list.in_list()) { @@ -4778,6 +4833,7 @@ RID RasterizerStorageGLES3::gi_probe_create() { gip->dynamic_range=1.0; gip->energy=1.0; gip->propagation=1.0; + gip->bias=0.4; gip->interior=false; gip->compress=false; gip->version=1; @@ -4883,6 +4939,16 @@ void RasterizerStorageGLES3::gi_probe_set_energy(RID p_probe,float p_range){ } + +void RasterizerStorageGLES3::gi_probe_set_bias(RID p_probe,float p_range){ + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->bias=p_range; + +} + void RasterizerStorageGLES3::gi_probe_set_propagation(RID p_probe,float p_range){ GIProbe *gip = gi_probe_owner.getornull(p_probe); @@ -4936,6 +5002,15 @@ float RasterizerStorageGLES3::gi_probe_get_energy(RID p_probe) const{ return gip->energy; } +float RasterizerStorageGLES3::gi_probe_get_bias(RID p_probe) const{ + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,0); + + return gip->bias; +} + + float RasterizerStorageGLES3::gi_probe_get_propagation(RID p_probe) const{ const GIProbe *gip = gi_probe_owner.getornull(p_probe); @@ -5535,9 +5610,10 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){ GLuint color_type; Image::Format image_format; + bool hdr = rt->flags[RENDER_TARGET_HDR] && config.hdr_supported; + hdr=false; - - if (!rt->flags[RENDER_TARGET_HDR] || rt->flags[RENDER_TARGET_NO_3D]) { + if (!hdr || rt->flags[RENDER_TARGET_NO_3D]) { color_internal_format=GL_RGBA8; color_format=GL_RGBA; @@ -5562,7 +5638,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){ glGenTextures(1, &rt->depth); glBindTexture(GL_TEXTURE_2D, rt->depth); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, rt->width, rt->height, 0, + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, rt->width, rt->height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -5586,6 +5662,10 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){ GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo); + if (status != GL_FRAMEBUFFER_COMPLETE) { + printf("framebuffer fail, status: %x\n",status); + } + ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE ); Texture *tex = texture_owner.get(rt->texture); @@ -5633,7 +5713,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){ if (msaa==0) glRenderbufferStorage(GL_RENDERBUFFER,color_internal_format,rt->width,rt->height); else - glRenderbufferStorageMultisample(GL_RENDERBUFFER,msaa,GL_RGBA16F,rt->width,rt->height); + glRenderbufferStorageMultisample(GL_RENDERBUFFER,msaa,color_internal_format,rt->width,rt->height); glFramebufferRenderbuffer(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_RENDERBUFFER,rt->buffers.diffuse); @@ -5641,7 +5721,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){ glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.specular); if (msaa==0) - glRenderbufferStorage(GL_RENDERBUFFER,GL_RGBA16F,rt->width,rt->height); + glRenderbufferStorage(GL_RENDERBUFFER,color_internal_format,rt->width,rt->height); else glRenderbufferStorageMultisample(GL_RENDERBUFFER,msaa,color_internal_format,rt->width,rt->height); @@ -6265,6 +6345,18 @@ bool RasterizerStorageGLES3::free(RID p_rid){ mesh->instance_remove_deps(); mesh_clear(p_rid); + while(mesh->multimeshes.first()) { + MultiMesh *multimesh = mesh->multimeshes.first()->self(); + multimesh->mesh=RID(); + multimesh->dirty_aabb=true; + mesh->multimeshes.remove(mesh->multimeshes.first()); + + if (!multimesh->update_list.in_list()) { + multimesh_update_list.add(&multimesh->update_list); + } + + } + mesh_owner.free(p_rid); memdelete(mesh); @@ -6274,9 +6366,17 @@ bool RasterizerStorageGLES3::free(RID p_rid){ MultiMesh *multimesh = multimesh_owner.get(p_rid); multimesh->instance_remove_deps(); + if (multimesh->mesh.is_valid()) { + Mesh *mesh = mesh_owner.getornull(multimesh->mesh); + if (mesh) { + mesh->multimeshes.remove(&multimesh->mesh_list); + } + } + multimesh_allocate(p_rid,0,VS::MULTIMESH_TRANSFORM_2D,VS::MULTIMESH_COLOR_NONE); //frees multimesh update_dirty_multimeshes(); + multimesh_owner.free(p_rid); memdelete(multimesh); } else if (immediate_owner.owns(p_rid)) { @@ -6405,9 +6505,11 @@ void RasterizerStorageGLES3::initialize() { config.latc_supported=config.extensions.has("GL_EXT_texture_compression_latc"); config.bptc_supported=config.extensions.has("GL_ARB_texture_compression_bptc"); #ifdef GLES_OVER_GL + config.hdr_supported=true; config.etc2_supported=false; #else config.etc2_supported=true; + config.hdr_supported=false; #endif config.pvrtc_supported=config.extensions.has("GL_IMG_texture_compression_pvrtc"); config.srgb_decode_supported=config.extensions.has("GL_EXT_texture_sRGB_decode"); @@ -6568,6 +6670,14 @@ void RasterizerStorageGLES3::finalize() { } +void RasterizerStorageGLES3::update_dirty_resources() { + + update_dirty_multimeshes(); + update_dirty_skeletons(); + update_dirty_shaders(); + update_dirty_materials(); + update_particles(); +} RasterizerStorageGLES3::RasterizerStorageGLES3() { diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 07998886a8..1fa15538de 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* rasterizer_storage_gles3.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RASTERIZERSTORAGEGLES3_H #define RASTERIZERSTORAGEGLES3_H @@ -46,6 +74,8 @@ public: bool etc2_supported; bool pvrtc_supported; + bool hdr_supported; + bool srgb_decode_supported; bool use_rgba_2d_shadows; @@ -567,6 +597,7 @@ public: virtual void material_changed_notify() { mesh->instance_material_change_notify(); + mesh->update_multimeshes(); } Surface() { @@ -591,6 +622,7 @@ public: } }; + class MultiMesh; struct Mesh : public GeometryOwner { @@ -600,6 +632,17 @@ public: VS::BlendShapeMode blend_shape_mode; Rect3 custom_aabb; mutable uint64_t last_pass; + SelfList<MultiMesh>::List multimeshes; + + _FORCE_INLINE_ void update_multimeshes() { + + SelfList<MultiMesh> *mm = multimeshes.first(); + while(mm) { + mm->self()->instance_material_change_notify(); + mm=mm->next(); + } + } + Mesh() { blend_shape_mode=VS::BLEND_SHAPE_MODE_NORMALIZED; blend_shape_count=0; @@ -659,6 +702,7 @@ public: Vector<float> data; Rect3 aabb; SelfList<MultiMesh> update_list; + SelfList<MultiMesh> mesh_list; GLuint buffer; int visible_instances; @@ -668,7 +712,7 @@ public: bool dirty_aabb; bool dirty_data; - MultiMesh() : update_list(this) { + MultiMesh() : update_list(this), mesh_list(this) { dirty_aabb=true; dirty_data=true; xform_floats=0; @@ -921,6 +965,7 @@ public: int dynamic_range; float energy; + float bias; float propagation; bool interior; bool compress; @@ -954,6 +999,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range); virtual float gi_probe_get_energy(RID p_probe) const; + virtual void gi_probe_set_bias(RID p_probe,float p_range); + virtual float gi_probe_get_bias(RID p_probe) const; + virtual void gi_probe_set_propagation(RID p_probe,float p_range); virtual float gi_probe_get_propagation(RID p_probe) const; @@ -1259,6 +1307,7 @@ public: virtual bool has_os_feature(const String& p_feature) const; + virtual void update_dirty_resources(); RasterizerStorageGLES3(); }; diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index 12aac79912..260f1787c4 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -1,4 +1,33 @@ +/*************************************************************************/ +/* shader_compiler_gles3.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "shader_compiler_gles3.h" + #include "os/os.h" #define SL ShaderLanguage @@ -401,6 +430,7 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener String scode = _dump_node_code(bnode->statements[i],p_level,r_gen_code,p_actions,p_default_actions); if (bnode->statements[i]->type==SL::Node::TYPE_CONTROL_FLOW || bnode->statements[i]->type==SL::Node::TYPE_CONTROL_FLOW) { + // FIXME: if (A || A) ? I am hesitant to delete one of them, could be copy-paste error. code+=scode; //use directly } else { code+=_mktab(p_level)+scode+";\n"; diff --git a/drivers/gles3/shader_compiler_gles3.h b/drivers/gles3/shader_compiler_gles3.h index 1beee66ad7..bbdfc7865f 100644 --- a/drivers/gles3/shader_compiler_gles3.h +++ b/drivers/gles3/shader_compiler_gles3.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* shader_compiler_gles3.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 SHADERCOMPILERGLES3_H #define SHADERCOMPILERGLES3_H diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp index 42a9f19671..a148d68a91 100644 --- a/drivers/gles3/shader_gles3.cpp +++ b/drivers/gles3/shader_gles3.cpp @@ -1,11 +1,11 @@ /*************************************************************************/ -/* shader_gles2.cpp */ +/* shader_gles3.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/gles3/shader_gles3.h b/drivers/gles3/shader_gles3.h index ee8db2ac8c..464f359d51 100644 --- a/drivers/gles3/shader_gles3.h +++ b/drivers/gles3/shader_gles3.h @@ -1,11 +1,11 @@ /*************************************************************************/ -/* shader_gles2.h */ +/* shader_gles3.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -149,7 +149,7 @@ private: struct VersionKeyHash { - static _FORCE_INLINE_ uint32_t hash( const VersionKey& p_key) { return HashMapHahserDefault::hash(p_key.key); }; + static _FORCE_INLINE_ uint32_t hash( const VersionKey& p_key) { return HashMapHasherDefault::hash(p_key.key); }; }; //this should use a way more cachefriendly version.. diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 200c0c0cac..a0bf6cd58b 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -533,8 +533,8 @@ float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) { float ratio_incr = 1.0/steps; do { - source += incr*2; - bias+=incr*2; + source += incr*2.0; + bias+=incr*2.0; vec3 uv_depth = (source.xyz / source.w) * 0.5 + 0.5; float depth = texture(depth_buffer,uv_depth.xy).r; @@ -931,6 +931,7 @@ uniform highp mat4 gi_probe_xform1; uniform highp vec3 gi_probe_bounds1; uniform highp vec3 gi_probe_cell_size1; uniform highp float gi_probe_multiplier1; +uniform highp float gi_probe_bias1; uniform bool gi_probe_blend_ambient1; uniform mediump sampler3D gi_probe2; //texunit:-7 @@ -938,13 +939,14 @@ uniform highp mat4 gi_probe_xform2; uniform highp vec3 gi_probe_bounds2; uniform highp vec3 gi_probe_cell_size2; uniform highp float gi_probe_multiplier2; +uniform highp float gi_probe_bias2; uniform bool gi_probe2_enabled; uniform bool gi_probe_blend_ambient2; -vec3 voxel_cone_trace(sampler3D probe, vec3 cell_size, vec3 pos, vec3 ambient, bool blend_ambient, vec3 direction, float tan_half_angle, float max_distance) { +vec3 voxel_cone_trace(sampler3D probe, vec3 cell_size, vec3 pos, vec3 ambient, bool blend_ambient, vec3 direction, float tan_half_angle, float max_distance, float p_bias) { - float dist = dot(direction,mix(vec3(-1.0),vec3(1.0),greaterThan(direction,vec3(0.0))))*2.0; + float dist = p_bias;//1.0; //dot(direction,mix(vec3(-1.0),vec3(1.0),greaterThan(direction,vec3(0.0))))*2.0; float alpha=0.0; vec3 color = vec3(0.0); @@ -957,12 +959,14 @@ vec3 voxel_cone_trace(sampler3D probe, vec3 cell_size, vec3 pos, vec3 ambient, b dist += diameter * 0.5; } - //color.rgb = mix(color.rgb,mix(ambient,color.rgb,alpha),blend_ambient); + if (blend_ambient) { + color.rgb = mix(ambient,color.rgb,min(1.0,alpha/0.95)); + } return color; } -void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_size,vec3 pos, vec3 ambient, vec3 environment, bool blend_ambient,float multiplier, mat3 normal_mtx,vec3 ref_vec, float roughness, out vec4 out_spec, out vec4 out_diff) { +void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_size,vec3 pos, vec3 ambient, vec3 environment, bool blend_ambient,float multiplier, mat3 normal_mtx,vec3 ref_vec, float roughness,float p_bias, out vec4 out_spec, out vec4 out_diff) { @@ -1023,7 +1027,7 @@ void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_s for(int i=0;i<MAX_CONE_DIRS;i++) { vec3 dir = normalize( (probe_xform * vec4(pos + normal_mtx * cone_dirs[i],1.0)).xyz - probe_pos); - light+=cone_weights[i] * voxel_cone_trace(probe,cell_size,probe_pos,ambient,blend_ambient,dir,cone_angle_tan,max_distance); + light+=cone_weights[i] * voxel_cone_trace(probe,cell_size,probe_pos,ambient,blend_ambient,dir,cone_angle_tan,max_distance,p_bias); } @@ -1033,7 +1037,7 @@ void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_s //irradiance - vec3 irr_light = voxel_cone_trace(probe,cell_size,probe_pos,environment,blend_ambient,ref_vec,max(min_ref_tan,tan(roughness * 0.5 * M_PI)) ,max_distance); + vec3 irr_light = voxel_cone_trace(probe,cell_size,probe_pos,environment,blend_ambient,ref_vec,max(min_ref_tan,tan(roughness * 0.5 * M_PI)) ,max_distance,p_bias); irr_light *= multiplier; //irr_light=vec3(0.0); @@ -1064,11 +1068,11 @@ void gi_probes_compute(vec3 pos, vec3 normal, float roughness, vec3 specular, in out_specular = vec3(0.0); - gi_probe_compute(gi_probe1,gi_probe_xform1,gi_probe_bounds1,gi_probe_cell_size1,pos,ambient,environment,gi_probe_blend_ambient1,gi_probe_multiplier1,normal_mat,ref_vec,roughness,spec_accum,diff_accum); + gi_probe_compute(gi_probe1,gi_probe_xform1,gi_probe_bounds1,gi_probe_cell_size1,pos,ambient,environment,gi_probe_blend_ambient1,gi_probe_multiplier1,normal_mat,ref_vec,roughness,gi_probe_bias1,spec_accum,diff_accum); if (gi_probe2_enabled) { - gi_probe_compute(gi_probe2,gi_probe_xform2,gi_probe_bounds2,gi_probe_cell_size2,pos,ambient,environment,gi_probe_blend_ambient2,gi_probe_multiplier2,normal_mat,ref_vec,roughness,spec_accum,diff_accum); + gi_probe_compute(gi_probe2,gi_probe_xform2,gi_probe_bounds2,gi_probe_cell_size2,pos,ambient,environment,gi_probe_blend_ambient2,gi_probe_multiplier2,normal_mat,ref_vec,roughness,gi_probe_bias2,spec_accum,diff_accum); } if (diff_accum.a>0.0) { diff --git a/drivers/gles3/shaders/ssao.glsl b/drivers/gles3/shaders/ssao.glsl index 75f49ef37a..ba29ec52c7 100644 --- a/drivers/gles3/shaders/ssao.glsl +++ b/drivers/gles3/shaders/ssao.glsl @@ -29,7 +29,7 @@ void main() { uniform sampler2D source_depth; //texunit:0 -uniform usampler2D source_depth_mipmaps; //texunit:1 +uniform highp usampler2D source_depth_mipmaps; //texunit:1 uniform sampler2D source_normal; //texunit:2 uniform ivec2 screen_size; @@ -78,8 +78,8 @@ vec3 reconstructCSFaceNormal(vec3 C) { /** Returns a unit vector and a screen-space radius for the tap on a unit disk (the caller should scale by the actual disk radius) */ vec2 tapLocation(int sampleNumber, float spinAngle, out float ssR){ // Radius relative to ssR - float alpha = float(sampleNumber + 0.5) * (1.0 / NUM_SAMPLES); - float angle = alpha * (NUM_SPIRAL_TURNS * 6.28) + spinAngle; + float alpha = (float(sampleNumber) + 0.5) * (1.0 / float(NUM_SAMPLES)); + float angle = alpha * (float(NUM_SPIRAL_TURNS) * 6.28) + spinAngle; ssR = alpha; return vec2(cos(angle), sin(angle)); @@ -193,7 +193,7 @@ void main() { // Hash function used in the HPG12 AlchemyAO paper - float randomPatternRotationAngle = (3 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 10; + float randomPatternRotationAngle = float((3 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 10); // Reconstruct normals from positions. These will lead to 1-pixel black lines // at depth discontinuities, however the blur will wipe those out so they are not visible @@ -208,12 +208,12 @@ void main() { sum += sampleAO(ssC, C, n_C, ssDiskRadius, radius,i, randomPatternRotationAngle); } - float A = max(0.0, 1.0 - sum * intensity_div_r6 * (5.0 / NUM_SAMPLES)); + float A = max(0.0, 1.0 - sum * intensity_div_r6 * (5.0 / float(NUM_SAMPLES))); #ifdef ENABLE_RADIUS2 //go again for radius2 - randomPatternRotationAngle = (5 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 11; + randomPatternRotationAngle = float((5 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 11); // Reconstruct normals from positions. These will lead to 1-pixel black lines // at depth discontinuities, however the blur will wipe those out so they are not visible @@ -228,15 +228,15 @@ void main() { sum += sampleAO(ssC, C, n_C, ssDiskRadius,radius2, i, randomPatternRotationAngle); } - A= min(A,max(0.0, 1.0 - sum * intensity_div_r62 * (5.0 / NUM_SAMPLES))); + A= min(A,max(0.0, 1.0 - sum * intensity_div_r62 * (5.0 / float(NUM_SAMPLES)))); #endif // Bilateral box-filter over a quad for free, respecting depth edges // (the difference that this makes is subtle) if (abs(dFdx(C.z)) < 0.02) { - A -= dFdx(A) * ((ssC.x & 1) - 0.5); + A -= dFdx(A) * (float(ssC.x & 1) - 0.5); } if (abs(dFdy(C.z)) < 0.02) { - A -= dFdy(A) * ((ssC.y & 1) - 0.5); + A -= dFdy(A) * (float(ssC.y & 1) - 0.5); } visibility = A; diff --git a/drivers/gles3/shaders/ssao_minify.glsl b/drivers/gles3/shaders/ssao_minify.glsl index df9045c28a..6e46a1842c 100644 --- a/drivers/gles3/shaders/ssao_minify.glsl +++ b/drivers/gles3/shaders/ssao_minify.glsl @@ -43,7 +43,7 @@ void main() { fdepth = fdepth * 2.0 - 1.0; fdepth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - fdepth * (camera_z_far - camera_z_near)); fdepth /= camera_z_far; - depth = uint(clamp(fdepth*65535,0.0,65535.0)); + depth = uint(clamp(fdepth*65535.0,0.0,65535.0)); #else depth = texelFetch(source_depth, clamp(ssP * 2 + ivec2(ssP.y & 1, ssP.x & 1), ivec2(0), from_size - ivec2(1)), source_mipmap).r; diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp index a9a199bb59..f55b089ded 100644 --- a/drivers/png/resource_saver_png.cpp +++ b/drivers/png/resource_saver_png.cpp @@ -29,7 +29,7 @@ #include "resource_saver_png.h" #include "core/image.h" -#include "globals.h" +#include "global_config.h" #include "os/file_access.h" #include "scene/resources/texture.h" diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 5f0e647545..f5268f3ebd 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -32,7 +32,7 @@ #include <pulse/error.h> -#include "globals.h" +#include "global_config.h" Error AudioDriverPulseAudio::init() { diff --git a/drivers/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp index 6ada0aaa68..cc715545bd 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.cpp +++ b/drivers/rtaudio/audio_driver_rtaudio.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "audio_driver_rtaudio.h" -#include "globals.h" +#include "global_config.h" #include "os/os.h" #ifdef RTAUDIO_ENABLED diff --git a/drivers/unix/memory_pool_static_malloc.cpp b/drivers/unix/memory_pool_static_malloc.cpp deleted file mode 100644 index 139597f9cb..0000000000 --- a/drivers/unix/memory_pool_static_malloc.cpp +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/drivers/unix/memory_pool_static_malloc.h b/drivers/unix/memory_pool_static_malloc.h deleted file mode 100644 index e69de29bb2..0000000000 --- a/drivers/unix/memory_pool_static_malloc.h +++ /dev/null diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index cc69283f97..fe49501328 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -61,7 +61,7 @@ #include <poll.h> #include <errno.h> #include <assert.h> -#include "globals.h" +#include "global_config.h" extern bool _print_error_enabled; @@ -117,7 +117,13 @@ int OS_Unix::unix_initialize_audio(int p_audio_driver) { return 0; } - +// Very simple signal handler to reap processes where ::execute was called with +// !p_blocking +void handle_sigchld(int sig) { + int saved_errno = errno; + while (waitpid((pid_t)(-1), 0, WNOHANG) > 0) {} + errno = saved_errno; +} void OS_Unix::initialize_core() { @@ -148,6 +154,14 @@ void OS_Unix::initialize_core() { ticks_start=0; ticks_start=get_ticks_usec(); + + struct sigaction sa; + sa.sa_handler = &handle_sigchld; + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_RESTART | SA_NOCLDSTOP; + if (sigaction(SIGCHLD, &sa, 0) == -1) { + perror("ERROR sigaction() failed:"); + } } void OS_Unix::finalize_core() { diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 6adb3eea70..7696a5fcb5 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -96,12 +96,15 @@ Error PacketPeerUDPPosix::get_packet(const uint8_t **r_buffer,int &r_buffer_size } Error PacketPeerUDPPosix::put_packet(const uint8_t *p_buffer,int p_buffer_size){ - ERR_FAIL_COND_V(peer_addr == IP_Address(), ERR_UNCONFIGURED); + ERR_FAIL_COND_V(!peer_addr.is_valid(), ERR_UNCONFIGURED); + + if (sock_type==IP::TYPE_NONE) + sock_type = peer_addr.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6; int sock = _get_socket(); ERR_FAIL_COND_V( sock == -1, FAILED ); struct sockaddr_storage addr; - size_t addr_size = _set_sockaddr(&addr, peer_addr, peer_port, ip_type); + size_t addr_size = _set_sockaddr(&addr, peer_addr, peer_port, sock_type); errno = 0; int err; @@ -121,16 +124,27 @@ int PacketPeerUDPPosix::get_max_packet_size() const{ return 512; // uhm maybe not } -Error PacketPeerUDPPosix::listen(int p_port, int p_recv_buffer_size) { +Error PacketPeerUDPPosix::listen(int p_port, IP_Address p_bind_address, int p_recv_buffer_size) { + + ERR_FAIL_COND_V(sockfd!=-1,ERR_ALREADY_IN_USE); + ERR_FAIL_COND_V(!p_bind_address.is_valid() && !p_bind_address.is_wildcard(),ERR_INVALID_PARAMETER); + +#ifdef __OpenBSD__ + sock_type = IP::TYPE_IPV4; // OpenBSD does not support dual stacking, fallback to IPv4 only. +#else + sock_type = IP::TYPE_ANY; +#endif + + if(p_bind_address.is_valid()) + sock_type = p_bind_address.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6; - close(); int sock = _get_socket(); if (sock == -1 ) return ERR_CANT_CREATE; sockaddr_storage addr = {0}; - size_t addr_size = _set_listen_sockaddr(&addr, p_port, ip_type, NULL); + size_t addr_size = _set_listen_sockaddr(&addr, p_port, sock_type, IP_Address()); if (bind(sock, (struct sockaddr*)&addr, addr_size) == -1 ) { close(); @@ -145,7 +159,8 @@ void PacketPeerUDPPosix::close(){ if (sockfd != -1) ::close(sockfd); sockfd=-1; - rb.resize(8); + sock_type = IP::TYPE_NONE; + rb.resize(16); queue_count=0; } @@ -157,10 +172,14 @@ Error PacketPeerUDPPosix::wait() { Error PacketPeerUDPPosix::_poll(bool p_wait) { + if (sockfd==-1) { + return FAILED; + } + struct sockaddr_storage from = {0}; socklen_t len = sizeof(struct sockaddr_storage); int ret; - while ( (ret = recvfrom(sockfd, recv_buffer, MIN((int)sizeof(recv_buffer),MAX(rb.space_left()-12, 0)), p_wait?0:MSG_DONTWAIT, (struct sockaddr*)&from, &len)) > 0) { + while ( (ret = recvfrom(sockfd, recv_buffer, MIN((int)sizeof(recv_buffer),MAX(rb.space_left()-24, 0)), p_wait?0:MSG_DONTWAIT, (struct sockaddr*)&from, &len)) > 0) { uint32_t port = 0; @@ -221,10 +240,12 @@ int PacketPeerUDPPosix::get_packet_port() const{ int PacketPeerUDPPosix::_get_socket() { + ERR_FAIL_COND_V(sock_type==IP::TYPE_NONE, -1); + if (sockfd != -1) return sockfd; - sockfd = _socket_create(ip_type, SOCK_DGRAM, IPPROTO_UDP); + sockfd = _socket_create(sock_type, SOCK_DGRAM, IPPROTO_UDP); return sockfd; } @@ -253,7 +274,8 @@ PacketPeerUDPPosix::PacketPeerUDPPosix() { packet_port=0; queue_count=0; peer_port=0; - ip_type = IP::TYPE_ANY; + sock_type = IP::TYPE_NONE; + rb.resize(16); } PacketPeerUDPPosix::~PacketPeerUDPPosix() { diff --git a/drivers/unix/packet_peer_udp_posix.h b/drivers/unix/packet_peer_udp_posix.h index ead7174a9d..ac68344d78 100644 --- a/drivers/unix/packet_peer_udp_posix.h +++ b/drivers/unix/packet_peer_udp_posix.h @@ -48,6 +48,7 @@ class PacketPeerUDPPosix : public PacketPeerUDP { mutable int packet_port; mutable int queue_count; int sockfd; + IP::Type sock_type; IP_Address peer_addr; int peer_port; @@ -65,7 +66,7 @@ public: virtual int get_max_packet_size() const; - virtual Error listen(int p_port, int p_recv_buffer_size=65536); + virtual Error listen(int p_port, IP_Address p_bind_address=IP_Address("*"), int p_recv_buffer_size=65536); virtual void close(); virtual Error wait(); virtual bool is_listening() const; diff --git a/drivers/unix/rw_lock_posix.cpp b/drivers/unix/rw_lock_posix.cpp index b51e5fd420..455dde73b1 100644 --- a/drivers/unix/rw_lock_posix.cpp +++ b/drivers/unix/rw_lock_posix.cpp @@ -1,8 +1,36 @@ - +/*************************************************************************/ +/* rw_lock_posix.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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. */ +/*************************************************************************/ #if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED) -#include "os/memory.h" #include "rw_lock_posix.h" + +#include "os/memory.h" #include "error_macros.h" #include <stdio.h> diff --git a/drivers/unix/rw_lock_posix.h b/drivers/unix/rw_lock_posix.h index bcc102f6a6..35a686b15c 100644 --- a/drivers/unix/rw_lock_posix.h +++ b/drivers/unix/rw_lock_posix.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* rw_lock_posix.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RWLOCKPOSIX_H #define RWLOCKPOSIX_H diff --git a/drivers/unix/socket_helpers.h b/drivers/unix/socket_helpers.h index 6d4f7e7519..fd5fa618ca 100644 --- a/drivers/unix/socket_helpers.h +++ b/drivers/unix/socket_helpers.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* socket_helpers.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 SOCKET_HELPERS_H #define SOCKET_HELPERS_H @@ -16,7 +44,7 @@ static size_t _set_sockaddr(struct sockaddr_storage* p_addr, const IP_Address& p memset(p_addr, 0, sizeof(struct sockaddr_storage)); - ERR_FAIL_COND_V(p_ip==IP_Address(),0); + ERR_FAIL_COND_V(!p_ip.is_valid(),0); // IPv6 socket if (p_sock_type == IP::TYPE_IPV6 || p_sock_type == IP::TYPE_ANY) { @@ -44,21 +72,29 @@ static size_t _set_sockaddr(struct sockaddr_storage* p_addr, const IP_Address& p }; }; -static size_t _set_listen_sockaddr(struct sockaddr_storage* p_addr, int p_port, IP::Type p_sock_type, const List<String> *p_accepted_hosts) { +static size_t _set_listen_sockaddr(struct sockaddr_storage* p_addr, int p_port, IP::Type p_sock_type, const IP_Address p_bind_address) { memset(p_addr, 0, sizeof(struct sockaddr_storage)); if (p_sock_type == IP::TYPE_IPV4) { struct sockaddr_in* addr4 = (struct sockaddr_in*)p_addr; addr4->sin_family = AF_INET; addr4->sin_port = htons(p_port); - addr4->sin_addr.s_addr = INADDR_ANY; // TODO: use accepted hosts list + if(p_bind_address.is_valid()) { + copymem(&addr4->sin_addr.s_addr, p_bind_address.get_ipv4(), 4); + } else { + addr4->sin_addr.s_addr = INADDR_ANY; + } return sizeof(sockaddr_in); } else { struct sockaddr_in6* addr6 = (struct sockaddr_in6*)p_addr; addr6->sin6_family = AF_INET6; addr6->sin6_port = htons(p_port); - addr6->sin6_addr = in6addr_any; // TODO: use accepted hosts list + if(p_bind_address.is_valid()) { + copymem(&addr6->sin6_addr.s6_addr, p_bind_address.get_ipv6(), 16); + } else { + addr6->sin6_addr = in6addr_any; + } return sizeof(sockaddr_in6); }; }; diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index ae4bf77c36..08a2954617 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -88,15 +88,10 @@ Error StreamPeerTCPPosix::_block(int p_sockfd, bool p_read, bool p_write) const return ret < 0 ? FAILED : OK; }; -Error StreamPeerTCPPosix::_poll_connection(bool p_block) const { +Error StreamPeerTCPPosix::_poll_connection() const { ERR_FAIL_COND_V(status != STATUS_CONNECTING || sockfd == -1, FAILED); - if (p_block) { - - _block(sockfd, false, true); - }; - struct sockaddr_storage their_addr; size_t addr_size = _set_sockaddr(&their_addr, peer_host, peer_port, sock_type); @@ -122,10 +117,9 @@ Error StreamPeerTCPPosix::_poll_connection(bool p_block) const { return OK; }; -void StreamPeerTCPPosix::set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_ip_type) { +void StreamPeerTCPPosix::set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_sock_type) { - ip_type = p_ip_type; - sock_type = p_ip_type; + sock_type = p_sock_type; sockfd = p_sockfd; #ifndef NO_FCNTL fcntl(sockfd, F_SETFL, O_NONBLOCK); @@ -142,7 +136,7 @@ void StreamPeerTCPPosix::set_socket(int p_sockfd, IP_Address p_host, int p_port, Error StreamPeerTCPPosix::connect_to_host(const IP_Address& p_host, uint16_t p_port) { - ERR_FAIL_COND_V( p_host == IP_Address(), ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V( !p_host.is_valid(), ERR_INVALID_PARAMETER); sock_type = p_host.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6; sockfd = _socket_create(sock_type, SOCK_STREAM, IPPROTO_TCP); @@ -192,7 +186,7 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent, if (status != STATUS_CONNECTED) { - if (_poll_connection(p_block) != OK) { + if (_poll_connection() != OK) { return FAILED; }; @@ -252,7 +246,7 @@ Error StreamPeerTCPPosix::read(uint8_t* p_buffer, int p_bytes,int &r_received, b if (status == STATUS_CONNECTING) { - if (_poll_connection(p_block) != OK) { + if (_poll_connection() != OK) { return FAILED; }; @@ -331,7 +325,7 @@ bool StreamPeerTCPPosix::is_connected_to_host() const { StreamPeerTCP::Status StreamPeerTCPPosix::get_status() const { if (status == STATUS_CONNECTING) { - _poll_connection(false); + _poll_connection(); }; return status; @@ -398,7 +392,6 @@ StreamPeerTCPPosix::StreamPeerTCPPosix() { sockfd = -1; status = STATUS_NONE; peer_port = 0; - ip_type = IP::TYPE_ANY; }; StreamPeerTCPPosix::~StreamPeerTCPPosix() { diff --git a/drivers/unix/stream_peer_tcp_posix.h b/drivers/unix/stream_peer_tcp_posix.h index d33883b159..7f8d90a448 100644 --- a/drivers/unix/stream_peer_tcp_posix.h +++ b/drivers/unix/stream_peer_tcp_posix.h @@ -46,7 +46,7 @@ protected: Error _block(int p_sockfd, bool p_read, bool p_write) const; - Error _poll_connection(bool p_block) const; + Error _poll_connection() const; IP_Address peer_host; int peer_port; @@ -68,7 +68,7 @@ public: virtual int get_available_bytes() const; - void set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_ip_type); + void set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_sock_type); virtual IP_Address get_connected_host() const; virtual uint16_t get_connected_port() const; diff --git a/drivers/unix/tcp_server_posix.cpp b/drivers/unix/tcp_server_posix.cpp index 0178f08b8c..7e9970453f 100644 --- a/drivers/unix/tcp_server_posix.cpp +++ b/drivers/unix/tcp_server_posix.cpp @@ -68,10 +68,23 @@ void TCPServerPosix::make_default() { TCP_Server::_create = TCPServerPosix::_create; }; -Error TCPServerPosix::listen(uint16_t p_port,const List<String> *p_accepted_hosts) { +Error TCPServerPosix::listen(uint16_t p_port,const IP_Address p_bind_address) { + + ERR_FAIL_COND_V(listen_sockfd!=-1,ERR_ALREADY_IN_USE); + ERR_FAIL_COND_V(!p_bind_address.is_valid() && !p_bind_address.is_wildcard(), ERR_INVALID_PARAMETER); int sockfd; - sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); +#ifdef __OpenBSD__ + sock_type = IP::TYPE_IPV4; // OpenBSD does not support dual stacking, fallback to IPv4 only. +#else + sock_type = IP::TYPE_ANY; +#endif + + // If the bind address is valid use its type as the socket type + if (p_bind_address.is_valid()) + sock_type = p_bind_address.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6; + + sockfd = _socket_create(sock_type, SOCK_STREAM, IPPROTO_TCP); ERR_FAIL_COND_V(sockfd == -1, FAILED); @@ -88,9 +101,7 @@ Error TCPServerPosix::listen(uint16_t p_port,const List<String> *p_accepted_host } struct sockaddr_storage addr; - size_t addr_size = _set_listen_sockaddr(&addr, p_port, ip_type, p_accepted_hosts); - - // automatically fill with my IP TODO: use p_accepted_hosts + size_t addr_size = _set_listen_sockaddr(&addr, p_port, sock_type, p_bind_address); if (bind(sockfd, (struct sockaddr *)&addr, addr_size) != -1) { @@ -157,7 +168,7 @@ Ref<StreamPeerTCP> TCPServerPosix::take_connection() { int port; _set_ip_addr_port(ip, port, &their_addr); - conn->set_socket(fd, ip, port, ip_type); + conn->set_socket(fd, ip, port, sock_type); return conn; }; @@ -170,13 +181,14 @@ void TCPServerPosix::stop() { }; listen_sockfd = -1; + sock_type = IP::TYPE_NONE; }; TCPServerPosix::TCPServerPosix() { listen_sockfd = -1; - ip_type = IP::TYPE_ANY; + sock_type = IP::TYPE_NONE; }; TCPServerPosix::~TCPServerPosix() { diff --git a/drivers/unix/tcp_server_posix.h b/drivers/unix/tcp_server_posix.h index 6f9fa8cb5b..ea42d0fc0c 100644 --- a/drivers/unix/tcp_server_posix.h +++ b/drivers/unix/tcp_server_posix.h @@ -35,12 +35,13 @@ class TCPServerPosix : public TCP_Server { int listen_sockfd; + IP::Type sock_type; static TCP_Server* _create(); public: - virtual Error listen(uint16_t p_port,const List<String> *p_accepted_hosts=NULL); + virtual Error listen(uint16_t p_port, IP_Address p_bind_address=IP_Address("*")); virtual bool is_connection_available() const; virtual Ref<StreamPeerTCP> take_connection(); diff --git a/drivers/windows/rw_lock_windows.cpp b/drivers/windows/rw_lock_windows.cpp index 0da7bf4bd5..edbd7b6a0f 100644 --- a/drivers/windows/rw_lock_windows.cpp +++ b/drivers/windows/rw_lock_windows.cpp @@ -1,8 +1,36 @@ - +/*************************************************************************/ +/* rw_lock_windows.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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. */ +/*************************************************************************/ #if defined(WINDOWS_ENABLED) -#include "os/memory.h" #include "rw_lock_windows.h" + +#include "os/memory.h" #include "error_macros.h" #include <stdio.h> diff --git a/drivers/windows/rw_lock_windows.h b/drivers/windows/rw_lock_windows.h index c089c31c33..059704e5c7 100644 --- a/drivers/windows/rw_lock_windows.h +++ b/drivers/windows/rw_lock_windows.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* rw_lock_windows.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RWLOCKWINDOWS_H #define RWLOCKWINDOWS_H diff --git a/drivers/xaudio2/audio_driver_xaudio2.cpp b/drivers/xaudio2/audio_driver_xaudio2.cpp index fa55c97325..cd61fefd91 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.cpp +++ b/drivers/xaudio2/audio_driver_xaudio2.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "audio_driver_xaudio2.h" -#include "globals.h" +#include "global_config.h" #include "os/os.h" const char * AudioDriverXAudio2::get_name() const diff --git a/tools/editor/SCsub b/editor/SCsub index 710dac3ea7..d7392f8249 100644 --- a/tools/editor/SCsub +++ b/editor/SCsub @@ -3,6 +3,8 @@ Import('env') env.editor_sources = [] +import os + def make_certs_header(target, source, env): @@ -29,11 +31,21 @@ def make_certs_header(target, source, env): def make_doc_header(target, source, env): - src = source[0].srcnode().abspath dst = target[0].srcnode().abspath - f = open(src, "rb") g = open(dst, "wb") - buf = f.read() + buf = "" + docbegin = "" + docend = "" + for s in source: + src = s.srcnode().abspath + f = open(src, "rb") + content = f.read() + buf += content[content.find("<class"): content.rfind("</doc>")] + if len(docbegin) == 0: + docbegin = content[0: content.find("<class")] + if len(docend) == 0: + docend = content[content.rfind("</doc>"): len(buf)] + buf = docbegin + buf + docend decomp_size = len(buf) import zlib buf = zlib.compress(buf) @@ -137,7 +149,7 @@ if (env["tools"] == "yes"): reg_exporters = 'void register_exporters() {\n' for e in env.platform_exporters: env.editor_sources.append("#platform/" + e + "/export/export.cpp") - reg_exporters += '\t//register_' + e + '_exporter();\n' + reg_exporters += '\tregister_' + e + '_exporter();\n' reg_exporters_inc += '#include "platform/' + e + '/export/export.h"\n' reg_exporters += '}\n' f = open("register_exporters.cpp", "wb") @@ -146,12 +158,19 @@ if (env["tools"] == "yes"): f.close() # API documentation - env.Depends("#tools/editor/doc_data_compressed.h", "#doc/base/classes.xml") - env.Command("#tools/editor/doc_data_compressed.h", "#doc/base/classes.xml", make_doc_header) + docs = ["#doc/base/classes.xml"] + moduledir = os.path.join(os.getcwd(), "..", "modules") + for m in os.listdir(moduledir): + curmodle = os.path.join(moduledir, m) + docfile = os.path.join(curmodle, "classes.xml") + if os.path.isdir(curmodle) and os.path.isfile(docfile): + docs.append(docfile) + env.Depends("#editor/doc_data_compressed.h", docs) + env.Command("#editor/doc_data_compressed.h", docs, make_doc_header) # Certificates - env.Depends("#tools/editor/certs_compressed.h", "#thirdparty/certs/ca-certificates.crt") - env.Command("#tools/editor/certs_compressed.h", "#thirdparty/certs/ca-certificates.crt", make_certs_header) + env.Depends("#editor/certs_compressed.h", "#thirdparty/certs/ca-certificates.crt") + env.Command("#editor/certs_compressed.h", "#thirdparty/certs/ca-certificates.crt", make_certs_header) import glob path = env.Dir('.').abspath @@ -159,15 +178,15 @@ if (env["tools"] == "yes"): # Translations tlist = glob.glob(path + "/translations/*.po") print("translations: ", tlist) - env.Depends('#tools/editor/translations.h', tlist) - env.Command('#tools/editor/translations.h', tlist, make_translations_header) + env.Depends('#editor/translations.h', tlist) + env.Command('#editor/translations.h', tlist, make_translations_header) # Fonts - flist = glob.glob(path + "/../../thirdparty/fonts/*.ttf") - flist.append(glob.glob(path + "/../../thirdparty/fonts/*.otf")) + flist = glob.glob(path + "/../thirdparty/fonts/*.ttf") + flist.append(glob.glob(path + "/../thirdparty/fonts/*.otf")) print("fonts: ", flist) - env.Depends('#tools/editor/builtin_fonts.h', flist) - env.Command('#tools/editor/builtin_fonts.h', flist, make_fonts_header) + env.Depends('#editor/builtin_fonts.h', flist) + env.Command('#editor/builtin_fonts.h', flist, make_fonts_header) env.add_source_files(env.editor_sources, "*.cpp") diff --git a/tools/editor/animation_editor.cpp b/editor/animation_editor.cpp index f256e351ae..d65f229fca 100644 --- a/tools/editor/animation_editor.cpp +++ b/editor/animation_editor.cpp @@ -35,7 +35,7 @@ #include "pair.h" #include "scene/gui/separator.h" #include "editor_node.h" -#include "tools/editor/plugins/animation_player_editor_plugin.h" +#include "editor/plugins/animation_player_editor_plugin.h" #include "scene/main/viewport.h" /* Missing to fix: @@ -3922,48 +3922,48 @@ void AnimationKeyEditor::cleanup() { void AnimationKeyEditor::_bind_methods() { - ClassDB::bind_method(_MD("_root_removed"),&AnimationKeyEditor::_root_removed); - ClassDB::bind_method(_MD("_scale"),&AnimationKeyEditor::_scale); - ClassDB::bind_method(_MD("set_root"),&AnimationKeyEditor::set_root); + ClassDB::bind_method(D_METHOD("_root_removed"),&AnimationKeyEditor::_root_removed); + ClassDB::bind_method(D_METHOD("_scale"),&AnimationKeyEditor::_scale); + ClassDB::bind_method(D_METHOD("set_root"),&AnimationKeyEditor::set_root); - //ClassDB::bind_method(_MD("_confirm_insert"),&AnimationKeyEditor::_confirm_insert); - ClassDB::bind_method(_MD("_confirm_insert_list"),&AnimationKeyEditor::_confirm_insert_list); + //ClassDB::bind_method(D_METHOD("_confirm_insert"),&AnimationKeyEditor::_confirm_insert); + ClassDB::bind_method(D_METHOD("_confirm_insert_list"),&AnimationKeyEditor::_confirm_insert_list); - ClassDB::bind_method(_MD("_update_paths"),&AnimationKeyEditor::_update_paths); - ClassDB::bind_method(_MD("_track_editor_draw"),&AnimationKeyEditor::_track_editor_draw); + ClassDB::bind_method(D_METHOD("_update_paths"),&AnimationKeyEditor::_update_paths); + ClassDB::bind_method(D_METHOD("_track_editor_draw"),&AnimationKeyEditor::_track_editor_draw); - ClassDB::bind_method(_MD("_animation_changed"),&AnimationKeyEditor::_animation_changed); - ClassDB::bind_method(_MD("_scroll_changed"),&AnimationKeyEditor::_scroll_changed); - ClassDB::bind_method(_MD("_track_editor_gui_input"),&AnimationKeyEditor::_track_editor_gui_input); - ClassDB::bind_method(_MD("_track_name_changed"),&AnimationKeyEditor::_track_name_changed); - ClassDB::bind_method(_MD("_track_menu_selected"),&AnimationKeyEditor::_track_menu_selected); - ClassDB::bind_method(_MD("_menu_add_track"),&AnimationKeyEditor::_menu_add_track); - ClassDB::bind_method(_MD("_menu_track"),&AnimationKeyEditor::_menu_track); - ClassDB::bind_method(_MD("_clear_selection_for_anim"),&AnimationKeyEditor::_clear_selection_for_anim); - ClassDB::bind_method(_MD("_select_at_anim"),&AnimationKeyEditor::_select_at_anim); - ClassDB::bind_method(_MD("_track_pos_draw"),&AnimationKeyEditor::_track_pos_draw); - ClassDB::bind_method(_MD("_insert_delay"),&AnimationKeyEditor::_insert_delay); - ClassDB::bind_method(_MD("_step_changed"),&AnimationKeyEditor::_step_changed); + ClassDB::bind_method(D_METHOD("_animation_changed"),&AnimationKeyEditor::_animation_changed); + ClassDB::bind_method(D_METHOD("_scroll_changed"),&AnimationKeyEditor::_scroll_changed); + ClassDB::bind_method(D_METHOD("_track_editor_gui_input"),&AnimationKeyEditor::_track_editor_gui_input); + ClassDB::bind_method(D_METHOD("_track_name_changed"),&AnimationKeyEditor::_track_name_changed); + ClassDB::bind_method(D_METHOD("_track_menu_selected"),&AnimationKeyEditor::_track_menu_selected); + ClassDB::bind_method(D_METHOD("_menu_add_track"),&AnimationKeyEditor::_menu_add_track); + ClassDB::bind_method(D_METHOD("_menu_track"),&AnimationKeyEditor::_menu_track); + ClassDB::bind_method(D_METHOD("_clear_selection_for_anim"),&AnimationKeyEditor::_clear_selection_for_anim); + ClassDB::bind_method(D_METHOD("_select_at_anim"),&AnimationKeyEditor::_select_at_anim); + ClassDB::bind_method(D_METHOD("_track_pos_draw"),&AnimationKeyEditor::_track_pos_draw); + ClassDB::bind_method(D_METHOD("_insert_delay"),&AnimationKeyEditor::_insert_delay); + ClassDB::bind_method(D_METHOD("_step_changed"),&AnimationKeyEditor::_step_changed); - ClassDB::bind_method(_MD("_animation_loop_changed"),&AnimationKeyEditor::_animation_loop_changed); - ClassDB::bind_method(_MD("_animation_len_changed"),&AnimationKeyEditor::_animation_len_changed); - ClassDB::bind_method(_MD("_create_value_item"),&AnimationKeyEditor::_create_value_item); - ClassDB::bind_method(_MD("_pane_drag"),&AnimationKeyEditor::_pane_drag); + ClassDB::bind_method(D_METHOD("_animation_loop_changed"),&AnimationKeyEditor::_animation_loop_changed); + ClassDB::bind_method(D_METHOD("_animation_len_changed"),&AnimationKeyEditor::_animation_len_changed); + ClassDB::bind_method(D_METHOD("_create_value_item"),&AnimationKeyEditor::_create_value_item); + ClassDB::bind_method(D_METHOD("_pane_drag"),&AnimationKeyEditor::_pane_drag); - ClassDB::bind_method(_MD("_animation_len_update"),&AnimationKeyEditor::_animation_len_update); + ClassDB::bind_method(D_METHOD("_animation_len_update"),&AnimationKeyEditor::_animation_len_update); - ClassDB::bind_method(_MD("set_animation"),&AnimationKeyEditor::set_animation); - ClassDB::bind_method(_MD("_animation_optimize"),&AnimationKeyEditor::_animation_optimize); - ClassDB::bind_method(_MD("_curve_transition_changed"),&AnimationKeyEditor::_curve_transition_changed); - ClassDB::bind_method(_MD("_toggle_edit_curves"),&AnimationKeyEditor::_toggle_edit_curves); - ClassDB::bind_method(_MD("_add_call_track"),&AnimationKeyEditor::_add_call_track); + ClassDB::bind_method(D_METHOD("set_animation"),&AnimationKeyEditor::set_animation); + ClassDB::bind_method(D_METHOD("_animation_optimize"),&AnimationKeyEditor::_animation_optimize); + ClassDB::bind_method(D_METHOD("_curve_transition_changed"),&AnimationKeyEditor::_curve_transition_changed); + ClassDB::bind_method(D_METHOD("_toggle_edit_curves"),&AnimationKeyEditor::_toggle_edit_curves); + ClassDB::bind_method(D_METHOD("_add_call_track"),&AnimationKeyEditor::_add_call_track); ADD_SIGNAL( MethodInfo("resource_selected", PropertyInfo( Variant::OBJECT, "res"),PropertyInfo( Variant::STRING, "prop") ) ); diff --git a/tools/editor/animation_editor.h b/editor/animation_editor.h index c4539cd763..c4539cd763 100644 --- a/tools/editor/animation_editor.h +++ b/editor/animation_editor.h diff --git a/tools/editor/array_property_edit.cpp b/editor/array_property_edit.cpp index b587c4f830..7304d8dddf 100644 --- a/tools/editor/array_property_edit.cpp +++ b/editor/array_property_edit.cpp @@ -288,10 +288,10 @@ Node *ArrayPropertyEdit::get_node() { void ArrayPropertyEdit::_bind_methods() { - ClassDB::bind_method(_MD("_set_size"),&ArrayPropertyEdit::_set_size); - ClassDB::bind_method(_MD("_set_value"),&ArrayPropertyEdit::_set_value); - ClassDB::bind_method(_MD("_notif_change"),&ArrayPropertyEdit::_notif_change); - ClassDB::bind_method(_MD("_notif_changev"),&ArrayPropertyEdit::_notif_changev); + ClassDB::bind_method(D_METHOD("_set_size"),&ArrayPropertyEdit::_set_size); + ClassDB::bind_method(D_METHOD("_set_value"),&ArrayPropertyEdit::_set_value); + ClassDB::bind_method(D_METHOD("_notif_change"),&ArrayPropertyEdit::_notif_change); + ClassDB::bind_method(D_METHOD("_notif_changev"),&ArrayPropertyEdit::_notif_changev); } ArrayPropertyEdit::ArrayPropertyEdit() diff --git a/tools/editor/array_property_edit.h b/editor/array_property_edit.h index 6ca700bf80..6ca700bf80 100644 --- a/tools/editor/array_property_edit.h +++ b/editor/array_property_edit.h diff --git a/tools/editor/asset_library_editor_plugin.cpp b/editor/asset_library_editor_plugin.cpp index 6ba7a7e79b..1c1b6c91e3 100644 --- a/tools/editor/asset_library_editor_plugin.cpp +++ b/editor/asset_library_editor_plugin.cpp @@ -199,9 +199,9 @@ void EditorAssetLibraryItemDescription::set_image(int p_type,int p_index,const R } void EditorAssetLibraryItemDescription::_bind_methods() { - ClassDB::bind_method(_MD("set_image"),&EditorAssetLibraryItemDescription::set_image); - ClassDB::bind_method(_MD("_link_click"),&EditorAssetLibraryItemDescription::_link_click); - ClassDB::bind_method(_MD("_preview_click"),&EditorAssetLibraryItemDescription::_preview_click); + ClassDB::bind_method(D_METHOD("set_image"),&EditorAssetLibraryItemDescription::set_image); + ClassDB::bind_method(D_METHOD("_link_click"),&EditorAssetLibraryItemDescription::_link_click); + ClassDB::bind_method(D_METHOD("_preview_click"),&EditorAssetLibraryItemDescription::_preview_click); } diff --git a/tools/editor/asset_library_editor_plugin.h b/editor/asset_library_editor_plugin.h index 0598ea90ea..0598ea90ea 100644 --- a/tools/editor/asset_library_editor_plugin.h +++ b/editor/asset_library_editor_plugin.h diff --git a/tools/editor/call_dialog.cpp b/editor/call_dialog.cpp index 6dfeb87dfd..6dfeb87dfd 100644 --- a/tools/editor/call_dialog.cpp +++ b/editor/call_dialog.cpp diff --git a/tools/editor/call_dialog.h b/editor/call_dialog.h index b0ebe68d86..56fc07c3df 100644 --- a/tools/editor/call_dialog.h +++ b/editor/call_dialog.h @@ -34,7 +34,7 @@ #include "scene/gui/tree.h" #include "scene/gui/label.h" #include "scene/gui/line_edit.h" -#include "tools/editor/property_editor.h" +#include "editor/property_editor.h" /** @author Juan Linietsky <reduzio@gmail.com> */ diff --git a/tools/editor/code_editor.cpp b/editor/code_editor.cpp index 0a25b43716..8e9925a0d3 100644 --- a/tools/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -33,7 +33,7 @@ #include "scene/gui/separator.h" #include "scene/resources/dynamic_font.h" #include "os/keyboard.h" -#include "tools/editor/editor_scale.h" +#include "editor/editor_scale.h" void GotoLineDialog::popup_find_line(TextEdit *p_edit) { diff --git a/tools/editor/code_editor.h b/editor/code_editor.h index a000f02010..7582985d4c 100644 --- a/tools/editor/code_editor.h +++ b/editor/code_editor.h @@ -29,7 +29,7 @@ #ifndef CODE_EDITOR_H #define CODE_EDITOR_H -#include "tools/editor/editor_plugin.h" +#include "editor/editor_plugin.h" #include "scene/gui/text_edit.h" #include "scene/gui/dialogs.h" #include "scene/main/timer.h" diff --git a/tools/editor/collada/SCsub b/editor/collada/SCsub index 04c9a827ef..04c9a827ef 100644 --- a/tools/editor/collada/SCsub +++ b/editor/collada/SCsub diff --git a/tools/editor/collada/collada.cpp b/editor/collada/collada.cpp index a23fd84aa0..2ba4f648a3 100644 --- a/tools/editor/collada/collada.cpp +++ b/editor/collada/collada.cpp @@ -352,7 +352,7 @@ void Collada::_parse_image(XMLParser& parser) { image.path=path; - } if (name=="data") { + } else if (name=="data") { ERR_PRINT("COLLADA Embedded image data not supported!"); @@ -728,7 +728,7 @@ void Collada::_parse_effect_material(XMLParser& parser,Effect &effect,String &id #endif } - } if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && ( + } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && ( parser.get_node_name()=="constant" || parser.get_node_name()=="lambert" || parser.get_node_name()=="phong" || @@ -1100,7 +1100,7 @@ void Collada::_parse_mesh_geometry(XMLParser& parser,String p_id,String p_name) current_source=id; COLLADA_PRINT("source data: "+id); - } else if (section=="float_array" || section=="array" || section=="float_array") { + } else if (section=="float_array" || section=="array") { // create a new array and read it. if (meshdata.sources.has(current_source)) { @@ -2192,7 +2192,7 @@ void Collada::_parse_scene(XMLParser& parser) { state.root_visual_scene=_uri_to_id(parser.get_attribute_value("url")); print_line("***ROOT VISUAL SCENE: "+state.root_visual_scene); - } if (name=="instance_physics_scene") { + } else if (name=="instance_physics_scene") { state.root_physics_scene=_uri_to_id(parser.get_attribute_value("url")); diff --git a/tools/editor/collada/collada.h b/editor/collada/collada.h index fd7ad4920d..2de2d22935 100644 --- a/tools/editor/collada/collada.h +++ b/editor/collada/collada.h @@ -33,7 +33,7 @@ #include "scene/resources/material.h" -#include "globals.h" +#include "global_config.h" #include "io/xml_parser.h" #include "map.h" diff --git a/tools/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 91ba419c97..91ba419c97 100644 --- a/tools/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp diff --git a/tools/editor/connections_dialog.h b/editor/connections_dialog.h index 64b292bc34..6407b83f6e 100644 --- a/tools/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -36,8 +36,8 @@ #include "scene/gui/dialogs.h" #include "scene/gui/menu_button.h" #include "scene/gui/line_edit.h" -#include "tools/editor/scene_tree_editor.h" -#include "tools/editor/property_editor.h" +#include "editor/scene_tree_editor.h" +#include "editor/property_editor.h" #include "undo_redo.h" /** diff --git a/tools/editor/create_dialog.cpp b/editor/create_dialog.cpp index 53e968f389..58bb148ce1 100644 --- a/tools/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -624,15 +624,15 @@ void CreateDialog::drop_data_fw(const Point2& p_point,const Variant& p_data,Cont void CreateDialog::_bind_methods() { - ClassDB::bind_method(_MD("_text_changed"),&CreateDialog::_text_changed); - ClassDB::bind_method(_MD("_confirmed"),&CreateDialog::_confirmed); - ClassDB::bind_method(_MD("_sbox_input"),&CreateDialog::_sbox_input); - ClassDB::bind_method(_MD("_item_selected"),&CreateDialog::_item_selected); - ClassDB::bind_method(_MD("_favorite_toggled"),&CreateDialog::_favorite_toggled); - ClassDB::bind_method(_MD("_history_selected"),&CreateDialog::_history_selected); - ClassDB::bind_method(_MD("_favorite_selected"),&CreateDialog::_favorite_selected); - ClassDB::bind_method(_MD("_history_activated"),&CreateDialog::_history_activated); - ClassDB::bind_method(_MD("_favorite_activated"),&CreateDialog::_favorite_activated); + ClassDB::bind_method(D_METHOD("_text_changed"),&CreateDialog::_text_changed); + ClassDB::bind_method(D_METHOD("_confirmed"),&CreateDialog::_confirmed); + ClassDB::bind_method(D_METHOD("_sbox_input"),&CreateDialog::_sbox_input); + ClassDB::bind_method(D_METHOD("_item_selected"),&CreateDialog::_item_selected); + ClassDB::bind_method(D_METHOD("_favorite_toggled"),&CreateDialog::_favorite_toggled); + ClassDB::bind_method(D_METHOD("_history_selected"),&CreateDialog::_history_selected); + ClassDB::bind_method(D_METHOD("_favorite_selected"),&CreateDialog::_favorite_selected); + ClassDB::bind_method(D_METHOD("_history_activated"),&CreateDialog::_history_activated); + ClassDB::bind_method(D_METHOD("_favorite_activated"),&CreateDialog::_favorite_activated); ClassDB::bind_method("get_drag_data_fw",&CreateDialog::get_drag_data_fw); diff --git a/tools/editor/create_dialog.h b/editor/create_dialog.h index 5ecb4db2c3..5ecb4db2c3 100644 --- a/tools/editor/create_dialog.h +++ b/editor/create_dialog.h diff --git a/tools/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index a01383a868..d7e04db86e 100644 --- a/tools/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -251,9 +251,9 @@ void DependencyEditor::edit(const String& p_path) { void DependencyEditor::_bind_methods() { - ClassDB::bind_method(_MD("_searched"),&DependencyEditor::_searched); - ClassDB::bind_method(_MD("_load_pressed"),&DependencyEditor::_load_pressed); - ClassDB::bind_method(_MD("_fix_all"),&DependencyEditor::_fix_all); + ClassDB::bind_method(D_METHOD("_searched"),&DependencyEditor::_searched); + ClassDB::bind_method(D_METHOD("_load_pressed"),&DependencyEditor::_load_pressed); + ClassDB::bind_method(D_METHOD("_fix_all"),&DependencyEditor::_fix_all); } @@ -691,8 +691,8 @@ void OrphanResourcesDialog::_button_pressed(Object *p_item,int p_column, int p_i void OrphanResourcesDialog::_bind_methods() { - ClassDB::bind_method(_MD("_delete_confirm"),&OrphanResourcesDialog::_delete_confirm); - ClassDB::bind_method(_MD("_button_pressed"),&OrphanResourcesDialog::_button_pressed); + ClassDB::bind_method(D_METHOD("_delete_confirm"),&OrphanResourcesDialog::_delete_confirm); + ClassDB::bind_method(D_METHOD("_button_pressed"),&OrphanResourcesDialog::_button_pressed); } diff --git a/tools/editor/dependency_editor.h b/editor/dependency_editor.h index a96ffe5fcf..a96ffe5fcf 100644 --- a/tools/editor/dependency_editor.h +++ b/editor/dependency_editor.h diff --git a/tools/editor/doc/SCsub b/editor/doc/SCsub index 04c9a827ef..04c9a827ef 100644 --- a/tools/editor/doc/SCsub +++ b/editor/doc/SCsub diff --git a/tools/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index d51dc886b2..47b8edfa04 100644 --- a/tools/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -30,7 +30,7 @@ #include "version.h" #include "global_constants.h" -#include "globals.h" +#include "global_config.h" #include "script_language.h" #include "io/marshalls.h" #include "io/compression.h" @@ -158,6 +158,13 @@ void DocData::merge_from(const DocData& p_data) { } +void DocData::remove_from(const DocData &p_data) { + for(Map<String,ClassDoc>::Element* E=p_data.class_list.front(); E; E=E->next()) { + if(class_list.has(E->key())) + class_list.erase(E->key()); + } +} + void DocData::generate(bool p_basic_types) { diff --git a/tools/editor/doc/doc_data.h b/editor/doc/doc_data.h index fead1da510..7601013979 100644 --- a/tools/editor/doc/doc_data.h +++ b/editor/doc/doc_data.h @@ -98,6 +98,7 @@ public: public: void merge_from(const DocData& p_data); + void remove_from(const DocData& p_data); void generate(bool p_basic_types=false); Error load(const String& p_path); Error save(const String& p_path); diff --git a/tools/editor/doc/doc_dump.cpp b/editor/doc/doc_dump.cpp index 5ebba596e9..5ebba596e9 100644 --- a/tools/editor/doc/doc_dump.cpp +++ b/editor/doc/doc_dump.cpp diff --git a/tools/editor/doc/doc_dump.h b/editor/doc/doc_dump.h index 84629b89c8..84629b89c8 100644 --- a/tools/editor/doc/doc_dump.h +++ b/editor/doc/doc_dump.h diff --git a/tools/editor/doc_code_font.h b/editor/doc_code_font.h index 55f335ab78..55f335ab78 100644 --- a/tools/editor/doc_code_font.h +++ b/editor/doc_code_font.h diff --git a/tools/editor/doc_font.h b/editor/doc_font.h index b598ee26f8..b598ee26f8 100644 --- a/tools/editor/doc_font.h +++ b/editor/doc_font.h diff --git a/tools/editor/doc_title_font.h b/editor/doc_title_font.h index afa0f61eda..afa0f61eda 100644 --- a/tools/editor/doc_title_font.h +++ b/editor/doc_title_font.h diff --git a/tools/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 8af01012a4..8af01012a4 100644 --- a/tools/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp diff --git a/tools/editor/editor_asset_installer.h b/editor/editor_asset_installer.h index 2d0486a6f6..2d0486a6f6 100644 --- a/tools/editor/editor_asset_installer.h +++ b/editor/editor_asset_installer.h diff --git a/tools/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 6ee18f08d8..8643644950 100644 --- a/tools/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -1,4 +1,33 @@ +/*************************************************************************/ +/* editor_audio_buses.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "editor_audio_buses.h" + #include "editor_node.h" #include "servers/audio_server.h" #include "os/keyboard.h" diff --git a/tools/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index e44f8cd579..8f9e327368 100644 --- a/tools/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* editor_audio_buses.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 EDITORAUDIOBUSES_H #define EDITORAUDIOBUSES_H @@ -14,7 +42,7 @@ #include "scene/gui/tree.h" #include "scene/gui/option_button.h" #include "scene/gui/panel.h" -#include "tools/editor/editor_file_dialog.h" +#include "editor/editor_file_dialog.h" #include "editor_plugin.h" class EditorAudioBuses; diff --git a/tools/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 0038ab48d5..3e3362f515 100644 --- a/tools/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "editor_autoload_settings.h" -#include "globals.h" +#include "global_config.h" #include "global_constants.h" #include "editor_node.h" diff --git a/tools/editor/editor_autoload_settings.h b/editor/editor_autoload_settings.h index 2afe239000..2afe239000 100644 --- a/tools/editor/editor_autoload_settings.h +++ b/editor/editor_autoload_settings.h diff --git a/tools/editor/editor_data.cpp b/editor/editor_data.cpp index ef839d7e74..d2fa40e08c 100644 --- a/tools/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "editor_data.h" -#include "globals.h" +#include "global_config.h" #include "editor_settings.h" #include "os/dir_access.h" #include "io/resource_loader.h" @@ -886,12 +886,12 @@ Array EditorSelection::_get_selected_nodes() { void EditorSelection::_bind_methods() { - ClassDB::bind_method(_MD("_node_removed"),&EditorSelection::_node_removed); - ClassDB::bind_method(_MD("clear"),&EditorSelection::clear); - ClassDB::bind_method(_MD("add_node","node:Node"),&EditorSelection::add_node); - ClassDB::bind_method(_MD("remove_node","node:Node"),&EditorSelection::remove_node); - ClassDB::bind_method(_MD("get_selected_nodes"),&EditorSelection::_get_selected_nodes); - ClassDB::bind_method(_MD("get_transformable_selected_nodes"),&EditorSelection::_get_transformable_selected_nodes); + ClassDB::bind_method(D_METHOD("_node_removed"),&EditorSelection::_node_removed); + ClassDB::bind_method(D_METHOD("clear"),&EditorSelection::clear); + ClassDB::bind_method(D_METHOD("add_node","node:Node"),&EditorSelection::add_node); + ClassDB::bind_method(D_METHOD("remove_node","node:Node"),&EditorSelection::remove_node); + ClassDB::bind_method(D_METHOD("get_selected_nodes"),&EditorSelection::_get_selected_nodes); + ClassDB::bind_method(D_METHOD("get_transformable_selected_nodes"),&EditorSelection::_get_transformable_selected_nodes); ADD_SIGNAL( MethodInfo("selection_changed") ); } diff --git a/tools/editor/editor_data.h b/editor/editor_data.h index fce606f722..4622791653 100644 --- a/tools/editor/editor_data.h +++ b/editor/editor_data.h @@ -29,7 +29,7 @@ #ifndef EDITOR_DATA_H #define EDITOR_DATA_H -#include "tools/editor/editor_plugin.h" +#include "editor/editor_plugin.h" #include "scene/resources/texture.h" #include "list.h" #include "undo_redo.h" diff --git a/tools/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index bb9ddc2aef..235d1f06ba 100644 --- a/tools/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -30,8 +30,8 @@ #include "os/os.h" #include "os/keyboard.h" -#include "tools/editor/editor_settings.h" -#include "tools/editor/editor_file_system.h" +#include "editor/editor_settings.h" +#include "editor/editor_file_system.h" void EditorDirDialog::_update_dir(TreeItem* p_item) { @@ -225,10 +225,10 @@ void EditorDirDialog::_make_dir_confirm() { void EditorDirDialog::_bind_methods() { - ClassDB::bind_method(_MD("_item_collapsed"),&EditorDirDialog::_item_collapsed); - ClassDB::bind_method(_MD("_make_dir"),&EditorDirDialog::_make_dir); - ClassDB::bind_method(_MD("_make_dir_confirm"),&EditorDirDialog::_make_dir_confirm); - ClassDB::bind_method(_MD("reload"),&EditorDirDialog::reload); + ClassDB::bind_method(D_METHOD("_item_collapsed"),&EditorDirDialog::_item_collapsed); + ClassDB::bind_method(D_METHOD("_make_dir"),&EditorDirDialog::_make_dir); + ClassDB::bind_method(D_METHOD("_make_dir_confirm"),&EditorDirDialog::_make_dir_confirm); + ClassDB::bind_method(D_METHOD("reload"),&EditorDirDialog::reload); ADD_SIGNAL(MethodInfo("dir_selected",PropertyInfo(Variant::STRING,"dir"))); } diff --git a/tools/editor/editor_dir_dialog.h b/editor/editor_dir_dialog.h index 0577ff0442..0577ff0442 100644 --- a/tools/editor/editor_dir_dialog.h +++ b/editor/editor_dir_dialog.h diff --git a/tools/editor/editor_import_export.cpp b/editor/editor_export.cpp index 69a004fc08..f5840d00fb 100644 --- a/tools/editor/editor_import_export.cpp +++ b/editor/editor_export.cpp @@ -26,15 +26,940 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "editor_import_export.h" +#include "editor_export.h" +#include "version.h" +#include "script_language.h" +#include "global_config.h" +#include "os/file_access.h" +#include "os/dir_access.h" +#include "editor/editor_file_system.h" +#include "io/resource_loader.h" +#include "editor_node.h" +#include "editor_settings.h" +#include "io/config_file.h" +#include "io/resource_saver.h" +#include "io/md5.h" +#include "editor/plugins/script_editor_plugin.h" +#include "io/zip_io.h" + +static int _get_pad(int p_alignment, int p_n) { + + int rest = p_n % p_alignment; + int pad = 0; + if (rest > 0) { + pad = p_alignment - rest; + }; + + return pad; +}; + +#define PCK_PADDING 16 + +bool EditorExportPreset::_set(const StringName& p_name, const Variant& p_value) { + + if (values.has(p_name)) { + values[p_name]=p_value; + EditorExport::singleton->save_presets(); + return true; + } + + return false; +} + +bool EditorExportPreset::_get(const StringName& p_name,Variant &r_ret) const{ + + if (values.has(p_name)) { + r_ret=values[p_name]; + return true; + } + + return false; +} +void EditorExportPreset::_get_property_list( List<PropertyInfo> *p_list) const{ + + for (const List<PropertyInfo>::Element *E=properties.front();E;E=E->next()) { + + p_list->push_back(E->get()); + } +} + +Ref<EditorExportPlatform> EditorExportPreset::get_platform() const { + + return platform; +} + +Vector<String> EditorExportPreset::get_files_to_export() const { + + Vector<String> files; + for(Set<String>::Element *E=selected_files.front();E;E=E->next()) { + files.push_back(E->get()); + } + return files; +} + +void EditorExportPreset::set_name(const String& p_name) { + name=p_name; + EditorExport::singleton->save_presets(); + +} + +String EditorExportPreset::get_name() const { + return name; + +} + +void EditorExportPreset::set_runnable(bool p_enable) { + + runnable=p_enable; + EditorExport::singleton->save_presets(); +} + +bool EditorExportPreset::is_runnable() const { + + return runnable; +} + +void EditorExportPreset::set_export_filter(ExportFilter p_filter) { + + export_filter=p_filter; + EditorExport::singleton->save_presets(); + +} + +EditorExportPreset::ExportFilter EditorExportPreset::get_export_filter() const { + return export_filter; +} + +void EditorExportPreset::set_include_filter(const String& p_include) { + + include_filter=p_include; + EditorExport::singleton->save_presets(); + +} + +String EditorExportPreset::get_include_filter() const { + + return include_filter; +} + +void EditorExportPreset::set_exclude_filter(const String& p_exclude) { + + exclude_filter=p_exclude; + EditorExport::singleton->save_presets(); +} + +String EditorExportPreset::get_exclude_filter() const { + + return exclude_filter; +} + +void EditorExportPreset::add_export_file(const String& p_path) { + + selected_files.insert(p_path); + EditorExport::singleton->save_presets(); +} + +void EditorExportPreset::remove_export_file(const String& p_path) { + selected_files.erase(p_path); + EditorExport::singleton->save_presets(); +} + +bool EditorExportPreset::has_export_file(const String& p_path) { + + return selected_files.has(p_path); +} + +void EditorExportPreset::add_patch(const String& p_path,int p_at_pos) { + + if (p_at_pos<0) + patches.push_back(p_path); + else + patches.insert(p_at_pos,p_path); + EditorExport::singleton->save_presets(); +} + +void EditorExportPreset::remove_patch(int p_idx) { + patches.remove(p_idx); + EditorExport::singleton->save_presets(); +} + +void EditorExportPreset::set_patch(int p_index,const String& p_path) { + ERR_FAIL_INDEX(p_index,patches.size()); + patches[p_index]=p_path; + EditorExport::singleton->save_presets(); +} +String EditorExportPreset::get_patch(int p_index) { + + ERR_FAIL_INDEX_V(p_index,patches.size(),String()); + return patches[p_index]; +} + +Vector<String> EditorExportPreset::get_patches() const { + return patches; +} + +EditorExportPreset::EditorExportPreset() { + + export_filter=EXPORT_ALL_RESOURCES; + runnable=false; +} + + +/////////////////////////////////// + +void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags) { + + String host = EditorSettings::get_singleton()->get("network/debug_host"); + + if (p_flags&DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST) + host="localhost"; + + if (p_flags&DEBUG_FLAG_DUMB_CLIENT) { + int port = EditorSettings::get_singleton()->get("filesystem/file_server/port"); + String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password"); + r_flags.push_back("-rfs"); + r_flags.push_back(host+":"+itos(port)); + if (passwd!="") { + r_flags.push_back("-rfs_pass"); + r_flags.push_back(passwd); + } + } + + if (p_flags&DEBUG_FLAG_REMOTE_DEBUG) { + + r_flags.push_back("-rdebug"); + + r_flags.push_back(host+":"+String::num(GLOBAL_DEF("network/debug/remote_port", 6007))); + + List<String> breakpoints; + ScriptEditor::get_singleton()->get_breakpoints(&breakpoints); + + + if (breakpoints.size()) { + + r_flags.push_back("-bp"); + String bpoints; + for(const List<String>::Element *E=breakpoints.front();E;E=E->next()) { + + bpoints+=E->get().replace(" ","%20"); + if (E->next()) + bpoints+=","; + } + + r_flags.push_back(bpoints); + } + + } + + if (p_flags&DEBUG_FLAG_VIEW_COLLISONS) { + + r_flags.push_back("-debugcol"); + } + + if (p_flags&DEBUG_FLAG_VIEW_NAVIGATION) { + + r_flags.push_back("-debugnav"); + } +} + +Error EditorExportPlatform::_save_pack_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total) { + + PackData *pd = (PackData*)p_userdata; + + SavedData sd; + sd.path_utf8=p_path.utf8(); + sd.ofs = pd->f->get_pos(); + sd.size = p_data.size(); + + pd->f->store_buffer(p_data.ptr(),p_data.size()); + int pad = _get_pad(PCK_PADDING,sd.size); + for(int i=0;i<pad;i++) { + pd->f->store_8(0); + } + + { + MD5_CTX ctx; + MD5Init(&ctx); + MD5Update(&ctx,(unsigned char*)p_data.ptr(),p_data.size()); + MD5Final(&ctx); + sd.md5.resize(16); + for(int i=0;i<16;i++) { + sd.md5[i]=ctx.digest[i]; + } + } + + pd->file_ofs.push_back(sd); + + pd->ep->step(TTR("Storing File:")+" "+p_path,2+p_file*100/p_total,false); + + return OK; +} + +Error EditorExportPlatform::_save_zip_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total) { + + + String path=p_path.replace_first("res://",""); + + ZipData *zd = (ZipData*)p_userdata; + + zipFile zip=(zipFile)zd->zip; + + zipOpenNewFileInZip(zip, + path.utf8().get_data(), + NULL, + NULL, + 0, + NULL, + 0, + NULL, + Z_DEFLATED, + Z_DEFAULT_COMPRESSION); + + zipWriteInFileInZip(zip,p_data.ptr(),p_data.size()); + zipCloseFileInZip(zip); + + zd->ep->step(TTR("Storing File:")+" "+p_path,2+p_file*100/p_total,false); + + return OK; +} + +String EditorExportPlatform::find_export_template(String template_file_name, String *err) const { + + String user_file = EditorSettings::get_singleton()->get_settings_path() + +"/templates/"+itos(VERSION_MAJOR)+"."+itos(VERSION_MINOR)+"."+_MKSTR(VERSION_STATUS)+"/"+template_file_name; + String system_file=OS::get_singleton()->get_installed_templates_path(); + bool has_system_path=(system_file!=""); + system_file+=template_file_name; + + // Prefer user file + if (FileAccess::exists(user_file)) { + return user_file; + } + + // Now check system file + if (has_system_path) { + if (FileAccess::exists(system_file)) { + return system_file; + } + } + + // Not found + if (err) { + *err+="No export template found at \""+user_file+"\""; + if (has_system_path) + *err+="\n or \""+system_file+"\"."; + else + *err+="."; + } + return ""; +} + +Ref<EditorExportPreset> EditorExportPlatform::create_preset() { + + Ref<EditorExportPreset> preset; + preset.instance(); + preset->platform=Ref<EditorExportPlatform>(this); + + List<ExportOption> options; + get_export_options(&options); + + for (List<ExportOption>::Element *E=options.front();E;E=E->next()) { + + preset->properties.push_back(E->get().option); + preset->values[E->get().option.name]=E->get().default_value; + } + + return preset; + +} + +void EditorExportPlatform::_export_find_resources(EditorFileSystemDirectory *p_dir,Set<String>& p_paths) { + + for(int i=0;i<p_dir->get_subdir_count();i++) { + _export_find_resources(p_dir->get_subdir(i),p_paths); + } + + for(int i=0;i<p_dir->get_file_count();i++) { + p_paths.insert(p_dir->get_file_path(i)); + } +} + + +void EditorExportPlatform::_export_find_dependencies(const String& p_path,Set<String>& p_paths) { + + if (p_paths.has(p_path)) + return; + + p_paths.insert(p_path); + + EditorFileSystemDirectory *dir; + int file_idx; + dir = EditorFileSystem::get_singleton()->find_file(p_path,&file_idx); + if (!dir) + return; + + Vector<String> deps = dir->get_file_deps(file_idx); + + for(int i=0;i<deps.size();i++) { + + _export_find_dependencies(deps[i],p_paths); + } +} + + +Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset>& p_preset,EditorExportSaveFunction p_func, void* p_udata) { + + Ref<EditorExportPlatform> platform = p_preset->get_platform(); + List<String> feature_list; + platform->get_preset_features(p_preset,&feature_list); + //figure out features + Set<String> features; + for (List<String>::Element *E=feature_list.front();E;E=E->next()) { + features.insert(E->get()); + } + + //figure out paths of files that will be exported + Set<String> paths; + + if (p_preset->get_export_filter()==EditorExportPreset::EXPORT_ALL_RESOURCES) { + //find stuff + _export_find_resources(EditorFileSystem::get_singleton()->get_filesystem(),paths); + } else { + bool scenes_only = p_preset->get_export_filter()==EditorExportPreset::EXPORT_SELECTED_SCENES; + + Vector<String> files = p_preset->get_files_to_export(); + for(int i=0;i<files.size();i++) { + if (scenes_only && ResourceLoader::get_resource_type(files[i])!="PackedScene") + continue; + + _export_find_dependencies(files[i],paths); + } + } + + //store everything in the export medium + int idx = 0; + int total=paths.size(); + + for(Set<String>::Element *E=paths.front();E;E=E->next()) { + + String path = E->get(); + + if (FileAccess::exists(path+".import")) { + //file is imported, replace by what it imports + Ref<ConfigFile> config; + config.instance(); + Error err = config->load(path+".import"); + if (err!=OK) { + ERR_PRINTS("Could not parse: '"+path+"', not exported."); + continue; + } + + List<String> remaps; + config->get_section_keys("remap",&remaps); + + for(List<String>::Element *F=remaps.front();F;F=F->next()) { + + String remap=F->get(); + if (remap=="path") { + String remapped_path=config->get_value("remap",remap); + Vector<uint8_t> array = FileAccess::get_file_as_array(remapped_path); + p_func(p_udata,remapped_path,array,idx,total); + } else if (remap.begins_with("path.")) { + String feature = remap.get_slice(".",1); + if (features.has(feature)) { + String remapped_path=config->get_value("remap",remap); + Vector<uint8_t> array = FileAccess::get_file_as_array(remapped_path); + p_func(p_udata,remapped_path,array,idx,total); + } + } + } + + //also save the .import file + Vector<uint8_t> array = FileAccess::get_file_as_array(path+".import"); + p_func(p_udata,path+".import",array,idx,total); + + } else { + //just store it as it comes + Vector<uint8_t> array = FileAccess::get_file_as_array(path); + p_func(p_udata,path,array,idx,total); + } + + idx++; + } + + //save config! + + String config_file="godot.cfb"; + String engine_cfb =EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmp"+config_file; + GlobalConfig::get_singleton()->save_custom(engine_cfb); + Vector<uint8_t> data = FileAccess::get_file_as_array(engine_cfb); + + p_func(p_udata,"res://"+config_file,data,idx,total); + + return OK; +} + +Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset>& p_preset,const String& p_path) { + + EditorProgress ep("savepack",TTR("Packing"),102); + + String tmppath = EditorSettings::get_singleton()->get_settings_path()+"/tmp/packtmp"; + FileAccess *ftmp = FileAccess::open(tmppath,FileAccess::WRITE); + ERR_FAIL_COND_V(!ftmp,ERR_CANT_CREATE) + + PackData pd; + pd.ep=&ep; + pd.f=ftmp; + + Error err = export_project_files(p_preset,_save_pack_file,&pd); + + memdelete(ftmp); //close tmp file + + if (err) + return err; + + pd.file_ofs.sort(); //do sort, so we can do binary search later + + + FileAccess *f = FileAccess::open(p_path,FileAccess::WRITE); + ERR_FAIL_COND_V(!f,ERR_CANT_CREATE) + f->store_32(0x43504447); //GDPK + f->store_32(1); //pack version + f->store_32(VERSION_MAJOR); + f->store_32(VERSION_MINOR); + f->store_32(0); //hmph + for(int i=0;i<16;i++) { + //reserved + f->store_32(0); + } + + f->store_32(pd.file_ofs.size()); //amount of files + + size_t header_size = f->get_pos(); + + //precalculate header size + + for(int i=0;i<pd.file_ofs.size();i++) { + header_size += 4; // size of path string (32 bits is enough) + uint32_t string_len = pd.file_ofs[i].path_utf8.length(); + header_size += string_len + _get_pad(4,string_len); ///size of path string + header_size += 8; // offset to file _with_ header size included + header_size += 8; // size of file + header_size +=16; // md5 + + } + + size_t header_padding = _get_pad(PCK_PADDING,header_size); + + + for(int i=0;i<pd.file_ofs.size();i++) { + + uint32_t string_len = pd.file_ofs[i].path_utf8.length(); + uint32_t pad = _get_pad(4,string_len);; + f->store_32(string_len+pad); + f->store_buffer((const uint8_t*)pd.file_ofs[i].path_utf8.get_data(),string_len); + for(uint32_t j=0;j<pad;j++) { + f->store_8(0); + } + + f->store_64(pd.file_ofs[i].ofs + header_padding + header_size); + f->store_64(pd.file_ofs[i].size); // pay attention here, this is where file is + f->store_buffer(pd.file_ofs[i].md5.ptr(),16); //also save md5 for file + } + + for(uint32_t j=0;j<header_padding;j++) { + f->store_8(0); + } + + //save the rest of the data + + ftmp = FileAccess::open(tmppath,FileAccess::READ); + if (!ftmp) { + memdelete(f); + ERR_FAIL_COND_V(!ftmp,ERR_CANT_CREATE) + } + + const int bufsize=16384; + uint8_t buf[bufsize]; + + while(true) { + + int got = ftmp->get_buffer(buf,bufsize); + if (got<=0) + break; + f->store_buffer(buf,got); + } + + memdelete(ftmp); + + f->store_32(0x43504447); //GDPK + memdelete(f); + + return OK; +} + +Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset>& p_preset,const String& p_path) { + + EditorProgress ep("savezip",TTR("Packing"),102); + + //FileAccess *tmp = FileAccess::open(tmppath,FileAccess::WRITE); + + FileAccess *src_f; + zlib_filefunc_def io = zipio_create_io_from_file(&src_f); + zipFile zip=zipOpen2(p_path.utf8().get_data(),APPEND_STATUS_CREATE,NULL,&io); + + ZipData zd; + zd.ep=&ep; + zd.zip=zip; + + + Error err = export_project_files(p_preset,_save_zip_file,&zd); + + zipClose(zip,NULL); + + return OK; +} + +EditorExportPlatform::EditorExportPlatform() { + + +} + + +//// + +EditorExport *EditorExport::singleton=NULL; + + +void EditorExport::_save() { + + + Ref<ConfigFile> config; + config.instance(); + for(int i=0;i<export_presets.size();i++) { + + Ref<EditorExportPreset> preset = export_presets[i]; + String section="preset."+itos(i); + + config->set_value(section,"name",preset->get_name()); + config->set_value(section,"platform",preset->get_platform()->get_name()); + config->set_value(section,"runnable",preset->is_runnable()); + bool save_files=false; + switch(preset->get_export_filter()) { + case EditorExportPreset::EXPORT_ALL_RESOURCES: { + config->set_value(section,"export_filter","all_resources"); + } break; + case EditorExportPreset::EXPORT_SELECTED_SCENES: { + config->set_value(section,"export_filter","scenes"); + save_files=true; + } break; + case EditorExportPreset::EXPORT_SELECTED_RESOURCES: { + config->set_value(section,"export_filter","resources"); + save_files=true; + } break; + + + } + + if (save_files) { + Vector<String> export_files = preset->get_files_to_export(); + config->set_value(section,"export_files",export_files); + } + config->set_value(section,"include_filter",preset->get_include_filter()); + config->set_value(section,"exclude_filter",preset->get_exclude_filter()); + config->set_value(section,"patch_list",preset->get_patches()); + + String option_section="preset."+itos(i)+".options"; + + for (const List<PropertyInfo>::Element *E=preset->get_properties().front();E;E=E->next()) { + config->set_value(option_section,E->get().name,preset->get(E->get().name)); + } + } + + config->save("res://export_presets.cfg"); + + print_line("saved ok"); + +} + + +void EditorExport::save_presets() { + + print_line("save presets"); + if (block_save) + return; + save_timer->start(); +} + +void EditorExport::_bind_methods() { + + ClassDB::bind_method("_save",&EditorExport::_save); +} + +void EditorExport::add_export_platform(const Ref<EditorExportPlatform>& p_platform) { + + export_platforms.push_back(p_platform); +} + +int EditorExport::get_export_platform_count() { + + return export_platforms.size(); +} + +Ref<EditorExportPlatform> EditorExport::get_export_platform(int p_idx) { + + ERR_FAIL_INDEX_V(p_idx,export_platforms.size(),Ref<EditorExportPlatform>()); + + return export_platforms[p_idx]; +} + + +void EditorExport::add_export_preset(const Ref<EditorExportPreset>& p_preset,int p_at_pos) { + + if (p_at_pos<0) + export_presets.push_back(p_preset); + else + export_presets.insert(p_at_pos,p_preset); + + +} + +int EditorExport::get_export_preset_count() const { + + return export_presets.size(); +} + +Ref<EditorExportPreset> EditorExport::get_export_preset(int p_idx) { + + ERR_FAIL_INDEX_V( p_idx, export_presets.size(),Ref<EditorExportPreset>() ); + return export_presets[p_idx]; +} + +void EditorExport::remove_export_preset(int p_idx) { + + export_presets.remove(p_idx); +} + +void EditorExport::_notification(int p_what) { + + if (p_what==NOTIFICATION_ENTER_TREE) { + load_config(); + } +} + +void EditorExport::load_config() { + + Ref<ConfigFile> config; + config.instance(); + Error err = config->load("res://export_presets.cfg"); + if (err!=OK) + return; + + block_save=true; + + int index=0; + while(true) { + + String section = "preset."+itos(index); + if (!config->has_section(section)) + break; + + String platform=config->get_value(section,"platform"); + + Ref<EditorExportPreset> preset; + + for(int i=0;i<export_platforms.size();i++) { + if (export_platforms[i]->get_name()==platform) { + preset = export_platforms[i]->create_preset(); + break; + } + } + + if (!preset.is_valid()) { + index++; + ERR_CONTINUE(!preset.is_valid()); + } + + preset->set_name( config->get_value(section,"name") ); + preset->set_runnable( config->get_value(section,"runnable") ); + + String export_filter = config->get_value(section,"export_filter"); + + bool get_files=false; + + if (export_filter=="all_resources") { + preset->set_export_filter(EditorExportPreset::EXPORT_ALL_RESOURCES); + } else if (export_filter=="scenes") { + preset->set_export_filter(EditorExportPreset::EXPORT_SELECTED_SCENES); + get_files=true; + } else if (export_filter=="resources") { + preset->set_export_filter(EditorExportPreset::EXPORT_SELECTED_RESOURCES); + get_files=true; + } + + if (get_files) { + + Vector<String> files = config->get_value(section,"export_files"); + + for(int i=0;i<files.size();i++) { + preset->add_export_file(files[i]); + } + } + + preset->set_include_filter( config->get_value(section,"include_filter") ); + preset->set_exclude_filter( config->get_value(section,"exclude_filter") ); + + + Vector<String> patch_list = config->get_value(section,"patch_list"); + + for(int i=0;i<patch_list.size();i++) { + preset->add_patch(patch_list[i]); + } + + String option_section="preset."+itos(index)+".options"; + + List<String> options; + + config->get_section_keys(option_section,&options); + + for (List<String>::Element *E=options.front();E;E=E->next()) { + + Variant value = config->get_value(option_section,E->get()); + + preset->set(E->get(),value); + } + + add_export_preset(preset); + index++; + } + + block_save=false; + +} + + + +EditorExport::EditorExport() { + + save_timer = memnew( Timer ); + add_child(save_timer); + save_timer->set_wait_time(0.8); + save_timer->set_one_shot(true); + save_timer->connect("timeout",this,"_save"); + block_save=false; + + singleton=this; +} + +EditorExport::~EditorExport() { + + +} + + +////////// + +void EditorExportPlatformPC::get_preset_features(const Ref<EditorExportPreset>& p_preset,List<String>* r_features) { + + if (p_preset->get("texture_format/s3tc")) { + r_features->push_back("s3tc"); + } + if (p_preset->get("texture_format/etc")) { + r_features->push_back("etc"); + } + if (p_preset->get("texture_format/etc2")) { + r_features->push_back("etc2"); + } +} + +void EditorExportPlatformPC::get_export_options(List<ExportOption> *r_options) { + + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL,"texture_format/s3tc"),true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL,"texture_format/etc"),false)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL,"texture_format/etc2"),false)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL,"binary_format/64_bits"),true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING,"custom_template/release",PROPERTY_HINT_GLOBAL_FILE),"")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING,"custom_template/debug",PROPERTY_HINT_GLOBAL_FILE),"")); +} + +String EditorExportPlatformPC::get_name() const { + + return name; +} +Ref<Texture> EditorExportPlatformPC::get_logo() const { + + return logo; +} + +bool EditorExportPlatformPC::can_export(const Ref<EditorExportPreset>& p_preset,String &r_error, bool &r_missing_templates) const { + + r_missing_templates=false; + + if (find_export_template(release_file_32)==String()) { + r_missing_templates=true; + } else if (find_export_template(debug_file_32)==String()) { + r_missing_templates=true; + } else if (find_export_template(release_file_64)==String()) { + r_missing_templates=true; + } else if (find_export_template(debug_file_64)==String()) { + r_missing_templates=true; + } + return !r_missing_templates; +} + +String EditorExportPlatformPC::get_binary_extension() const { + return extension; +} + +Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset>& p_preset, bool p_debug, const String& p_path, int p_flags) { + + return OK; +} + +void EditorExportPlatformPC::set_extension(const String& p_extension) { + extension=p_extension; +} + +void EditorExportPlatformPC::set_name(const String& p_name) { + name=p_name; +} + +void EditorExportPlatformPC::set_logo(const Ref<Texture>& p_logo) { + logo=p_logo; +} + +void EditorExportPlatformPC::set_release_64(const String& p_file) { + + release_file_64=p_file; +} + +void EditorExportPlatformPC::set_release_32(const String& p_file){ + + release_file_32=p_file; +} +void EditorExportPlatformPC::set_debug_64(const String& p_file){ + + debug_file_64=p_file; +} +void EditorExportPlatformPC::set_debug_32(const String& p_file){ + + debug_file_32=p_file; + +} + +EditorExportPlatformPC::EditorExportPlatformPC() { + +} + +//////// #if 0 #include "version.h" #include "script_language.h" -#include "globals.h" +#include "global_config.h" #include "os/file_access.h" #include "os/dir_access.h" -#include "tools/editor/editor_file_system.h" +#include "editor/editor_file_system.h" #include "io/resource_loader.h" #include "editor_node.h" #include "editor_settings.h" @@ -42,7 +967,7 @@ #include "io/resource_saver.h" #include "io/md5.h" #include "io_plugins/editor_texture_import_plugin.h" -#include "tools/editor/plugins/script_editor_plugin.h" +#include "editor/plugins/script_editor_plugin.h" #include "io/zip_io.h" @@ -79,8 +1004,8 @@ String EditorImportPlugin::_expand_source_path(const String& p_path) { void EditorImportPlugin::_bind_methods() { - ClassDB::bind_method(_MD("validate_source_path","path"),&EditorImportPlugin::_validate_source_path); - ClassDB::bind_method(_MD("expand_source_path","path"),&EditorImportPlugin::_expand_source_path); + ClassDB::bind_method(D_METHOD("validate_source_path","path"),&EditorImportPlugin::_validate_source_path); + ClassDB::bind_method(D_METHOD("expand_source_path","path"),&EditorImportPlugin::_expand_source_path); ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::STRING,"get_name")); ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::STRING,"get_visible_name")); @@ -745,7 +1670,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func } break; //use default } - String image_list_md5; + String image_listD_METHOD5; { MD5_CTX ctx; @@ -758,7 +1683,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func } MD5Final(&ctx); - image_list_md5=String::md5(ctx.digest); + image_listD_METHOD5=String::md5(ctx.digest); } //ok see if cached String md5; @@ -803,7 +1728,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func if (atlas_valid) { //check md5 of list of image /names/ - if (f->get_line().strip_edges()!=image_list_md5) { + if (f->get_line().strip_edges()!=image_listD_METHOD5) { atlas_valid=false; print_line("IMAGE MD5 INVALID!"); } @@ -829,10 +1754,10 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func uint64_t file_mod_time = FileAccess::get_modified_time(F->get()); if (mod_time!=file_mod_time) { - String image_md5 = slices[1]; - String file_md5 = FileAccess::get_md5(F->get()); + String imageD_METHOD5 = slices[1]; + String fileD_METHOD5 = FileAccess::getD_METHOD5(F->get()); - if (image_md5!=file_md5) { + if (imageD_METHOD5!=fileD_METHOD5) { atlas_valid=false; print_line("IMAGE INVALID "+slices[0]); break; @@ -867,7 +1792,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func for (List<StringName>::Element *F=atlas_images.front();F;F=F->next()) { - imd->add_source(EditorImportPlugin::validate_source_path(F->get()),FileAccess::get_md5(F->get())); + imd->add_source(EditorImportPlugin::validate_source_path(F->get()),FileAccess::getD_METHOD5(F->get())); } @@ -925,7 +1850,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func options["shrink"]=EditorImportExport::get_singleton()->image_export_group_get_shrink(E->get()); options["image_format"]=group_format; //f->store_line(options.to_json()); - f->store_line(image_list_md5); + f->store_line(image_listD_METHOD5); } //go through all ATEX files @@ -961,8 +1886,8 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func if (f) { //recreating deps.. String depline; - //depline=String(F->get())+"::"+itos(FileAccess::get_modified_time(F->get()))+"::"+FileAccess::get_md5(F->get()); name unneccesary by top md5 - depline=itos(FileAccess::get_modified_time(F->get()))+"::"+FileAccess::get_md5(F->get()); + //depline=String(F->get())+"::"+itos(FileAccess::get_modified_time(F->get()))+"::"+FileAccess::getD_METHOD5(F->get()); name unneccesary by top md5 + depline=itos(FileAccess::get_modified_time(F->get()))+"::"+FileAccess::getD_METHOD5(F->get()); depline+="::"+itos(region.pos.x)+"::"+itos(region.pos.y)+"::"+itos(region.size.x)+"::"+itos(region.size.y); depline+="::"+itos(margin.pos.x)+"::"+itos(margin.pos.y)+"::"+itos(margin.size.x)+"::"+itos(margin.size.y); f->store_line(depline); @@ -2210,49 +3135,49 @@ PoolVector<String> EditorImportExport::_get_export_platforms() { void EditorImportExport::_bind_methods() { - ClassDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::add_import_plugin); - ClassDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::remove_import_plugin); - ClassDB::bind_method(_MD("get_import_plugin_count"),&EditorImportExport::get_import_plugin_count); - ClassDB::bind_method(_MD("get_import_plugin:EditorImportPlugin","idx"),&EditorImportExport::get_import_plugin); - ClassDB::bind_method(_MD("get_import_plugin_by_name:EditorImportPlugin","name"),&EditorImportExport::get_import_plugin_by_name); - - ClassDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::add_export_plugin); - ClassDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::remove_export_plugin); - ClassDB::bind_method(_MD("get_export_plugin_count"),&EditorImportExport::get_export_plugin_count); - ClassDB::bind_method(_MD("get_export_plugin:EditorExportPlugin","idx"),&EditorImportExport::get_export_plugin); - - ClassDB::bind_method(_MD("set_export_file_action","file","action"),&EditorImportExport::set_export_file_action); - ClassDB::bind_method(_MD("get_export_file_action","file"),&EditorImportExport::get_export_file_action); - ClassDB::bind_method(_MD("get_export_file_list"),&EditorImportExport::_get_export_file_list); - - ClassDB::bind_method(_MD("add_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform); - //ClassDB::bind_method(_MD("remove_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform); - ClassDB::bind_method(_MD("get_export_platform:EditorExportPlatform","name"),&EditorImportExport::get_export_platform); - ClassDB::bind_method(_MD("get_export_platforms"),&EditorImportExport::_get_export_platforms); - - ClassDB::bind_method(_MD("set_export_filter","filter"),&EditorImportExport::set_export_filter); - ClassDB::bind_method(_MD("get_export_filter"),&EditorImportExport::get_export_filter); - - ClassDB::bind_method(_MD("set_export_custom_filter","filter"),&EditorImportExport::set_export_custom_filter); - ClassDB::bind_method(_MD("get_export_custom_filter"),&EditorImportExport::get_export_custom_filter); - - ClassDB::bind_method(_MD("set_export_custom_filter_exclude","filter_exclude"),&EditorImportExport::set_export_custom_filter_exclude); - ClassDB::bind_method(_MD("get_export_custom_filter_exclude"),&EditorImportExport::get_export_custom_filter_exclude); - - - ClassDB::bind_method(_MD("image_export_group_create"),&EditorImportExport::image_export_group_create); - ClassDB::bind_method(_MD("image_export_group_remove"),&EditorImportExport::image_export_group_remove); - ClassDB::bind_method(_MD("image_export_group_set_image_action"),&EditorImportExport::image_export_group_set_image_action); - ClassDB::bind_method(_MD("image_export_group_set_make_atlas"),&EditorImportExport::image_export_group_set_make_atlas); - ClassDB::bind_method(_MD("image_export_group_set_shrink"),&EditorImportExport::image_export_group_set_shrink); - ClassDB::bind_method(_MD("image_export_group_get_image_action"),&EditorImportExport::image_export_group_get_image_action); - ClassDB::bind_method(_MD("image_export_group_get_make_atlas"),&EditorImportExport::image_export_group_get_make_atlas); - ClassDB::bind_method(_MD("image_export_group_get_shrink"),&EditorImportExport::image_export_group_get_shrink); - ClassDB::bind_method(_MD("image_add_to_export_group"),&EditorImportExport::image_add_to_export_group); - ClassDB::bind_method(_MD("script_set_action"),&EditorImportExport::script_set_action); - ClassDB::bind_method(_MD("script_set_encryption_key"),&EditorImportExport::script_set_encryption_key); - ClassDB::bind_method(_MD("script_get_action"),&EditorImportExport::script_get_action); - ClassDB::bind_method(_MD("script_get_encryption_key"),&EditorImportExport::script_get_encryption_key); + ClassDB::bind_method(D_METHOD("add_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::add_import_plugin); + ClassDB::bind_method(D_METHOD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::remove_import_plugin); + ClassDB::bind_method(D_METHOD("get_import_plugin_count"),&EditorImportExport::get_import_plugin_count); + ClassDB::bind_method(D_METHOD("get_import_plugin:EditorImportPlugin","idx"),&EditorImportExport::get_import_plugin); + ClassDB::bind_method(D_METHOD("get_import_plugin_by_name:EditorImportPlugin","name"),&EditorImportExport::get_import_plugin_by_name); + + ClassDB::bind_method(D_METHOD("add_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::add_export_plugin); + ClassDB::bind_method(D_METHOD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::remove_export_plugin); + ClassDB::bind_method(D_METHOD("get_export_plugin_count"),&EditorImportExport::get_export_plugin_count); + ClassDB::bind_method(D_METHOD("get_export_plugin:EditorExportPlugin","idx"),&EditorImportExport::get_export_plugin); + + ClassDB::bind_method(D_METHOD("set_export_file_action","file","action"),&EditorImportExport::set_export_file_action); + ClassDB::bind_method(D_METHOD("get_export_file_action","file"),&EditorImportExport::get_export_file_action); + ClassDB::bind_method(D_METHOD("get_export_file_list"),&EditorImportExport::_get_export_file_list); + + ClassDB::bind_method(D_METHOD("add_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform); + //ClassDB::bind_method(D_METHOD("remove_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform); + ClassDB::bind_method(D_METHOD("get_export_platform:EditorExportPlatform","name"),&EditorImportExport::get_export_platform); + ClassDB::bind_method(D_METHOD("get_export_platforms"),&EditorImportExport::_get_export_platforms); + + ClassDB::bind_method(D_METHOD("set_export_filter","filter"),&EditorImportExport::set_export_filter); + ClassDB::bind_method(D_METHOD("get_export_filter"),&EditorImportExport::get_export_filter); + + ClassDB::bind_method(D_METHOD("set_export_custom_filter","filter"),&EditorImportExport::set_export_custom_filter); + ClassDB::bind_method(D_METHOD("get_export_custom_filter"),&EditorImportExport::get_export_custom_filter); + + ClassDB::bind_method(D_METHOD("set_export_custom_filter_exclude","filter_exclude"),&EditorImportExport::set_export_custom_filter_exclude); + ClassDB::bind_method(D_METHOD("get_export_custom_filter_exclude"),&EditorImportExport::get_export_custom_filter_exclude); + + + ClassDB::bind_method(D_METHOD("image_export_group_create"),&EditorImportExport::image_export_group_create); + ClassDB::bind_method(D_METHOD("image_export_group_remove"),&EditorImportExport::image_export_group_remove); + ClassDB::bind_method(D_METHOD("image_export_group_set_image_action"),&EditorImportExport::image_export_group_set_image_action); + ClassDB::bind_method(D_METHOD("image_export_group_set_make_atlas"),&EditorImportExport::image_export_group_set_make_atlas); + ClassDB::bind_method(D_METHOD("image_export_group_set_shrink"),&EditorImportExport::image_export_group_set_shrink); + ClassDB::bind_method(D_METHOD("image_export_group_get_image_action"),&EditorImportExport::image_export_group_get_image_action); + ClassDB::bind_method(D_METHOD("image_export_group_get_make_atlas"),&EditorImportExport::image_export_group_get_make_atlas); + ClassDB::bind_method(D_METHOD("image_export_group_get_shrink"),&EditorImportExport::image_export_group_get_shrink); + ClassDB::bind_method(D_METHOD("image_add_to_export_group"),&EditorImportExport::image_add_to_export_group); + ClassDB::bind_method(D_METHOD("script_set_action"),&EditorImportExport::script_set_action); + ClassDB::bind_method(D_METHOD("script_set_encryption_key"),&EditorImportExport::script_set_encryption_key); + ClassDB::bind_method(D_METHOD("script_get_action"),&EditorImportExport::script_get_action); + ClassDB::bind_method(D_METHOD("script_get_encryption_key"),&EditorImportExport::script_get_encryption_key); diff --git a/editor/editor_export.h b/editor/editor_export.h new file mode 100644 index 0000000000..8a9dc965e5 --- /dev/null +++ b/editor/editor_export.h @@ -0,0 +1,297 @@ +/*************************************************************************/ +/* editor_import_export.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 EDITOR_EXPORT_H +#define EDITOR_EXPORT_H + + + +#include "resource.h" +#include "scene/main/node.h" +#include "scene/resources/texture.h" +#include "scene/main/timer.h" + +class EditorProgress; +class FileAccess; +class EditorExportPlatform; +class EditorFileSystemDirectory; + +class EditorExportPreset : public Reference { + + GDCLASS( EditorExportPreset,Reference ) +public: + enum ExportFilter { + EXPORT_ALL_RESOURCES, + EXPORT_SELECTED_SCENES, + EXPORT_SELECTED_RESOURCES, + }; + +private: + + Ref<EditorExportPlatform> platform; + ExportFilter export_filter; + String include_filter; + String exclude_filter; + + String exporter; + Set<String> selected_files; + bool runnable; + + Vector<String> patches; + + +friend class EditorExport; +friend class EditorExportPlatform; + + List<PropertyInfo> properties; + Map<StringName,Variant> values; + + String name; +protected: + bool _set(const StringName& p_name, const Variant& p_value); + bool _get(const StringName& p_name,Variant &r_ret) const; + void _get_property_list( List<PropertyInfo> *p_list) const; + +public: + + Ref<EditorExportPlatform> get_platform() const; + bool has(const StringName& p_property) const { return values.has(p_property); } + + Vector<String> get_files_to_export() const; + + void add_export_file(const String& p_path); + void remove_export_file(const String& p_path); + bool has_export_file(const String& p_path); + + void set_name(const String& p_name); + String get_name() const; + + void set_runnable(bool p_enable); + bool is_runnable() const; + + void set_export_filter(ExportFilter p_filter); + ExportFilter get_export_filter() const; + + void set_include_filter(const String& p_include); + String get_include_filter() const; + + void set_exclude_filter(const String& p_exclude); + String get_exclude_filter() const; + + void add_patch(const String& p_path,int p_at_pos=-1); + void set_patch(int p_index,const String& p_path); + String get_patch(int p_index); + void remove_patch(int p_idx); + Vector<String> get_patches() const; + + const List<PropertyInfo>& get_properties() const { return properties; } + + EditorExportPreset(); +}; + + +class EditorExportPlatform : public Reference { + + GDCLASS( EditorExportPlatform,Reference ) + +public: + + typedef Error (*EditorExportSaveFunction)(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total); + +private: + + struct SavedData { + + uint64_t ofs; + uint64_t size; + Vector<uint8_t> md5; + CharString path_utf8; + + bool operator<(const SavedData& p_data) const { + return path_utf8 < p_data.path_utf8; + } + }; + + struct PackData { + + FileAccess *f; + Vector<SavedData> file_ofs; + EditorProgress *ep; + }; + + struct ZipData { + + void* zip; + EditorProgress *ep; + + }; + + void _export_find_resources(EditorFileSystemDirectory *p_dir,Set<String>& p_paths); + void _export_find_dependencies(const String& p_path,Set<String>& p_paths); + + void gen_debug_flags(Vector<String> &r_flags, int p_flags); + static Error _save_pack_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total); + static Error _save_zip_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total); + + +protected: + + virtual void get_preset_features(const Ref<EditorExportPreset>& p_preset,List<String> *r_features)=0; + String find_export_template(String template_file_name, String *err=NULL) const; + +public: + + + struct ExportOption { + PropertyInfo option; + Variant default_value; + + ExportOption(const PropertyInfo& p_info,const Variant& p_default) { option=p_info; default_value=p_default; } + ExportOption() {} + }; + + virtual Ref<EditorExportPreset> create_preset(); + + virtual void get_export_options(List<ExportOption> *r_options)=0; + virtual String get_name() const =0; + virtual Ref<Texture> get_logo() const =0; + + + Error export_project_files(const Ref<EditorExportPreset>& p_preset,EditorExportSaveFunction p_func, void* p_udata); + + Error save_pack(const Ref<EditorExportPreset>& p_preset,const String& p_path); + Error save_zip(const Ref<EditorExportPreset>& p_preset,const String& p_path); + + + virtual bool poll_devices() { return false; } + virtual int get_device_count() const { return 0; } + virtual String get_device_name(int p_device) const { return ""; } + virtual String get_device_info(int p_device) const { return ""; } + + enum DebugFlags { + DEBUG_FLAG_DUMB_CLIENT=1, + DEBUG_FLAG_REMOTE_DEBUG=2, + DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST=4, + DEBUG_FLAG_VIEW_COLLISONS=8, + DEBUG_FLAG_VIEW_NAVIGATION=16, + }; + + virtual Error run(int p_device,int p_debug_flags) { return OK; } + + virtual bool can_export(const Ref<EditorExportPreset>& p_preset,String &r_error,bool &r_missing_templates) const=0; + + virtual String get_binary_extension() const=0; + virtual Error export_project(const Ref<EditorExportPreset>& p_preset,bool p_debug,const String& p_path,int p_flags=0)=0; + + EditorExportPlatform(); +}; + + +class EditorExport : public Node { + GDCLASS(EditorExport,Node); + + Vector<Ref<EditorExportPlatform> > export_platforms; + Vector<Ref<EditorExportPreset> > export_presets; + + Timer *save_timer; + bool block_save; + + static EditorExport *singleton; + + void _save(); +protected: + +friend class EditorExportPreset; + void save_presets(); + + void _notification(int p_what); + static void _bind_methods(); +public: + + static EditorExport * get_singleton() { return singleton; } + + void add_export_platform(const Ref<EditorExportPlatform>& p_platform); + int get_export_platform_count(); + Ref<EditorExportPlatform> get_export_platform(int p_idx); + + + void add_export_preset(const Ref<EditorExportPreset>& p_preset,int p_at_pos=-1); + int get_export_preset_count() const; + Ref<EditorExportPreset> get_export_preset(int p_idx); + void remove_export_preset(int p_idx); + + void load_config(); + + EditorExport(); + ~EditorExport(); +}; + + + + +class EditorExportPlatformPC : public EditorExportPlatform { + + GDCLASS( EditorExportPlatformPC,EditorExportPlatform ) + + Ref<ImageTexture> logo; + String name; + String extension; + + String release_file_32; + String release_file_64; + String debug_file_32; + String debug_file_64; + +public: + + virtual void get_preset_features(const Ref<EditorExportPreset>& p_preset,List<String>* r_features); + + virtual void get_export_options(List<ExportOption> *r_options); + + virtual String get_name() const; + virtual Ref<Texture> get_logo() const; + + virtual bool can_export(const Ref<EditorExportPreset>& p_preset,String &r_error,bool &r_missing_templates) const; + virtual String get_binary_extension() const; + virtual Error export_project(const Ref<EditorExportPreset>& p_preset,bool p_debug,const String& p_path,int p_flags=0); + + void set_extension(const String& p_extension); + void set_name(const String& p_name); + + void set_logo(const Ref<Texture>& p_loco); + + void set_release_64(const String& p_file); + void set_release_32(const String& p_file); + void set_debug_64(const String& p_file); + void set_debug_32(const String& p_file); + + EditorExportPlatformPC(); +}; + + +#endif // EDITOR_IMPORT_EXPORT_H diff --git a/tools/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index e23e2419d8..bfaf1906d8 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1164,55 +1164,55 @@ EditorFileDialog::DisplayMode EditorFileDialog::get_display_mode() const{ void EditorFileDialog::_bind_methods() { - ClassDB::bind_method(_MD("_unhandled_input"),&EditorFileDialog::_unhandled_input); - - ClassDB::bind_method(_MD("_item_selected"),&EditorFileDialog::_item_selected); - ClassDB::bind_method(_MD("_item_db_selected"),&EditorFileDialog::_item_dc_selected); - ClassDB::bind_method(_MD("_dir_entered"),&EditorFileDialog::_dir_entered); - ClassDB::bind_method(_MD("_file_entered"),&EditorFileDialog::_file_entered); - ClassDB::bind_method(_MD("_action_pressed"),&EditorFileDialog::_action_pressed); - ClassDB::bind_method(_MD("_cancel_pressed"),&EditorFileDialog::_cancel_pressed); - ClassDB::bind_method(_MD("_filter_selected"),&EditorFileDialog::_filter_selected); - ClassDB::bind_method(_MD("_save_confirm_pressed"),&EditorFileDialog::_save_confirm_pressed); - - ClassDB::bind_method(_MD("clear_filters"),&EditorFileDialog::clear_filters); - ClassDB::bind_method(_MD("add_filter","filter"),&EditorFileDialog::add_filter); - ClassDB::bind_method(_MD("get_current_dir"),&EditorFileDialog::get_current_dir); - ClassDB::bind_method(_MD("get_current_file"),&EditorFileDialog::get_current_file); - ClassDB::bind_method(_MD("get_current_path"),&EditorFileDialog::get_current_path); - ClassDB::bind_method(_MD("set_current_dir","dir"),&EditorFileDialog::set_current_dir); - ClassDB::bind_method(_MD("set_current_file","file"),&EditorFileDialog::set_current_file); - ClassDB::bind_method(_MD("set_current_path","path"),&EditorFileDialog::set_current_path); - ClassDB::bind_method(_MD("set_mode","mode"),&EditorFileDialog::set_mode); - ClassDB::bind_method(_MD("get_mode"),&EditorFileDialog::get_mode); - ClassDB::bind_method(_MD("get_vbox:VBoxContainer"),&EditorFileDialog::get_vbox); - ClassDB::bind_method(_MD("set_access","access"),&EditorFileDialog::set_access); - ClassDB::bind_method(_MD("get_access"),&EditorFileDialog::get_access); - ClassDB::bind_method(_MD("set_show_hidden_files","show"),&EditorFileDialog::set_show_hidden_files); - ClassDB::bind_method(_MD("is_showing_hidden_files"),&EditorFileDialog::is_showing_hidden_files); - ClassDB::bind_method(_MD("_select_drive"),&EditorFileDialog::_select_drive); - ClassDB::bind_method(_MD("_make_dir"),&EditorFileDialog::_make_dir); - ClassDB::bind_method(_MD("_make_dir_confirm"),&EditorFileDialog::_make_dir_confirm); - ClassDB::bind_method(_MD("_update_file_list"),&EditorFileDialog::update_file_list); - ClassDB::bind_method(_MD("_update_dir"),&EditorFileDialog::update_dir); - ClassDB::bind_method(_MD("_thumbnail_done"),&EditorFileDialog::_thumbnail_done); - ClassDB::bind_method(_MD("set_display_mode","mode"),&EditorFileDialog::set_display_mode); - ClassDB::bind_method(_MD("get_display_mode"),&EditorFileDialog::get_display_mode); - ClassDB::bind_method(_MD("_thumbnail_result"),&EditorFileDialog::_thumbnail_result); - ClassDB::bind_method(_MD("set_disable_overwrite_warning","disable"),&EditorFileDialog::set_disable_overwrite_warning); - ClassDB::bind_method(_MD("is_overwrite_warning_disabled"),&EditorFileDialog::is_overwrite_warning_disabled); - - ClassDB::bind_method(_MD("_recent_selected"),&EditorFileDialog::_recent_selected); - ClassDB::bind_method(_MD("_go_back"),&EditorFileDialog::_go_back); - ClassDB::bind_method(_MD("_go_forward"),&EditorFileDialog::_go_forward); - ClassDB::bind_method(_MD("_go_up"),&EditorFileDialog::_go_up); - - ClassDB::bind_method(_MD("_favorite_toggled"),&EditorFileDialog::_favorite_toggled); - ClassDB::bind_method(_MD("_favorite_selected"),&EditorFileDialog::_favorite_selected); - ClassDB::bind_method(_MD("_favorite_move_up"),&EditorFileDialog::_favorite_move_up); - ClassDB::bind_method(_MD("_favorite_move_down"),&EditorFileDialog::_favorite_move_down); - - ClassDB::bind_method(_MD("invalidate"),&EditorFileDialog::invalidate); + ClassDB::bind_method(D_METHOD("_unhandled_input"),&EditorFileDialog::_unhandled_input); + + ClassDB::bind_method(D_METHOD("_item_selected"),&EditorFileDialog::_item_selected); + ClassDB::bind_method(D_METHOD("_item_db_selected"),&EditorFileDialog::_item_dc_selected); + ClassDB::bind_method(D_METHOD("_dir_entered"),&EditorFileDialog::_dir_entered); + ClassDB::bind_method(D_METHOD("_file_entered"),&EditorFileDialog::_file_entered); + ClassDB::bind_method(D_METHOD("_action_pressed"),&EditorFileDialog::_action_pressed); + ClassDB::bind_method(D_METHOD("_cancel_pressed"),&EditorFileDialog::_cancel_pressed); + ClassDB::bind_method(D_METHOD("_filter_selected"),&EditorFileDialog::_filter_selected); + ClassDB::bind_method(D_METHOD("_save_confirm_pressed"),&EditorFileDialog::_save_confirm_pressed); + + ClassDB::bind_method(D_METHOD("clear_filters"),&EditorFileDialog::clear_filters); + ClassDB::bind_method(D_METHOD("add_filter","filter"),&EditorFileDialog::add_filter); + ClassDB::bind_method(D_METHOD("get_current_dir"),&EditorFileDialog::get_current_dir); + ClassDB::bind_method(D_METHOD("get_current_file"),&EditorFileDialog::get_current_file); + ClassDB::bind_method(D_METHOD("get_current_path"),&EditorFileDialog::get_current_path); + ClassDB::bind_method(D_METHOD("set_current_dir","dir"),&EditorFileDialog::set_current_dir); + ClassDB::bind_method(D_METHOD("set_current_file","file"),&EditorFileDialog::set_current_file); + ClassDB::bind_method(D_METHOD("set_current_path","path"),&EditorFileDialog::set_current_path); + ClassDB::bind_method(D_METHOD("set_mode","mode"),&EditorFileDialog::set_mode); + ClassDB::bind_method(D_METHOD("get_mode"),&EditorFileDialog::get_mode); + ClassDB::bind_method(D_METHOD("get_vbox:VBoxContainer"),&EditorFileDialog::get_vbox); + ClassDB::bind_method(D_METHOD("set_access","access"),&EditorFileDialog::set_access); + ClassDB::bind_method(D_METHOD("get_access"),&EditorFileDialog::get_access); + ClassDB::bind_method(D_METHOD("set_show_hidden_files","show"),&EditorFileDialog::set_show_hidden_files); + ClassDB::bind_method(D_METHOD("is_showing_hidden_files"),&EditorFileDialog::is_showing_hidden_files); + ClassDB::bind_method(D_METHOD("_select_drive"),&EditorFileDialog::_select_drive); + ClassDB::bind_method(D_METHOD("_make_dir"),&EditorFileDialog::_make_dir); + ClassDB::bind_method(D_METHOD("_make_dir_confirm"),&EditorFileDialog::_make_dir_confirm); + ClassDB::bind_method(D_METHOD("_update_file_list"),&EditorFileDialog::update_file_list); + ClassDB::bind_method(D_METHOD("_update_dir"),&EditorFileDialog::update_dir); + ClassDB::bind_method(D_METHOD("_thumbnail_done"),&EditorFileDialog::_thumbnail_done); + ClassDB::bind_method(D_METHOD("set_display_mode","mode"),&EditorFileDialog::set_display_mode); + ClassDB::bind_method(D_METHOD("get_display_mode"),&EditorFileDialog::get_display_mode); + ClassDB::bind_method(D_METHOD("_thumbnail_result"),&EditorFileDialog::_thumbnail_result); + ClassDB::bind_method(D_METHOD("set_disable_overwrite_warning","disable"),&EditorFileDialog::set_disable_overwrite_warning); + ClassDB::bind_method(D_METHOD("is_overwrite_warning_disabled"),&EditorFileDialog::is_overwrite_warning_disabled); + + ClassDB::bind_method(D_METHOD("_recent_selected"),&EditorFileDialog::_recent_selected); + ClassDB::bind_method(D_METHOD("_go_back"),&EditorFileDialog::_go_back); + ClassDB::bind_method(D_METHOD("_go_forward"),&EditorFileDialog::_go_forward); + ClassDB::bind_method(D_METHOD("_go_up"),&EditorFileDialog::_go_up); + + ClassDB::bind_method(D_METHOD("_favorite_toggled"),&EditorFileDialog::_favorite_toggled); + ClassDB::bind_method(D_METHOD("_favorite_selected"),&EditorFileDialog::_favorite_selected); + ClassDB::bind_method(D_METHOD("_favorite_move_up"),&EditorFileDialog::_favorite_move_up); + ClassDB::bind_method(D_METHOD("_favorite_move_down"),&EditorFileDialog::_favorite_move_down); + + ClassDB::bind_method(D_METHOD("invalidate"),&EditorFileDialog::invalidate); ADD_SIGNAL(MethodInfo("file_selected",PropertyInfo( Variant::STRING,"path"))); ADD_SIGNAL(MethodInfo("files_selected",PropertyInfo( Variant::POOL_STRING_ARRAY,"paths"))); @@ -1493,11 +1493,11 @@ EditorFileDialog::~EditorFileDialog() { void EditorLineEditFileChooser::_bind_methods() { - ClassDB::bind_method(_MD("_browse"),&EditorLineEditFileChooser::_browse); - ClassDB::bind_method(_MD("_chosen"),&EditorLineEditFileChooser::_chosen); - ClassDB::bind_method(_MD("get_button:Button"),&EditorLineEditFileChooser::get_button); - ClassDB::bind_method(_MD("get_line_edit:LineEdit"),&EditorLineEditFileChooser::get_line_edit); - ClassDB::bind_method(_MD("get_file_dialog:EditorFileDialog"),&EditorLineEditFileChooser::get_file_dialog); + ClassDB::bind_method(D_METHOD("_browse"),&EditorLineEditFileChooser::_browse); + ClassDB::bind_method(D_METHOD("_chosen"),&EditorLineEditFileChooser::_chosen); + ClassDB::bind_method(D_METHOD("get_button:Button"),&EditorLineEditFileChooser::get_button); + ClassDB::bind_method(D_METHOD("get_line_edit:LineEdit"),&EditorLineEditFileChooser::get_line_edit); + ClassDB::bind_method(D_METHOD("get_file_dialog:EditorFileDialog"),&EditorLineEditFileChooser::get_file_dialog); } diff --git a/tools/editor/editor_file_dialog.h b/editor/editor_file_dialog.h index 193cbc513c..193cbc513c 100644 --- a/tools/editor/editor_file_dialog.h +++ b/editor/editor_file_dialog.h diff --git a/tools/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index c7b50a3c09..cd151cd90b 100644 --- a/tools/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "editor_file_system.h" -#include "globals.h" +#include "global_config.h" #include "io/resource_loader.h" #include "os/os.h" #include "os/file_access.h" @@ -144,17 +144,17 @@ EditorFileSystemDirectory *EditorFileSystemDirectory::get_parent() { void EditorFileSystemDirectory::_bind_methods() { - ClassDB::bind_method(_MD("get_subdir_count"),&EditorFileSystemDirectory::get_subdir_count); - ClassDB::bind_method(_MD("get_subdir","idx"),&EditorFileSystemDirectory::get_subdir); - ClassDB::bind_method(_MD("get_file_count"),&EditorFileSystemDirectory::get_file_count); - ClassDB::bind_method(_MD("get_file","idx"),&EditorFileSystemDirectory::get_file); - ClassDB::bind_method(_MD("get_file_path","idx"),&EditorFileSystemDirectory::get_file_path); - ClassDB::bind_method(_MD("get_file_type","idx"),&EditorFileSystemDirectory::get_file_type); - ClassDB::bind_method(_MD("get_name"),&EditorFileSystemDirectory::get_name); - ClassDB::bind_method(_MD("get_path"),&EditorFileSystemDirectory::get_path); - ClassDB::bind_method(_MD("get_parent:EditorFileSystemDirectory"),&EditorFileSystemDirectory::get_parent); - ClassDB::bind_method(_MD("find_file_index","name"),&EditorFileSystemDirectory::find_file_index); - ClassDB::bind_method(_MD("find_dir_index","name"),&EditorFileSystemDirectory::find_dir_index); + ClassDB::bind_method(D_METHOD("get_subdir_count"),&EditorFileSystemDirectory::get_subdir_count); + ClassDB::bind_method(D_METHOD("get_subdir","idx"),&EditorFileSystemDirectory::get_subdir); + ClassDB::bind_method(D_METHOD("get_file_count"),&EditorFileSystemDirectory::get_file_count); + ClassDB::bind_method(D_METHOD("get_file","idx"),&EditorFileSystemDirectory::get_file); + ClassDB::bind_method(D_METHOD("get_file_path","idx"),&EditorFileSystemDirectory::get_file_path); + ClassDB::bind_method(D_METHOD("get_file_type","idx"),&EditorFileSystemDirectory::get_file_type); + ClassDB::bind_method(D_METHOD("get_name"),&EditorFileSystemDirectory::get_name); + ClassDB::bind_method(D_METHOD("get_path"),&EditorFileSystemDirectory::get_path); + ClassDB::bind_method(D_METHOD("get_parent:EditorFileSystemDirectory"),&EditorFileSystemDirectory::get_parent); + ClassDB::bind_method(D_METHOD("find_file_index","name"),&EditorFileSystemDirectory::find_file_index); + ClassDB::bind_method(D_METHOD("find_dir_index","name"),&EditorFileSystemDirectory::find_dir_index); } @@ -1484,14 +1484,14 @@ void EditorFileSystem::reimport_files(const Vector<String>& p_files) { void EditorFileSystem::_bind_methods() { - ClassDB::bind_method(_MD("get_filesystem:EditorFileSystemDirectory"),&EditorFileSystem::get_filesystem); - ClassDB::bind_method(_MD("is_scanning"),&EditorFileSystem::is_scanning); - ClassDB::bind_method(_MD("get_scanning_progress"),&EditorFileSystem::get_scanning_progress); - ClassDB::bind_method(_MD("scan"),&EditorFileSystem::scan); - ClassDB::bind_method(_MD("scan_sources"),&EditorFileSystem::scan_changes); - ClassDB::bind_method(_MD("update_file","path"),&EditorFileSystem::update_file); - ClassDB::bind_method(_MD("get_filesystem_path:EditorFileSystemDirectory","path"),&EditorFileSystem::get_filesystem_path); - ClassDB::bind_method(_MD("get_file_type","path"),&EditorFileSystem::get_file_type); + ClassDB::bind_method(D_METHOD("get_filesystem:EditorFileSystemDirectory"),&EditorFileSystem::get_filesystem); + ClassDB::bind_method(D_METHOD("is_scanning"),&EditorFileSystem::is_scanning); + ClassDB::bind_method(D_METHOD("get_scanning_progress"),&EditorFileSystem::get_scanning_progress); + ClassDB::bind_method(D_METHOD("scan"),&EditorFileSystem::scan); + ClassDB::bind_method(D_METHOD("scan_sources"),&EditorFileSystem::scan_changes); + ClassDB::bind_method(D_METHOD("update_file","path"),&EditorFileSystem::update_file); + ClassDB::bind_method(D_METHOD("get_filesystem_path:EditorFileSystemDirectory","path"),&EditorFileSystem::get_filesystem_path); + ClassDB::bind_method(D_METHOD("get_file_type","path"),&EditorFileSystem::get_file_type); ADD_SIGNAL( MethodInfo("filesystem_changed") ); ADD_SIGNAL( MethodInfo("sources_changed",PropertyInfo(Variant::BOOL,"exist")) ); diff --git a/tools/editor/editor_file_system.h b/editor/editor_file_system.h index 10d9b919fc..10d9b919fc 100644 --- a/tools/editor/editor_file_system.h +++ b/editor/editor_file_system.h diff --git a/tools/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 3652a59978..3652a59978 100644 --- a/tools/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp diff --git a/tools/editor/editor_fonts.h b/editor/editor_fonts.h index 0e8ce20609..0e8ce20609 100644 --- a/tools/editor/editor_fonts.h +++ b/editor/editor_fonts.h diff --git a/tools/editor/editor_help.cpp b/editor/editor_help.cpp index 03e631cbc3..7ef7658132 100644 --- a/tools/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -32,7 +32,7 @@ #include "editor_settings.h" #include "os/keyboard.h" #include "doc_data_compressed.h" -#include "tools/editor/plugins/script_editor_plugin.h" +#include "editor/plugins/script_editor_plugin.h" void EditorHelpSearch::popup() { popup_centered_ratio(0.6); @@ -297,10 +297,10 @@ void EditorHelpSearch::_notification(int p_what) { void EditorHelpSearch::_bind_methods() { - ClassDB::bind_method(_MD("_text_changed"),&EditorHelpSearch::_text_changed); - ClassDB::bind_method(_MD("_confirmed"),&EditorHelpSearch::_confirmed); - ClassDB::bind_method(_MD("_sbox_input"),&EditorHelpSearch::_sbox_input); - ClassDB::bind_method(_MD("_update_search"),&EditorHelpSearch::_update_search); + ClassDB::bind_method(D_METHOD("_text_changed"),&EditorHelpSearch::_text_changed); + ClassDB::bind_method(D_METHOD("_confirmed"),&EditorHelpSearch::_confirmed); + ClassDB::bind_method(D_METHOD("_sbox_input"),&EditorHelpSearch::_sbox_input); + ClassDB::bind_method(D_METHOD("_update_search"),&EditorHelpSearch::_update_search); ADD_SIGNAL(MethodInfo("go_to_help")); diff --git a/tools/editor/editor_help.h b/editor/editor_help.h index 3c4ba1f43e..909226f403 100644 --- a/tools/editor/editor_help.h +++ b/editor/editor_help.h @@ -29,7 +29,7 @@ #ifndef EDITOR_HELP_H #define EDITOR_HELP_H -#include "tools/editor/editor_plugin.h" +#include "editor/editor_plugin.h" #include "scene/gui/tab_container.h" #include "scene/gui/text_edit.h" #include "scene/gui/split_container.h" @@ -39,8 +39,8 @@ #include "scene/gui/tree.h" #include "scene/main/timer.h" -#include "tools/editor/code_editor.h" -#include "tools/editor/doc/doc_data.h" +#include "editor/code_editor.h" +#include "editor/doc/doc_data.h" class EditorNode; diff --git a/tools/editor/editor_icons.h b/editor/editor_icons.h index 7e8d8c0828..7e8d8c0828 100644 --- a/tools/editor/editor_icons.h +++ b/editor/editor_icons.h diff --git a/tools/editor/editor_initialize_ssl.cpp b/editor/editor_initialize_ssl.cpp index c08dcc6656..c08dcc6656 100644 --- a/tools/editor/editor_initialize_ssl.cpp +++ b/editor/editor_initialize_ssl.cpp diff --git a/tools/editor/editor_initialize_ssl.h b/editor/editor_initialize_ssl.h index 0b34ac1d7e..0b34ac1d7e 100644 --- a/tools/editor/editor_initialize_ssl.h +++ b/editor/editor_initialize_ssl.h diff --git a/tools/editor/editor_log.cpp b/editor/editor_log.cpp index 6b6a1b9988..850d9273f8 100644 --- a/tools/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -167,9 +167,9 @@ void EditorLog::_undo_redo_cbk(void *p_self,const String& p_name) { void EditorLog::_bind_methods() { - ClassDB::bind_method(_MD("_clear_request"),&EditorLog::_clear_request ); + ClassDB::bind_method(D_METHOD("_clear_request"),&EditorLog::_clear_request ); ClassDB::bind_method("_override_logger_styles",&EditorLog::_override_logger_styles ); - //ClassDB::bind_method(_MD("_dragged"),&EditorLog::_dragged ); + //ClassDB::bind_method(D_METHOD("_dragged"),&EditorLog::_dragged ); ADD_SIGNAL( MethodInfo("clear_request")); } diff --git a/tools/editor/editor_log.h b/editor/editor_log.h index 965d8d6420..965d8d6420 100644 --- a/tools/editor/editor_log.h +++ b/editor/editor_log.h diff --git a/tools/editor/editor_name_dialog.cpp b/editor/editor_name_dialog.cpp index da9f25f1e3..da9f25f1e3 100644 --- a/tools/editor/editor_name_dialog.cpp +++ b/editor/editor_name_dialog.cpp diff --git a/tools/editor/editor_name_dialog.h b/editor/editor_name_dialog.h index d6bc7eca94..d6bc7eca94 100644 --- a/tools/editor/editor_name_dialog.h +++ b/editor/editor_name_dialog.h diff --git a/tools/editor/editor_node.cpp b/editor/editor_node.cpp index 352b0818b4..7a85941b0d 100644 --- a/tools/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -37,7 +37,7 @@ #include "servers/physics_2d_server.h" #include "scene/resources/packed_scene.h" #include "editor_settings.h" -#include "globals.h" +#include "global_config.h" #include <stdio.h> #include "class_db.h" #include "os/keyboard.h" @@ -87,6 +87,7 @@ #include "plugins/script_editor_plugin.h" #include "plugins/script_text_editor.h" #include "plugins/path_2d_editor_plugin.h" +#include "plugins/line_2d_editor_plugin.h" #include "plugins/particles_editor_plugin.h" #include "plugins/particles_2d_editor_plugin.h" #include "plugins/animation_tree_editor_plugin.h" @@ -338,6 +339,7 @@ void EditorNode::_notification(int p_what) { VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(),true); _editor_select(EDITOR_3D); + _update_debug_options(); /* if (defer_optimize!="") { @@ -1790,7 +1792,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) { play_custom_scene_button->set_pressed(false); play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom","EditorIcons")); - String current_filename; + String main_scene; String run_filename; String args; @@ -1817,25 +1819,16 @@ void EditorNode::_run(bool p_current,const String& p_custom) { } - - - if (run_settings_dialog->get_run_mode()==RunSettingsDialog::RUN_LOCAL_SCENE) { - - run_filename=scene->get_filename(); - } else { - current_filename=scene->get_filename(); - } - + run_filename=scene->get_filename(); } else if (p_custom!="") { - - run_filename=p_custom; + run_filename = p_custom; } if (run_filename=="") { //evidently, run the scene - run_filename=GLOBAL_DEF("application/main_scene",""); - if (run_filename=="") { + main_scene=GLOBAL_DEF("application/main_scene",""); + if (main_scene=="") { current_option=-1; //accept->get_cancel()->hide(); @@ -1844,21 +1837,21 @@ void EditorNode::_run(bool p_current,const String& p_custom) { return; } - if (!FileAccess::exists(run_filename)) { + if (!FileAccess::exists(main_scene)) { current_option=-1; //accept->get_cancel()->hide(); - pick_main_scene->set_text(vformat(TTR("Selected scene '%s' does not exist, select a valid one?\nYou can change it later in \"Project Settings\" under the 'application' category."), run_filename)); + pick_main_scene->set_text(vformat(TTR("Selected scene '%s' does not exist, select a valid one?\nYou can change it later in \"Project Settings\" under the 'application' category."), main_scene)); pick_main_scene->popup_centered_minsize(); return; } - if (ResourceLoader::get_resource_type(run_filename)!="PackedScene") { + if (ResourceLoader::get_resource_type(main_scene)!="PackedScene") { current_option=-1; //accept->get_cancel()->hide(); - pick_main_scene->set_text(vformat(TTR("Selected scene '%s' is not a scene file, select a valid one?\nYou can change it later in \"Project Settings\" under the 'application' category."), run_filename)); + pick_main_scene->set_text(vformat(TTR("Selected scene '%s' is not a scene file, select a valid one?\nYou can change it later in \"Project Settings\" under the 'application' category."), main_scene)); pick_main_scene->popup_centered_minsize(); return; @@ -1906,7 +1899,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) { args = GlobalConfig::get_singleton()->get("editor/main_run_args"); - Error error = editor_run.run(run_filename,args,breakpoints,current_filename); + Error error = editor_run.run(run_filename,args,breakpoints); if (error!=OK) { @@ -1924,7 +1917,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) { play_scene_button->set_pressed(true); play_scene_button->set_icon(gui_base->get_icon("Reload","EditorIcons")); } else if (p_custom!="") { - run_custom_filename=run_filename; + run_custom_filename=p_custom; play_custom_scene_button->set_pressed(true); play_custom_scene_button->set_icon(gui_base->get_icon("Reload","EditorIcons")); } else { @@ -2207,25 +2200,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { case FILE_EXPORT_PROJECT: { - //project_export_settings->popup_export(); - /* - String target = export_db->get_current_platform(); - Ref<EditorExporter> exporter = export_db->get_exporter(target); - if (exporter.is_null()) { - accept->set_text("No exporter for platform '"+target+"' yet."); - accept->popup_centered(Size2(300,70)); - return; - } - - String extension = exporter->get_binary_extension(); - print_line("for target: "+target+" extension: "+extension); - file_export_password->set_editable( exporter->requieres_password(file_export_check->is_pressed())); - - file_export->clear_filters(); - if (extension!="") { - file_export->add_filter("*."+extension); - } - file_export->popup_centered_ratio();*/ + project_export->popup_export(); } break; case FILE_EXPORT_MESH_LIBRARY: { @@ -2603,6 +2578,14 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { play_custom_scene_button->set_pressed(false); play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom","EditorIcons")); //pause_button->set_pressed(false); + if (bool(EDITOR_DEF("run/output/always_close_output_on_stop", true))) { + for(int i=0;i<bottom_panel_items.size();i++) { + if (bottom_panel_items[i].control==log) { + _bottom_panel_switch(false,i); + break; + } + } + } emit_signal("stop_pressed"); } break; @@ -2674,7 +2657,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } debug_button->get_popup()->set_item_checked( debug_button->get_popup()->get_item_index(RUN_FILE_SERVER),!ischecked); - + EditorSettings::get_singleton()->set_project_metadata("debug_options", "run_file_server", !ischecked); } break; case RUN_LIVE_DEBUG: { @@ -2682,6 +2665,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { debug_button->get_popup()->set_item_checked( debug_button->get_popup()->get_item_index(RUN_LIVE_DEBUG),!ischecked); ScriptEditor::get_singleton()->get_debugger()->set_live_debugging(!ischecked); + EditorSettings::get_singleton()->set_project_metadata("debug_options", "run_live_debug", !ischecked); + } break; /*case RUN_DEPLOY_DUMB_CLIENTS: { @@ -2696,6 +2681,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { bool ischecked = debug_button->get_popup()->is_item_checked( debug_button->get_popup()->get_item_index(RUN_DEPLOY_REMOTE_DEBUG)); debug_button->get_popup()->set_item_checked( debug_button->get_popup()->get_item_index(RUN_DEPLOY_REMOTE_DEBUG),!ischecked); run_native->set_deploy_debug_remote(!ischecked); + EditorSettings::get_singleton()->set_project_metadata("debug_options", "run_deploy_remote_debug", !ischecked); } break; case RUN_DEBUG_COLLISONS: { @@ -2704,6 +2690,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { debug_button->get_popup()->set_item_checked( debug_button->get_popup()->get_item_index(RUN_DEBUG_COLLISONS),!ischecked); run_native->set_debug_collisions(!ischecked); editor_run.set_debug_collisions(!ischecked); + EditorSettings::get_singleton()->set_project_metadata("debug_options", "run_debug_collisons", !ischecked); + } break; case RUN_DEBUG_NAVIGATION: { @@ -2711,6 +2699,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { debug_button->get_popup()->set_item_checked( debug_button->get_popup()->get_item_index(RUN_DEBUG_NAVIGATION),!ischecked); run_native->set_debug_navigation(!ischecked); editor_run.set_debug_navigation(!ischecked); + EditorSettings::get_singleton()->set_project_metadata("debug_options", "run_debug_navigation", !ischecked); + } break; case RUN_RELOAD_SCRIPTS: { @@ -2719,6 +2709,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { debug_button->get_popup()->set_item_checked( debug_button->get_popup()->get_item_index(RUN_RELOAD_SCRIPTS),!ischecked); ScriptEditor::get_singleton()->set_live_auto_reload_running_scripts(!ischecked); + EditorSettings::get_singleton()->set_project_metadata("debug_options", "run_reload_scripts", !ischecked); + } break; case SETTINGS_UPDATE_ALWAYS: { @@ -2864,6 +2856,23 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } } +void EditorNode::_update_debug_options() { + + bool check_deploy_remote = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_deploy_remote_debug", false); + bool check_file_server = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_file_server", false); + bool check_debug_collisons = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_collisons", false); + bool check_debug_navigation = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_navigation", false); + bool check_live_debug = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_live_debug", false); + bool check_reload_scripts = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_reload_scripts", false); + + if (check_deploy_remote) _menu_option_confirm(RUN_DEPLOY_REMOTE_DEBUG, true); + if (check_file_server) _menu_option_confirm(RUN_FILE_SERVER, true); + if (check_debug_collisons) _menu_option_confirm(RUN_DEBUG_COLLISONS, true); + if (check_debug_navigation) _menu_option_confirm(RUN_DEBUG_NAVIGATION, true); + if (check_live_debug) _menu_option_confirm(RUN_LIVE_DEBUG, true); + if (check_reload_scripts) _menu_option_confirm(RUN_RELOAD_SCRIPTS, true); + +} Control* EditorNode::get_viewport() { @@ -5062,13 +5071,13 @@ void EditorNode::_bind_methods() { -// ClassDB::bind_method(_MD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin); - //ClassDB::bind_method(_MD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin); - ClassDB::bind_method(_MD("get_gui_base"), &EditorNode::get_gui_base); - ClassDB::bind_method(_MD("_bottom_panel_switch"), &EditorNode::_bottom_panel_switch); +// ClassDB::bind_method(D_METHOD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin); + //ClassDB::bind_method(D_METHOD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin); + ClassDB::bind_method(D_METHOD("get_gui_base"), &EditorNode::get_gui_base); + ClassDB::bind_method(D_METHOD("_bottom_panel_switch"), &EditorNode::_bottom_panel_switch); - ClassDB::bind_method(_MD("_open_imported"), &EditorNode::_open_imported); - ClassDB::bind_method(_MD("_inherit_imported"), &EditorNode::_inherit_imported); + ClassDB::bind_method(D_METHOD("_open_imported"), &EditorNode::_open_imported); + ClassDB::bind_method(D_METHOD("_inherit_imported"), &EditorNode::_inherit_imported); ADD_SIGNAL( MethodInfo("play_pressed") ); ADD_SIGNAL( MethodInfo("pause_pressed") ); @@ -5200,10 +5209,13 @@ EditorNode::EditorNode() { EditorFileDialog::register_func=_editor_file_dialog_register; EditorFileDialog::unregister_func=_editor_file_dialog_unregister; + editor_export = memnew( EditorExport ); + add_child(editor_export); + register_exporters(); - GLOBAL_DEF("editor/main_run_args","$scene"); + GLOBAL_DEF("editor/main_run_args",""); ClassDB::set_class_enabled("CollisionShape",true); ClassDB::set_class_enabled("CollisionShape2D",true); @@ -6120,8 +6132,8 @@ EditorNode::EditorNode() { //gui_base->add_child(optimized_save); //optimized_save->connect("confirmed",this,"_save_optimized"); - //project_export = memnew( ProjectExport(&editor_data) ); - //gui_base->add_child(project_export); + project_export = memnew( ProjectExportDialog ); + gui_base->add_child(project_export); //project_export_settings = memnew( ProjectExportDialog(this) ); //gui_base->add_child(project_export_settings); @@ -6266,6 +6278,7 @@ EditorNode::EditorNode() { + add_editor_plugin( memnew( AnimationPlayerEditorPlugin(this) ) ); add_editor_plugin( memnew( CanvasItemEditorPlugin(this) ) ); add_editor_plugin( memnew( SpatialEditorPlugin(this) ) ); @@ -6315,6 +6328,7 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( Path2DEditorPlugin(this) ) ); //add_editor_plugin( memnew( PathEditorPlugin(this) ) ); //add_editor_plugin( memnew( BakedLightEditorPlugin(this) ) ); + add_editor_plugin( memnew( Line2DEditorPlugin(this) ) ); add_editor_plugin( memnew( Polygon2DEditorPlugin(this) ) ); add_editor_plugin( memnew( LightOccluder2DEditorPlugin(this) ) ); add_editor_plugin( memnew( NavigationPolygonEditorPlugin(this) ) ); diff --git a/tools/editor/editor_node.h b/editor/editor_node.h index 4aca433f9c..fb0b5c4c25 100644 --- a/tools/editor/editor_node.h +++ b/editor/editor_node.h @@ -42,41 +42,41 @@ #include "scene/gui/split_container.h" #include "scene/gui/center_container.h" #include "scene/gui/texture_progress.h" -#include "tools/editor/filesystem_dock.h" -#include "tools/editor/scene_tree_editor.h" -#include "tools/editor/property_editor.h" -#include "tools/editor/create_dialog.h" -#include "tools/editor/call_dialog.h" -#include "tools/editor/reparent_dialog.h" -#include "tools/editor/connections_dialog.h" -#include "tools/editor/node_dock.h" -#include "tools/editor/import_dock.h" -#include "tools/editor/settings_config_dialog.h" -#include "tools/editor/groups_editor.h" -#include "tools/editor/editor_data.h" -#include "tools/editor/editor_path.h" -#include "tools/editor/editor_run.h" - -#include "tools/editor/pane_drag.h" - -#include "tools/editor/script_create_dialog.h" -#include "tools/editor/run_settings_dialog.h" -#include "tools/editor/project_settings.h" -#include "tools/editor/project_export.h" -#include "tools/editor/editor_log.h" -#include "tools/editor/scene_tree_dock.h" -#include "tools/editor/resources_dock.h" -#include "tools/editor/editor_run_script.h" - -#include "tools/editor/editor_run_native.h" +#include "editor/filesystem_dock.h" +#include "editor/scene_tree_editor.h" +#include "editor/property_editor.h" +#include "editor/create_dialog.h" +#include "editor/call_dialog.h" +#include "editor/reparent_dialog.h" +#include "editor/connections_dialog.h" +#include "editor/node_dock.h" +#include "editor/import_dock.h" +#include "editor/settings_config_dialog.h" +#include "editor/groups_editor.h" +#include "editor/editor_data.h" +#include "editor/editor_path.h" +#include "editor/editor_run.h" + +#include "editor/pane_drag.h" + +#include "editor/script_create_dialog.h" +#include "editor/run_settings_dialog.h" +#include "editor/project_settings.h" +#include "editor/project_export.h" +#include "editor/editor_log.h" +#include "editor/scene_tree_dock.h" +#include "editor/resources_dock.h" +#include "editor/editor_run_script.h" + +#include "editor/editor_run_native.h" #include "scene/gui/tabs.h" -#include "tools/editor/quick_open.h" -#include "tools/editor/project_export.h" -#include "tools/editor/editor_sub_scene.h" -#include "editor_import_export.h" +#include "editor/quick_open.h" +#include "editor/project_export.h" +#include "editor/editor_sub_scene.h" +#include "editor_export.h" #include "editor_reimport_dialog.h" -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_name_dialog.h" +#include "editor/editor_plugin.h" +#include "editor/editor_name_dialog.h" #include "fileserver/editor_file_server.h" #include "editor_resource_preview.h" @@ -365,7 +365,7 @@ private: String _tmp_import_path; - EditorImportExport *editor_import_export; + EditorExport *editor_export; Object *current; @@ -395,7 +395,7 @@ private: EditorRun editor_run; EditorSelection *editor_selection; // ProjectExport *project_export; -// ProjectExportDialog *project_export_settings; + ProjectExportDialog *project_export; EditorResourcePreview *resource_preview; EditorFileServer *file_server; @@ -432,6 +432,7 @@ private: void _menu_option(int p_option); void _menu_confirm_current(); void _menu_option_confirm(int p_option,bool p_confirmed); + void _update_debug_options(); void _property_editor_forward(); void _property_editor_back(); diff --git a/tools/editor/editor_path.cpp b/editor/editor_path.cpp index 8cd31c4bcc..8cd31c4bcc 100644 --- a/tools/editor/editor_path.cpp +++ b/editor/editor_path.cpp diff --git a/tools/editor/editor_path.h b/editor/editor_path.h index fd5b469d07..fd5b469d07 100644 --- a/tools/editor/editor_path.h +++ b/editor/editor_path.h diff --git a/tools/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 2f44b5558c..85ef96fcc3 100644 --- a/tools/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -32,8 +32,8 @@ #include "scene/3d/camera.h" #include "plugins/canvas_item_editor_plugin.h" #include "plugins/spatial_editor_plugin.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_node.h" +#include "editor/editor_settings.h" #include "editor_resource_preview.h" void EditorPlugin::add_custom_type(const String& p_type, const String& p_base,const Ref<Script>& p_script, const Ref<Texture>& p_icon) { @@ -345,33 +345,33 @@ EditorFileSystem *EditorPlugin::get_resource_file_system() { void EditorPlugin::_bind_methods() { - ClassDB::bind_method(_MD("add_control_to_container","container","control:Control"),&EditorPlugin::add_control_to_container); - ClassDB::bind_method(_MD("add_control_to_bottom_panel:ToolButton","control:Control","title"),&EditorPlugin::add_control_to_bottom_panel); - ClassDB::bind_method(_MD("add_control_to_dock","slot","control:Control"),&EditorPlugin::add_control_to_dock); - ClassDB::bind_method(_MD("remove_control_from_docks","control:Control"),&EditorPlugin::remove_control_from_docks); - ClassDB::bind_method(_MD("remove_control_from_bottom_panel","control:Control"),&EditorPlugin::remove_control_from_bottom_panel); - //ClassDB::bind_method(_MD("add_tool_menu_item", "name", "handler", "callback", "ud"),&EditorPlugin::add_tool_menu_item,DEFVAL(Variant())); - ClassDB::bind_method(_MD("add_tool_submenu_item", "name", "submenu:PopupMenu"),&EditorPlugin::add_tool_submenu_item); - //ClassDB::bind_method(_MD("remove_tool_menu_item", "name"),&EditorPlugin::remove_tool_menu_item); - ClassDB::bind_method(_MD("add_custom_type","type","base","script:Script","icon:Texture"),&EditorPlugin::add_custom_type); - ClassDB::bind_method(_MD("remove_custom_type","type"),&EditorPlugin::remove_custom_type); - ClassDB::bind_method(_MD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport); - - ClassDB::bind_method(_MD("get_resource_previewer:EditorResourcePreview"),&EditorPlugin::get_resource_previewer); - ClassDB::bind_method(_MD("get_resource_filesystem:EditorFileSystem"),&EditorPlugin::get_resource_file_system); - - ClassDB::bind_method(_MD("inspect_object","object","for_property"),&EditorPlugin::inspect_object,DEFVAL(String())); - ClassDB::bind_method(_MD("update_canvas"),&EditorPlugin::update_canvas); - - ClassDB::bind_method(_MD("make_bottom_panel_item_visible","item:Control"), &EditorPlugin::make_bottom_panel_item_visible); - ClassDB::bind_method(_MD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel); - - ClassDB::bind_method(_MD("get_base_control:Control"),&EditorPlugin::get_base_control); - ClassDB::bind_method(_MD("get_undo_redo:UndoRedo"),&EditorPlugin::_get_undo_redo); - ClassDB::bind_method(_MD("get_selection:EditorSelection"),&EditorPlugin::get_selection); - ClassDB::bind_method(_MD("get_editor_settings:EditorSettings"),&EditorPlugin::get_editor_settings); - ClassDB::bind_method(_MD("queue_save_layout"),&EditorPlugin::queue_save_layout); - ClassDB::bind_method(_MD("edit_resource"),&EditorPlugin::edit_resource); + ClassDB::bind_method(D_METHOD("add_control_to_container","container","control:Control"),&EditorPlugin::add_control_to_container); + ClassDB::bind_method(D_METHOD("add_control_to_bottom_panel:ToolButton","control:Control","title"),&EditorPlugin::add_control_to_bottom_panel); + ClassDB::bind_method(D_METHOD("add_control_to_dock","slot","control:Control"),&EditorPlugin::add_control_to_dock); + ClassDB::bind_method(D_METHOD("remove_control_from_docks","control:Control"),&EditorPlugin::remove_control_from_docks); + ClassDB::bind_method(D_METHOD("remove_control_from_bottom_panel","control:Control"),&EditorPlugin::remove_control_from_bottom_panel); + //ClassDB::bind_method(D_METHOD("add_tool_menu_item", "name", "handler", "callback", "ud"),&EditorPlugin::add_tool_menu_item,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("add_tool_submenu_item", "name", "submenu:PopupMenu"),&EditorPlugin::add_tool_submenu_item); + //ClassDB::bind_method(D_METHOD("remove_tool_menu_item", "name"),&EditorPlugin::remove_tool_menu_item); + ClassDB::bind_method(D_METHOD("add_custom_type","type","base","script:Script","icon:Texture"),&EditorPlugin::add_custom_type); + ClassDB::bind_method(D_METHOD("remove_custom_type","type"),&EditorPlugin::remove_custom_type); + ClassDB::bind_method(D_METHOD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport); + + ClassDB::bind_method(D_METHOD("get_resource_previewer:EditorResourcePreview"),&EditorPlugin::get_resource_previewer); + ClassDB::bind_method(D_METHOD("get_resource_filesystem:EditorFileSystem"),&EditorPlugin::get_resource_file_system); + + ClassDB::bind_method(D_METHOD("inspect_object","object","for_property"),&EditorPlugin::inspect_object,DEFVAL(String())); + ClassDB::bind_method(D_METHOD("update_canvas"),&EditorPlugin::update_canvas); + + ClassDB::bind_method(D_METHOD("make_bottom_panel_item_visible","item:Control"), &EditorPlugin::make_bottom_panel_item_visible); + ClassDB::bind_method(D_METHOD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel); + + ClassDB::bind_method(D_METHOD("get_base_control:Control"),&EditorPlugin::get_base_control); + ClassDB::bind_method(D_METHOD("get_undo_redo:UndoRedo"),&EditorPlugin::_get_undo_redo); + ClassDB::bind_method(D_METHOD("get_selection:EditorSelection"),&EditorPlugin::get_selection); + ClassDB::bind_method(D_METHOD("get_editor_settings:EditorSettings"),&EditorPlugin::get_editor_settings); + ClassDB::bind_method(D_METHOD("queue_save_layout"),&EditorPlugin::queue_save_layout); + ClassDB::bind_method(D_METHOD("edit_resource"),&EditorPlugin::edit_resource); ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"forward_canvas_gui_input",PropertyInfo(Variant::TRANSFORM2D,"canvas_xform"),PropertyInfo(Variant::INPUT_EVENT,"event"))); ClassDB::add_virtual_method(get_class_static(),MethodInfo("forward_draw_over_canvas",PropertyInfo(Variant::TRANSFORM2D,"canvas_xform"),PropertyInfo(Variant::OBJECT,"canvas:Control"))); diff --git a/tools/editor/editor_plugin.h b/editor/editor_plugin.h index cf998dd55b..13d8ab0343 100644 --- a/tools/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -43,7 +43,7 @@ class EditorNode; class Spatial; class Camera; class EditorSelection; -class EditorImportExport; +class EditorExport; class EditorSettings; class SpatialEditorGizmo; class EditorImportPlugin; diff --git a/tools/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index 2b6828e82f..2d879e38cf 100644 --- a/tools/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -32,7 +32,7 @@ #include "io/config_file.h" #include "os/file_access.h" #include "os/main_loop.h" -#include "globals.h" +#include "global_config.h" #include "editor_node.h" void EditorPluginSettings::_notification(int p_what) { diff --git a/tools/editor/editor_plugin_settings.h b/editor/editor_plugin_settings.h index e24880a21d..e24880a21d 100644 --- a/tools/editor/editor_plugin_settings.h +++ b/editor/editor_plugin_settings.h diff --git a/tools/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index 94ec059ea7..d9a4174246 100644 --- a/tools/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -646,16 +646,16 @@ void EditorProfiler::_combo_changed(int) { void EditorProfiler::_bind_methods() { - ClassDB::bind_method(_MD("_update_frame"),&EditorProfiler::_update_frame); - ClassDB::bind_method(_MD("_update_plot"),&EditorProfiler::_update_plot); - ClassDB::bind_method(_MD("_activate_pressed"),&EditorProfiler::_activate_pressed); - ClassDB::bind_method(_MD("_graph_tex_draw"),&EditorProfiler::_graph_tex_draw); - ClassDB::bind_method(_MD("_graph_tex_input"),&EditorProfiler::_graph_tex_input); - ClassDB::bind_method(_MD("_graph_tex_mouse_exit"),&EditorProfiler::_graph_tex_mouse_exit); - ClassDB::bind_method(_MD("_cursor_metric_changed"),&EditorProfiler::_cursor_metric_changed); - ClassDB::bind_method(_MD("_combo_changed"),&EditorProfiler::_combo_changed); - - ClassDB::bind_method(_MD("_item_edited"),&EditorProfiler::_item_edited); + ClassDB::bind_method(D_METHOD("_update_frame"),&EditorProfiler::_update_frame); + ClassDB::bind_method(D_METHOD("_update_plot"),&EditorProfiler::_update_plot); + ClassDB::bind_method(D_METHOD("_activate_pressed"),&EditorProfiler::_activate_pressed); + ClassDB::bind_method(D_METHOD("_graph_tex_draw"),&EditorProfiler::_graph_tex_draw); + ClassDB::bind_method(D_METHOD("_graph_tex_input"),&EditorProfiler::_graph_tex_input); + ClassDB::bind_method(D_METHOD("_graph_tex_mouse_exit"),&EditorProfiler::_graph_tex_mouse_exit); + ClassDB::bind_method(D_METHOD("_cursor_metric_changed"),&EditorProfiler::_cursor_metric_changed); + ClassDB::bind_method(D_METHOD("_combo_changed"),&EditorProfiler::_combo_changed); + + ClassDB::bind_method(D_METHOD("_item_edited"),&EditorProfiler::_item_edited); ADD_SIGNAL( MethodInfo("enable_profiling",PropertyInfo(Variant::BOOL,"enable"))); ADD_SIGNAL( MethodInfo("break_request")); diff --git a/tools/editor/editor_profiler.h b/editor/editor_profiler.h index bf89e3939c..bf89e3939c 100644 --- a/tools/editor/editor_profiler.h +++ b/editor/editor_profiler.h diff --git a/tools/editor/editor_reimport_dialog.cpp b/editor/editor_reimport_dialog.cpp index 5904070230..5904070230 100644 --- a/tools/editor/editor_reimport_dialog.cpp +++ b/editor/editor_reimport_dialog.cpp diff --git a/tools/editor/editor_reimport_dialog.h b/editor/editor_reimport_dialog.h index 7379c70c5e..7379c70c5e 100644 --- a/tools/editor/editor_reimport_dialog.h +++ b/editor/editor_reimport_dialog.h diff --git a/tools/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index b4c459a493..ab2226e79a 100644 --- a/tools/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -32,7 +32,7 @@ #include "os/file_access.h" #include "io/resource_loader.h" #include "io/resource_saver.h" -#include "globals.h" +#include "global_config.h" #include "editor_scale.h" #include "message_queue.h" @@ -379,11 +379,11 @@ void EditorResourcePreview::_bind_methods() { ClassDB::bind_method("_preview_ready",&EditorResourcePreview::_preview_ready); - ClassDB::bind_method(_MD("queue_resource_preview","path","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_resource_preview); - ClassDB::bind_method(_MD("queue_edited_resource_preview","resource:Resource","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_edited_resource_preview); - ClassDB::bind_method(_MD("add_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::add_preview_generator); - ClassDB::bind_method(_MD("remove_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::remove_preview_generator); - ClassDB::bind_method(_MD("check_for_invalidation","path"),&EditorResourcePreview::check_for_invalidation); + ClassDB::bind_method(D_METHOD("queue_resource_preview","path","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_resource_preview); + ClassDB::bind_method(D_METHOD("queue_edited_resource_preview","resource:Resource","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_edited_resource_preview); + ClassDB::bind_method(D_METHOD("add_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::add_preview_generator); + ClassDB::bind_method(D_METHOD("remove_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::remove_preview_generator); + ClassDB::bind_method(D_METHOD("check_for_invalidation","path"),&EditorResourcePreview::check_for_invalidation); ADD_SIGNAL(MethodInfo("preview_invalidated",PropertyInfo(Variant::STRING,"path"))); diff --git a/tools/editor/editor_resource_preview.h b/editor/editor_resource_preview.h index e4a593330d..e4a593330d 100644 --- a/tools/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h diff --git a/tools/editor/editor_run.cpp b/editor/editor_run.cpp index 813a8ee5b7..46e400ae7f 100644 --- a/tools/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -28,14 +28,14 @@ /*************************************************************************/ #include "editor_run.h" -#include "globals.h" +#include "global_config.h" #include "editor_settings.h" EditorRun::Status EditorRun::get_status() const { return status; } -Error EditorRun::run(const String& p_scene,const String p_custom_args,const List<String>& p_breakpoints,const String& p_edited_scene) { +Error EditorRun::run(const String& p_scene,const String p_custom_args,const List<String>& p_breakpoints) { List<String> args; @@ -141,11 +141,15 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List args.push_back(bpoints); } + + if (p_scene!="") { + args.push_back(p_scene); + } if (p_custom_args!="") { Vector<String> cargs=p_custom_args.split(" ",false); for(int i=0;i<cargs.size();i++) { - args.push_back(cargs[i].replace("$scene",p_scene).replace(" ","%20")); + args.push_back(cargs[i].replace(" ","%20")); } } diff --git a/tools/editor/editor_run.h b/editor/editor_run.h index 78fa892488..46c5dc7521 100644 --- a/tools/editor/editor_run.h +++ b/editor/editor_run.h @@ -49,7 +49,7 @@ private: public: Status get_status() const; - Error run(const String& p_scene,const String p_custom_args,const List<String>& p_breakpoints,const String& p_edited_scene); + Error run(const String& p_scene,const String p_custom_args,const List<String>& p_breakpoints); void run_native_notify() { status=STATUS_PLAY; } void stop(); diff --git a/tools/editor/editor_run_native.cpp b/editor/editor_run_native.cpp index 25cb41befc..60a9f53b94 100644 --- a/tools/editor/editor_run_native.cpp +++ b/editor/editor_run_native.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "editor_run_native.h" -#include "editor_import_export.h" +#include "editor_export.h" void EditorRunNative::_notification(int p_what) { diff --git a/tools/editor/editor_run_native.h b/editor/editor_run_native.h index c62021148b..c62021148b 100644 --- a/tools/editor/editor_run_native.h +++ b/editor/editor_run_native.h diff --git a/tools/editor/editor_run_script.cpp b/editor/editor_run_script.cpp index 6a980019e4..77dc7bd4bf 100644 --- a/tools/editor/editor_run_script.cpp +++ b/editor/editor_run_script.cpp @@ -83,8 +83,8 @@ void EditorScript::set_editor(EditorNode *p_editor) { void EditorScript::_bind_methods() { - ClassDB::bind_method(_MD("add_root_node","node"),&EditorScript::add_root_node); - ClassDB::bind_method(_MD("get_scene"),&EditorScript::get_scene); + ClassDB::bind_method(D_METHOD("add_root_node","node"),&EditorScript::add_root_node); + ClassDB::bind_method(D_METHOD("get_scene"),&EditorScript::get_scene); BIND_VMETHOD( MethodInfo("_run") ); diff --git a/tools/editor/editor_run_script.h b/editor/editor_run_script.h index 3ab8525cc6..3ab8525cc6 100644 --- a/tools/editor/editor_run_script.h +++ b/editor/editor_run_script.h diff --git a/tools/editor/editor_scale.cpp b/editor/editor_scale.cpp index 5687f97b22..5687f97b22 100644 --- a/tools/editor/editor_scale.cpp +++ b/editor/editor_scale.cpp diff --git a/tools/editor/editor_scale.h b/editor/editor_scale.h index 035a5056c1..035a5056c1 100644 --- a/tools/editor/editor_scale.h +++ b/editor/editor_scale.h diff --git a/tools/editor/editor_settings.cpp b/editor/editor_settings.cpp index 1cdc426541..f977a40243 100644 --- a/tools/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -39,7 +39,7 @@ #include "scene/main/viewport.h" #include "io/config_file.h" #include "editor_node.h" -#include "globals.h" +#include "global_config.h" #include "translations.h" #include "io/file_access_memory.h" #include "io/translation_loader_po.h" @@ -242,13 +242,20 @@ void EditorSettings::create() { String exe_path = OS::get_singleton()->get_executable_path().get_base_dir(); DirAccess* d = DirAccess::create_for_path(exe_path); + bool self_contained = false; if (d->file_exists(exe_path + "/._sc_")) { + self_contained = true; + extra_config->load(exe_path + "/._sc_"); + } else if (d->file_exists(exe_path + "/_sc_")) { + self_contained = true; + extra_config->load(exe_path + "/_sc_"); + } + if (self_contained) { // editor is self contained config_path = exe_path; config_dir = "editor_data"; - extra_config->load(exe_path + "/._sc_"); } else { if (OS::get_singleton()->has_environment("APPDATA")) { @@ -655,6 +662,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { set("run/auto_save/save_before_running",true); set("run/output/always_clear_output_on_play",true); set("run/output/always_open_output_on_play",true); + set("run/output/always_close_output_on_stop",false); set("filesystem/resources/save_compressed_resources",true); set("filesystem/resources/auto_reload_modified_images",true); @@ -1029,42 +1037,38 @@ void EditorSettings::set_optimize_save(bool p_optimize) { optimize_save=p_optimize; } -String EditorSettings::get_last_selected_language() -{ +Variant EditorSettings::get_project_metadata(const String& p_section, const String& p_key, Variant p_default) { Ref<ConfigFile> cf = memnew( ConfigFile ); String path = get_project_settings_path().plus_file("project_metadata.cfg"); Error err = cf->load(path); if (err != OK) { - return ""; + return p_default; } - Variant last_selected_language = cf->get_value("script_setup", "last_selected_language"); - if (last_selected_language.get_type() != Variant::STRING) - return ""; - return static_cast<String>(last_selected_language); + return cf->get_value(p_section, p_key, p_default); } -void EditorSettings::set_last_selected_language(String p_language) +void EditorSettings::set_project_metadata(const String& p_section, const String& p_key, Variant p_data) { Ref<ConfigFile> cf = memnew( ConfigFile ); String path = get_project_settings_path().plus_file("project_metadata.cfg"); cf->load(path); - cf->set_value("script_setup", "last_selected_language", p_language); + cf->set_value(p_section, p_key, p_data); cf->save(path); } void EditorSettings::_bind_methods() { - ClassDB::bind_method(_MD("erase","property"),&EditorSettings::erase); - ClassDB::bind_method(_MD("get_settings_path"),&EditorSettings::get_settings_path); - ClassDB::bind_method(_MD("get_project_settings_path"),&EditorSettings::get_project_settings_path); + ClassDB::bind_method(D_METHOD("erase","property"),&EditorSettings::erase); + ClassDB::bind_method(D_METHOD("get_settings_path"),&EditorSettings::get_settings_path); + ClassDB::bind_method(D_METHOD("get_project_settings_path"),&EditorSettings::get_project_settings_path); - ClassDB::bind_method(_MD("add_property_info", "info"),&EditorSettings::_add_property_info_bind); + ClassDB::bind_method(D_METHOD("add_property_info", "info"),&EditorSettings::_add_property_info_bind); - ClassDB::bind_method(_MD("set_favorite_dirs","dirs"),&EditorSettings::set_favorite_dirs); - ClassDB::bind_method(_MD("get_favorite_dirs"),&EditorSettings::get_favorite_dirs); + ClassDB::bind_method(D_METHOD("set_favorite_dirs","dirs"),&EditorSettings::set_favorite_dirs); + ClassDB::bind_method(D_METHOD("get_favorite_dirs"),&EditorSettings::get_favorite_dirs); - ClassDB::bind_method(_MD("set_recent_dirs","dirs"),&EditorSettings::set_recent_dirs); - ClassDB::bind_method(_MD("get_recent_dirs"),&EditorSettings::get_recent_dirs); + ClassDB::bind_method(D_METHOD("set_recent_dirs","dirs"),&EditorSettings::set_recent_dirs); + ClassDB::bind_method(D_METHOD("get_recent_dirs"),&EditorSettings::get_recent_dirs); ADD_SIGNAL(MethodInfo("settings_changed")); diff --git a/tools/editor/editor_settings.h b/editor/editor_settings.h index c11feef667..809389eb40 100644 --- a/tools/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -160,8 +160,8 @@ public: void set_optimize_save(bool p_optimize); - String get_last_selected_language(); - void set_last_selected_language(String p_language); + Variant get_project_metadata(const String& p_section, const String& p_key, Variant p_default); + void set_project_metadata(const String& p_section, const String& p_key, Variant p_data); EditorSettings(); ~EditorSettings(); diff --git a/tools/editor/editor_sub_scene.cpp b/editor/editor_sub_scene.cpp index 094cf049b3..917560b540 100644 --- a/tools/editor/editor_sub_scene.cpp +++ b/editor/editor_sub_scene.cpp @@ -187,9 +187,9 @@ void EditorSubScene::clear() { void EditorSubScene::_bind_methods() { - ClassDB::bind_method(_MD("_path_selected"),&EditorSubScene::_path_selected); - ClassDB::bind_method(_MD("_path_changed"),&EditorSubScene::_path_changed); - ClassDB::bind_method(_MD("_path_browse"),&EditorSubScene::_path_browse); + ClassDB::bind_method(D_METHOD("_path_selected"),&EditorSubScene::_path_selected); + ClassDB::bind_method(D_METHOD("_path_changed"),&EditorSubScene::_path_changed); + ClassDB::bind_method(D_METHOD("_path_browse"),&EditorSubScene::_path_browse); ADD_SIGNAL( MethodInfo("subscene_selected")); } diff --git a/tools/editor/editor_sub_scene.h b/editor/editor_sub_scene.h index cc9faffc77..46cdceafa5 100644 --- a/tools/editor/editor_sub_scene.h +++ b/editor/editor_sub_scene.h @@ -31,7 +31,7 @@ #include "scene/gui/dialogs.h" #include "scene/gui/tree.h" -#include "tools/editor/editor_file_dialog.h" +#include "editor/editor_file_dialog.h" class EditorSubScene : public ConfirmationDialog { diff --git a/tools/editor/editor_themes.cpp b/editor/editor_themes.cpp index 7657996b81..7657996b81 100644 --- a/tools/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp diff --git a/tools/editor/editor_themes.h b/editor/editor_themes.h index bf15420917..bf15420917 100644 --- a/tools/editor/editor_themes.h +++ b/editor/editor_themes.h diff --git a/tools/editor/file_type_cache.cpp b/editor/file_type_cache.cpp index aff99fbc05..891669db13 100644 --- a/tools/editor/file_type_cache.cpp +++ b/editor/file_type_cache.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "file_type_cache.h" -#include "globals.h" +#include "global_config.h" #include "os/file_access.h" FileTypeCache* FileTypeCache::singleton=NULL; diff --git a/tools/editor/file_type_cache.h b/editor/file_type_cache.h index 25755f168c..25755f168c 100644 --- a/tools/editor/file_type_cache.h +++ b/editor/file_type_cache.h diff --git a/tools/editor/fileserver/SCsub b/editor/fileserver/SCsub index f1fa50148f..f1fa50148f 100644 --- a/tools/editor/fileserver/SCsub +++ b/editor/fileserver/SCsub diff --git a/tools/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index 2e5dbf6248..2e5dbf6248 100644 --- a/tools/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp diff --git a/tools/editor/fileserver/editor_file_server.h b/editor/fileserver/editor_file_server.h index 31f8ae84b8..31f8ae84b8 100644 --- a/tools/editor/fileserver/editor_file_server.h +++ b/editor/fileserver/editor_file_server.h diff --git a/tools/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 08b8307eb4..bce0e9148a 100644 --- a/tools/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -30,7 +30,7 @@ #include "os/dir_access.h" #include "os/file_access.h" -#include "globals.h" +#include "global_config.h" #include "io/resource_loader.h" #include "os/os.h" #include "editor_node.h" @@ -287,6 +287,39 @@ String FileSystemDock::get_current_path() const { return path; } +void FileSystemDock::navigate_to_path(const String& p_path) { + // If the path is a file, do not only go to the directory in the tree, also select the file in the file list. + String dir_path=""; + String file_name=""; + DirAccess* dirAccess=DirAccess::open("res://"); + if (dirAccess->file_exists(p_path)) { + dir_path=p_path.get_base_dir(); + file_name=p_path.get_file(); + } else if (dirAccess->dir_exists(p_path)) { + dir_path=p_path; + } else { + ERR_EXPLAIN(TTR("Cannot navigate to '" + p_path + "' as it has not been found in the file system!")); + ERR_FAIL(); + } + + path=dir_path; + _update_tree(); + tree->ensure_cursor_is_visible(); + + if (!file_name.empty()) { + _open_pressed(); // Seems to be the only way to get into the file view. This also pushes to history. + + // Focus the given file. + for (int i=0; i<files->get_item_count(); i++) { + if (files->get_item_text(i) == file_name) { + files->select(i,true); + files->ensure_current_is_visible(); + break; + } + } + } +} + void FileSystemDock::_thumbnail_done(const String& p_path,const Ref<Texture>& p_preview, const Variant& p_udata) { bool valid=false; @@ -1641,37 +1674,37 @@ void FileSystemDock::_file_selected() { void FileSystemDock::_bind_methods() { - ClassDB::bind_method(_MD("_update_tree"),&FileSystemDock::_update_tree); - ClassDB::bind_method(_MD("_rescan"),&FileSystemDock::_rescan); - ClassDB::bind_method(_MD("_favorites_pressed"),&FileSystemDock::_favorites_pressed); - //ClassDB::bind_method(_MD("_instance_pressed"),&ScenesDock::_instance_pressed); - ClassDB::bind_method(_MD("_open_pressed"),&FileSystemDock::_open_pressed); - ClassDB::bind_method(_MD("_dir_rmb_pressed"),&FileSystemDock::_dir_rmb_pressed); - - ClassDB::bind_method(_MD("_thumbnail_done"),&FileSystemDock::_thumbnail_done); - ClassDB::bind_method(_MD("_select_file"), &FileSystemDock::_select_file); - ClassDB::bind_method(_MD("_go_to_tree"), &FileSystemDock::_go_to_tree); - ClassDB::bind_method(_MD("_go_to_dir"), &FileSystemDock::_go_to_dir); - ClassDB::bind_method(_MD("_change_file_display"), &FileSystemDock::_change_file_display); - ClassDB::bind_method(_MD("_fw_history"), &FileSystemDock::_fw_history); - ClassDB::bind_method(_MD("_bw_history"), &FileSystemDock::_bw_history); - ClassDB::bind_method(_MD("_fs_changed"), &FileSystemDock::_fs_changed); - ClassDB::bind_method(_MD("_dir_selected"), &FileSystemDock::_dir_selected); - ClassDB::bind_method(_MD("_file_option"), &FileSystemDock::_file_option); - ClassDB::bind_method(_MD("_folder_option"), &FileSystemDock::_folder_option); - ClassDB::bind_method(_MD("_move_operation"), &FileSystemDock::_move_operation); - ClassDB::bind_method(_MD("_rename_operation"), &FileSystemDock::_rename_operation); - - ClassDB::bind_method(_MD("_search_changed"), &FileSystemDock::_search_changed); - - ClassDB::bind_method(_MD("get_drag_data_fw"), &FileSystemDock::get_drag_data_fw); - ClassDB::bind_method(_MD("can_drop_data_fw"), &FileSystemDock::can_drop_data_fw); - ClassDB::bind_method(_MD("drop_data_fw"), &FileSystemDock::drop_data_fw); - ClassDB::bind_method(_MD("_files_list_rmb_select"),&FileSystemDock::_files_list_rmb_select); - - ClassDB::bind_method(_MD("_preview_invalidated"),&FileSystemDock::_preview_invalidated); - ClassDB::bind_method(_MD("_file_selected"),&FileSystemDock::_file_selected); - ClassDB::bind_method(_MD("_file_multi_selected"),&FileSystemDock::_file_multi_selected); + ClassDB::bind_method(D_METHOD("_update_tree"),&FileSystemDock::_update_tree); + ClassDB::bind_method(D_METHOD("_rescan"),&FileSystemDock::_rescan); + ClassDB::bind_method(D_METHOD("_favorites_pressed"),&FileSystemDock::_favorites_pressed); + //ClassDB::bind_method(D_METHOD("_instance_pressed"),&ScenesDock::_instance_pressed); + ClassDB::bind_method(D_METHOD("_open_pressed"),&FileSystemDock::_open_pressed); + ClassDB::bind_method(D_METHOD("_dir_rmb_pressed"),&FileSystemDock::_dir_rmb_pressed); + + ClassDB::bind_method(D_METHOD("_thumbnail_done"),&FileSystemDock::_thumbnail_done); + ClassDB::bind_method(D_METHOD("_select_file"), &FileSystemDock::_select_file); + ClassDB::bind_method(D_METHOD("_go_to_tree"), &FileSystemDock::_go_to_tree); + ClassDB::bind_method(D_METHOD("_go_to_dir"), &FileSystemDock::_go_to_dir); + ClassDB::bind_method(D_METHOD("_change_file_display"), &FileSystemDock::_change_file_display); + ClassDB::bind_method(D_METHOD("_fw_history"), &FileSystemDock::_fw_history); + ClassDB::bind_method(D_METHOD("_bw_history"), &FileSystemDock::_bw_history); + ClassDB::bind_method(D_METHOD("_fs_changed"), &FileSystemDock::_fs_changed); + ClassDB::bind_method(D_METHOD("_dir_selected"), &FileSystemDock::_dir_selected); + ClassDB::bind_method(D_METHOD("_file_option"), &FileSystemDock::_file_option); + ClassDB::bind_method(D_METHOD("_folder_option"), &FileSystemDock::_folder_option); + ClassDB::bind_method(D_METHOD("_move_operation"), &FileSystemDock::_move_operation); + ClassDB::bind_method(D_METHOD("_rename_operation"), &FileSystemDock::_rename_operation); + + ClassDB::bind_method(D_METHOD("_search_changed"), &FileSystemDock::_search_changed); + + ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &FileSystemDock::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &FileSystemDock::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &FileSystemDock::drop_data_fw); + ClassDB::bind_method(D_METHOD("_files_list_rmb_select"),&FileSystemDock::_files_list_rmb_select); + + ClassDB::bind_method(D_METHOD("_preview_invalidated"),&FileSystemDock::_preview_invalidated); + ClassDB::bind_method(D_METHOD("_file_selected"),&FileSystemDock::_file_selected); + ClassDB::bind_method(D_METHOD("_file_multi_selected"),&FileSystemDock::_file_multi_selected); ADD_SIGNAL(MethodInfo("instance", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"))); diff --git a/tools/editor/filesystem_dock.h b/editor/filesystem_dock.h index 224efe0f28..916321d8fd 100644 --- a/tools/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -198,6 +198,7 @@ public: String get_selected_path() const; String get_current_path() const; + void navigate_to_path(const String& p_path); void focus_on_filter(); void fix_dependencies(const String& p_for_file); diff --git a/tools/editor/groups_editor.cpp b/editor/groups_editor.cpp index 90f0bab6dd..90f0bab6dd 100644 --- a/tools/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp diff --git a/tools/editor/groups_editor.h b/editor/groups_editor.h index 9ab75c6cfd..9ab75c6cfd 100644 --- a/tools/editor/groups_editor.h +++ b/editor/groups_editor.h diff --git a/tools/editor/icons/2x/icon_accept_dialog.png b/editor/icons/2x/icon_accept_dialog.png Binary files differindex fca344aefc..fca344aefc 100644 --- a/tools/editor/icons/2x/icon_accept_dialog.png +++ b/editor/icons/2x/icon_accept_dialog.png diff --git a/tools/editor/icons/2x/icon_add.png b/editor/icons/2x/icon_add.png Binary files differindex a46c521f2a..a46c521f2a 100644 --- a/tools/editor/icons/2x/icon_add.png +++ b/editor/icons/2x/icon_add.png diff --git a/tools/editor/icons/2x/icon_add_track.png b/editor/icons/2x/icon_add_track.png Binary files differindex a46c521f2a..a46c521f2a 100644 --- a/tools/editor/icons/2x/icon_add_track.png +++ b/editor/icons/2x/icon_add_track.png diff --git a/tools/editor/icons/2x/icon_anchor.png b/editor/icons/2x/icon_anchor.png Binary files differindex 7e9e259c13..7e9e259c13 100644 --- a/tools/editor/icons/2x/icon_anchor.png +++ b/editor/icons/2x/icon_anchor.png diff --git a/tools/editor/icons/2x/icon_animated_sprite.png b/editor/icons/2x/icon_animated_sprite.png Binary files differindex 461dac8f13..461dac8f13 100644 --- a/tools/editor/icons/2x/icon_animated_sprite.png +++ b/editor/icons/2x/icon_animated_sprite.png diff --git a/tools/editor/icons/2x/icon_animated_sprite_3d.png b/editor/icons/2x/icon_animated_sprite_3d.png Binary files differindex 6c79c38875..6c79c38875 100644 --- a/tools/editor/icons/2x/icon_animated_sprite_3d.png +++ b/editor/icons/2x/icon_animated_sprite_3d.png diff --git a/tools/editor/icons/2x/icon_animation.png b/editor/icons/2x/icon_animation.png Binary files differindex ef18959a74..ef18959a74 100644 --- a/tools/editor/icons/2x/icon_animation.png +++ b/editor/icons/2x/icon_animation.png diff --git a/tools/editor/icons/2x/icon_animation_player.png b/editor/icons/2x/icon_animation_player.png Binary files differindex 4a3209ab70..4a3209ab70 100644 --- a/tools/editor/icons/2x/icon_animation_player.png +++ b/editor/icons/2x/icon_animation_player.png diff --git a/tools/editor/icons/2x/icon_animation_tree.png b/editor/icons/2x/icon_animation_tree.png Binary files differindex a213ab6e5e..a213ab6e5e 100644 --- a/tools/editor/icons/2x/icon_animation_tree.png +++ b/editor/icons/2x/icon_animation_tree.png diff --git a/tools/editor/icons/2x/icon_animation_tree_player.png b/editor/icons/2x/icon_animation_tree_player.png Binary files differindex a213ab6e5e..a213ab6e5e 100644 --- a/tools/editor/icons/2x/icon_animation_tree_player.png +++ b/editor/icons/2x/icon_animation_tree_player.png diff --git a/tools/editor/icons/2x/icon_area.png b/editor/icons/2x/icon_area.png Binary files differindex d9cefe8fc4..d9cefe8fc4 100644 --- a/tools/editor/icons/2x/icon_area.png +++ b/editor/icons/2x/icon_area.png diff --git a/tools/editor/icons/2x/icon_area_2d.png b/editor/icons/2x/icon_area_2d.png Binary files differindex 22616cc754..22616cc754 100644 --- a/tools/editor/icons/2x/icon_area_2d.png +++ b/editor/icons/2x/icon_area_2d.png diff --git a/tools/editor/icons/2x/icon_arrow_left.png b/editor/icons/2x/icon_arrow_left.png Binary files differindex bc3995f70b..bc3995f70b 100644 --- a/tools/editor/icons/2x/icon_arrow_left.png +++ b/editor/icons/2x/icon_arrow_left.png diff --git a/tools/editor/icons/2x/icon_arrow_right.png b/editor/icons/2x/icon_arrow_right.png Binary files differindex 045b390e0d..045b390e0d 100644 --- a/tools/editor/icons/2x/icon_arrow_right.png +++ b/editor/icons/2x/icon_arrow_right.png diff --git a/tools/editor/icons/2x/icon_arrow_up.png b/editor/icons/2x/icon_arrow_up.png Binary files differindex 524ab934e2..524ab934e2 100644 --- a/tools/editor/icons/2x/icon_arrow_up.png +++ b/editor/icons/2x/icon_arrow_up.png diff --git a/tools/editor/icons/2x/icon_atlas_texture.png b/editor/icons/2x/icon_atlas_texture.png Binary files differindex bd5bdc3148..bd5bdc3148 100644 --- a/tools/editor/icons/2x/icon_atlas_texture.png +++ b/editor/icons/2x/icon_atlas_texture.png diff --git a/tools/editor/icons/2x/icon_audio_stream_gibberish.png b/editor/icons/2x/icon_audio_stream_gibberish.png Binary files differindex da200740a4..da200740a4 100644 --- a/tools/editor/icons/2x/icon_audio_stream_gibberish.png +++ b/editor/icons/2x/icon_audio_stream_gibberish.png diff --git a/tools/editor/icons/2x/icon_auto_play.png b/editor/icons/2x/icon_auto_play.png Binary files differindex ec31dee958..ec31dee958 100644 --- a/tools/editor/icons/2x/icon_auto_play.png +++ b/editor/icons/2x/icon_auto_play.png diff --git a/tools/editor/icons/2x/icon_back.png b/editor/icons/2x/icon_back.png Binary files differindex 648c440928..648c440928 100644 --- a/tools/editor/icons/2x/icon_back.png +++ b/editor/icons/2x/icon_back.png diff --git a/tools/editor/icons/2x/icon_back_buffer_copy.png b/editor/icons/2x/icon_back_buffer_copy.png Binary files differindex 8b5c37b7e5..8b5c37b7e5 100644 --- a/tools/editor/icons/2x/icon_back_buffer_copy.png +++ b/editor/icons/2x/icon_back_buffer_copy.png diff --git a/tools/editor/icons/2x/icon_bake.png b/editor/icons/2x/icon_bake.png Binary files differindex 3c1cba5586..3c1cba5586 100644 --- a/tools/editor/icons/2x/icon_bake.png +++ b/editor/icons/2x/icon_bake.png diff --git a/tools/editor/icons/2x/icon_baked_light.png b/editor/icons/2x/icon_baked_light.png Binary files differindex 3c1cba5586..3c1cba5586 100644 --- a/tools/editor/icons/2x/icon_baked_light.png +++ b/editor/icons/2x/icon_baked_light.png diff --git a/tools/editor/icons/2x/icon_baked_light_instance.png b/editor/icons/2x/icon_baked_light_instance.png Binary files differindex 9b13ed8ff1..9b13ed8ff1 100644 --- a/tools/editor/icons/2x/icon_baked_light_instance.png +++ b/editor/icons/2x/icon_baked_light_instance.png diff --git a/tools/editor/icons/2x/icon_baked_light_sampler.png b/editor/icons/2x/icon_baked_light_sampler.png Binary files differindex 8dfc1793f1..8dfc1793f1 100644 --- a/tools/editor/icons/2x/icon_baked_light_sampler.png +++ b/editor/icons/2x/icon_baked_light_sampler.png diff --git a/tools/editor/icons/2x/icon_bit_map.png b/editor/icons/2x/icon_bit_map.png Binary files differindex 7372b85944..7372b85944 100644 --- a/tools/editor/icons/2x/icon_bit_map.png +++ b/editor/icons/2x/icon_bit_map.png diff --git a/tools/editor/icons/2x/icon_bitmap_font.png b/editor/icons/2x/icon_bitmap_font.png Binary files differindex c533b5f40e..c533b5f40e 100644 --- a/tools/editor/icons/2x/icon_bitmap_font.png +++ b/editor/icons/2x/icon_bitmap_font.png diff --git a/tools/editor/icons/2x/icon_blend.png b/editor/icons/2x/icon_blend.png Binary files differindex 8dd30d1a04..8dd30d1a04 100644 --- a/tools/editor/icons/2x/icon_blend.png +++ b/editor/icons/2x/icon_blend.png diff --git a/tools/editor/icons/2x/icon_bone.png b/editor/icons/2x/icon_bone.png Binary files differindex 0a8ceb4ce1..0a8ceb4ce1 100644 --- a/tools/editor/icons/2x/icon_bone.png +++ b/editor/icons/2x/icon_bone.png diff --git a/tools/editor/icons/2x/icon_bone_attachment.png b/editor/icons/2x/icon_bone_attachment.png Binary files differindex 4e9333d3d1..4e9333d3d1 100644 --- a/tools/editor/icons/2x/icon_bone_attachment.png +++ b/editor/icons/2x/icon_bone_attachment.png diff --git a/tools/editor/icons/2x/icon_bone_track.png b/editor/icons/2x/icon_bone_track.png Binary files differindex a956923a07..a956923a07 100644 --- a/tools/editor/icons/2x/icon_bone_track.png +++ b/editor/icons/2x/icon_bone_track.png diff --git a/tools/editor/icons/2x/icon_bool.png b/editor/icons/2x/icon_bool.png Binary files differindex 47103538bd..47103538bd 100644 --- a/tools/editor/icons/2x/icon_bool.png +++ b/editor/icons/2x/icon_bool.png diff --git a/tools/editor/icons/2x/icon_box_shape.png b/editor/icons/2x/icon_box_shape.png Binary files differindex 7d5356ad94..7d5356ad94 100644 --- a/tools/editor/icons/2x/icon_box_shape.png +++ b/editor/icons/2x/icon_box_shape.png diff --git a/tools/editor/icons/2x/icon_button.png b/editor/icons/2x/icon_button.png Binary files differindex 210b0da486..210b0da486 100644 --- a/tools/editor/icons/2x/icon_button.png +++ b/editor/icons/2x/icon_button.png diff --git a/tools/editor/icons/2x/icon_button_group.png b/editor/icons/2x/icon_button_group.png Binary files differindex 47f62005b9..47f62005b9 100644 --- a/tools/editor/icons/2x/icon_button_group.png +++ b/editor/icons/2x/icon_button_group.png diff --git a/tools/editor/icons/2x/icon_camera.png b/editor/icons/2x/icon_camera.png Binary files differindex ea17779784..ea17779784 100644 --- a/tools/editor/icons/2x/icon_camera.png +++ b/editor/icons/2x/icon_camera.png diff --git a/tools/editor/icons/2x/icon_camera_2d.png b/editor/icons/2x/icon_camera_2d.png Binary files differindex c5c881c435..c5c881c435 100644 --- a/tools/editor/icons/2x/icon_camera_2d.png +++ b/editor/icons/2x/icon_camera_2d.png diff --git a/tools/editor/icons/2x/icon_canvas_item.png b/editor/icons/2x/icon_canvas_item.png Binary files differindex 42863020f0..42863020f0 100644 --- a/tools/editor/icons/2x/icon_canvas_item.png +++ b/editor/icons/2x/icon_canvas_item.png diff --git a/tools/editor/icons/2x/icon_canvas_item_material.png b/editor/icons/2x/icon_canvas_item_material.png Binary files differindex a9f7948060..a9f7948060 100644 --- a/tools/editor/icons/2x/icon_canvas_item_material.png +++ b/editor/icons/2x/icon_canvas_item_material.png diff --git a/tools/editor/icons/2x/icon_canvas_item_shader.png b/editor/icons/2x/icon_canvas_item_shader.png Binary files differindex 5091a947c0..5091a947c0 100644 --- a/tools/editor/icons/2x/icon_canvas_item_shader.png +++ b/editor/icons/2x/icon_canvas_item_shader.png diff --git a/tools/editor/icons/2x/icon_canvas_item_shader_graph.png b/editor/icons/2x/icon_canvas_item_shader_graph.png Binary files differindex a26a9754fe..a26a9754fe 100644 --- a/tools/editor/icons/2x/icon_canvas_item_shader_graph.png +++ b/editor/icons/2x/icon_canvas_item_shader_graph.png diff --git a/tools/editor/icons/2x/icon_canvas_layer.png b/editor/icons/2x/icon_canvas_layer.png Binary files differindex 8a4b31cd7d..8a4b31cd7d 100644 --- a/tools/editor/icons/2x/icon_canvas_layer.png +++ b/editor/icons/2x/icon_canvas_layer.png diff --git a/tools/editor/icons/2x/icon_canvas_modulate.png b/editor/icons/2x/icon_canvas_modulate.png Binary files differindex 6cc15e2655..6cc15e2655 100644 --- a/tools/editor/icons/2x/icon_canvas_modulate.png +++ b/editor/icons/2x/icon_canvas_modulate.png diff --git a/tools/editor/icons/2x/icon_capsule_shape.png b/editor/icons/2x/icon_capsule_shape.png Binary files differindex f8844ecef4..f8844ecef4 100644 --- a/tools/editor/icons/2x/icon_capsule_shape.png +++ b/editor/icons/2x/icon_capsule_shape.png diff --git a/tools/editor/icons/2x/icon_capsule_shape_2d.png b/editor/icons/2x/icon_capsule_shape_2d.png Binary files differindex e449ce4985..e449ce4985 100644 --- a/tools/editor/icons/2x/icon_capsule_shape_2d.png +++ b/editor/icons/2x/icon_capsule_shape_2d.png diff --git a/tools/editor/icons/2x/icon_center_container.png b/editor/icons/2x/icon_center_container.png Binary files differindex c715f0959e..c715f0959e 100644 --- a/tools/editor/icons/2x/icon_center_container.png +++ b/editor/icons/2x/icon_center_container.png diff --git a/tools/editor/icons/2x/icon_check_box.png b/editor/icons/2x/icon_check_box.png Binary files differindex bade572304..bade572304 100644 --- a/tools/editor/icons/2x/icon_check_box.png +++ b/editor/icons/2x/icon_check_box.png diff --git a/tools/editor/icons/2x/icon_check_button.png b/editor/icons/2x/icon_check_button.png Binary files differindex 4f498bb9ad..4f498bb9ad 100644 --- a/tools/editor/icons/2x/icon_check_button.png +++ b/editor/icons/2x/icon_check_button.png diff --git a/tools/editor/icons/2x/icon_circle_shape_2d.png b/editor/icons/2x/icon_circle_shape_2d.png Binary files differindex feb84d2f1c..feb84d2f1c 100644 --- a/tools/editor/icons/2x/icon_circle_shape_2d.png +++ b/editor/icons/2x/icon_circle_shape_2d.png diff --git a/tools/editor/icons/2x/icon_class_list.png b/editor/icons/2x/icon_class_list.png Binary files differindex 4ae0b3edab..4ae0b3edab 100644 --- a/tools/editor/icons/2x/icon_class_list.png +++ b/editor/icons/2x/icon_class_list.png diff --git a/tools/editor/icons/2x/icon_close.png b/editor/icons/2x/icon_close.png Binary files differindex 62ab763fec..62ab763fec 100644 --- a/tools/editor/icons/2x/icon_close.png +++ b/editor/icons/2x/icon_close.png diff --git a/tools/editor/icons/2x/icon_collapse.png b/editor/icons/2x/icon_collapse.png Binary files differindex 18486c03f5..18486c03f5 100644 --- a/tools/editor/icons/2x/icon_collapse.png +++ b/editor/icons/2x/icon_collapse.png diff --git a/tools/editor/icons/2x/icon_collision_2d.png b/editor/icons/2x/icon_collision_2d.png Binary files differindex 491ebfaa78..491ebfaa78 100644 --- a/tools/editor/icons/2x/icon_collision_2d.png +++ b/editor/icons/2x/icon_collision_2d.png diff --git a/tools/editor/icons/2x/icon_collision_polygon.png b/editor/icons/2x/icon_collision_polygon.png Binary files differindex ef786f6a3d..ef786f6a3d 100644 --- a/tools/editor/icons/2x/icon_collision_polygon.png +++ b/editor/icons/2x/icon_collision_polygon.png diff --git a/tools/editor/icons/2x/icon_collision_polygon_2d.png b/editor/icons/2x/icon_collision_polygon_2d.png Binary files differindex 491ebfaa78..491ebfaa78 100644 --- a/tools/editor/icons/2x/icon_collision_polygon_2d.png +++ b/editor/icons/2x/icon_collision_polygon_2d.png diff --git a/tools/editor/icons/2x/icon_collision_shape.png b/editor/icons/2x/icon_collision_shape.png Binary files differindex 23bec8cdd9..23bec8cdd9 100644 --- a/tools/editor/icons/2x/icon_collision_shape.png +++ b/editor/icons/2x/icon_collision_shape.png diff --git a/tools/editor/icons/2x/icon_collision_shape_2d.png b/editor/icons/2x/icon_collision_shape_2d.png Binary files differindex c91456b58e..c91456b58e 100644 --- a/tools/editor/icons/2x/icon_collision_shape_2d.png +++ b/editor/icons/2x/icon_collision_shape_2d.png diff --git a/tools/editor/icons/2x/icon_color.png b/editor/icons/2x/icon_color.png Binary files differindex 125dd86ec0..125dd86ec0 100644 --- a/tools/editor/icons/2x/icon_color.png +++ b/editor/icons/2x/icon_color.png diff --git a/tools/editor/icons/2x/icon_color_pick.png b/editor/icons/2x/icon_color_pick.png Binary files differindex c61f2d4174..c61f2d4174 100644 --- a/tools/editor/icons/2x/icon_color_pick.png +++ b/editor/icons/2x/icon_color_pick.png diff --git a/tools/editor/icons/2x/icon_color_picker.png b/editor/icons/2x/icon_color_picker.png Binary files differindex 2b683c75ea..2b683c75ea 100644 --- a/tools/editor/icons/2x/icon_color_picker.png +++ b/editor/icons/2x/icon_color_picker.png diff --git a/tools/editor/icons/2x/icon_color_picker_button.png b/editor/icons/2x/icon_color_picker_button.png Binary files differindex 8d9bd17ccc..8d9bd17ccc 100644 --- a/tools/editor/icons/2x/icon_color_picker_button.png +++ b/editor/icons/2x/icon_color_picker_button.png diff --git a/tools/editor/icons/2x/icon_color_ramp.png b/editor/icons/2x/icon_color_ramp.png Binary files differindex d0056f0c7d..d0056f0c7d 100644 --- a/tools/editor/icons/2x/icon_color_ramp.png +++ b/editor/icons/2x/icon_color_ramp.png diff --git a/tools/editor/icons/2x/icon_color_rect.png b/editor/icons/2x/icon_color_rect.png Binary files differindex 153029ac20..153029ac20 100644 --- a/tools/editor/icons/2x/icon_color_rect.png +++ b/editor/icons/2x/icon_color_rect.png diff --git a/tools/editor/icons/2x/icon_concave_polygon_shape.png b/editor/icons/2x/icon_concave_polygon_shape.png Binary files differindex 82a67ca4d0..82a67ca4d0 100644 --- a/tools/editor/icons/2x/icon_concave_polygon_shape.png +++ b/editor/icons/2x/icon_concave_polygon_shape.png diff --git a/tools/editor/icons/2x/icon_concave_polygon_shape_2d.png b/editor/icons/2x/icon_concave_polygon_shape_2d.png Binary files differindex 1ad3f30950..1ad3f30950 100644 --- a/tools/editor/icons/2x/icon_concave_polygon_shape_2d.png +++ b/editor/icons/2x/icon_concave_polygon_shape_2d.png diff --git a/tools/editor/icons/2x/icon_cone_twist_joint.png b/editor/icons/2x/icon_cone_twist_joint.png Binary files differindex 3aeba5855d..3aeba5855d 100644 --- a/tools/editor/icons/2x/icon_cone_twist_joint.png +++ b/editor/icons/2x/icon_cone_twist_joint.png diff --git a/tools/editor/icons/2x/icon_confirmation_dialog.png b/editor/icons/2x/icon_confirmation_dialog.png Binary files differindex a0df7fcd1e..a0df7fcd1e 100644 --- a/tools/editor/icons/2x/icon_confirmation_dialog.png +++ b/editor/icons/2x/icon_confirmation_dialog.png diff --git a/tools/editor/icons/2x/icon_connect.png b/editor/icons/2x/icon_connect.png Binary files differindex e3f4b8fd12..e3f4b8fd12 100644 --- a/tools/editor/icons/2x/icon_connect.png +++ b/editor/icons/2x/icon_connect.png diff --git a/tools/editor/icons/2x/icon_connection_and_groups.png b/editor/icons/2x/icon_connection_and_groups.png Binary files differindex e7619327f6..e7619327f6 100644 --- a/tools/editor/icons/2x/icon_connection_and_groups.png +++ b/editor/icons/2x/icon_connection_and_groups.png diff --git a/tools/editor/icons/2x/icon_container.png b/editor/icons/2x/icon_container.png Binary files differindex baa09bbea9..baa09bbea9 100644 --- a/tools/editor/icons/2x/icon_container.png +++ b/editor/icons/2x/icon_container.png diff --git a/tools/editor/icons/2x/icon_control.png b/editor/icons/2x/icon_control.png Binary files differindex 82d7457f3b..82d7457f3b 100644 --- a/tools/editor/icons/2x/icon_control.png +++ b/editor/icons/2x/icon_control.png diff --git a/tools/editor/icons/2x/icon_control_align_bottom_center.png b/editor/icons/2x/icon_control_align_bottom_center.png Binary files differindex 9dc738c746..9dc738c746 100644 --- a/tools/editor/icons/2x/icon_control_align_bottom_center.png +++ b/editor/icons/2x/icon_control_align_bottom_center.png diff --git a/tools/editor/icons/2x/icon_control_align_bottom_left.png b/editor/icons/2x/icon_control_align_bottom_left.png Binary files differindex a11a13528d..a11a13528d 100644 --- a/tools/editor/icons/2x/icon_control_align_bottom_left.png +++ b/editor/icons/2x/icon_control_align_bottom_left.png diff --git a/tools/editor/icons/2x/icon_control_align_bottom_right.png b/editor/icons/2x/icon_control_align_bottom_right.png Binary files differindex 7fee3f0752..7fee3f0752 100644 --- a/tools/editor/icons/2x/icon_control_align_bottom_right.png +++ b/editor/icons/2x/icon_control_align_bottom_right.png diff --git a/tools/editor/icons/2x/icon_control_align_bottom_wide.png b/editor/icons/2x/icon_control_align_bottom_wide.png Binary files differindex 573619ccbb..573619ccbb 100644 --- a/tools/editor/icons/2x/icon_control_align_bottom_wide.png +++ b/editor/icons/2x/icon_control_align_bottom_wide.png diff --git a/tools/editor/icons/2x/icon_control_align_center.png b/editor/icons/2x/icon_control_align_center.png Binary files differindex 9850ecd775..9850ecd775 100644 --- a/tools/editor/icons/2x/icon_control_align_center.png +++ b/editor/icons/2x/icon_control_align_center.png diff --git a/tools/editor/icons/2x/icon_control_align_center_left.png b/editor/icons/2x/icon_control_align_center_left.png Binary files differindex 2c48b889ad..2c48b889ad 100644 --- a/tools/editor/icons/2x/icon_control_align_center_left.png +++ b/editor/icons/2x/icon_control_align_center_left.png diff --git a/tools/editor/icons/2x/icon_control_align_center_right.png b/editor/icons/2x/icon_control_align_center_right.png Binary files differindex 4f87a68ad3..4f87a68ad3 100644 --- a/tools/editor/icons/2x/icon_control_align_center_right.png +++ b/editor/icons/2x/icon_control_align_center_right.png diff --git a/tools/editor/icons/2x/icon_control_align_left_center.png b/editor/icons/2x/icon_control_align_left_center.png Binary files differindex c4250dcb37..c4250dcb37 100644 --- a/tools/editor/icons/2x/icon_control_align_left_center.png +++ b/editor/icons/2x/icon_control_align_left_center.png diff --git a/tools/editor/icons/2x/icon_control_align_left_wide.png b/editor/icons/2x/icon_control_align_left_wide.png Binary files differindex 5436397189..5436397189 100644 --- a/tools/editor/icons/2x/icon_control_align_left_wide.png +++ b/editor/icons/2x/icon_control_align_left_wide.png diff --git a/tools/editor/icons/2x/icon_control_align_right_center.png b/editor/icons/2x/icon_control_align_right_center.png Binary files differindex b1fd9a075d..b1fd9a075d 100644 --- a/tools/editor/icons/2x/icon_control_align_right_center.png +++ b/editor/icons/2x/icon_control_align_right_center.png diff --git a/tools/editor/icons/2x/icon_control_align_right_wide.png b/editor/icons/2x/icon_control_align_right_wide.png Binary files differindex 0ce81d3a50..0ce81d3a50 100644 --- a/tools/editor/icons/2x/icon_control_align_right_wide.png +++ b/editor/icons/2x/icon_control_align_right_wide.png diff --git a/tools/editor/icons/2x/icon_control_align_top_center.png b/editor/icons/2x/icon_control_align_top_center.png Binary files differindex baa2601531..baa2601531 100644 --- a/tools/editor/icons/2x/icon_control_align_top_center.png +++ b/editor/icons/2x/icon_control_align_top_center.png diff --git a/tools/editor/icons/2x/icon_control_align_top_left.png b/editor/icons/2x/icon_control_align_top_left.png Binary files differindex 90f3cb6105..90f3cb6105 100644 --- a/tools/editor/icons/2x/icon_control_align_top_left.png +++ b/editor/icons/2x/icon_control_align_top_left.png diff --git a/tools/editor/icons/2x/icon_control_align_top_right.png b/editor/icons/2x/icon_control_align_top_right.png Binary files differindex 040b7b27ee..040b7b27ee 100644 --- a/tools/editor/icons/2x/icon_control_align_top_right.png +++ b/editor/icons/2x/icon_control_align_top_right.png diff --git a/tools/editor/icons/2x/icon_control_align_top_wide.png b/editor/icons/2x/icon_control_align_top_wide.png Binary files differindex 5c14782fc2..5c14782fc2 100644 --- a/tools/editor/icons/2x/icon_control_align_top_wide.png +++ b/editor/icons/2x/icon_control_align_top_wide.png diff --git a/tools/editor/icons/2x/icon_control_align_wide.png b/editor/icons/2x/icon_control_align_wide.png Binary files differindex 383b63d069..383b63d069 100644 --- a/tools/editor/icons/2x/icon_control_align_wide.png +++ b/editor/icons/2x/icon_control_align_wide.png diff --git a/tools/editor/icons/2x/icon_control_hcenter_wide.png b/editor/icons/2x/icon_control_hcenter_wide.png Binary files differindex 840ac557f5..840ac557f5 100644 --- a/tools/editor/icons/2x/icon_control_hcenter_wide.png +++ b/editor/icons/2x/icon_control_hcenter_wide.png diff --git a/tools/editor/icons/2x/icon_control_vcenter_wide.png b/editor/icons/2x/icon_control_vcenter_wide.png Binary files differindex a9e406d4b5..a9e406d4b5 100644 --- a/tools/editor/icons/2x/icon_control_vcenter_wide.png +++ b/editor/icons/2x/icon_control_vcenter_wide.png diff --git a/tools/editor/icons/2x/icon_convex_polygon_shape.png b/editor/icons/2x/icon_convex_polygon_shape.png Binary files differindex 40dd40f299..40dd40f299 100644 --- a/tools/editor/icons/2x/icon_convex_polygon_shape.png +++ b/editor/icons/2x/icon_convex_polygon_shape.png diff --git a/tools/editor/icons/2x/icon_convex_polygon_shape_2d.png b/editor/icons/2x/icon_convex_polygon_shape_2d.png Binary files differindex 6d46a96f9d..6d46a96f9d 100644 --- a/tools/editor/icons/2x/icon_convex_polygon_shape_2d.png +++ b/editor/icons/2x/icon_convex_polygon_shape_2d.png diff --git a/tools/editor/icons/2x/icon_copy_node_path.png b/editor/icons/2x/icon_copy_node_path.png Binary files differindex 056748d20b..056748d20b 100644 --- a/tools/editor/icons/2x/icon_copy_node_path.png +++ b/editor/icons/2x/icon_copy_node_path.png diff --git a/tools/editor/icons/2x/icon_create_new_scene_from.png b/editor/icons/2x/icon_create_new_scene_from.png Binary files differindex cc3be48033..cc3be48033 100644 --- a/tools/editor/icons/2x/icon_create_new_scene_from.png +++ b/editor/icons/2x/icon_create_new_scene_from.png diff --git a/tools/editor/icons/2x/icon_cube_map.png b/editor/icons/2x/icon_cube_map.png Binary files differindex 0edf82a88e..0edf82a88e 100644 --- a/tools/editor/icons/2x/icon_cube_map.png +++ b/editor/icons/2x/icon_cube_map.png diff --git a/tools/editor/icons/2x/icon_curve_2d.png b/editor/icons/2x/icon_curve_2d.png Binary files differindex 69a6f9a9dc..69a6f9a9dc 100644 --- a/tools/editor/icons/2x/icon_curve_2d.png +++ b/editor/icons/2x/icon_curve_2d.png diff --git a/tools/editor/icons/2x/icon_curve_3d.png b/editor/icons/2x/icon_curve_3d.png Binary files differindex e989df4769..e989df4769 100644 --- a/tools/editor/icons/2x/icon_curve_3d.png +++ b/editor/icons/2x/icon_curve_3d.png diff --git a/tools/editor/icons/2x/icon_curve_close.png b/editor/icons/2x/icon_curve_close.png Binary files differindex bd2de0edc8..bd2de0edc8 100644 --- a/tools/editor/icons/2x/icon_curve_close.png +++ b/editor/icons/2x/icon_curve_close.png diff --git a/tools/editor/icons/2x/icon_curve_constant.png b/editor/icons/2x/icon_curve_constant.png Binary files differindex a6e32e0467..a6e32e0467 100644 --- a/tools/editor/icons/2x/icon_curve_constant.png +++ b/editor/icons/2x/icon_curve_constant.png diff --git a/tools/editor/icons/2x/icon_curve_create.png b/editor/icons/2x/icon_curve_create.png Binary files differindex 39f10fd8db..39f10fd8db 100644 --- a/tools/editor/icons/2x/icon_curve_create.png +++ b/editor/icons/2x/icon_curve_create.png diff --git a/tools/editor/icons/2x/icon_curve_curve.png b/editor/icons/2x/icon_curve_curve.png Binary files differindex 6476579a64..6476579a64 100644 --- a/tools/editor/icons/2x/icon_curve_curve.png +++ b/editor/icons/2x/icon_curve_curve.png diff --git a/tools/editor/icons/2x/icon_curve_delete.png b/editor/icons/2x/icon_curve_delete.png Binary files differindex 60c081bbd0..60c081bbd0 100644 --- a/tools/editor/icons/2x/icon_curve_delete.png +++ b/editor/icons/2x/icon_curve_delete.png diff --git a/tools/editor/icons/2x/icon_curve_edit.png b/editor/icons/2x/icon_curve_edit.png Binary files differindex f9701e05cb..f9701e05cb 100644 --- a/tools/editor/icons/2x/icon_curve_edit.png +++ b/editor/icons/2x/icon_curve_edit.png diff --git a/tools/editor/icons/2x/icon_curve_in.png b/editor/icons/2x/icon_curve_in.png Binary files differindex a018d28035..a018d28035 100644 --- a/tools/editor/icons/2x/icon_curve_in.png +++ b/editor/icons/2x/icon_curve_in.png diff --git a/tools/editor/icons/2x/icon_curve_in_out.png b/editor/icons/2x/icon_curve_in_out.png Binary files differindex 8b8b8d7d8a..8b8b8d7d8a 100644 --- a/tools/editor/icons/2x/icon_curve_in_out.png +++ b/editor/icons/2x/icon_curve_in_out.png diff --git a/tools/editor/icons/2x/icon_curve_linear.png b/editor/icons/2x/icon_curve_linear.png Binary files differindex 9733ec6f49..9733ec6f49 100644 --- a/tools/editor/icons/2x/icon_curve_linear.png +++ b/editor/icons/2x/icon_curve_linear.png diff --git a/tools/editor/icons/2x/icon_curve_out.png b/editor/icons/2x/icon_curve_out.png Binary files differindex 49e62ef471..49e62ef471 100644 --- a/tools/editor/icons/2x/icon_curve_out.png +++ b/editor/icons/2x/icon_curve_out.png diff --git a/tools/editor/icons/2x/icon_curve_out_in.png b/editor/icons/2x/icon_curve_out_in.png Binary files differindex cc716cdbe8..cc716cdbe8 100644 --- a/tools/editor/icons/2x/icon_curve_out_in.png +++ b/editor/icons/2x/icon_curve_out_in.png diff --git a/tools/editor/icons/2x/icon_damped_spring_joint_2d.png b/editor/icons/2x/icon_damped_spring_joint_2d.png Binary files differindex a51081efca..a51081efca 100644 --- a/tools/editor/icons/2x/icon_damped_spring_joint_2d.png +++ b/editor/icons/2x/icon_damped_spring_joint_2d.png diff --git a/tools/editor/icons/2x/icon_debug_continue.png b/editor/icons/2x/icon_debug_continue.png Binary files differindex be460bd61d..be460bd61d 100644 --- a/tools/editor/icons/2x/icon_debug_continue.png +++ b/editor/icons/2x/icon_debug_continue.png diff --git a/tools/editor/icons/2x/icon_debug_next.png b/editor/icons/2x/icon_debug_next.png Binary files differindex b52e276f36..b52e276f36 100644 --- a/tools/editor/icons/2x/icon_debug_next.png +++ b/editor/icons/2x/icon_debug_next.png diff --git a/tools/editor/icons/2x/icon_debug_step.png b/editor/icons/2x/icon_debug_step.png Binary files differindex e06a1ad56b..e06a1ad56b 100644 --- a/tools/editor/icons/2x/icon_debug_step.png +++ b/editor/icons/2x/icon_debug_step.png diff --git a/tools/editor/icons/2x/icon_dependency_changed.png b/editor/icons/2x/icon_dependency_changed.png Binary files differindex 3ec13e0e3b..3ec13e0e3b 100644 --- a/tools/editor/icons/2x/icon_dependency_changed.png +++ b/editor/icons/2x/icon_dependency_changed.png diff --git a/tools/editor/icons/2x/icon_dependency_changed_hl.png b/editor/icons/2x/icon_dependency_changed_hl.png Binary files differindex 630ea40554..630ea40554 100644 --- a/tools/editor/icons/2x/icon_dependency_changed_hl.png +++ b/editor/icons/2x/icon_dependency_changed_hl.png diff --git a/tools/editor/icons/2x/icon_dependency_local_changed.png b/editor/icons/2x/icon_dependency_local_changed.png Binary files differindex 9bc2545439..9bc2545439 100644 --- a/tools/editor/icons/2x/icon_dependency_local_changed.png +++ b/editor/icons/2x/icon_dependency_local_changed.png diff --git a/tools/editor/icons/2x/icon_dependency_local_changed_hl.png b/editor/icons/2x/icon_dependency_local_changed_hl.png Binary files differindex 385371df9f..385371df9f 100644 --- a/tools/editor/icons/2x/icon_dependency_local_changed_hl.png +++ b/editor/icons/2x/icon_dependency_local_changed_hl.png diff --git a/tools/editor/icons/2x/icon_dependency_ok.png b/editor/icons/2x/icon_dependency_ok.png Binary files differindex 80fe7f573a..80fe7f573a 100644 --- a/tools/editor/icons/2x/icon_dependency_ok.png +++ b/editor/icons/2x/icon_dependency_ok.png diff --git a/tools/editor/icons/2x/icon_dependency_ok_hl.png b/editor/icons/2x/icon_dependency_ok_hl.png Binary files differindex 9d496688cc..9d496688cc 100644 --- a/tools/editor/icons/2x/icon_dependency_ok_hl.png +++ b/editor/icons/2x/icon_dependency_ok_hl.png diff --git a/tools/editor/icons/2x/icon_directional_light.png b/editor/icons/2x/icon_directional_light.png Binary files differindex 9a35325aec..9a35325aec 100644 --- a/tools/editor/icons/2x/icon_directional_light.png +++ b/editor/icons/2x/icon_directional_light.png diff --git a/tools/editor/icons/2x/icon_distraction_free.png b/editor/icons/2x/icon_distraction_free.png Binary files differindex 034239a4e7..034239a4e7 100644 --- a/tools/editor/icons/2x/icon_distraction_free.png +++ b/editor/icons/2x/icon_distraction_free.png diff --git a/tools/editor/icons/2x/icon_duplicate.png b/editor/icons/2x/icon_duplicate.png Binary files differindex 37996482ae..37996482ae 100644 --- a/tools/editor/icons/2x/icon_duplicate.png +++ b/editor/icons/2x/icon_duplicate.png diff --git a/tools/editor/icons/2x/icon_dynamic_font.png b/editor/icons/2x/icon_dynamic_font.png Binary files differindex 1f1dc52dfb..1f1dc52dfb 100644 --- a/tools/editor/icons/2x/icon_dynamic_font.png +++ b/editor/icons/2x/icon_dynamic_font.png diff --git a/tools/editor/icons/2x/icon_dynamic_font_data.png b/editor/icons/2x/icon_dynamic_font_data.png Binary files differindex 6d76303c81..6d76303c81 100644 --- a/tools/editor/icons/2x/icon_dynamic_font_data.png +++ b/editor/icons/2x/icon_dynamic_font_data.png diff --git a/tools/editor/icons/2x/icon_edit.png b/editor/icons/2x/icon_edit.png Binary files differindex b9ed2c3e58..b9ed2c3e58 100644 --- a/tools/editor/icons/2x/icon_edit.png +++ b/editor/icons/2x/icon_edit.png diff --git a/tools/editor/icons/2x/icon_edit_key.png b/editor/icons/2x/icon_edit_key.png Binary files differindex 58b9a6e749..58b9a6e749 100644 --- a/tools/editor/icons/2x/icon_edit_key.png +++ b/editor/icons/2x/icon_edit_key.png diff --git a/tools/editor/icons/2x/icon_edit_pivot.png b/editor/icons/2x/icon_edit_pivot.png Binary files differindex ac5a2cafb9..ac5a2cafb9 100644 --- a/tools/editor/icons/2x/icon_edit_pivot.png +++ b/editor/icons/2x/icon_edit_pivot.png diff --git a/tools/editor/icons/2x/icon_edit_resource.png b/editor/icons/2x/icon_edit_resource.png Binary files differindex 5ba9b36b0a..5ba9b36b0a 100644 --- a/tools/editor/icons/2x/icon_edit_resource.png +++ b/editor/icons/2x/icon_edit_resource.png diff --git a/tools/editor/icons/2x/icon_editor_3d_handle.png b/editor/icons/2x/icon_editor_3d_handle.png Binary files differindex f76af85cc1..f76af85cc1 100644 --- a/tools/editor/icons/2x/icon_editor_3d_handle.png +++ b/editor/icons/2x/icon_editor_3d_handle.png diff --git a/tools/editor/icons/2x/icon_editor_handle.png b/editor/icons/2x/icon_editor_handle.png Binary files differindex 355d8fe155..355d8fe155 100644 --- a/tools/editor/icons/2x/icon_editor_handle.png +++ b/editor/icons/2x/icon_editor_handle.png diff --git a/tools/editor/icons/2x/icon_editor_pivot.png b/editor/icons/2x/icon_editor_pivot.png Binary files differindex e1666e38de..e1666e38de 100644 --- a/tools/editor/icons/2x/icon_editor_pivot.png +++ b/editor/icons/2x/icon_editor_pivot.png diff --git a/tools/editor/icons/2x/icon_editor_plugin.png b/editor/icons/2x/icon_editor_plugin.png Binary files differindex f6411bb323..f6411bb323 100644 --- a/tools/editor/icons/2x/icon_editor_plugin.png +++ b/editor/icons/2x/icon_editor_plugin.png diff --git a/tools/editor/icons/2x/icon_enum.png b/editor/icons/2x/icon_enum.png Binary files differindex d9df3a3ec3..d9df3a3ec3 100644 --- a/tools/editor/icons/2x/icon_enum.png +++ b/editor/icons/2x/icon_enum.png diff --git a/tools/editor/icons/2x/icon_environment.png b/editor/icons/2x/icon_environment.png Binary files differindex 4c4c30b0e5..4c4c30b0e5 100644 --- a/tools/editor/icons/2x/icon_environment.png +++ b/editor/icons/2x/icon_environment.png diff --git a/tools/editor/icons/2x/icon_error.png b/editor/icons/2x/icon_error.png Binary files differindex a6d79ab41b..a6d79ab41b 100644 --- a/tools/editor/icons/2x/icon_error.png +++ b/editor/icons/2x/icon_error.png diff --git a/tools/editor/icons/2x/icon_error_sign.png b/editor/icons/2x/icon_error_sign.png Binary files differindex f1d16ea669..f1d16ea669 100644 --- a/tools/editor/icons/2x/icon_error_sign.png +++ b/editor/icons/2x/icon_error_sign.png diff --git a/tools/editor/icons/2x/icon_event_player.png b/editor/icons/2x/icon_event_player.png Binary files differindex 2482c576db..2482c576db 100644 --- a/tools/editor/icons/2x/icon_event_player.png +++ b/editor/icons/2x/icon_event_player.png diff --git a/tools/editor/icons/2x/icon_favorites.png b/editor/icons/2x/icon_favorites.png Binary files differindex 7a63835b3d..7a63835b3d 100644 --- a/tools/editor/icons/2x/icon_favorites.png +++ b/editor/icons/2x/icon_favorites.png diff --git a/tools/editor/icons/2x/icon_file.png b/editor/icons/2x/icon_file.png Binary files differindex 683f1141fd..683f1141fd 100644 --- a/tools/editor/icons/2x/icon_file.png +++ b/editor/icons/2x/icon_file.png diff --git a/tools/editor/icons/2x/icon_file_big.png b/editor/icons/2x/icon_file_big.png Binary files differindex 8c86c6b958..8c86c6b958 100644 --- a/tools/editor/icons/2x/icon_file_big.png +++ b/editor/icons/2x/icon_file_big.png diff --git a/tools/editor/icons/2x/icon_file_dialog.png b/editor/icons/2x/icon_file_dialog.png Binary files differindex f19b4d7507..f19b4d7507 100644 --- a/tools/editor/icons/2x/icon_file_dialog.png +++ b/editor/icons/2x/icon_file_dialog.png diff --git a/tools/editor/icons/2x/icon_file_list.png b/editor/icons/2x/icon_file_list.png Binary files differindex d9df3a3ec3..d9df3a3ec3 100644 --- a/tools/editor/icons/2x/icon_file_list.png +++ b/editor/icons/2x/icon_file_list.png diff --git a/tools/editor/icons/2x/icon_file_server.png b/editor/icons/2x/icon_file_server.png Binary files differindex d8021a4067..d8021a4067 100644 --- a/tools/editor/icons/2x/icon_file_server.png +++ b/editor/icons/2x/icon_file_server.png diff --git a/tools/editor/icons/2x/icon_file_server_active.png b/editor/icons/2x/icon_file_server_active.png Binary files differindex f503fe406b..f503fe406b 100644 --- a/tools/editor/icons/2x/icon_file_server_active.png +++ b/editor/icons/2x/icon_file_server_active.png diff --git a/tools/editor/icons/2x/icon_file_thumbnail.png b/editor/icons/2x/icon_file_thumbnail.png Binary files differindex 5a8d282fe1..5a8d282fe1 100644 --- a/tools/editor/icons/2x/icon_file_thumbnail.png +++ b/editor/icons/2x/icon_file_thumbnail.png diff --git a/tools/editor/icons/2x/icon_filesystem.png b/editor/icons/2x/icon_filesystem.png Binary files differindex 4ae0b3edab..4ae0b3edab 100644 --- a/tools/editor/icons/2x/icon_filesystem.png +++ b/editor/icons/2x/icon_filesystem.png diff --git a/tools/editor/icons/2x/icon_fixed_material.png b/editor/icons/2x/icon_fixed_material.png Binary files differindex 21bfb15838..21bfb15838 100644 --- a/tools/editor/icons/2x/icon_fixed_material.png +++ b/editor/icons/2x/icon_fixed_material.png diff --git a/tools/editor/icons/2x/icon_fixed_spatial_material.png b/editor/icons/2x/icon_fixed_spatial_material.png Binary files differindex 65509a590e..65509a590e 100644 --- a/tools/editor/icons/2x/icon_fixed_spatial_material.png +++ b/editor/icons/2x/icon_fixed_spatial_material.png diff --git a/tools/editor/icons/2x/icon_folder.png b/editor/icons/2x/icon_folder.png Binary files differindex 2e797c448b..2e797c448b 100644 --- a/tools/editor/icons/2x/icon_folder.png +++ b/editor/icons/2x/icon_folder.png diff --git a/tools/editor/icons/2x/icon_folder_big.png b/editor/icons/2x/icon_folder_big.png Binary files differindex b89600619a..b89600619a 100644 --- a/tools/editor/icons/2x/icon_folder_big.png +++ b/editor/icons/2x/icon_folder_big.png diff --git a/tools/editor/icons/2x/icon_font.png b/editor/icons/2x/icon_font.png Binary files differindex b78c95a827..b78c95a827 100644 --- a/tools/editor/icons/2x/icon_font.png +++ b/editor/icons/2x/icon_font.png diff --git a/tools/editor/icons/2x/icon_forward.png b/editor/icons/2x/icon_forward.png Binary files differindex 11fd444a04..11fd444a04 100644 --- a/tools/editor/icons/2x/icon_forward.png +++ b/editor/icons/2x/icon_forward.png diff --git a/tools/editor/icons/2x/icon_g_d_script.png b/editor/icons/2x/icon_g_d_script.png Binary files differindex 6143191fc7..6143191fc7 100644 --- a/tools/editor/icons/2x/icon_g_d_script.png +++ b/editor/icons/2x/icon_g_d_script.png diff --git a/tools/editor/icons/2x/icon_g_i_probe.png b/editor/icons/2x/icon_g_i_probe.png Binary files differindex 921f1cca42..921f1cca42 100644 --- a/tools/editor/icons/2x/icon_g_i_probe.png +++ b/editor/icons/2x/icon_g_i_probe.png diff --git a/tools/editor/icons/2x/icon_g_i_probe_data.png b/editor/icons/2x/icon_g_i_probe_data.png Binary files differindex 69c4ed7184..69c4ed7184 100644 --- a/tools/editor/icons/2x/icon_g_i_probe_data.png +++ b/editor/icons/2x/icon_g_i_probe_data.png diff --git a/tools/editor/icons/2x/icon_generic_6_d_o_f_joint.png b/editor/icons/2x/icon_generic_6_d_o_f_joint.png Binary files differindex 506c873376..506c873376 100644 --- a/tools/editor/icons/2x/icon_generic_6_d_o_f_joint.png +++ b/editor/icons/2x/icon_generic_6_d_o_f_joint.png diff --git a/tools/editor/icons/2x/icon_gizmo_directional_light.png b/editor/icons/2x/icon_gizmo_directional_light.png Binary files differindex 0d02788040..0d02788040 100644 --- a/tools/editor/icons/2x/icon_gizmo_directional_light.png +++ b/editor/icons/2x/icon_gizmo_directional_light.png diff --git a/tools/editor/icons/2x/icon_gizmo_light.png b/editor/icons/2x/icon_gizmo_light.png Binary files differindex 2ba9689107..2ba9689107 100644 --- a/tools/editor/icons/2x/icon_gizmo_light.png +++ b/editor/icons/2x/icon_gizmo_light.png diff --git a/tools/editor/icons/2x/icon_gizmo_listener.png b/editor/icons/2x/icon_gizmo_listener.png Binary files differindex bc2908824d..bc2908824d 100644 --- a/tools/editor/icons/2x/icon_gizmo_listener.png +++ b/editor/icons/2x/icon_gizmo_listener.png diff --git a/tools/editor/icons/2x/icon_gizmo_spatial_sample_player.png b/editor/icons/2x/icon_gizmo_spatial_sample_player.png Binary files differindex 78a88c55c1..78a88c55c1 100644 --- a/tools/editor/icons/2x/icon_gizmo_spatial_sample_player.png +++ b/editor/icons/2x/icon_gizmo_spatial_sample_player.png diff --git a/tools/editor/icons/2x/icon_gizmo_spatial_stream_player.png b/editor/icons/2x/icon_gizmo_spatial_stream_player.png Binary files differindex 631f03e874..631f03e874 100644 --- a/tools/editor/icons/2x/icon_gizmo_spatial_stream_player.png +++ b/editor/icons/2x/icon_gizmo_spatial_stream_player.png diff --git a/tools/editor/icons/2x/icon_godot.png b/editor/icons/2x/icon_godot.png Binary files differindex 94d87e23cc..94d87e23cc 100644 --- a/tools/editor/icons/2x/icon_godot.png +++ b/editor/icons/2x/icon_godot.png diff --git a/tools/editor/icons/2x/icon_graph_color_ramp.png b/editor/icons/2x/icon_graph_color_ramp.png Binary files differindex d0056f0c7d..d0056f0c7d 100644 --- a/tools/editor/icons/2x/icon_graph_color_ramp.png +++ b/editor/icons/2x/icon_graph_color_ramp.png diff --git a/tools/editor/icons/2x/icon_graph_comment.png b/editor/icons/2x/icon_graph_comment.png Binary files differindex 3dedbfab52..3dedbfab52 100644 --- a/tools/editor/icons/2x/icon_graph_comment.png +++ b/editor/icons/2x/icon_graph_comment.png diff --git a/tools/editor/icons/2x/icon_graph_cube_uniform.png b/editor/icons/2x/icon_graph_cube_uniform.png Binary files differindex 43ec1fa6d6..43ec1fa6d6 100644 --- a/tools/editor/icons/2x/icon_graph_cube_uniform.png +++ b/editor/icons/2x/icon_graph_cube_uniform.png diff --git a/tools/editor/icons/2x/icon_graph_curve_map.png b/editor/icons/2x/icon_graph_curve_map.png Binary files differindex f29086e503..f29086e503 100644 --- a/tools/editor/icons/2x/icon_graph_curve_map.png +++ b/editor/icons/2x/icon_graph_curve_map.png diff --git a/tools/editor/icons/2x/icon_graph_default_texture.png b/editor/icons/2x/icon_graph_default_texture.png Binary files differindex 45e4470502..45e4470502 100644 --- a/tools/editor/icons/2x/icon_graph_default_texture.png +++ b/editor/icons/2x/icon_graph_default_texture.png diff --git a/tools/editor/icons/2x/icon_graph_edit.png b/editor/icons/2x/icon_graph_edit.png Binary files differindex bd4386839d..bd4386839d 100644 --- a/tools/editor/icons/2x/icon_graph_edit.png +++ b/editor/icons/2x/icon_graph_edit.png diff --git a/tools/editor/icons/2x/icon_graph_input.png b/editor/icons/2x/icon_graph_input.png Binary files differindex 3eeb29a3e7..3eeb29a3e7 100644 --- a/tools/editor/icons/2x/icon_graph_input.png +++ b/editor/icons/2x/icon_graph_input.png diff --git a/tools/editor/icons/2x/icon_graph_node.png b/editor/icons/2x/icon_graph_node.png Binary files differindex 7ce633af4d..7ce633af4d 100644 --- a/tools/editor/icons/2x/icon_graph_node.png +++ b/editor/icons/2x/icon_graph_node.png diff --git a/tools/editor/icons/2x/icon_graph_rgb.png b/editor/icons/2x/icon_graph_rgb.png Binary files differindex a9c39f0222..a9c39f0222 100644 --- a/tools/editor/icons/2x/icon_graph_rgb.png +++ b/editor/icons/2x/icon_graph_rgb.png diff --git a/tools/editor/icons/2x/icon_graph_rgb_op.png b/editor/icons/2x/icon_graph_rgb_op.png Binary files differindex 44812d8dd8..44812d8dd8 100644 --- a/tools/editor/icons/2x/icon_graph_rgb_op.png +++ b/editor/icons/2x/icon_graph_rgb_op.png diff --git a/tools/editor/icons/2x/icon_graph_rgb_uniform.png b/editor/icons/2x/icon_graph_rgb_uniform.png Binary files differindex b06f1d4d8d..b06f1d4d8d 100644 --- a/tools/editor/icons/2x/icon_graph_rgb_uniform.png +++ b/editor/icons/2x/icon_graph_rgb_uniform.png diff --git a/tools/editor/icons/2x/icon_graph_scalar.png b/editor/icons/2x/icon_graph_scalar.png Binary files differindex 382c429d35..382c429d35 100644 --- a/tools/editor/icons/2x/icon_graph_scalar.png +++ b/editor/icons/2x/icon_graph_scalar.png diff --git a/tools/editor/icons/2x/icon_graph_scalar_interp.png b/editor/icons/2x/icon_graph_scalar_interp.png Binary files differindex 430e35470f..430e35470f 100644 --- a/tools/editor/icons/2x/icon_graph_scalar_interp.png +++ b/editor/icons/2x/icon_graph_scalar_interp.png diff --git a/tools/editor/icons/2x/icon_graph_scalar_op.png b/editor/icons/2x/icon_graph_scalar_op.png Binary files differindex b90b6a6190..b90b6a6190 100644 --- a/tools/editor/icons/2x/icon_graph_scalar_op.png +++ b/editor/icons/2x/icon_graph_scalar_op.png diff --git a/tools/editor/icons/2x/icon_graph_scalar_uniform.png b/editor/icons/2x/icon_graph_scalar_uniform.png Binary files differindex dff850df03..dff850df03 100644 --- a/tools/editor/icons/2x/icon_graph_scalar_uniform.png +++ b/editor/icons/2x/icon_graph_scalar_uniform.png diff --git a/tools/editor/icons/2x/icon_graph_scalars_to_vec.png b/editor/icons/2x/icon_graph_scalars_to_vec.png Binary files differindex 266c84e5ae..266c84e5ae 100644 --- a/tools/editor/icons/2x/icon_graph_scalars_to_vec.png +++ b/editor/icons/2x/icon_graph_scalars_to_vec.png diff --git a/tools/editor/icons/2x/icon_graph_texscreen.png b/editor/icons/2x/icon_graph_texscreen.png Binary files differindex 8b1d250129..8b1d250129 100644 --- a/tools/editor/icons/2x/icon_graph_texscreen.png +++ b/editor/icons/2x/icon_graph_texscreen.png diff --git a/tools/editor/icons/2x/icon_graph_texture_uniform.png b/editor/icons/2x/icon_graph_texture_uniform.png Binary files differindex ee211b6c03..ee211b6c03 100644 --- a/tools/editor/icons/2x/icon_graph_texture_uniform.png +++ b/editor/icons/2x/icon_graph_texture_uniform.png diff --git a/tools/editor/icons/2x/icon_graph_time.png b/editor/icons/2x/icon_graph_time.png Binary files differindex 3cf9bf2035..3cf9bf2035 100644 --- a/tools/editor/icons/2x/icon_graph_time.png +++ b/editor/icons/2x/icon_graph_time.png diff --git a/tools/editor/icons/2x/icon_graph_vec_dp.png b/editor/icons/2x/icon_graph_vec_dp.png Binary files differindex e339f6a1e8..e339f6a1e8 100644 --- a/tools/editor/icons/2x/icon_graph_vec_dp.png +++ b/editor/icons/2x/icon_graph_vec_dp.png diff --git a/tools/editor/icons/2x/icon_graph_vec_interp.png b/editor/icons/2x/icon_graph_vec_interp.png Binary files differindex 02e7915748..02e7915748 100644 --- a/tools/editor/icons/2x/icon_graph_vec_interp.png +++ b/editor/icons/2x/icon_graph_vec_interp.png diff --git a/tools/editor/icons/2x/icon_graph_vec_length.png b/editor/icons/2x/icon_graph_vec_length.png Binary files differindex 857e006b6e..857e006b6e 100644 --- a/tools/editor/icons/2x/icon_graph_vec_length.png +++ b/editor/icons/2x/icon_graph_vec_length.png diff --git a/tools/editor/icons/2x/icon_graph_vec_op.png b/editor/icons/2x/icon_graph_vec_op.png Binary files differindex 282336f9d0..282336f9d0 100644 --- a/tools/editor/icons/2x/icon_graph_vec_op.png +++ b/editor/icons/2x/icon_graph_vec_op.png diff --git a/tools/editor/icons/2x/icon_graph_vec_scalar_op.png b/editor/icons/2x/icon_graph_vec_scalar_op.png Binary files differindex 38d355ef06..38d355ef06 100644 --- a/tools/editor/icons/2x/icon_graph_vec_scalar_op.png +++ b/editor/icons/2x/icon_graph_vec_scalar_op.png diff --git a/tools/editor/icons/2x/icon_graph_vec_to_scalars.png b/editor/icons/2x/icon_graph_vec_to_scalars.png Binary files differindex 1b8254b3c6..1b8254b3c6 100644 --- a/tools/editor/icons/2x/icon_graph_vec_to_scalars.png +++ b/editor/icons/2x/icon_graph_vec_to_scalars.png diff --git a/tools/editor/icons/2x/icon_graph_vecs_to_xform.png b/editor/icons/2x/icon_graph_vecs_to_xform.png Binary files differindex a9ed5052be..a9ed5052be 100644 --- a/tools/editor/icons/2x/icon_graph_vecs_to_xform.png +++ b/editor/icons/2x/icon_graph_vecs_to_xform.png diff --git a/tools/editor/icons/2x/icon_graph_vector.png b/editor/icons/2x/icon_graph_vector.png Binary files differindex eb4e94acee..eb4e94acee 100644 --- a/tools/editor/icons/2x/icon_graph_vector.png +++ b/editor/icons/2x/icon_graph_vector.png diff --git a/tools/editor/icons/2x/icon_graph_vector_uniform.png b/editor/icons/2x/icon_graph_vector_uniform.png Binary files differindex 94cde72904..94cde72904 100644 --- a/tools/editor/icons/2x/icon_graph_vector_uniform.png +++ b/editor/icons/2x/icon_graph_vector_uniform.png diff --git a/tools/editor/icons/2x/icon_graph_xform.png b/editor/icons/2x/icon_graph_xform.png Binary files differindex 4d823e2aa9..4d823e2aa9 100644 --- a/tools/editor/icons/2x/icon_graph_xform.png +++ b/editor/icons/2x/icon_graph_xform.png diff --git a/tools/editor/icons/2x/icon_graph_xform_mult.png b/editor/icons/2x/icon_graph_xform_mult.png Binary files differindex a6d41e43a4..a6d41e43a4 100644 --- a/tools/editor/icons/2x/icon_graph_xform_mult.png +++ b/editor/icons/2x/icon_graph_xform_mult.png diff --git a/tools/editor/icons/2x/icon_graph_xform_scalar_func.png b/editor/icons/2x/icon_graph_xform_scalar_func.png Binary files differindex 06826a1ca2..06826a1ca2 100644 --- a/tools/editor/icons/2x/icon_graph_xform_scalar_func.png +++ b/editor/icons/2x/icon_graph_xform_scalar_func.png diff --git a/tools/editor/icons/2x/icon_graph_xform_to_vecs.png b/editor/icons/2x/icon_graph_xform_to_vecs.png Binary files differindex 22125df573..22125df573 100644 --- a/tools/editor/icons/2x/icon_graph_xform_to_vecs.png +++ b/editor/icons/2x/icon_graph_xform_to_vecs.png diff --git a/tools/editor/icons/2x/icon_graph_xform_uniform.png b/editor/icons/2x/icon_graph_xform_uniform.png Binary files differindex b87f9936b8..b87f9936b8 100644 --- a/tools/editor/icons/2x/icon_graph_xform_uniform.png +++ b/editor/icons/2x/icon_graph_xform_uniform.png diff --git a/tools/editor/icons/2x/icon_graph_xform_vec_func.png b/editor/icons/2x/icon_graph_xform_vec_func.png Binary files differindex 007555ff7b..007555ff7b 100644 --- a/tools/editor/icons/2x/icon_graph_xform_vec_func.png +++ b/editor/icons/2x/icon_graph_xform_vec_func.png diff --git a/tools/editor/icons/2x/icon_graph_xform_vec_imult.png b/editor/icons/2x/icon_graph_xform_vec_imult.png Binary files differindex 39e25ef9b3..39e25ef9b3 100644 --- a/tools/editor/icons/2x/icon_graph_xform_vec_imult.png +++ b/editor/icons/2x/icon_graph_xform_vec_imult.png diff --git a/tools/editor/icons/2x/icon_graph_xform_vec_mult.png b/editor/icons/2x/icon_graph_xform_vec_mult.png Binary files differindex 32802fa1ed..32802fa1ed 100644 --- a/tools/editor/icons/2x/icon_graph_xform_vec_mult.png +++ b/editor/icons/2x/icon_graph_xform_vec_mult.png diff --git a/tools/editor/icons/2x/icon_grid.png b/editor/icons/2x/icon_grid.png Binary files differindex 99d896c012..99d896c012 100644 --- a/tools/editor/icons/2x/icon_grid.png +++ b/editor/icons/2x/icon_grid.png diff --git a/tools/editor/icons/2x/icon_grid_container.png b/editor/icons/2x/icon_grid_container.png Binary files differindex b83b1f4347..b83b1f4347 100644 --- a/tools/editor/icons/2x/icon_grid_container.png +++ b/editor/icons/2x/icon_grid_container.png diff --git a/tools/editor/icons/2x/icon_grid_map.png b/editor/icons/2x/icon_grid_map.png Binary files differindex 5bbd16d3df..5bbd16d3df 100644 --- a/tools/editor/icons/2x/icon_grid_map.png +++ b/editor/icons/2x/icon_grid_map.png diff --git a/tools/editor/icons/2x/icon_groove_joint_2d.png b/editor/icons/2x/icon_groove_joint_2d.png Binary files differindex ab9cd4f3eb..ab9cd4f3eb 100644 --- a/tools/editor/icons/2x/icon_groove_joint_2d.png +++ b/editor/icons/2x/icon_groove_joint_2d.png diff --git a/tools/editor/icons/2x/icon_group.png b/editor/icons/2x/icon_group.png Binary files differindex 158efa5fe4..158efa5fe4 100644 --- a/tools/editor/icons/2x/icon_group.png +++ b/editor/icons/2x/icon_group.png diff --git a/tools/editor/icons/2x/icon_groups.png b/editor/icons/2x/icon_groups.png Binary files differindex 203d36071b..203d36071b 100644 --- a/tools/editor/icons/2x/icon_groups.png +++ b/editor/icons/2x/icon_groups.png diff --git a/tools/editor/icons/2x/icon_h_box_container.png b/editor/icons/2x/icon_h_box_container.png Binary files differindex 3767cab1cf..3767cab1cf 100644 --- a/tools/editor/icons/2x/icon_h_box_container.png +++ b/editor/icons/2x/icon_h_box_container.png diff --git a/tools/editor/icons/2x/icon_h_button_array.png b/editor/icons/2x/icon_h_button_array.png Binary files differindex 750eef8267..750eef8267 100644 --- a/tools/editor/icons/2x/icon_h_button_array.png +++ b/editor/icons/2x/icon_h_button_array.png diff --git a/tools/editor/icons/2x/icon_h_scroll_bar.png b/editor/icons/2x/icon_h_scroll_bar.png Binary files differindex d15a36bb16..d15a36bb16 100644 --- a/tools/editor/icons/2x/icon_h_scroll_bar.png +++ b/editor/icons/2x/icon_h_scroll_bar.png diff --git a/tools/editor/icons/2x/icon_h_separator.png b/editor/icons/2x/icon_h_separator.png Binary files differindex 7dd7e1e314..7dd7e1e314 100644 --- a/tools/editor/icons/2x/icon_h_separator.png +++ b/editor/icons/2x/icon_h_separator.png diff --git a/tools/editor/icons/2x/icon_h_slider.png b/editor/icons/2x/icon_h_slider.png Binary files differindex 50bad1cc18..50bad1cc18 100644 --- a/tools/editor/icons/2x/icon_h_slider.png +++ b/editor/icons/2x/icon_h_slider.png diff --git a/tools/editor/icons/2x/icon_h_split_container.png b/editor/icons/2x/icon_h_split_container.png Binary files differindex 33e18946c1..33e18946c1 100644 --- a/tools/editor/icons/2x/icon_h_split_container.png +++ b/editor/icons/2x/icon_h_split_container.png diff --git a/tools/editor/icons/2x/icon_h_t_t_p_request.png b/editor/icons/2x/icon_h_t_t_p_request.png Binary files differindex a334dea4e2..a334dea4e2 100644 --- a/tools/editor/icons/2x/icon_h_t_t_p_request.png +++ b/editor/icons/2x/icon_h_t_t_p_request.png diff --git a/tools/editor/icons/2x/icon_headphones.png b/editor/icons/2x/icon_headphones.png Binary files differindex eca62b9372..eca62b9372 100644 --- a/tools/editor/icons/2x/icon_headphones.png +++ b/editor/icons/2x/icon_headphones.png diff --git a/tools/editor/icons/2x/icon_help.png b/editor/icons/2x/icon_help.png Binary files differindex f16a34c918..f16a34c918 100644 --- a/tools/editor/icons/2x/icon_help.png +++ b/editor/icons/2x/icon_help.png diff --git a/tools/editor/icons/2x/icon_hidden.png b/editor/icons/2x/icon_hidden.png Binary files differindex 09d38c5bef..09d38c5bef 100644 --- a/tools/editor/icons/2x/icon_hidden.png +++ b/editor/icons/2x/icon_hidden.png diff --git a/tools/editor/icons/2x/icon_hinge_joint.png b/editor/icons/2x/icon_hinge_joint.png Binary files differindex b888102573..b888102573 100644 --- a/tools/editor/icons/2x/icon_hinge_joint.png +++ b/editor/icons/2x/icon_hinge_joint.png diff --git a/tools/editor/icons/2x/icon_history.png b/editor/icons/2x/icon_history.png Binary files differindex 153a2b4edf..153a2b4edf 100644 --- a/tools/editor/icons/2x/icon_history.png +++ b/editor/icons/2x/icon_history.png diff --git a/tools/editor/icons/2x/icon_hsize.png b/editor/icons/2x/icon_hsize.png Binary files differindex 3b096dce88..3b096dce88 100644 --- a/tools/editor/icons/2x/icon_hsize.png +++ b/editor/icons/2x/icon_hsize.png diff --git a/tools/editor/icons/2x/icon_image.png b/editor/icons/2x/icon_image.png Binary files differindex 951b2242f1..951b2242f1 100644 --- a/tools/editor/icons/2x/icon_image.png +++ b/editor/icons/2x/icon_image.png diff --git a/tools/editor/icons/2x/icon_image_sky_box.png b/editor/icons/2x/icon_image_sky_box.png Binary files differindex 487178afab..487178afab 100644 --- a/tools/editor/icons/2x/icon_image_sky_box.png +++ b/editor/icons/2x/icon_image_sky_box.png diff --git a/tools/editor/icons/2x/icon_image_texture.png b/editor/icons/2x/icon_image_texture.png Binary files differindex ad5d04dfee..ad5d04dfee 100644 --- a/tools/editor/icons/2x/icon_image_texture.png +++ b/editor/icons/2x/icon_image_texture.png diff --git a/tools/editor/icons/2x/icon_immediate_geometry.png b/editor/icons/2x/icon_immediate_geometry.png Binary files differindex 5fafecadc3..5fafecadc3 100644 --- a/tools/editor/icons/2x/icon_immediate_geometry.png +++ b/editor/icons/2x/icon_immediate_geometry.png diff --git a/tools/editor/icons/2x/icon_import_check.png b/editor/icons/2x/icon_import_check.png Binary files differindex 98e76e2640..98e76e2640 100644 --- a/tools/editor/icons/2x/icon_import_check.png +++ b/editor/icons/2x/icon_import_check.png diff --git a/tools/editor/icons/2x/icon_import_fail.png b/editor/icons/2x/icon_import_fail.png Binary files differindex f89c2f5c75..f89c2f5c75 100644 --- a/tools/editor/icons/2x/icon_import_fail.png +++ b/editor/icons/2x/icon_import_fail.png diff --git a/tools/editor/icons/2x/icon_instance.png b/editor/icons/2x/icon_instance.png Binary files differindex 9b4731de03..9b4731de03 100644 --- a/tools/editor/icons/2x/icon_instance.png +++ b/editor/icons/2x/icon_instance.png diff --git a/tools/editor/icons/2x/icon_instance_options.png b/editor/icons/2x/icon_instance_options.png Binary files differindex 28e2db25f2..28e2db25f2 100644 --- a/tools/editor/icons/2x/icon_instance_options.png +++ b/editor/icons/2x/icon_instance_options.png diff --git a/tools/editor/icons/2x/icon_integer.png b/editor/icons/2x/icon_integer.png Binary files differindex 7ad2f62458..7ad2f62458 100644 --- a/tools/editor/icons/2x/icon_integer.png +++ b/editor/icons/2x/icon_integer.png diff --git a/tools/editor/icons/2x/icon_interp_cubic.png b/editor/icons/2x/icon_interp_cubic.png Binary files differindex e33bb65577..e33bb65577 100644 --- a/tools/editor/icons/2x/icon_interp_cubic.png +++ b/editor/icons/2x/icon_interp_cubic.png diff --git a/tools/editor/icons/2x/icon_interp_linear.png b/editor/icons/2x/icon_interp_linear.png Binary files differindex 205f7febd5..205f7febd5 100644 --- a/tools/editor/icons/2x/icon_interp_linear.png +++ b/editor/icons/2x/icon_interp_linear.png diff --git a/tools/editor/icons/2x/icon_interp_raw.png b/editor/icons/2x/icon_interp_raw.png Binary files differindex 848ef07be6..848ef07be6 100644 --- a/tools/editor/icons/2x/icon_interp_raw.png +++ b/editor/icons/2x/icon_interp_raw.png diff --git a/tools/editor/icons/2x/icon_interp_wrap_clamp.png b/editor/icons/2x/icon_interp_wrap_clamp.png Binary files differindex 93a5bc56ee..93a5bc56ee 100644 --- a/tools/editor/icons/2x/icon_interp_wrap_clamp.png +++ b/editor/icons/2x/icon_interp_wrap_clamp.png diff --git a/tools/editor/icons/2x/icon_interp_wrap_loop.png b/editor/icons/2x/icon_interp_wrap_loop.png Binary files differindex 3e656f7b07..3e656f7b07 100644 --- a/tools/editor/icons/2x/icon_interp_wrap_loop.png +++ b/editor/icons/2x/icon_interp_wrap_loop.png diff --git a/tools/editor/icons/2x/icon_interpolated_camera.png b/editor/icons/2x/icon_interpolated_camera.png Binary files differindex e4551a84ce..e4551a84ce 100644 --- a/tools/editor/icons/2x/icon_interpolated_camera.png +++ b/editor/icons/2x/icon_interpolated_camera.png diff --git a/tools/editor/icons/2x/icon_invalid_key.png b/editor/icons/2x/icon_invalid_key.png Binary files differindex c34f2bc276..c34f2bc276 100644 --- a/tools/editor/icons/2x/icon_invalid_key.png +++ b/editor/icons/2x/icon_invalid_key.png diff --git a/tools/editor/icons/2x/icon_inverse_kinematics.png b/editor/icons/2x/icon_inverse_kinematics.png Binary files differindex 3b10c9590c..3b10c9590c 100644 --- a/tools/editor/icons/2x/icon_inverse_kinematics.png +++ b/editor/icons/2x/icon_inverse_kinematics.png diff --git a/tools/editor/icons/2x/icon_item_list.png b/editor/icons/2x/icon_item_list.png Binary files differindex 11a375caac..11a375caac 100644 --- a/tools/editor/icons/2x/icon_item_list.png +++ b/editor/icons/2x/icon_item_list.png diff --git a/tools/editor/icons/2x/icon_joy_axis.png b/editor/icons/2x/icon_joy_axis.png Binary files differindex 90f3d7a444..90f3d7a444 100644 --- a/tools/editor/icons/2x/icon_joy_axis.png +++ b/editor/icons/2x/icon_joy_axis.png diff --git a/tools/editor/icons/2x/icon_joy_button.png b/editor/icons/2x/icon_joy_button.png Binary files differindex a6b911ba1b..a6b911ba1b 100644 --- a/tools/editor/icons/2x/icon_joy_button.png +++ b/editor/icons/2x/icon_joy_button.png diff --git a/tools/editor/icons/2x/icon_joypad.png b/editor/icons/2x/icon_joypad.png Binary files differindex 285d048544..285d048544 100644 --- a/tools/editor/icons/2x/icon_joypad.png +++ b/editor/icons/2x/icon_joypad.png diff --git a/tools/editor/icons/2x/icon_key.png b/editor/icons/2x/icon_key.png Binary files differindex d0c07bb1ea..d0c07bb1ea 100644 --- a/tools/editor/icons/2x/icon_key.png +++ b/editor/icons/2x/icon_key.png diff --git a/tools/editor/icons/2x/icon_key_hover.png b/editor/icons/2x/icon_key_hover.png Binary files differindex c9894ad8bf..c9894ad8bf 100644 --- a/tools/editor/icons/2x/icon_key_hover.png +++ b/editor/icons/2x/icon_key_hover.png diff --git a/tools/editor/icons/2x/icon_key_invalid.png b/editor/icons/2x/icon_key_invalid.png Binary files differindex c34f2bc276..c34f2bc276 100644 --- a/tools/editor/icons/2x/icon_key_invalid.png +++ b/editor/icons/2x/icon_key_invalid.png diff --git a/tools/editor/icons/2x/icon_key_next.png b/editor/icons/2x/icon_key_next.png Binary files differindex d35b52d3c7..d35b52d3c7 100644 --- a/tools/editor/icons/2x/icon_key_next.png +++ b/editor/icons/2x/icon_key_next.png diff --git a/tools/editor/icons/2x/icon_key_selected.png b/editor/icons/2x/icon_key_selected.png Binary files differindex 243dacb604..243dacb604 100644 --- a/tools/editor/icons/2x/icon_key_selected.png +++ b/editor/icons/2x/icon_key_selected.png diff --git a/tools/editor/icons/2x/icon_key_value.png b/editor/icons/2x/icon_key_value.png Binary files differindex 3863403706..3863403706 100644 --- a/tools/editor/icons/2x/icon_key_value.png +++ b/editor/icons/2x/icon_key_value.png diff --git a/tools/editor/icons/2x/icon_key_xform.png b/editor/icons/2x/icon_key_xform.png Binary files differindex 70c49b5b5f..70c49b5b5f 100644 --- a/tools/editor/icons/2x/icon_key_xform.png +++ b/editor/icons/2x/icon_key_xform.png diff --git a/tools/editor/icons/2x/icon_keyboard.png b/editor/icons/2x/icon_keyboard.png Binary files differindex a7daa06cc2..a7daa06cc2 100644 --- a/tools/editor/icons/2x/icon_keyboard.png +++ b/editor/icons/2x/icon_keyboard.png diff --git a/tools/editor/icons/2x/icon_kinematic_body.png b/editor/icons/2x/icon_kinematic_body.png Binary files differindex 59298dfa72..59298dfa72 100644 --- a/tools/editor/icons/2x/icon_kinematic_body.png +++ b/editor/icons/2x/icon_kinematic_body.png diff --git a/tools/editor/icons/2x/icon_kinematic_body_2d.png b/editor/icons/2x/icon_kinematic_body_2d.png Binary files differindex 5fd3b319ac..5fd3b319ac 100644 --- a/tools/editor/icons/2x/icon_kinematic_body_2d.png +++ b/editor/icons/2x/icon_kinematic_body_2d.png diff --git a/tools/editor/icons/2x/icon_label.png b/editor/icons/2x/icon_label.png Binary files differindex c5e3bc844d..c5e3bc844d 100644 --- a/tools/editor/icons/2x/icon_label.png +++ b/editor/icons/2x/icon_label.png diff --git a/tools/editor/icons/2x/icon_large_texture.png b/editor/icons/2x/icon_large_texture.png Binary files differindex dd1ec86d39..dd1ec86d39 100644 --- a/tools/editor/icons/2x/icon_large_texture.png +++ b/editor/icons/2x/icon_large_texture.png diff --git a/tools/editor/icons/2x/icon_light_2d.png b/editor/icons/2x/icon_light_2d.png Binary files differindex d441659354..d441659354 100644 --- a/tools/editor/icons/2x/icon_light_2d.png +++ b/editor/icons/2x/icon_light_2d.png diff --git a/tools/editor/icons/2x/icon_light_occluder_2d.png b/editor/icons/2x/icon_light_occluder_2d.png Binary files differindex 90e4387297..90e4387297 100644 --- a/tools/editor/icons/2x/icon_light_occluder_2d.png +++ b/editor/icons/2x/icon_light_occluder_2d.png diff --git a/editor/icons/2x/icon_line_2d.png b/editor/icons/2x/icon_line_2d.png Binary files differnew file mode 100644 index 0000000000..27299a2b69 --- /dev/null +++ b/editor/icons/2x/icon_line_2d.png diff --git a/tools/editor/icons/2x/icon_line_edit.png b/editor/icons/2x/icon_line_edit.png Binary files differindex d0c987388f..d0c987388f 100644 --- a/tools/editor/icons/2x/icon_line_edit.png +++ b/editor/icons/2x/icon_line_edit.png diff --git a/tools/editor/icons/2x/icon_line_shape_2d.png b/editor/icons/2x/icon_line_shape_2d.png Binary files differindex 490db5ca5b..490db5ca5b 100644 --- a/tools/editor/icons/2x/icon_line_shape_2d.png +++ b/editor/icons/2x/icon_line_shape_2d.png diff --git a/tools/editor/icons/2x/icon_link_button.png b/editor/icons/2x/icon_link_button.png Binary files differindex 20f300a553..20f300a553 100644 --- a/tools/editor/icons/2x/icon_link_button.png +++ b/editor/icons/2x/icon_link_button.png diff --git a/tools/editor/icons/2x/icon_list_select.png b/editor/icons/2x/icon_list_select.png Binary files differindex 9f7fa5b865..9f7fa5b865 100644 --- a/tools/editor/icons/2x/icon_list_select.png +++ b/editor/icons/2x/icon_list_select.png diff --git a/tools/editor/icons/2x/icon_listener.png b/editor/icons/2x/icon_listener.png Binary files differindex 1441a81bdd..1441a81bdd 100644 --- a/tools/editor/icons/2x/icon_listener.png +++ b/editor/icons/2x/icon_listener.png diff --git a/tools/editor/icons/2x/icon_load.png b/editor/icons/2x/icon_load.png Binary files differindex 759381d636..759381d636 100644 --- a/tools/editor/icons/2x/icon_load.png +++ b/editor/icons/2x/icon_load.png diff --git a/tools/editor/icons/2x/icon_lock.png b/editor/icons/2x/icon_lock.png Binary files differindex 912eaf9eb9..912eaf9eb9 100644 --- a/tools/editor/icons/2x/icon_lock.png +++ b/editor/icons/2x/icon_lock.png diff --git a/tools/editor/icons/2x/icon_loop.png b/editor/icons/2x/icon_loop.png Binary files differindex bd1322ae00..bd1322ae00 100644 --- a/tools/editor/icons/2x/icon_loop.png +++ b/editor/icons/2x/icon_loop.png diff --git a/tools/editor/icons/2x/icon_loop_interpolation.png b/editor/icons/2x/icon_loop_interpolation.png Binary files differindex 6009b50300..6009b50300 100644 --- a/tools/editor/icons/2x/icon_loop_interpolation.png +++ b/editor/icons/2x/icon_loop_interpolation.png diff --git a/tools/editor/icons/2x/icon_main_play.png b/editor/icons/2x/icon_main_play.png Binary files differindex 1f69ce6f17..1f69ce6f17 100644 --- a/tools/editor/icons/2x/icon_main_play.png +++ b/editor/icons/2x/icon_main_play.png diff --git a/tools/editor/icons/2x/icon_main_stop.png b/editor/icons/2x/icon_main_stop.png Binary files differindex 5048141485..5048141485 100644 --- a/tools/editor/icons/2x/icon_main_stop.png +++ b/editor/icons/2x/icon_main_stop.png diff --git a/tools/editor/icons/2x/icon_margin_container.png b/editor/icons/2x/icon_margin_container.png Binary files differindex 10eda265e0..10eda265e0 100644 --- a/tools/editor/icons/2x/icon_margin_container.png +++ b/editor/icons/2x/icon_margin_container.png diff --git a/tools/editor/icons/2x/icon_material_preview_cube.png b/editor/icons/2x/icon_material_preview_cube.png Binary files differindex 2507c969c3..2507c969c3 100644 --- a/tools/editor/icons/2x/icon_material_preview_cube.png +++ b/editor/icons/2x/icon_material_preview_cube.png diff --git a/tools/editor/icons/2x/icon_material_preview_cube_off.png b/editor/icons/2x/icon_material_preview_cube_off.png Binary files differindex 079b3a6645..079b3a6645 100644 --- a/tools/editor/icons/2x/icon_material_preview_cube_off.png +++ b/editor/icons/2x/icon_material_preview_cube_off.png diff --git a/tools/editor/icons/2x/icon_material_preview_light_1.png b/editor/icons/2x/icon_material_preview_light_1.png Binary files differindex f1d0ccdaca..f1d0ccdaca 100644 --- a/tools/editor/icons/2x/icon_material_preview_light_1.png +++ b/editor/icons/2x/icon_material_preview_light_1.png diff --git a/tools/editor/icons/2x/icon_material_preview_light_1_off.png b/editor/icons/2x/icon_material_preview_light_1_off.png Binary files differindex 5a42b7f2a1..5a42b7f2a1 100644 --- a/tools/editor/icons/2x/icon_material_preview_light_1_off.png +++ b/editor/icons/2x/icon_material_preview_light_1_off.png diff --git a/tools/editor/icons/2x/icon_material_preview_light_2.png b/editor/icons/2x/icon_material_preview_light_2.png Binary files differindex 934e696b51..934e696b51 100644 --- a/tools/editor/icons/2x/icon_material_preview_light_2.png +++ b/editor/icons/2x/icon_material_preview_light_2.png diff --git a/tools/editor/icons/2x/icon_material_preview_light_2_off.png b/editor/icons/2x/icon_material_preview_light_2_off.png Binary files differindex 1aa4c0bb79..1aa4c0bb79 100644 --- a/tools/editor/icons/2x/icon_material_preview_light_2_off.png +++ b/editor/icons/2x/icon_material_preview_light_2_off.png diff --git a/tools/editor/icons/2x/icon_material_preview_sphere.png b/editor/icons/2x/icon_material_preview_sphere.png Binary files differindex f5cc7f7819..f5cc7f7819 100644 --- a/tools/editor/icons/2x/icon_material_preview_sphere.png +++ b/editor/icons/2x/icon_material_preview_sphere.png diff --git a/tools/editor/icons/2x/icon_material_preview_sphere_off.png b/editor/icons/2x/icon_material_preview_sphere_off.png Binary files differindex 7ccef62553..7ccef62553 100644 --- a/tools/editor/icons/2x/icon_material_preview_sphere_off.png +++ b/editor/icons/2x/icon_material_preview_sphere_off.png diff --git a/tools/editor/icons/2x/icon_material_shader.png b/editor/icons/2x/icon_material_shader.png Binary files differindex f8c2e15fcb..f8c2e15fcb 100644 --- a/tools/editor/icons/2x/icon_material_shader.png +++ b/editor/icons/2x/icon_material_shader.png diff --git a/tools/editor/icons/2x/icon_material_shader_graph.png b/editor/icons/2x/icon_material_shader_graph.png Binary files differindex a26a9754fe..a26a9754fe 100644 --- a/tools/editor/icons/2x/icon_material_shader_graph.png +++ b/editor/icons/2x/icon_material_shader_graph.png diff --git a/tools/editor/icons/2x/icon_matrix.png b/editor/icons/2x/icon_matrix.png Binary files differindex 0ac4ae170b..0ac4ae170b 100644 --- a/tools/editor/icons/2x/icon_matrix.png +++ b/editor/icons/2x/icon_matrix.png diff --git a/tools/editor/icons/2x/icon_menu_button.png b/editor/icons/2x/icon_menu_button.png Binary files differindex abf9b490e3..abf9b490e3 100644 --- a/tools/editor/icons/2x/icon_menu_button.png +++ b/editor/icons/2x/icon_menu_button.png diff --git a/tools/editor/icons/2x/icon_mesh.png b/editor/icons/2x/icon_mesh.png Binary files differindex 19b9095619..19b9095619 100644 --- a/tools/editor/icons/2x/icon_mesh.png +++ b/editor/icons/2x/icon_mesh.png diff --git a/tools/editor/icons/2x/icon_mesh_instance.png b/editor/icons/2x/icon_mesh_instance.png Binary files differindex 02f3f5ffaa..02f3f5ffaa 100644 --- a/tools/editor/icons/2x/icon_mesh_instance.png +++ b/editor/icons/2x/icon_mesh_instance.png diff --git a/tools/editor/icons/2x/icon_mesh_library.png b/editor/icons/2x/icon_mesh_library.png Binary files differindex 2495e4a037..2495e4a037 100644 --- a/tools/editor/icons/2x/icon_mesh_library.png +++ b/editor/icons/2x/icon_mesh_library.png diff --git a/tools/editor/icons/2x/icon_mini_aabb.png b/editor/icons/2x/icon_mini_aabb.png Binary files differindex 25603eec49..25603eec49 100644 --- a/tools/editor/icons/2x/icon_mini_aabb.png +++ b/editor/icons/2x/icon_mini_aabb.png diff --git a/tools/editor/icons/2x/icon_mini_array.png b/editor/icons/2x/icon_mini_array.png Binary files differindex 5c7bde2639..5c7bde2639 100644 --- a/tools/editor/icons/2x/icon_mini_array.png +++ b/editor/icons/2x/icon_mini_array.png diff --git a/tools/editor/icons/2x/icon_mini_boolean.png b/editor/icons/2x/icon_mini_boolean.png Binary files differindex a7d00056bb..a7d00056bb 100644 --- a/tools/editor/icons/2x/icon_mini_boolean.png +++ b/editor/icons/2x/icon_mini_boolean.png diff --git a/tools/editor/icons/2x/icon_mini_color.png b/editor/icons/2x/icon_mini_color.png Binary files differindex f4059bfb91..f4059bfb91 100644 --- a/tools/editor/icons/2x/icon_mini_color.png +++ b/editor/icons/2x/icon_mini_color.png diff --git a/tools/editor/icons/2x/icon_mini_color_array.png b/editor/icons/2x/icon_mini_color_array.png Binary files differindex 26f1d9fce4..26f1d9fce4 100644 --- a/tools/editor/icons/2x/icon_mini_color_array.png +++ b/editor/icons/2x/icon_mini_color_array.png diff --git a/tools/editor/icons/2x/icon_mini_dictionary.png b/editor/icons/2x/icon_mini_dictionary.png Binary files differindex 241e0587b4..241e0587b4 100644 --- a/tools/editor/icons/2x/icon_mini_dictionary.png +++ b/editor/icons/2x/icon_mini_dictionary.png diff --git a/tools/editor/icons/2x/icon_mini_float.png b/editor/icons/2x/icon_mini_float.png Binary files differindex 6edf76ece1..6edf76ece1 100644 --- a/tools/editor/icons/2x/icon_mini_float.png +++ b/editor/icons/2x/icon_mini_float.png diff --git a/tools/editor/icons/2x/icon_mini_float_array.png b/editor/icons/2x/icon_mini_float_array.png Binary files differindex 5a79fab721..5a79fab721 100644 --- a/tools/editor/icons/2x/icon_mini_float_array.png +++ b/editor/icons/2x/icon_mini_float_array.png diff --git a/tools/editor/icons/2x/icon_mini_image.png b/editor/icons/2x/icon_mini_image.png Binary files differindex 98faebeef2..98faebeef2 100644 --- a/tools/editor/icons/2x/icon_mini_image.png +++ b/editor/icons/2x/icon_mini_image.png diff --git a/tools/editor/icons/2x/icon_mini_input.png b/editor/icons/2x/icon_mini_input.png Binary files differindex 48536e156c..48536e156c 100644 --- a/tools/editor/icons/2x/icon_mini_input.png +++ b/editor/icons/2x/icon_mini_input.png diff --git a/tools/editor/icons/2x/icon_mini_int_array.png b/editor/icons/2x/icon_mini_int_array.png Binary files differindex 790ed44c30..790ed44c30 100644 --- a/tools/editor/icons/2x/icon_mini_int_array.png +++ b/editor/icons/2x/icon_mini_int_array.png diff --git a/tools/editor/icons/2x/icon_mini_integer.png b/editor/icons/2x/icon_mini_integer.png Binary files differindex cd9118f024..cd9118f024 100644 --- a/tools/editor/icons/2x/icon_mini_integer.png +++ b/editor/icons/2x/icon_mini_integer.png diff --git a/tools/editor/icons/2x/icon_mini_matrix3.png b/editor/icons/2x/icon_mini_matrix3.png Binary files differindex 93783177e1..93783177e1 100644 --- a/tools/editor/icons/2x/icon_mini_matrix3.png +++ b/editor/icons/2x/icon_mini_matrix3.png diff --git a/tools/editor/icons/2x/icon_mini_matrix32.png b/editor/icons/2x/icon_mini_matrix32.png Binary files differindex c2f7ea3817..c2f7ea3817 100644 --- a/tools/editor/icons/2x/icon_mini_matrix32.png +++ b/editor/icons/2x/icon_mini_matrix32.png diff --git a/tools/editor/icons/2x/icon_mini_object.png b/editor/icons/2x/icon_mini_object.png Binary files differindex 7987f750ff..7987f750ff 100644 --- a/tools/editor/icons/2x/icon_mini_object.png +++ b/editor/icons/2x/icon_mini_object.png diff --git a/tools/editor/icons/2x/icon_mini_path.png b/editor/icons/2x/icon_mini_path.png Binary files differindex 2e60a46086..2e60a46086 100644 --- a/tools/editor/icons/2x/icon_mini_path.png +++ b/editor/icons/2x/icon_mini_path.png diff --git a/tools/editor/icons/2x/icon_mini_plane.png b/editor/icons/2x/icon_mini_plane.png Binary files differindex 12b5cd26cc..12b5cd26cc 100644 --- a/tools/editor/icons/2x/icon_mini_plane.png +++ b/editor/icons/2x/icon_mini_plane.png diff --git a/tools/editor/icons/2x/icon_mini_quat.png b/editor/icons/2x/icon_mini_quat.png Binary files differindex 9a33902e59..9a33902e59 100644 --- a/tools/editor/icons/2x/icon_mini_quat.png +++ b/editor/icons/2x/icon_mini_quat.png diff --git a/tools/editor/icons/2x/icon_mini_raw_array.png b/editor/icons/2x/icon_mini_raw_array.png Binary files differindex 629b01e72a..629b01e72a 100644 --- a/tools/editor/icons/2x/icon_mini_raw_array.png +++ b/editor/icons/2x/icon_mini_raw_array.png diff --git a/tools/editor/icons/2x/icon_mini_rect2.png b/editor/icons/2x/icon_mini_rect2.png Binary files differindex 88b12e3a3a..88b12e3a3a 100644 --- a/tools/editor/icons/2x/icon_mini_rect2.png +++ b/editor/icons/2x/icon_mini_rect2.png diff --git a/tools/editor/icons/2x/icon_mini_rid.png b/editor/icons/2x/icon_mini_rid.png Binary files differindex 5388c19817..5388c19817 100644 --- a/tools/editor/icons/2x/icon_mini_rid.png +++ b/editor/icons/2x/icon_mini_rid.png diff --git a/tools/editor/icons/2x/icon_mini_string.png b/editor/icons/2x/icon_mini_string.png Binary files differindex 2264451c73..2264451c73 100644 --- a/tools/editor/icons/2x/icon_mini_string.png +++ b/editor/icons/2x/icon_mini_string.png diff --git a/tools/editor/icons/2x/icon_mini_string_array.png b/editor/icons/2x/icon_mini_string_array.png Binary files differindex fa8109b88a..fa8109b88a 100644 --- a/tools/editor/icons/2x/icon_mini_string_array.png +++ b/editor/icons/2x/icon_mini_string_array.png diff --git a/tools/editor/icons/2x/icon_mini_transform.png b/editor/icons/2x/icon_mini_transform.png Binary files differindex 5144871c5c..5144871c5c 100644 --- a/tools/editor/icons/2x/icon_mini_transform.png +++ b/editor/icons/2x/icon_mini_transform.png diff --git a/tools/editor/icons/2x/icon_mini_variant.png b/editor/icons/2x/icon_mini_variant.png Binary files differindex ae0aad16cf..ae0aad16cf 100644 --- a/tools/editor/icons/2x/icon_mini_variant.png +++ b/editor/icons/2x/icon_mini_variant.png diff --git a/tools/editor/icons/2x/icon_mini_vector2.png b/editor/icons/2x/icon_mini_vector2.png Binary files differindex 9e608e61c1..9e608e61c1 100644 --- a/tools/editor/icons/2x/icon_mini_vector2.png +++ b/editor/icons/2x/icon_mini_vector2.png diff --git a/tools/editor/icons/2x/icon_mini_vector2_array.png b/editor/icons/2x/icon_mini_vector2_array.png Binary files differindex 247c0e2592..247c0e2592 100644 --- a/tools/editor/icons/2x/icon_mini_vector2_array.png +++ b/editor/icons/2x/icon_mini_vector2_array.png diff --git a/tools/editor/icons/2x/icon_mini_vector3.png b/editor/icons/2x/icon_mini_vector3.png Binary files differindex 0b84b4628f..0b84b4628f 100644 --- a/tools/editor/icons/2x/icon_mini_vector3.png +++ b/editor/icons/2x/icon_mini_vector3.png diff --git a/tools/editor/icons/2x/icon_mini_vector3_array.png b/editor/icons/2x/icon_mini_vector3_array.png Binary files differindex 68058e4232..68058e4232 100644 --- a/tools/editor/icons/2x/icon_mini_vector3_array.png +++ b/editor/icons/2x/icon_mini_vector3_array.png diff --git a/tools/editor/icons/2x/icon_mirror_x.png b/editor/icons/2x/icon_mirror_x.png Binary files differindex 3b096dce88..3b096dce88 100644 --- a/tools/editor/icons/2x/icon_mirror_x.png +++ b/editor/icons/2x/icon_mirror_x.png diff --git a/tools/editor/icons/2x/icon_mirror_y.png b/editor/icons/2x/icon_mirror_y.png Binary files differindex 4c89b167b5..4c89b167b5 100644 --- a/tools/editor/icons/2x/icon_mirror_y.png +++ b/editor/icons/2x/icon_mirror_y.png diff --git a/tools/editor/icons/2x/icon_mouse.png b/editor/icons/2x/icon_mouse.png Binary files differindex 9c4a76bd4f..9c4a76bd4f 100644 --- a/tools/editor/icons/2x/icon_mouse.png +++ b/editor/icons/2x/icon_mouse.png diff --git a/tools/editor/icons/2x/icon_move_down.png b/editor/icons/2x/icon_move_down.png Binary files differindex 97bbeea631..97bbeea631 100644 --- a/tools/editor/icons/2x/icon_move_down.png +++ b/editor/icons/2x/icon_move_down.png diff --git a/tools/editor/icons/2x/icon_move_point.png b/editor/icons/2x/icon_move_point.png Binary files differindex 5d135ae294..5d135ae294 100644 --- a/tools/editor/icons/2x/icon_move_point.png +++ b/editor/icons/2x/icon_move_point.png diff --git a/tools/editor/icons/2x/icon_move_up.png b/editor/icons/2x/icon_move_up.png Binary files differindex f8f31baeb1..f8f31baeb1 100644 --- a/tools/editor/icons/2x/icon_move_up.png +++ b/editor/icons/2x/icon_move_up.png diff --git a/tools/editor/icons/2x/icon_multi_edit.png b/editor/icons/2x/icon_multi_edit.png Binary files differindex 93360b93f7..93360b93f7 100644 --- a/tools/editor/icons/2x/icon_multi_edit.png +++ b/editor/icons/2x/icon_multi_edit.png diff --git a/tools/editor/icons/2x/icon_multi_line.png b/editor/icons/2x/icon_multi_line.png Binary files differindex 5d43b79e8a..5d43b79e8a 100644 --- a/tools/editor/icons/2x/icon_multi_line.png +++ b/editor/icons/2x/icon_multi_line.png diff --git a/tools/editor/icons/2x/icon_multi_mesh.png b/editor/icons/2x/icon_multi_mesh.png Binary files differindex 35b99d6698..35b99d6698 100644 --- a/tools/editor/icons/2x/icon_multi_mesh.png +++ b/editor/icons/2x/icon_multi_mesh.png diff --git a/tools/editor/icons/2x/icon_multi_mesh_instance.png b/editor/icons/2x/icon_multi_mesh_instance.png Binary files differindex f69768c6e3..f69768c6e3 100644 --- a/tools/editor/icons/2x/icon_multi_mesh_instance.png +++ b/editor/icons/2x/icon_multi_mesh_instance.png diff --git a/tools/editor/icons/2x/icon_multi_node_edit.png b/editor/icons/2x/icon_multi_node_edit.png Binary files differindex 93360b93f7..93360b93f7 100644 --- a/tools/editor/icons/2x/icon_multi_node_edit.png +++ b/editor/icons/2x/icon_multi_node_edit.png diff --git a/tools/editor/icons/2x/icon_navigation.png b/editor/icons/2x/icon_navigation.png Binary files differindex 3cd838d2fc..3cd838d2fc 100644 --- a/tools/editor/icons/2x/icon_navigation.png +++ b/editor/icons/2x/icon_navigation.png diff --git a/tools/editor/icons/2x/icon_navigation_2d.png b/editor/icons/2x/icon_navigation_2d.png Binary files differindex 9efbeaaef0..9efbeaaef0 100644 --- a/tools/editor/icons/2x/icon_navigation_2d.png +++ b/editor/icons/2x/icon_navigation_2d.png diff --git a/tools/editor/icons/2x/icon_navigation_mesh.png b/editor/icons/2x/icon_navigation_mesh.png Binary files differindex 35b893c3bb..35b893c3bb 100644 --- a/tools/editor/icons/2x/icon_navigation_mesh.png +++ b/editor/icons/2x/icon_navigation_mesh.png diff --git a/tools/editor/icons/2x/icon_navigation_mesh_instance.png b/editor/icons/2x/icon_navigation_mesh_instance.png Binary files differindex 404fad2d31..404fad2d31 100644 --- a/tools/editor/icons/2x/icon_navigation_mesh_instance.png +++ b/editor/icons/2x/icon_navigation_mesh_instance.png diff --git a/tools/editor/icons/2x/icon_navigation_polygon.png b/editor/icons/2x/icon_navigation_polygon.png Binary files differindex 3f4845e206..3f4845e206 100644 --- a/tools/editor/icons/2x/icon_navigation_polygon.png +++ b/editor/icons/2x/icon_navigation_polygon.png diff --git a/tools/editor/icons/2x/icon_navigation_polygon_instance.png b/editor/icons/2x/icon_navigation_polygon_instance.png Binary files differindex 5556835d76..5556835d76 100644 --- a/tools/editor/icons/2x/icon_navigation_polygon_instance.png +++ b/editor/icons/2x/icon_navigation_polygon_instance.png diff --git a/tools/editor/icons/2x/icon_new.png b/editor/icons/2x/icon_new.png Binary files differindex 683f1141fd..683f1141fd 100644 --- a/tools/editor/icons/2x/icon_new.png +++ b/editor/icons/2x/icon_new.png diff --git a/tools/editor/icons/2x/icon_nine_patch_rect.png b/editor/icons/2x/icon_nine_patch_rect.png Binary files differindex 5762a0392e..5762a0392e 100644 --- a/tools/editor/icons/2x/icon_nine_patch_rect.png +++ b/editor/icons/2x/icon_nine_patch_rect.png diff --git a/tools/editor/icons/2x/icon_node.png b/editor/icons/2x/icon_node.png Binary files differindex e487f988a2..e487f988a2 100644 --- a/tools/editor/icons/2x/icon_node.png +++ b/editor/icons/2x/icon_node.png diff --git a/tools/editor/icons/2x/icon_node_2d.png b/editor/icons/2x/icon_node_2d.png Binary files differindex 967d4b7da6..967d4b7da6 100644 --- a/tools/editor/icons/2x/icon_node_2d.png +++ b/editor/icons/2x/icon_node_2d.png diff --git a/tools/editor/icons/2x/icon_node_warning.png b/editor/icons/2x/icon_node_warning.png Binary files differindex 397a57bf1f..397a57bf1f 100644 --- a/tools/editor/icons/2x/icon_node_warning.png +++ b/editor/icons/2x/icon_node_warning.png diff --git a/tools/editor/icons/2x/icon_non_favorite.png b/editor/icons/2x/icon_non_favorite.png Binary files differindex 18aa94e6b9..18aa94e6b9 100644 --- a/tools/editor/icons/2x/icon_non_favorite.png +++ b/editor/icons/2x/icon_non_favorite.png diff --git a/tools/editor/icons/2x/icon_object.png b/editor/icons/2x/icon_object.png Binary files differindex dc0a94aacd..dc0a94aacd 100644 --- a/tools/editor/icons/2x/icon_object.png +++ b/editor/icons/2x/icon_object.png diff --git a/tools/editor/icons/2x/icon_occluder_polygon_2d.png b/editor/icons/2x/icon_occluder_polygon_2d.png Binary files differindex e5e27dda32..e5e27dda32 100644 --- a/tools/editor/icons/2x/icon_occluder_polygon_2d.png +++ b/editor/icons/2x/icon_occluder_polygon_2d.png diff --git a/tools/editor/icons/2x/icon_omni_light.png b/editor/icons/2x/icon_omni_light.png Binary files differindex 2c44252b9c..2c44252b9c 100644 --- a/tools/editor/icons/2x/icon_omni_light.png +++ b/editor/icons/2x/icon_omni_light.png diff --git a/tools/editor/icons/2x/icon_open.png b/editor/icons/2x/icon_open.png Binary files differindex 2e797c448b..2e797c448b 100644 --- a/tools/editor/icons/2x/icon_open.png +++ b/editor/icons/2x/icon_open.png diff --git a/tools/editor/icons/2x/icon_option_button.png b/editor/icons/2x/icon_option_button.png Binary files differindex f4438f9efd..f4438f9efd 100644 --- a/tools/editor/icons/2x/icon_option_button.png +++ b/editor/icons/2x/icon_option_button.png diff --git a/tools/editor/icons/2x/icon_override.png b/editor/icons/2x/icon_override.png Binary files differindex d735a1c734..d735a1c734 100644 --- a/tools/editor/icons/2x/icon_override.png +++ b/editor/icons/2x/icon_override.png diff --git a/tools/editor/icons/2x/icon_p_hash_translation.png b/editor/icons/2x/icon_p_hash_translation.png Binary files differindex 0ddc1da282..0ddc1da282 100644 --- a/tools/editor/icons/2x/icon_p_hash_translation.png +++ b/editor/icons/2x/icon_p_hash_translation.png diff --git a/tools/editor/icons/2x/icon_packed_data_container.png b/editor/icons/2x/icon_packed_data_container.png Binary files differindex 958e41ede2..958e41ede2 100644 --- a/tools/editor/icons/2x/icon_packed_data_container.png +++ b/editor/icons/2x/icon_packed_data_container.png diff --git a/tools/editor/icons/2x/icon_packed_scene.png b/editor/icons/2x/icon_packed_scene.png Binary files differindex 00778e8c0a..00778e8c0a 100644 --- a/tools/editor/icons/2x/icon_packed_scene.png +++ b/editor/icons/2x/icon_packed_scene.png diff --git a/tools/editor/icons/2x/icon_panel.png b/editor/icons/2x/icon_panel.png Binary files differindex 23491a7358..23491a7358 100644 --- a/tools/editor/icons/2x/icon_panel.png +++ b/editor/icons/2x/icon_panel.png diff --git a/tools/editor/icons/2x/icon_panel_container.png b/editor/icons/2x/icon_panel_container.png Binary files differindex fb2980ee8b..fb2980ee8b 100644 --- a/tools/editor/icons/2x/icon_panel_container.png +++ b/editor/icons/2x/icon_panel_container.png diff --git a/tools/editor/icons/2x/icon_panels_1.png b/editor/icons/2x/icon_panels_1.png Binary files differindex b8386daa2e..b8386daa2e 100644 --- a/tools/editor/icons/2x/icon_panels_1.png +++ b/editor/icons/2x/icon_panels_1.png diff --git a/tools/editor/icons/2x/icon_panels_2.png b/editor/icons/2x/icon_panels_2.png Binary files differindex 4d9f3ef724..4d9f3ef724 100644 --- a/tools/editor/icons/2x/icon_panels_2.png +++ b/editor/icons/2x/icon_panels_2.png diff --git a/tools/editor/icons/2x/icon_panels_2_alt.png b/editor/icons/2x/icon_panels_2_alt.png Binary files differindex 69aeecce34..69aeecce34 100644 --- a/tools/editor/icons/2x/icon_panels_2_alt.png +++ b/editor/icons/2x/icon_panels_2_alt.png diff --git a/tools/editor/icons/2x/icon_panels_3.png b/editor/icons/2x/icon_panels_3.png Binary files differindex e889504f15..e889504f15 100644 --- a/tools/editor/icons/2x/icon_panels_3.png +++ b/editor/icons/2x/icon_panels_3.png diff --git a/tools/editor/icons/2x/icon_panels_3_alt.png b/editor/icons/2x/icon_panels_3_alt.png Binary files differindex 1e9a17ca75..1e9a17ca75 100644 --- a/tools/editor/icons/2x/icon_panels_3_alt.png +++ b/editor/icons/2x/icon_panels_3_alt.png diff --git a/tools/editor/icons/2x/icon_panels_4.png b/editor/icons/2x/icon_panels_4.png Binary files differindex 62e77e417a..62e77e417a 100644 --- a/tools/editor/icons/2x/icon_panels_4.png +++ b/editor/icons/2x/icon_panels_4.png diff --git a/tools/editor/icons/2x/icon_parallax_background.png b/editor/icons/2x/icon_parallax_background.png Binary files differindex a81046e805..a81046e805 100644 --- a/tools/editor/icons/2x/icon_parallax_background.png +++ b/editor/icons/2x/icon_parallax_background.png diff --git a/tools/editor/icons/2x/icon_parallax_layer.png b/editor/icons/2x/icon_parallax_layer.png Binary files differindex 285999df61..285999df61 100644 --- a/tools/editor/icons/2x/icon_parallax_layer.png +++ b/editor/icons/2x/icon_parallax_layer.png diff --git a/tools/editor/icons/2x/icon_particle_attractor_2d.png b/editor/icons/2x/icon_particle_attractor_2d.png Binary files differindex b985a0ba57..b985a0ba57 100644 --- a/tools/editor/icons/2x/icon_particle_attractor_2d.png +++ b/editor/icons/2x/icon_particle_attractor_2d.png diff --git a/tools/editor/icons/2x/icon_particles.png b/editor/icons/2x/icon_particles.png Binary files differindex 68f30b4213..68f30b4213 100644 --- a/tools/editor/icons/2x/icon_particles.png +++ b/editor/icons/2x/icon_particles.png diff --git a/tools/editor/icons/2x/icon_particles_2d.png b/editor/icons/2x/icon_particles_2d.png Binary files differindex 13fc8a35e6..13fc8a35e6 100644 --- a/tools/editor/icons/2x/icon_particles_2d.png +++ b/editor/icons/2x/icon_particles_2d.png diff --git a/tools/editor/icons/2x/icon_particles_shader.png b/editor/icons/2x/icon_particles_shader.png Binary files differindex 26ce8f6809..26ce8f6809 100644 --- a/tools/editor/icons/2x/icon_particles_shader.png +++ b/editor/icons/2x/icon_particles_shader.png diff --git a/tools/editor/icons/2x/icon_patch_9_rect.png b/editor/icons/2x/icon_patch_9_rect.png Binary files differindex 5762a0392e..5762a0392e 100644 --- a/tools/editor/icons/2x/icon_patch_9_rect.png +++ b/editor/icons/2x/icon_patch_9_rect.png diff --git a/tools/editor/icons/2x/icon_path.png b/editor/icons/2x/icon_path.png Binary files differindex d10cb37bcd..d10cb37bcd 100644 --- a/tools/editor/icons/2x/icon_path.png +++ b/editor/icons/2x/icon_path.png diff --git a/tools/editor/icons/2x/icon_path_2d.png b/editor/icons/2x/icon_path_2d.png Binary files differindex dabf5ccc49..dabf5ccc49 100644 --- a/tools/editor/icons/2x/icon_path_2d.png +++ b/editor/icons/2x/icon_path_2d.png diff --git a/tools/editor/icons/2x/icon_path_follow.png b/editor/icons/2x/icon_path_follow.png Binary files differindex 8538b1f3b9..8538b1f3b9 100644 --- a/tools/editor/icons/2x/icon_path_follow.png +++ b/editor/icons/2x/icon_path_follow.png diff --git a/tools/editor/icons/2x/icon_path_follow_2d.png b/editor/icons/2x/icon_path_follow_2d.png Binary files differindex a83ed837ba..a83ed837ba 100644 --- a/tools/editor/icons/2x/icon_path_follow_2d.png +++ b/editor/icons/2x/icon_path_follow_2d.png diff --git a/tools/editor/icons/2x/icon_pause.png b/editor/icons/2x/icon_pause.png Binary files differindex 35e6b25294..35e6b25294 100644 --- a/tools/editor/icons/2x/icon_pause.png +++ b/editor/icons/2x/icon_pause.png diff --git a/tools/editor/icons/2x/icon_pin.png b/editor/icons/2x/icon_pin.png Binary files differindex d19fe7afef..d19fe7afef 100644 --- a/tools/editor/icons/2x/icon_pin.png +++ b/editor/icons/2x/icon_pin.png diff --git a/tools/editor/icons/2x/icon_pin_joint.png b/editor/icons/2x/icon_pin_joint.png Binary files differindex 304cb39724..304cb39724 100644 --- a/tools/editor/icons/2x/icon_pin_joint.png +++ b/editor/icons/2x/icon_pin_joint.png diff --git a/tools/editor/icons/2x/icon_pin_joint_2d.png b/editor/icons/2x/icon_pin_joint_2d.png Binary files differindex a2302c4756..a2302c4756 100644 --- a/tools/editor/icons/2x/icon_pin_joint_2d.png +++ b/editor/icons/2x/icon_pin_joint_2d.png diff --git a/tools/editor/icons/2x/icon_pin_pressed.png b/editor/icons/2x/icon_pin_pressed.png Binary files differindex d19fe7afef..d19fe7afef 100644 --- a/tools/editor/icons/2x/icon_pin_pressed.png +++ b/editor/icons/2x/icon_pin_pressed.png diff --git a/tools/editor/icons/2x/icon_plane.png b/editor/icons/2x/icon_plane.png Binary files differindex a096e30065..a096e30065 100644 --- a/tools/editor/icons/2x/icon_plane.png +++ b/editor/icons/2x/icon_plane.png diff --git a/tools/editor/icons/2x/icon_plane_shape.png b/editor/icons/2x/icon_plane_shape.png Binary files differindex 8ebd38fe83..8ebd38fe83 100644 --- a/tools/editor/icons/2x/icon_plane_shape.png +++ b/editor/icons/2x/icon_plane_shape.png diff --git a/tools/editor/icons/2x/icon_play.png b/editor/icons/2x/icon_play.png Binary files differindex b84ed23091..b84ed23091 100644 --- a/tools/editor/icons/2x/icon_play.png +++ b/editor/icons/2x/icon_play.png diff --git a/tools/editor/icons/2x/icon_play_backwards.png b/editor/icons/2x/icon_play_backwards.png Binary files differindex 42aeca74e5..42aeca74e5 100644 --- a/tools/editor/icons/2x/icon_play_backwards.png +++ b/editor/icons/2x/icon_play_backwards.png diff --git a/tools/editor/icons/2x/icon_play_custom.png b/editor/icons/2x/icon_play_custom.png Binary files differindex 299ac3ffbc..299ac3ffbc 100644 --- a/tools/editor/icons/2x/icon_play_custom.png +++ b/editor/icons/2x/icon_play_custom.png diff --git a/tools/editor/icons/2x/icon_play_scene.png b/editor/icons/2x/icon_play_scene.png Binary files differindex 948a2e9ba5..948a2e9ba5 100644 --- a/tools/editor/icons/2x/icon_play_scene.png +++ b/editor/icons/2x/icon_play_scene.png diff --git a/tools/editor/icons/2x/icon_play_start.png b/editor/icons/2x/icon_play_start.png Binary files differindex 227e1b6f19..227e1b6f19 100644 --- a/tools/editor/icons/2x/icon_play_start.png +++ b/editor/icons/2x/icon_play_start.png diff --git a/tools/editor/icons/2x/icon_play_start_backwards.png b/editor/icons/2x/icon_play_start_backwards.png Binary files differindex e9a46325f6..e9a46325f6 100644 --- a/tools/editor/icons/2x/icon_play_start_backwards.png +++ b/editor/icons/2x/icon_play_start_backwards.png diff --git a/tools/editor/icons/2x/icon_polygon_2d.png b/editor/icons/2x/icon_polygon_2d.png Binary files differindex 491ebfaa78..491ebfaa78 100644 --- a/tools/editor/icons/2x/icon_polygon_2d.png +++ b/editor/icons/2x/icon_polygon_2d.png diff --git a/tools/editor/icons/2x/icon_polygon_path_finder.png b/editor/icons/2x/icon_polygon_path_finder.png Binary files differindex ee6423c265..ee6423c265 100644 --- a/tools/editor/icons/2x/icon_polygon_path_finder.png +++ b/editor/icons/2x/icon_polygon_path_finder.png diff --git a/tools/editor/icons/2x/icon_popup.png b/editor/icons/2x/icon_popup.png Binary files differindex 7bcfb114da..7bcfb114da 100644 --- a/tools/editor/icons/2x/icon_popup.png +++ b/editor/icons/2x/icon_popup.png diff --git a/tools/editor/icons/2x/icon_popup_dialog.png b/editor/icons/2x/icon_popup_dialog.png Binary files differindex 6920fa27bf..6920fa27bf 100644 --- a/tools/editor/icons/2x/icon_popup_dialog.png +++ b/editor/icons/2x/icon_popup_dialog.png diff --git a/tools/editor/icons/2x/icon_popup_menu.png b/editor/icons/2x/icon_popup_menu.png Binary files differindex 4e0246879b..4e0246879b 100644 --- a/tools/editor/icons/2x/icon_popup_menu.png +++ b/editor/icons/2x/icon_popup_menu.png diff --git a/tools/editor/icons/2x/icon_popup_panel.png b/editor/icons/2x/icon_popup_panel.png Binary files differindex 15d977cc81..15d977cc81 100644 --- a/tools/editor/icons/2x/icon_popup_panel.png +++ b/editor/icons/2x/icon_popup_panel.png diff --git a/tools/editor/icons/2x/icon_portal.png b/editor/icons/2x/icon_portal.png Binary files differindex c934e65fc4..c934e65fc4 100644 --- a/tools/editor/icons/2x/icon_portal.png +++ b/editor/icons/2x/icon_portal.png diff --git a/tools/editor/icons/2x/icon_position_2d.png b/editor/icons/2x/icon_position_2d.png Binary files differindex 176a2300ef..176a2300ef 100644 --- a/tools/editor/icons/2x/icon_position_2d.png +++ b/editor/icons/2x/icon_position_2d.png diff --git a/tools/editor/icons/2x/icon_position_3d.png b/editor/icons/2x/icon_position_3d.png Binary files differindex ed19f011b0..ed19f011b0 100644 --- a/tools/editor/icons/2x/icon_position_3d.png +++ b/editor/icons/2x/icon_position_3d.png diff --git a/tools/editor/icons/2x/icon_progress_1.png b/editor/icons/2x/icon_progress_1.png Binary files differindex b73dded521..b73dded521 100644 --- a/tools/editor/icons/2x/icon_progress_1.png +++ b/editor/icons/2x/icon_progress_1.png diff --git a/tools/editor/icons/2x/icon_progress_2.png b/editor/icons/2x/icon_progress_2.png Binary files differindex 19d89bd369..19d89bd369 100644 --- a/tools/editor/icons/2x/icon_progress_2.png +++ b/editor/icons/2x/icon_progress_2.png diff --git a/tools/editor/icons/2x/icon_progress_3.png b/editor/icons/2x/icon_progress_3.png Binary files differindex ca6b270ef7..ca6b270ef7 100644 --- a/tools/editor/icons/2x/icon_progress_3.png +++ b/editor/icons/2x/icon_progress_3.png diff --git a/tools/editor/icons/2x/icon_progress_4.png b/editor/icons/2x/icon_progress_4.png Binary files differindex 3afa1f845e..3afa1f845e 100644 --- a/tools/editor/icons/2x/icon_progress_4.png +++ b/editor/icons/2x/icon_progress_4.png diff --git a/tools/editor/icons/2x/icon_progress_5.png b/editor/icons/2x/icon_progress_5.png Binary files differindex 8230048771..8230048771 100644 --- a/tools/editor/icons/2x/icon_progress_5.png +++ b/editor/icons/2x/icon_progress_5.png diff --git a/tools/editor/icons/2x/icon_progress_6.png b/editor/icons/2x/icon_progress_6.png Binary files differindex 6c21a5d053..6c21a5d053 100644 --- a/tools/editor/icons/2x/icon_progress_6.png +++ b/editor/icons/2x/icon_progress_6.png diff --git a/tools/editor/icons/2x/icon_progress_7.png b/editor/icons/2x/icon_progress_7.png Binary files differindex 96316b54ca..96316b54ca 100644 --- a/tools/editor/icons/2x/icon_progress_7.png +++ b/editor/icons/2x/icon_progress_7.png diff --git a/tools/editor/icons/2x/icon_progress_8.png b/editor/icons/2x/icon_progress_8.png Binary files differindex 95133b380d..95133b380d 100644 --- a/tools/editor/icons/2x/icon_progress_8.png +++ b/editor/icons/2x/icon_progress_8.png diff --git a/tools/editor/icons/2x/icon_progress_bar.png b/editor/icons/2x/icon_progress_bar.png Binary files differindex f9a243032e..f9a243032e 100644 --- a/tools/editor/icons/2x/icon_progress_bar.png +++ b/editor/icons/2x/icon_progress_bar.png diff --git a/tools/editor/icons/2x/icon_proximity_group.png b/editor/icons/2x/icon_proximity_group.png Binary files differindex 6602afa7ce..6602afa7ce 100644 --- a/tools/editor/icons/2x/icon_proximity_group.png +++ b/editor/icons/2x/icon_proximity_group.png diff --git a/tools/editor/icons/2x/icon_quad.png b/editor/icons/2x/icon_quad.png Binary files differindex a4074cd5b6..a4074cd5b6 100644 --- a/tools/editor/icons/2x/icon_quad.png +++ b/editor/icons/2x/icon_quad.png diff --git a/tools/editor/icons/2x/icon_quat.png b/editor/icons/2x/icon_quat.png Binary files differindex f909e134f4..f909e134f4 100644 --- a/tools/editor/icons/2x/icon_quat.png +++ b/editor/icons/2x/icon_quat.png diff --git a/tools/editor/icons/2x/icon_range.png b/editor/icons/2x/icon_range.png Binary files differindex 92c0934df6..92c0934df6 100644 --- a/tools/editor/icons/2x/icon_range.png +++ b/editor/icons/2x/icon_range.png diff --git a/tools/editor/icons/2x/icon_rating_no_star.png b/editor/icons/2x/icon_rating_no_star.png Binary files differindex f855fd8b56..f855fd8b56 100644 --- a/tools/editor/icons/2x/icon_rating_no_star.png +++ b/editor/icons/2x/icon_rating_no_star.png diff --git a/tools/editor/icons/2x/icon_rating_star.png b/editor/icons/2x/icon_rating_star.png Binary files differindex bfe082d330..bfe082d330 100644 --- a/tools/editor/icons/2x/icon_rating_star.png +++ b/editor/icons/2x/icon_rating_star.png diff --git a/tools/editor/icons/2x/icon_ray_cast.png b/editor/icons/2x/icon_ray_cast.png Binary files differindex 26d958ac2b..26d958ac2b 100644 --- a/tools/editor/icons/2x/icon_ray_cast.png +++ b/editor/icons/2x/icon_ray_cast.png diff --git a/tools/editor/icons/2x/icon_ray_cast_2d.png b/editor/icons/2x/icon_ray_cast_2d.png Binary files differindex e496cdcc2b..e496cdcc2b 100644 --- a/tools/editor/icons/2x/icon_ray_cast_2d.png +++ b/editor/icons/2x/icon_ray_cast_2d.png diff --git a/tools/editor/icons/2x/icon_ray_shape.png b/editor/icons/2x/icon_ray_shape.png Binary files differindex 54a1cf8fe9..54a1cf8fe9 100644 --- a/tools/editor/icons/2x/icon_ray_shape.png +++ b/editor/icons/2x/icon_ray_shape.png diff --git a/tools/editor/icons/2x/icon_ray_shape_2d.png b/editor/icons/2x/icon_ray_shape_2d.png Binary files differindex 2dc7041a93..2dc7041a93 100644 --- a/tools/editor/icons/2x/icon_ray_shape_2d.png +++ b/editor/icons/2x/icon_ray_shape_2d.png diff --git a/tools/editor/icons/2x/icon_rayito.png b/editor/icons/2x/icon_rayito.png Binary files differindex 1959b8bf00..1959b8bf00 100644 --- a/tools/editor/icons/2x/icon_rayito.png +++ b/editor/icons/2x/icon_rayito.png diff --git a/tools/editor/icons/2x/icon_real.png b/editor/icons/2x/icon_real.png Binary files differindex 5ec56ebcac..5ec56ebcac 100644 --- a/tools/editor/icons/2x/icon_real.png +++ b/editor/icons/2x/icon_real.png diff --git a/tools/editor/icons/2x/icon_rectangle_shape_2d.png b/editor/icons/2x/icon_rectangle_shape_2d.png Binary files differindex 51a93cdb1d..51a93cdb1d 100644 --- a/tools/editor/icons/2x/icon_rectangle_shape_2d.png +++ b/editor/icons/2x/icon_rectangle_shape_2d.png diff --git a/tools/editor/icons/2x/icon_reference_rect.png b/editor/icons/2x/icon_reference_rect.png Binary files differindex 63fe559fa7..63fe559fa7 100644 --- a/tools/editor/icons/2x/icon_reference_rect.png +++ b/editor/icons/2x/icon_reference_rect.png diff --git a/tools/editor/icons/2x/icon_reflection_probe.png b/editor/icons/2x/icon_reflection_probe.png Binary files differindex 5604b403df..5604b403df 100644 --- a/tools/editor/icons/2x/icon_reflection_probe.png +++ b/editor/icons/2x/icon_reflection_probe.png diff --git a/tools/editor/icons/2x/icon_region_edit.png b/editor/icons/2x/icon_region_edit.png Binary files differindex bcaba769d4..bcaba769d4 100644 --- a/tools/editor/icons/2x/icon_region_edit.png +++ b/editor/icons/2x/icon_region_edit.png diff --git a/tools/editor/icons/2x/icon_reload.png b/editor/icons/2x/icon_reload.png Binary files differindex b13c858124..b13c858124 100644 --- a/tools/editor/icons/2x/icon_reload.png +++ b/editor/icons/2x/icon_reload.png diff --git a/tools/editor/icons/2x/icon_reload_small.png b/editor/icons/2x/icon_reload_small.png Binary files differindex a278c34e4c..a278c34e4c 100644 --- a/tools/editor/icons/2x/icon_reload_small.png +++ b/editor/icons/2x/icon_reload_small.png diff --git a/tools/editor/icons/2x/icon_remote.png b/editor/icons/2x/icon_remote.png Binary files differindex 87883ed7e1..87883ed7e1 100644 --- a/tools/editor/icons/2x/icon_remote.png +++ b/editor/icons/2x/icon_remote.png diff --git a/tools/editor/icons/2x/icon_remote_transform.png b/editor/icons/2x/icon_remote_transform.png Binary files differindex dad528615a..dad528615a 100644 --- a/tools/editor/icons/2x/icon_remote_transform.png +++ b/editor/icons/2x/icon_remote_transform.png diff --git a/tools/editor/icons/2x/icon_remote_transform_2d.png b/editor/icons/2x/icon_remote_transform_2d.png Binary files differindex 7ef3e06f81..7ef3e06f81 100644 --- a/tools/editor/icons/2x/icon_remote_transform_2d.png +++ b/editor/icons/2x/icon_remote_transform_2d.png diff --git a/tools/editor/icons/2x/icon_remove.png b/editor/icons/2x/icon_remove.png Binary files differindex dbed177745..dbed177745 100644 --- a/tools/editor/icons/2x/icon_remove.png +++ b/editor/icons/2x/icon_remove.png diff --git a/tools/editor/icons/2x/icon_rename.png b/editor/icons/2x/icon_rename.png Binary files differindex a306a7b8c8..a306a7b8c8 100644 --- a/tools/editor/icons/2x/icon_rename.png +++ b/editor/icons/2x/icon_rename.png diff --git a/tools/editor/icons/2x/icon_reparent.png b/editor/icons/2x/icon_reparent.png Binary files differindex 3063da4b43..3063da4b43 100644 --- a/tools/editor/icons/2x/icon_reparent.png +++ b/editor/icons/2x/icon_reparent.png diff --git a/tools/editor/icons/2x/icon_resource_preloader.png b/editor/icons/2x/icon_resource_preloader.png Binary files differindex d48f37d21f..d48f37d21f 100644 --- a/tools/editor/icons/2x/icon_resource_preloader.png +++ b/editor/icons/2x/icon_resource_preloader.png diff --git a/tools/editor/icons/2x/icon_rich_text_label.png b/editor/icons/2x/icon_rich_text_label.png Binary files differindex 598913d896..598913d896 100644 --- a/tools/editor/icons/2x/icon_rich_text_label.png +++ b/editor/icons/2x/icon_rich_text_label.png diff --git a/tools/editor/icons/2x/icon_rigid_body.png b/editor/icons/2x/icon_rigid_body.png Binary files differindex 3b682f0033..3b682f0033 100644 --- a/tools/editor/icons/2x/icon_rigid_body.png +++ b/editor/icons/2x/icon_rigid_body.png diff --git a/tools/editor/icons/2x/icon_rigid_body_2d.png b/editor/icons/2x/icon_rigid_body_2d.png Binary files differindex bd45d2f01a..bd45d2f01a 100644 --- a/tools/editor/icons/2x/icon_rigid_body_2d.png +++ b/editor/icons/2x/icon_rigid_body_2d.png diff --git a/tools/editor/icons/2x/icon_room.png b/editor/icons/2x/icon_room.png Binary files differindex 946f95e955..946f95e955 100644 --- a/tools/editor/icons/2x/icon_room.png +++ b/editor/icons/2x/icon_room.png diff --git a/tools/editor/icons/2x/icon_room_bounds.png b/editor/icons/2x/icon_room_bounds.png Binary files differindex 94da9c437d..94da9c437d 100644 --- a/tools/editor/icons/2x/icon_room_bounds.png +++ b/editor/icons/2x/icon_room_bounds.png diff --git a/tools/editor/icons/2x/icon_rotate_0.png b/editor/icons/2x/icon_rotate_0.png Binary files differindex a4524b7856..a4524b7856 100644 --- a/tools/editor/icons/2x/icon_rotate_0.png +++ b/editor/icons/2x/icon_rotate_0.png diff --git a/tools/editor/icons/2x/icon_rotate_180.png b/editor/icons/2x/icon_rotate_180.png Binary files differindex a00e1b727c..a00e1b727c 100644 --- a/tools/editor/icons/2x/icon_rotate_180.png +++ b/editor/icons/2x/icon_rotate_180.png diff --git a/tools/editor/icons/2x/icon_rotate_270.png b/editor/icons/2x/icon_rotate_270.png Binary files differindex be56f080a9..be56f080a9 100644 --- a/tools/editor/icons/2x/icon_rotate_270.png +++ b/editor/icons/2x/icon_rotate_270.png diff --git a/tools/editor/icons/2x/icon_rotate_90.png b/editor/icons/2x/icon_rotate_90.png Binary files differindex a3a937892d..a3a937892d 100644 --- a/tools/editor/icons/2x/icon_rotate_90.png +++ b/editor/icons/2x/icon_rotate_90.png diff --git a/tools/editor/icons/2x/icon_sample.png b/editor/icons/2x/icon_sample.png Binary files differindex b01674f923..b01674f923 100644 --- a/tools/editor/icons/2x/icon_sample.png +++ b/editor/icons/2x/icon_sample.png diff --git a/tools/editor/icons/2x/icon_sample_library.png b/editor/icons/2x/icon_sample_library.png Binary files differindex 3f76a78aca..3f76a78aca 100644 --- a/tools/editor/icons/2x/icon_sample_library.png +++ b/editor/icons/2x/icon_sample_library.png diff --git a/tools/editor/icons/2x/icon_sample_player.png b/editor/icons/2x/icon_sample_player.png Binary files differindex aac4c1bbed..aac4c1bbed 100644 --- a/tools/editor/icons/2x/icon_sample_player.png +++ b/editor/icons/2x/icon_sample_player.png diff --git a/tools/editor/icons/2x/icon_sample_player_2d.png b/editor/icons/2x/icon_sample_player_2d.png Binary files differindex 9308d43128..9308d43128 100644 --- a/tools/editor/icons/2x/icon_sample_player_2d.png +++ b/editor/icons/2x/icon_sample_player_2d.png diff --git a/tools/editor/icons/2x/icon_save.png b/editor/icons/2x/icon_save.png Binary files differindex 0a643f2c88..0a643f2c88 100644 --- a/tools/editor/icons/2x/icon_save.png +++ b/editor/icons/2x/icon_save.png diff --git a/tools/editor/icons/2x/icon_script.png b/editor/icons/2x/icon_script.png Binary files differindex 6f54c20442..6f54c20442 100644 --- a/tools/editor/icons/2x/icon_script.png +++ b/editor/icons/2x/icon_script.png diff --git a/tools/editor/icons/2x/icon_script_create.png b/editor/icons/2x/icon_script_create.png Binary files differindex f1e25efe1c..f1e25efe1c 100644 --- a/tools/editor/icons/2x/icon_script_create.png +++ b/editor/icons/2x/icon_script_create.png diff --git a/tools/editor/icons/2x/icon_script_remove.png b/editor/icons/2x/icon_script_remove.png Binary files differindex f9a1bb19a4..f9a1bb19a4 100644 --- a/tools/editor/icons/2x/icon_script_remove.png +++ b/editor/icons/2x/icon_script_remove.png diff --git a/tools/editor/icons/2x/icon_scroll_bar.png b/editor/icons/2x/icon_scroll_bar.png Binary files differindex d15a36bb16..d15a36bb16 100644 --- a/tools/editor/icons/2x/icon_scroll_bar.png +++ b/editor/icons/2x/icon_scroll_bar.png diff --git a/tools/editor/icons/2x/icon_scroll_container.png b/editor/icons/2x/icon_scroll_container.png Binary files differindex 4ffe2f78f5..4ffe2f78f5 100644 --- a/tools/editor/icons/2x/icon_scroll_container.png +++ b/editor/icons/2x/icon_scroll_container.png diff --git a/tools/editor/icons/2x/icon_segment_shape_2d.png b/editor/icons/2x/icon_segment_shape_2d.png Binary files differindex 43d5d837cc..43d5d837cc 100644 --- a/tools/editor/icons/2x/icon_segment_shape_2d.png +++ b/editor/icons/2x/icon_segment_shape_2d.png diff --git a/tools/editor/icons/2x/icon_shader.png b/editor/icons/2x/icon_shader.png Binary files differindex f8c2e15fcb..f8c2e15fcb 100644 --- a/tools/editor/icons/2x/icon_shader.png +++ b/editor/icons/2x/icon_shader.png diff --git a/tools/editor/icons/2x/icon_shader_material.png b/editor/icons/2x/icon_shader_material.png Binary files differindex f8c2e15fcb..f8c2e15fcb 100644 --- a/tools/editor/icons/2x/icon_shader_material.png +++ b/editor/icons/2x/icon_shader_material.png diff --git a/tools/editor/icons/2x/icon_short_cut.png b/editor/icons/2x/icon_short_cut.png Binary files differindex 58c3e08ca4..58c3e08ca4 100644 --- a/tools/editor/icons/2x/icon_short_cut.png +++ b/editor/icons/2x/icon_short_cut.png diff --git a/tools/editor/icons/2x/icon_signal.png b/editor/icons/2x/icon_signal.png Binary files differindex 22b6da361e..22b6da361e 100644 --- a/tools/editor/icons/2x/icon_signal.png +++ b/editor/icons/2x/icon_signal.png diff --git a/tools/editor/icons/2x/icon_skeleton.png b/editor/icons/2x/icon_skeleton.png Binary files differindex 5345dfbd5c..5345dfbd5c 100644 --- a/tools/editor/icons/2x/icon_skeleton.png +++ b/editor/icons/2x/icon_skeleton.png diff --git a/tools/editor/icons/2x/icon_slider_joint.png b/editor/icons/2x/icon_slider_joint.png Binary files differindex 626479152f..626479152f 100644 --- a/tools/editor/icons/2x/icon_slider_joint.png +++ b/editor/icons/2x/icon_slider_joint.png diff --git a/tools/editor/icons/2x/icon_slot.png b/editor/icons/2x/icon_slot.png Binary files differindex 2176544c79..2176544c79 100644 --- a/tools/editor/icons/2x/icon_slot.png +++ b/editor/icons/2x/icon_slot.png diff --git a/tools/editor/icons/2x/icon_snap.png b/editor/icons/2x/icon_snap.png Binary files differindex 509b1c73f3..509b1c73f3 100644 --- a/tools/editor/icons/2x/icon_snap.png +++ b/editor/icons/2x/icon_snap.png diff --git a/tools/editor/icons/2x/icon_sound_room_params.png b/editor/icons/2x/icon_sound_room_params.png Binary files differindex 32927eaabc..32927eaabc 100644 --- a/tools/editor/icons/2x/icon_sound_room_params.png +++ b/editor/icons/2x/icon_sound_room_params.png diff --git a/tools/editor/icons/2x/icon_spatial.png b/editor/icons/2x/icon_spatial.png Binary files differindex 999771a7fe..999771a7fe 100644 --- a/tools/editor/icons/2x/icon_spatial.png +++ b/editor/icons/2x/icon_spatial.png diff --git a/tools/editor/icons/2x/icon_spatial_sample_player.png b/editor/icons/2x/icon_spatial_sample_player.png Binary files differindex f1926c446e..f1926c446e 100644 --- a/tools/editor/icons/2x/icon_spatial_sample_player.png +++ b/editor/icons/2x/icon_spatial_sample_player.png diff --git a/tools/editor/icons/2x/icon_spatial_shader.png b/editor/icons/2x/icon_spatial_shader.png Binary files differindex 68f6cf8dac..68f6cf8dac 100644 --- a/tools/editor/icons/2x/icon_spatial_shader.png +++ b/editor/icons/2x/icon_spatial_shader.png diff --git a/tools/editor/icons/2x/icon_spatial_stream_player.png b/editor/icons/2x/icon_spatial_stream_player.png Binary files differindex 835c5c0bbc..835c5c0bbc 100644 --- a/tools/editor/icons/2x/icon_spatial_stream_player.png +++ b/editor/icons/2x/icon_spatial_stream_player.png diff --git a/tools/editor/icons/2x/icon_sphere_shape.png b/editor/icons/2x/icon_sphere_shape.png Binary files differindex bdb7881e70..bdb7881e70 100644 --- a/tools/editor/icons/2x/icon_sphere_shape.png +++ b/editor/icons/2x/icon_sphere_shape.png diff --git a/tools/editor/icons/2x/icon_spin_box.png b/editor/icons/2x/icon_spin_box.png Binary files differindex 3d12664b86..3d12664b86 100644 --- a/tools/editor/icons/2x/icon_spin_box.png +++ b/editor/icons/2x/icon_spin_box.png diff --git a/tools/editor/icons/2x/icon_spot_light.png b/editor/icons/2x/icon_spot_light.png Binary files differindex e7aa35cbbf..e7aa35cbbf 100644 --- a/tools/editor/icons/2x/icon_spot_light.png +++ b/editor/icons/2x/icon_spot_light.png diff --git a/tools/editor/icons/2x/icon_sprite.png b/editor/icons/2x/icon_sprite.png Binary files differindex 3f18d313e7..3f18d313e7 100644 --- a/tools/editor/icons/2x/icon_sprite.png +++ b/editor/icons/2x/icon_sprite.png diff --git a/tools/editor/icons/2x/icon_sprite_3d.png b/editor/icons/2x/icon_sprite_3d.png Binary files differindex d3a491b9ee..d3a491b9ee 100644 --- a/tools/editor/icons/2x/icon_sprite_3d.png +++ b/editor/icons/2x/icon_sprite_3d.png diff --git a/tools/editor/icons/2x/icon_sprite_frames.png b/editor/icons/2x/icon_sprite_frames.png Binary files differindex 263f5c4aad..263f5c4aad 100644 --- a/tools/editor/icons/2x/icon_sprite_frames.png +++ b/editor/icons/2x/icon_sprite_frames.png diff --git a/tools/editor/icons/2x/icon_static_body.png b/editor/icons/2x/icon_static_body.png Binary files differindex 74f65ef490..74f65ef490 100644 --- a/tools/editor/icons/2x/icon_static_body.png +++ b/editor/icons/2x/icon_static_body.png diff --git a/tools/editor/icons/2x/icon_static_body_2d.png b/editor/icons/2x/icon_static_body_2d.png Binary files differindex 220c829edd..220c829edd 100644 --- a/tools/editor/icons/2x/icon_static_body_2d.png +++ b/editor/icons/2x/icon_static_body_2d.png diff --git a/tools/editor/icons/2x/icon_stream_player.png b/editor/icons/2x/icon_stream_player.png Binary files differindex 8ff471cb8a..8ff471cb8a 100644 --- a/tools/editor/icons/2x/icon_stream_player.png +++ b/editor/icons/2x/icon_stream_player.png diff --git a/tools/editor/icons/2x/icon_string.png b/editor/icons/2x/icon_string.png Binary files differindex e25a81f24e..e25a81f24e 100644 --- a/tools/editor/icons/2x/icon_string.png +++ b/editor/icons/2x/icon_string.png diff --git a/tools/editor/icons/2x/icon_style_box_empty.png b/editor/icons/2x/icon_style_box_empty.png Binary files differindex e790af4de4..e790af4de4 100644 --- a/tools/editor/icons/2x/icon_style_box_empty.png +++ b/editor/icons/2x/icon_style_box_empty.png diff --git a/tools/editor/icons/2x/icon_style_box_flat.png b/editor/icons/2x/icon_style_box_flat.png Binary files differindex 1cd5c7f69a..1cd5c7f69a 100644 --- a/tools/editor/icons/2x/icon_style_box_flat.png +++ b/editor/icons/2x/icon_style_box_flat.png diff --git a/tools/editor/icons/2x/icon_style_box_texture.png b/editor/icons/2x/icon_style_box_texture.png Binary files differindex a93e0228bd..a93e0228bd 100644 --- a/tools/editor/icons/2x/icon_style_box_texture.png +++ b/editor/icons/2x/icon_style_box_texture.png diff --git a/tools/editor/icons/2x/icon_tab_container.png b/editor/icons/2x/icon_tab_container.png Binary files differindex 93b7161a69..93b7161a69 100644 --- a/tools/editor/icons/2x/icon_tab_container.png +++ b/editor/icons/2x/icon_tab_container.png diff --git a/tools/editor/icons/2x/icon_tabs.png b/editor/icons/2x/icon_tabs.png Binary files differindex 6c317010c8..6c317010c8 100644 --- a/tools/editor/icons/2x/icon_tabs.png +++ b/editor/icons/2x/icon_tabs.png diff --git a/tools/editor/icons/2x/icon_test_cube.png b/editor/icons/2x/icon_test_cube.png Binary files differindex f2e523be3f..f2e523be3f 100644 --- a/tools/editor/icons/2x/icon_test_cube.png +++ b/editor/icons/2x/icon_test_cube.png diff --git a/tools/editor/icons/2x/icon_text_edit.png b/editor/icons/2x/icon_text_edit.png Binary files differindex 4fd92e518e..4fd92e518e 100644 --- a/tools/editor/icons/2x/icon_text_edit.png +++ b/editor/icons/2x/icon_text_edit.png diff --git a/tools/editor/icons/2x/icon_texture.png b/editor/icons/2x/icon_texture.png Binary files differindex ad5d04dfee..ad5d04dfee 100644 --- a/tools/editor/icons/2x/icon_texture.png +++ b/editor/icons/2x/icon_texture.png diff --git a/tools/editor/icons/2x/icon_texture_button.png b/editor/icons/2x/icon_texture_button.png Binary files differindex 84494209d7..84494209d7 100644 --- a/tools/editor/icons/2x/icon_texture_button.png +++ b/editor/icons/2x/icon_texture_button.png diff --git a/tools/editor/icons/2x/icon_texture_progress.png b/editor/icons/2x/icon_texture_progress.png Binary files differindex c11c1bbe4b..c11c1bbe4b 100644 --- a/tools/editor/icons/2x/icon_texture_progress.png +++ b/editor/icons/2x/icon_texture_progress.png diff --git a/tools/editor/icons/2x/icon_texture_rect.png b/editor/icons/2x/icon_texture_rect.png Binary files differindex 50d715dd09..50d715dd09 100644 --- a/tools/editor/icons/2x/icon_texture_rect.png +++ b/editor/icons/2x/icon_texture_rect.png diff --git a/tools/editor/icons/2x/icon_theme.png b/editor/icons/2x/icon_theme.png Binary files differindex 55b51428dd..55b51428dd 100644 --- a/tools/editor/icons/2x/icon_theme.png +++ b/editor/icons/2x/icon_theme.png diff --git a/tools/editor/icons/2x/icon_tile_map.png b/editor/icons/2x/icon_tile_map.png Binary files differindex fd98fb6a39..fd98fb6a39 100644 --- a/tools/editor/icons/2x/icon_tile_map.png +++ b/editor/icons/2x/icon_tile_map.png diff --git a/tools/editor/icons/2x/icon_tile_set.png b/editor/icons/2x/icon_tile_set.png Binary files differindex 9fbd0b4719..9fbd0b4719 100644 --- a/tools/editor/icons/2x/icon_tile_set.png +++ b/editor/icons/2x/icon_tile_set.png diff --git a/tools/editor/icons/2x/icon_timer.png b/editor/icons/2x/icon_timer.png Binary files differindex b0df31d803..b0df31d803 100644 --- a/tools/editor/icons/2x/icon_timer.png +++ b/editor/icons/2x/icon_timer.png diff --git a/tools/editor/icons/2x/icon_tool_button.png b/editor/icons/2x/icon_tool_button.png Binary files differindex 091fa8334f..091fa8334f 100644 --- a/tools/editor/icons/2x/icon_tool_button.png +++ b/editor/icons/2x/icon_tool_button.png diff --git a/tools/editor/icons/2x/icon_tool_move.png b/editor/icons/2x/icon_tool_move.png Binary files differindex 86419cb6a9..86419cb6a9 100644 --- a/tools/editor/icons/2x/icon_tool_move.png +++ b/editor/icons/2x/icon_tool_move.png diff --git a/tools/editor/icons/2x/icon_tool_pan.png b/editor/icons/2x/icon_tool_pan.png Binary files differindex b7a6c3566f..b7a6c3566f 100644 --- a/tools/editor/icons/2x/icon_tool_pan.png +++ b/editor/icons/2x/icon_tool_pan.png diff --git a/tools/editor/icons/2x/icon_tool_rotate.png b/editor/icons/2x/icon_tool_rotate.png Binary files differindex b13c858124..b13c858124 100644 --- a/tools/editor/icons/2x/icon_tool_rotate.png +++ b/editor/icons/2x/icon_tool_rotate.png diff --git a/tools/editor/icons/2x/icon_tool_scale.png b/editor/icons/2x/icon_tool_scale.png Binary files differindex 1bc29f4acc..1bc29f4acc 100644 --- a/tools/editor/icons/2x/icon_tool_scale.png +++ b/editor/icons/2x/icon_tool_scale.png diff --git a/tools/editor/icons/2x/icon_tool_select.png b/editor/icons/2x/icon_tool_select.png Binary files differindex 7421b98ef6..7421b98ef6 100644 --- a/tools/editor/icons/2x/icon_tool_select.png +++ b/editor/icons/2x/icon_tool_select.png diff --git a/tools/editor/icons/2x/icon_tools.png b/editor/icons/2x/icon_tools.png Binary files differindex 6143191fc7..6143191fc7 100644 --- a/tools/editor/icons/2x/icon_tools.png +++ b/editor/icons/2x/icon_tools.png diff --git a/tools/editor/icons/2x/icon_touch_screen_button.png b/editor/icons/2x/icon_touch_screen_button.png Binary files differindex b1af644e42..b1af644e42 100644 --- a/tools/editor/icons/2x/icon_touch_screen_button.png +++ b/editor/icons/2x/icon_touch_screen_button.png diff --git a/tools/editor/icons/2x/icon_track_add_key.png b/editor/icons/2x/icon_track_add_key.png Binary files differindex 9b7bd14fb4..9b7bd14fb4 100644 --- a/tools/editor/icons/2x/icon_track_add_key.png +++ b/editor/icons/2x/icon_track_add_key.png diff --git a/tools/editor/icons/2x/icon_track_add_key_hl.png b/editor/icons/2x/icon_track_add_key_hl.png Binary files differindex 0763836c3a..0763836c3a 100644 --- a/tools/editor/icons/2x/icon_track_add_key_hl.png +++ b/editor/icons/2x/icon_track_add_key_hl.png diff --git a/tools/editor/icons/2x/icon_track_continuous.png b/editor/icons/2x/icon_track_continuous.png Binary files differindex 5b4515f642..5b4515f642 100644 --- a/tools/editor/icons/2x/icon_track_continuous.png +++ b/editor/icons/2x/icon_track_continuous.png diff --git a/tools/editor/icons/2x/icon_track_discrete.png b/editor/icons/2x/icon_track_discrete.png Binary files differindex 19f479657b..19f479657b 100644 --- a/tools/editor/icons/2x/icon_track_discrete.png +++ b/editor/icons/2x/icon_track_discrete.png diff --git a/tools/editor/icons/2x/icon_track_trigger.png b/editor/icons/2x/icon_track_trigger.png Binary files differindex c04d47f9a4..c04d47f9a4 100644 --- a/tools/editor/icons/2x/icon_track_trigger.png +++ b/editor/icons/2x/icon_track_trigger.png diff --git a/tools/editor/icons/2x/icon_translation.png b/editor/icons/2x/icon_translation.png Binary files differindex 0ddc1da282..0ddc1da282 100644 --- a/tools/editor/icons/2x/icon_translation.png +++ b/editor/icons/2x/icon_translation.png diff --git a/tools/editor/icons/2x/icon_transparent.png b/editor/icons/2x/icon_transparent.png Binary files differindex 627607039b..627607039b 100644 --- a/tools/editor/icons/2x/icon_transparent.png +++ b/editor/icons/2x/icon_transparent.png diff --git a/tools/editor/icons/2x/icon_transpose.png b/editor/icons/2x/icon_transpose.png Binary files differindex 589dc54919..589dc54919 100644 --- a/tools/editor/icons/2x/icon_transpose.png +++ b/editor/icons/2x/icon_transpose.png diff --git a/tools/editor/icons/2x/icon_tree.png b/editor/icons/2x/icon_tree.png Binary files differindex 3f470cc0f3..3f470cc0f3 100644 --- a/tools/editor/icons/2x/icon_tree.png +++ b/editor/icons/2x/icon_tree.png diff --git a/tools/editor/icons/2x/icon_tween.png b/editor/icons/2x/icon_tween.png Binary files differindex a13d955eb0..a13d955eb0 100644 --- a/tools/editor/icons/2x/icon_tween.png +++ b/editor/icons/2x/icon_tween.png diff --git a/tools/editor/icons/2x/icon_unbone.png b/editor/icons/2x/icon_unbone.png Binary files differindex c20d6d9b2c..c20d6d9b2c 100644 --- a/tools/editor/icons/2x/icon_unbone.png +++ b/editor/icons/2x/icon_unbone.png diff --git a/tools/editor/icons/2x/icon_ungroup.png b/editor/icons/2x/icon_ungroup.png Binary files differindex bb46185370..bb46185370 100644 --- a/tools/editor/icons/2x/icon_ungroup.png +++ b/editor/icons/2x/icon_ungroup.png diff --git a/tools/editor/icons/2x/icon_uninstance.png b/editor/icons/2x/icon_uninstance.png Binary files differindex bf3dc00368..bf3dc00368 100644 --- a/tools/editor/icons/2x/icon_uninstance.png +++ b/editor/icons/2x/icon_uninstance.png diff --git a/tools/editor/icons/2x/icon_unlock.png b/editor/icons/2x/icon_unlock.png Binary files differindex 40ff3f25a0..40ff3f25a0 100644 --- a/tools/editor/icons/2x/icon_unlock.png +++ b/editor/icons/2x/icon_unlock.png diff --git a/tools/editor/icons/2x/icon_uv.png b/editor/icons/2x/icon_uv.png Binary files differindex e06be54edd..e06be54edd 100644 --- a/tools/editor/icons/2x/icon_uv.png +++ b/editor/icons/2x/icon_uv.png diff --git a/tools/editor/icons/2x/icon_v_box_container.png b/editor/icons/2x/icon_v_box_container.png Binary files differindex 97eb18c528..97eb18c528 100644 --- a/tools/editor/icons/2x/icon_v_box_container.png +++ b/editor/icons/2x/icon_v_box_container.png diff --git a/tools/editor/icons/2x/icon_v_button_array.png b/editor/icons/2x/icon_v_button_array.png Binary files differindex 93fd1fed04..93fd1fed04 100644 --- a/tools/editor/icons/2x/icon_v_button_array.png +++ b/editor/icons/2x/icon_v_button_array.png diff --git a/tools/editor/icons/2x/icon_v_scroll_bar.png b/editor/icons/2x/icon_v_scroll_bar.png Binary files differindex 5e4f83197f..5e4f83197f 100644 --- a/tools/editor/icons/2x/icon_v_scroll_bar.png +++ b/editor/icons/2x/icon_v_scroll_bar.png diff --git a/tools/editor/icons/2x/icon_v_separator.png b/editor/icons/2x/icon_v_separator.png Binary files differindex 58cdc3e8de..58cdc3e8de 100644 --- a/tools/editor/icons/2x/icon_v_separator.png +++ b/editor/icons/2x/icon_v_separator.png diff --git a/tools/editor/icons/2x/icon_v_slider.png b/editor/icons/2x/icon_v_slider.png Binary files differindex afc88cf510..afc88cf510 100644 --- a/tools/editor/icons/2x/icon_v_slider.png +++ b/editor/icons/2x/icon_v_slider.png diff --git a/tools/editor/icons/2x/icon_v_split_container.png b/editor/icons/2x/icon_v_split_container.png Binary files differindex b0f68381fc..b0f68381fc 100644 --- a/tools/editor/icons/2x/icon_v_split_container.png +++ b/editor/icons/2x/icon_v_split_container.png diff --git a/tools/editor/icons/2x/icon_vector.png b/editor/icons/2x/icon_vector.png Binary files differindex 9950d950ac..9950d950ac 100644 --- a/tools/editor/icons/2x/icon_vector.png +++ b/editor/icons/2x/icon_vector.png diff --git a/tools/editor/icons/2x/icon_vector2.png b/editor/icons/2x/icon_vector2.png Binary files differindex 73c1ca007f..73c1ca007f 100644 --- a/tools/editor/icons/2x/icon_vector2.png +++ b/editor/icons/2x/icon_vector2.png diff --git a/tools/editor/icons/2x/icon_vehicle_body.png b/editor/icons/2x/icon_vehicle_body.png Binary files differindex 215f7ac021..215f7ac021 100644 --- a/tools/editor/icons/2x/icon_vehicle_body.png +++ b/editor/icons/2x/icon_vehicle_body.png diff --git a/tools/editor/icons/2x/icon_vehicle_wheel.png b/editor/icons/2x/icon_vehicle_wheel.png Binary files differindex 6f7fecac4a..6f7fecac4a 100644 --- a/tools/editor/icons/2x/icon_vehicle_wheel.png +++ b/editor/icons/2x/icon_vehicle_wheel.png diff --git a/tools/editor/icons/2x/icon_video_player.png b/editor/icons/2x/icon_video_player.png Binary files differindex 588e17aa4e..588e17aa4e 100644 --- a/tools/editor/icons/2x/icon_video_player.png +++ b/editor/icons/2x/icon_video_player.png diff --git a/tools/editor/icons/2x/icon_viewport.png b/editor/icons/2x/icon_viewport.png Binary files differindex 7e588333fb..7e588333fb 100644 --- a/tools/editor/icons/2x/icon_viewport.png +++ b/editor/icons/2x/icon_viewport.png diff --git a/tools/editor/icons/2x/icon_viewport_container.png b/editor/icons/2x/icon_viewport_container.png Binary files differindex c43e53c34e..c43e53c34e 100644 --- a/tools/editor/icons/2x/icon_viewport_container.png +++ b/editor/icons/2x/icon_viewport_container.png diff --git a/tools/editor/icons/2x/icon_viewport_sprite.png b/editor/icons/2x/icon_viewport_sprite.png Binary files differindex adb336103f..adb336103f 100644 --- a/tools/editor/icons/2x/icon_viewport_sprite.png +++ b/editor/icons/2x/icon_viewport_sprite.png diff --git a/tools/editor/icons/2x/icon_viewport_texture.png b/editor/icons/2x/icon_viewport_texture.png Binary files differindex f798f1d221..f798f1d221 100644 --- a/tools/editor/icons/2x/icon_viewport_texture.png +++ b/editor/icons/2x/icon_viewport_texture.png diff --git a/tools/editor/icons/2x/icon_visibility_enabler.png b/editor/icons/2x/icon_visibility_enabler.png Binary files differindex 4be06a5123..4be06a5123 100644 --- a/tools/editor/icons/2x/icon_visibility_enabler.png +++ b/editor/icons/2x/icon_visibility_enabler.png diff --git a/tools/editor/icons/2x/icon_visibility_enabler_2d.png b/editor/icons/2x/icon_visibility_enabler_2d.png Binary files differindex 3d592e8983..3d592e8983 100644 --- a/tools/editor/icons/2x/icon_visibility_enabler_2d.png +++ b/editor/icons/2x/icon_visibility_enabler_2d.png diff --git a/tools/editor/icons/2x/icon_visibility_notifier.png b/editor/icons/2x/icon_visibility_notifier.png Binary files differindex aa73402d8e..aa73402d8e 100644 --- a/tools/editor/icons/2x/icon_visibility_notifier.png +++ b/editor/icons/2x/icon_visibility_notifier.png diff --git a/tools/editor/icons/2x/icon_visibility_notifier_2d.png b/editor/icons/2x/icon_visibility_notifier_2d.png Binary files differindex 5f3b7ecf42..5f3b7ecf42 100644 --- a/tools/editor/icons/2x/icon_visibility_notifier_2d.png +++ b/editor/icons/2x/icon_visibility_notifier_2d.png diff --git a/tools/editor/icons/2x/icon_visible.png b/editor/icons/2x/icon_visible.png Binary files differindex 761ff12c66..761ff12c66 100644 --- a/tools/editor/icons/2x/icon_visible.png +++ b/editor/icons/2x/icon_visible.png diff --git a/tools/editor/icons/2x/icon_visual_script.png b/editor/icons/2x/icon_visual_script.png Binary files differindex 78a3a0c318..78a3a0c318 100644 --- a/tools/editor/icons/2x/icon_visual_script.png +++ b/editor/icons/2x/icon_visual_script.png diff --git a/tools/editor/icons/2x/icon_visual_shader_port.png b/editor/icons/2x/icon_visual_shader_port.png Binary files differindex 3f9bf96b01..3f9bf96b01 100644 --- a/tools/editor/icons/2x/icon_visual_shader_port.png +++ b/editor/icons/2x/icon_visual_shader_port.png diff --git a/tools/editor/icons/2x/icon_vu_empty.png b/editor/icons/2x/icon_vu_empty.png Binary files differindex 7ecf215933..7ecf215933 100644 --- a/tools/editor/icons/2x/icon_vu_empty.png +++ b/editor/icons/2x/icon_vu_empty.png diff --git a/tools/editor/icons/2x/icon_vu_full.png b/editor/icons/2x/icon_vu_full.png Binary files differindex cfd29fa833..cfd29fa833 100644 --- a/tools/editor/icons/2x/icon_vu_full.png +++ b/editor/icons/2x/icon_vu_full.png diff --git a/tools/editor/icons/2x/icon_warning.png b/editor/icons/2x/icon_warning.png Binary files differindex 5d807065e7..5d807065e7 100644 --- a/tools/editor/icons/2x/icon_warning.png +++ b/editor/icons/2x/icon_warning.png diff --git a/tools/editor/icons/2x/icon_window_dialog.png b/editor/icons/2x/icon_window_dialog.png Binary files differindex 995381ed5f..995381ed5f 100644 --- a/tools/editor/icons/2x/icon_window_dialog.png +++ b/editor/icons/2x/icon_window_dialog.png diff --git a/tools/editor/icons/2x/icon_world.png b/editor/icons/2x/icon_world.png Binary files differindex 51b587c01e..51b587c01e 100644 --- a/tools/editor/icons/2x/icon_world.png +++ b/editor/icons/2x/icon_world.png diff --git a/tools/editor/icons/2x/icon_world_2d.png b/editor/icons/2x/icon_world_2d.png Binary files differindex e9cfa10461..e9cfa10461 100644 --- a/tools/editor/icons/2x/icon_world_2d.png +++ b/editor/icons/2x/icon_world_2d.png diff --git a/tools/editor/icons/2x/icon_world_environment.png b/editor/icons/2x/icon_world_environment.png Binary files differindex 9ca558fcba..9ca558fcba 100644 --- a/tools/editor/icons/2x/icon_world_environment.png +++ b/editor/icons/2x/icon_world_environment.png diff --git a/tools/editor/icons/2x/icon_y_sort.png b/editor/icons/2x/icon_y_sort.png Binary files differindex a38cbbe863..a38cbbe863 100644 --- a/tools/editor/icons/2x/icon_y_sort.png +++ b/editor/icons/2x/icon_y_sort.png diff --git a/tools/editor/icons/2x/icon_zoom.png b/editor/icons/2x/icon_zoom.png Binary files differindex 0c4a6a8c84..0c4a6a8c84 100644 --- a/tools/editor/icons/2x/icon_zoom.png +++ b/editor/icons/2x/icon_zoom.png diff --git a/tools/editor/icons/2x/icon_zoom_less.png b/editor/icons/2x/icon_zoom_less.png Binary files differindex d483db55ce..d483db55ce 100644 --- a/tools/editor/icons/2x/icon_zoom_less.png +++ b/editor/icons/2x/icon_zoom_less.png diff --git a/tools/editor/icons/2x/icon_zoom_more.png b/editor/icons/2x/icon_zoom_more.png Binary files differindex 8f9ef77849..8f9ef77849 100644 --- a/tools/editor/icons/2x/icon_zoom_more.png +++ b/editor/icons/2x/icon_zoom_more.png diff --git a/tools/editor/icons/2x/icon_zoom_reset.png b/editor/icons/2x/icon_zoom_reset.png Binary files differindex 092215b3e2..092215b3e2 100644 --- a/tools/editor/icons/2x/icon_zoom_reset.png +++ b/editor/icons/2x/icon_zoom_reset.png diff --git a/tools/editor/icons/SCsub b/editor/icons/SCsub index 4af481d1f6..3fc8e5461f 100644 --- a/tools/editor/icons/SCsub +++ b/editor/icons/SCsub @@ -90,7 +90,7 @@ make_editor_icons_builder = Builder(action=make_editor_icons_action, suffix='.cpp', src_suffix='.png') env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder -env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#tools/editor/editor_icons.cpp', Glob("*.png"))]) +env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.cpp', Glob("*.png"))]) -env.editor_sources.append("#tools/editor/editor_icons.cpp") +env.editor_sources.append("#editor/editor_icons.cpp") Export('env') diff --git a/tools/editor/icons/icon_accept_dialog.png b/editor/icons/icon_accept_dialog.png Binary files differindex 7530127f82..7530127f82 100644 --- a/tools/editor/icons/icon_accept_dialog.png +++ b/editor/icons/icon_accept_dialog.png diff --git a/tools/editor/icons/icon_add.png b/editor/icons/icon_add.png Binary files differindex fa675045bc..fa675045bc 100644 --- a/tools/editor/icons/icon_add.png +++ b/editor/icons/icon_add.png diff --git a/tools/editor/icons/icon_add_track.png b/editor/icons/icon_add_track.png Binary files differindex fa675045bc..fa675045bc 100644 --- a/tools/editor/icons/icon_add_track.png +++ b/editor/icons/icon_add_track.png diff --git a/tools/editor/icons/icon_anchor.png b/editor/icons/icon_anchor.png Binary files differindex 7b02eb448e..7b02eb448e 100644 --- a/tools/editor/icons/icon_anchor.png +++ b/editor/icons/icon_anchor.png diff --git a/tools/editor/icons/icon_anim_export.png b/editor/icons/icon_anim_export.png Binary files differindex b17ecdeb22..b17ecdeb22 100644 --- a/tools/editor/icons/icon_anim_export.png +++ b/editor/icons/icon_anim_export.png diff --git a/tools/editor/icons/icon_anim_export_all.png b/editor/icons/icon_anim_export_all.png Binary files differindex 65a3cf5745..65a3cf5745 100644 --- a/tools/editor/icons/icon_anim_export_all.png +++ b/editor/icons/icon_anim_export_all.png diff --git a/tools/editor/icons/icon_anim_get.png b/editor/icons/icon_anim_get.png Binary files differindex 7edd883f02..7edd883f02 100644 --- a/tools/editor/icons/icon_anim_get.png +++ b/editor/icons/icon_anim_get.png diff --git a/tools/editor/icons/icon_anim_get_hl.png b/editor/icons/icon_anim_get_hl.png Binary files differindex fa6e94545b..fa6e94545b 100644 --- a/tools/editor/icons/icon_anim_get_hl.png +++ b/editor/icons/icon_anim_get_hl.png diff --git a/tools/editor/icons/icon_anim_import.png b/editor/icons/icon_anim_import.png Binary files differindex 166e3fecd7..166e3fecd7 100644 --- a/tools/editor/icons/icon_anim_import.png +++ b/editor/icons/icon_anim_import.png diff --git a/tools/editor/icons/icon_anim_import_all.png b/editor/icons/icon_anim_import_all.png Binary files differindex c99893d59d..c99893d59d 100644 --- a/tools/editor/icons/icon_anim_import_all.png +++ b/editor/icons/icon_anim_import_all.png diff --git a/tools/editor/icons/icon_anim_set.png b/editor/icons/icon_anim_set.png Binary files differindex c52334c72f..c52334c72f 100644 --- a/tools/editor/icons/icon_anim_set.png +++ b/editor/icons/icon_anim_set.png diff --git a/tools/editor/icons/icon_anim_set_hl.png b/editor/icons/icon_anim_set_hl.png Binary files differindex aefaf7f738..aefaf7f738 100644 --- a/tools/editor/icons/icon_anim_set_hl.png +++ b/editor/icons/icon_anim_set_hl.png diff --git a/tools/editor/icons/icon_animated_sprite.png b/editor/icons/icon_animated_sprite.png Binary files differindex 6b6cb2fbfa..6b6cb2fbfa 100644 --- a/tools/editor/icons/icon_animated_sprite.png +++ b/editor/icons/icon_animated_sprite.png diff --git a/tools/editor/icons/icon_animated_sprite_3d.png b/editor/icons/icon_animated_sprite_3d.png Binary files differindex e04d687bfb..e04d687bfb 100644 --- a/tools/editor/icons/icon_animated_sprite_3d.png +++ b/editor/icons/icon_animated_sprite_3d.png diff --git a/tools/editor/icons/icon_animation.png b/editor/icons/icon_animation.png Binary files differindex b333f82711..b333f82711 100644 --- a/tools/editor/icons/icon_animation.png +++ b/editor/icons/icon_animation.png diff --git a/tools/editor/icons/icon_animation_node.png b/editor/icons/icon_animation_node.png Binary files differindex 81026b3a98..81026b3a98 100644 --- a/tools/editor/icons/icon_animation_node.png +++ b/editor/icons/icon_animation_node.png diff --git a/tools/editor/icons/icon_animation_play.png b/editor/icons/icon_animation_play.png Binary files differindex b405bf98f4..b405bf98f4 100644 --- a/tools/editor/icons/icon_animation_play.png +++ b/editor/icons/icon_animation_play.png diff --git a/tools/editor/icons/icon_animation_player.png b/editor/icons/icon_animation_player.png Binary files differindex 8a6f446e4e..8a6f446e4e 100644 --- a/tools/editor/icons/icon_animation_player.png +++ b/editor/icons/icon_animation_player.png diff --git a/tools/editor/icons/icon_animation_set.png b/editor/icons/icon_animation_set.png Binary files differindex b603382b0c..b603382b0c 100644 --- a/tools/editor/icons/icon_animation_set.png +++ b/editor/icons/icon_animation_set.png diff --git a/tools/editor/icons/icon_animation_tree.png b/editor/icons/icon_animation_tree.png Binary files differindex 684edb876b..684edb876b 100644 --- a/tools/editor/icons/icon_animation_tree.png +++ b/editor/icons/icon_animation_tree.png diff --git a/tools/editor/icons/icon_animation_tree_player.png b/editor/icons/icon_animation_tree_player.png Binary files differindex 684edb876b..684edb876b 100644 --- a/tools/editor/icons/icon_animation_tree_player.png +++ b/editor/icons/icon_animation_tree_player.png diff --git a/tools/editor/icons/icon_area.png b/editor/icons/icon_area.png Binary files differindex 31b4473d17..31b4473d17 100644 --- a/tools/editor/icons/icon_area.png +++ b/editor/icons/icon_area.png diff --git a/tools/editor/icons/icon_area_2d.png b/editor/icons/icon_area_2d.png Binary files differindex 2f9c6bb8d4..2f9c6bb8d4 100644 --- a/tools/editor/icons/icon_area_2d.png +++ b/editor/icons/icon_area_2d.png diff --git a/tools/editor/icons/icon_array_data.png b/editor/icons/icon_array_data.png Binary files differindex 447acaab2b..447acaab2b 100644 --- a/tools/editor/icons/icon_array_data.png +++ b/editor/icons/icon_array_data.png diff --git a/tools/editor/icons/icon_array_float.png b/editor/icons/icon_array_float.png Binary files differindex d1b78b4c3e..d1b78b4c3e 100644 --- a/tools/editor/icons/icon_array_float.png +++ b/editor/icons/icon_array_float.png diff --git a/tools/editor/icons/icon_array_int.png b/editor/icons/icon_array_int.png Binary files differindex 2c4ec5bafb..2c4ec5bafb 100644 --- a/tools/editor/icons/icon_array_int.png +++ b/editor/icons/icon_array_int.png diff --git a/tools/editor/icons/icon_array_string.png b/editor/icons/icon_array_string.png Binary files differindex a2e3f11c35..a2e3f11c35 100644 --- a/tools/editor/icons/icon_array_string.png +++ b/editor/icons/icon_array_string.png diff --git a/tools/editor/icons/icon_array_variant.png b/editor/icons/icon_array_variant.png Binary files differindex ab294898ad..ab294898ad 100644 --- a/tools/editor/icons/icon_array_variant.png +++ b/editor/icons/icon_array_variant.png diff --git a/tools/editor/icons/icon_arrow_left.png b/editor/icons/icon_arrow_left.png Binary files differindex 1e0d38b4b6..1e0d38b4b6 100644 --- a/tools/editor/icons/icon_arrow_left.png +++ b/editor/icons/icon_arrow_left.png diff --git a/tools/editor/icons/icon_arrow_left_disabled.png b/editor/icons/icon_arrow_left_disabled.png Binary files differindex f1f9d0f988..f1f9d0f988 100644 --- a/tools/editor/icons/icon_arrow_left_disabled.png +++ b/editor/icons/icon_arrow_left_disabled.png diff --git a/tools/editor/icons/icon_arrow_right.png b/editor/icons/icon_arrow_right.png Binary files differindex 09907755e1..09907755e1 100644 --- a/tools/editor/icons/icon_arrow_right.png +++ b/editor/icons/icon_arrow_right.png diff --git a/tools/editor/icons/icon_arrow_right_disabled.png b/editor/icons/icon_arrow_right_disabled.png Binary files differindex 840cd0da0a..840cd0da0a 100644 --- a/tools/editor/icons/icon_arrow_right_disabled.png +++ b/editor/icons/icon_arrow_right_disabled.png diff --git a/tools/editor/icons/icon_arrow_up.png b/editor/icons/icon_arrow_up.png Binary files differindex f7ec666f69..f7ec666f69 100644 --- a/tools/editor/icons/icon_arrow_up.png +++ b/editor/icons/icon_arrow_up.png diff --git a/tools/editor/icons/icon_arrow_up_disabled.png b/editor/icons/icon_arrow_up_disabled.png Binary files differindex fb46aa1373..fb46aa1373 100644 --- a/tools/editor/icons/icon_arrow_up_disabled.png +++ b/editor/icons/icon_arrow_up_disabled.png diff --git a/tools/editor/icons/icon_atlas_texture.png b/editor/icons/icon_atlas_texture.png Binary files differindex 438ac8bfb5..438ac8bfb5 100644 --- a/tools/editor/icons/icon_atlas_texture.png +++ b/editor/icons/icon_atlas_texture.png diff --git a/tools/editor/icons/icon_audio_effect_amplify.png b/editor/icons/icon_audio_effect_amplify.png Binary files differindex 9af3227d40..9af3227d40 100644 --- a/tools/editor/icons/icon_audio_effect_amplify.png +++ b/editor/icons/icon_audio_effect_amplify.png diff --git a/tools/editor/icons/icon_audio_stream_gibberish.png b/editor/icons/icon_audio_stream_gibberish.png Binary files differindex 60c85fa5b4..60c85fa5b4 100644 --- a/tools/editor/icons/icon_audio_stream_gibberish.png +++ b/editor/icons/icon_audio_stream_gibberish.png diff --git a/tools/editor/icons/icon_audio_stream_m_p_c.png b/editor/icons/icon_audio_stream_m_p_c.png Binary files differindex 665d7b56a1..665d7b56a1 100644 --- a/tools/editor/icons/icon_audio_stream_m_p_c.png +++ b/editor/icons/icon_audio_stream_m_p_c.png diff --git a/tools/editor/icons/icon_audio_stream_o_g_g_vorbis.png b/editor/icons/icon_audio_stream_o_g_g_vorbis.png Binary files differindex 7860e111d0..7860e111d0 100644 --- a/tools/editor/icons/icon_audio_stream_o_g_g_vorbis.png +++ b/editor/icons/icon_audio_stream_o_g_g_vorbis.png diff --git a/tools/editor/icons/icon_audio_stream_opus.png b/editor/icons/icon_audio_stream_opus.png Binary files differindex 69b0c83b4d..69b0c83b4d 100644 --- a/tools/editor/icons/icon_audio_stream_opus.png +++ b/editor/icons/icon_audio_stream_opus.png diff --git a/tools/editor/icons/icon_audio_stream_speex.png b/editor/icons/icon_audio_stream_speex.png Binary files differindex 6fefe47284..6fefe47284 100644 --- a/tools/editor/icons/icon_audio_stream_speex.png +++ b/editor/icons/icon_audio_stream_speex.png diff --git a/tools/editor/icons/icon_auto_play.png b/editor/icons/icon_auto_play.png Binary files differindex a6be64a1d1..a6be64a1d1 100644 --- a/tools/editor/icons/icon_auto_play.png +++ b/editor/icons/icon_auto_play.png diff --git a/tools/editor/icons/icon_b_c_s_f_x.png b/editor/icons/icon_b_c_s_f_x.png Binary files differindex 2100aea6a0..2100aea6a0 100644 --- a/tools/editor/icons/icon_b_c_s_f_x.png +++ b/editor/icons/icon_b_c_s_f_x.png diff --git a/tools/editor/icons/icon_b_g_color_f_x.png b/editor/icons/icon_b_g_color_f_x.png Binary files differindex 5b7552f6d5..5b7552f6d5 100644 --- a/tools/editor/icons/icon_b_g_color_f_x.png +++ b/editor/icons/icon_b_g_color_f_x.png diff --git a/tools/editor/icons/icon_b_g_image_f_x.png b/editor/icons/icon_b_g_image_f_x.png Binary files differindex 7e8ec86eec..7e8ec86eec 100644 --- a/tools/editor/icons/icon_b_g_image_f_x.png +++ b/editor/icons/icon_b_g_image_f_x.png diff --git a/tools/editor/icons/icon_back.png b/editor/icons/icon_back.png Binary files differindex 52fbc8117a..52fbc8117a 100644 --- a/tools/editor/icons/icon_back.png +++ b/editor/icons/icon_back.png diff --git a/tools/editor/icons/icon_back_buffer_copy.png b/editor/icons/icon_back_buffer_copy.png Binary files differindex 35f04ddac8..35f04ddac8 100644 --- a/tools/editor/icons/icon_back_buffer_copy.png +++ b/editor/icons/icon_back_buffer_copy.png diff --git a/tools/editor/icons/icon_back_disabled.png b/editor/icons/icon_back_disabled.png Binary files differindex 31aab496e2..31aab496e2 100644 --- a/tools/editor/icons/icon_back_disabled.png +++ b/editor/icons/icon_back_disabled.png diff --git a/tools/editor/icons/icon_back_no.png b/editor/icons/icon_back_no.png Binary files differindex 539ce4124a..539ce4124a 100644 --- a/tools/editor/icons/icon_back_no.png +++ b/editor/icons/icon_back_no.png diff --git a/tools/editor/icons/icon_bake.png b/editor/icons/icon_bake.png Binary files differindex 3b7fce5c9f..3b7fce5c9f 100644 --- a/tools/editor/icons/icon_bake.png +++ b/editor/icons/icon_bake.png diff --git a/tools/editor/icons/icon_baked_light.png b/editor/icons/icon_baked_light.png Binary files differindex 3b7fce5c9f..3b7fce5c9f 100644 --- a/tools/editor/icons/icon_baked_light.png +++ b/editor/icons/icon_baked_light.png diff --git a/tools/editor/icons/icon_baked_light_instance.png b/editor/icons/icon_baked_light_instance.png Binary files differindex c667b542c1..c667b542c1 100644 --- a/tools/editor/icons/icon_baked_light_instance.png +++ b/editor/icons/icon_baked_light_instance.png diff --git a/tools/editor/icons/icon_baked_light_sampler.png b/editor/icons/icon_baked_light_sampler.png Binary files differindex 15ff7b98b9..15ff7b98b9 100644 --- a/tools/editor/icons/icon_baked_light_sampler.png +++ b/editor/icons/icon_baked_light_sampler.png diff --git a/tools/editor/icons/icon_bit_map.png b/editor/icons/icon_bit_map.png Binary files differindex 50dd8157d1..50dd8157d1 100644 --- a/tools/editor/icons/icon_bit_map.png +++ b/editor/icons/icon_bit_map.png diff --git a/tools/editor/icons/icon_bitmap_font.png b/editor/icons/icon_bitmap_font.png Binary files differindex 5334c335dc..5334c335dc 100644 --- a/tools/editor/icons/icon_bitmap_font.png +++ b/editor/icons/icon_bitmap_font.png diff --git a/tools/editor/icons/icon_blend.png b/editor/icons/icon_blend.png Binary files differindex 1676c650c2..1676c650c2 100644 --- a/tools/editor/icons/icon_blend.png +++ b/editor/icons/icon_blend.png diff --git a/tools/editor/icons/icon_bone.png b/editor/icons/icon_bone.png Binary files differindex 2d9a7b47f3..2d9a7b47f3 100644 --- a/tools/editor/icons/icon_bone.png +++ b/editor/icons/icon_bone.png diff --git a/tools/editor/icons/icon_bone_attachment.png b/editor/icons/icon_bone_attachment.png Binary files differindex 882bb55f44..882bb55f44 100644 --- a/tools/editor/icons/icon_bone_attachment.png +++ b/editor/icons/icon_bone_attachment.png diff --git a/tools/editor/icons/icon_bone_track.png b/editor/icons/icon_bone_track.png Binary files differindex 1e55e53d6b..1e55e53d6b 100644 --- a/tools/editor/icons/icon_bone_track.png +++ b/editor/icons/icon_bone_track.png diff --git a/tools/editor/icons/icon_bool.png b/editor/icons/icon_bool.png Binary files differindex 822b5dd688..822b5dd688 100644 --- a/tools/editor/icons/icon_bool.png +++ b/editor/icons/icon_bool.png diff --git a/tools/editor/icons/icon_box_shape.png b/editor/icons/icon_box_shape.png Binary files differindex 68ec6088c9..68ec6088c9 100644 --- a/tools/editor/icons/icon_box_shape.png +++ b/editor/icons/icon_box_shape.png diff --git a/tools/editor/icons/icon_bus_vu_db.png b/editor/icons/icon_bus_vu_db.png Binary files differindex 52507cae52..52507cae52 100644 --- a/tools/editor/icons/icon_bus_vu_db.png +++ b/editor/icons/icon_bus_vu_db.png diff --git a/tools/editor/icons/icon_bus_vu_empty.png b/editor/icons/icon_bus_vu_empty.png Binary files differindex 6fc3143a55..6fc3143a55 100644 --- a/tools/editor/icons/icon_bus_vu_empty.png +++ b/editor/icons/icon_bus_vu_empty.png diff --git a/tools/editor/icons/icon_bus_vu_frozen.png b/editor/icons/icon_bus_vu_frozen.png Binary files differindex cf128afa91..cf128afa91 100644 --- a/tools/editor/icons/icon_bus_vu_frozen.png +++ b/editor/icons/icon_bus_vu_frozen.png diff --git a/tools/editor/icons/icon_bus_vu_full.png b/editor/icons/icon_bus_vu_full.png Binary files differindex 9e3d7a93e3..9e3d7a93e3 100644 --- a/tools/editor/icons/icon_bus_vu_full.png +++ b/editor/icons/icon_bus_vu_full.png diff --git a/tools/editor/icons/icon_button.png b/editor/icons/icon_button.png Binary files differindex da02831da2..da02831da2 100644 --- a/tools/editor/icons/icon_button.png +++ b/editor/icons/icon_button.png diff --git a/tools/editor/icons/icon_button_group.png b/editor/icons/icon_button_group.png Binary files differindex c105234598..c105234598 100644 --- a/tools/editor/icons/icon_button_group.png +++ b/editor/icons/icon_button_group.png diff --git a/tools/editor/icons/icon_camera.png b/editor/icons/icon_camera.png Binary files differindex 4dff1791ad..4dff1791ad 100644 --- a/tools/editor/icons/icon_camera.png +++ b/editor/icons/icon_camera.png diff --git a/tools/editor/icons/icon_camera_2d.png b/editor/icons/icon_camera_2d.png Binary files differindex 6497997afe..6497997afe 100644 --- a/tools/editor/icons/icon_camera_2d.png +++ b/editor/icons/icon_camera_2d.png diff --git a/tools/editor/icons/icon_canvas_item.png b/editor/icons/icon_canvas_item.png Binary files differindex 64f5d8abdf..64f5d8abdf 100644 --- a/tools/editor/icons/icon_canvas_item.png +++ b/editor/icons/icon_canvas_item.png diff --git a/tools/editor/icons/icon_canvas_item_material.png b/editor/icons/icon_canvas_item_material.png Binary files differindex a04f6e8f5f..a04f6e8f5f 100644 --- a/tools/editor/icons/icon_canvas_item_material.png +++ b/editor/icons/icon_canvas_item_material.png diff --git a/tools/editor/icons/icon_canvas_item_shader.png b/editor/icons/icon_canvas_item_shader.png Binary files differindex 8392f889d1..8392f889d1 100644 --- a/tools/editor/icons/icon_canvas_item_shader.png +++ b/editor/icons/icon_canvas_item_shader.png diff --git a/tools/editor/icons/icon_canvas_item_shader_graph.png b/editor/icons/icon_canvas_item_shader_graph.png Binary files differindex f40e3755af..f40e3755af 100644 --- a/tools/editor/icons/icon_canvas_item_shader_graph.png +++ b/editor/icons/icon_canvas_item_shader_graph.png diff --git a/tools/editor/icons/icon_canvas_layer.png b/editor/icons/icon_canvas_layer.png Binary files differindex bb32d6d3ad..bb32d6d3ad 100644 --- a/tools/editor/icons/icon_canvas_layer.png +++ b/editor/icons/icon_canvas_layer.png diff --git a/tools/editor/icons/icon_canvas_modulate.png b/editor/icons/icon_canvas_modulate.png Binary files differindex b76e532268..b76e532268 100644 --- a/tools/editor/icons/icon_canvas_modulate.png +++ b/editor/icons/icon_canvas_modulate.png diff --git a/tools/editor/icons/icon_capsule_shape.png b/editor/icons/icon_capsule_shape.png Binary files differindex bc00e491d3..bc00e491d3 100644 --- a/tools/editor/icons/icon_capsule_shape.png +++ b/editor/icons/icon_capsule_shape.png diff --git a/tools/editor/icons/icon_capsule_shape_2d.png b/editor/icons/icon_capsule_shape_2d.png Binary files differindex 6f6554fbc7..6f6554fbc7 100644 --- a/tools/editor/icons/icon_capsule_shape_2d.png +++ b/editor/icons/icon_capsule_shape_2d.png diff --git a/tools/editor/icons/icon_center_container.png b/editor/icons/icon_center_container.png Binary files differindex 61904e7b00..61904e7b00 100644 --- a/tools/editor/icons/icon_center_container.png +++ b/editor/icons/icon_center_container.png diff --git a/tools/editor/icons/icon_character_body.png b/editor/icons/icon_character_body.png Binary files differindex b859a271d5..b859a271d5 100644 --- a/tools/editor/icons/icon_character_body.png +++ b/editor/icons/icon_character_body.png diff --git a/tools/editor/icons/icon_character_camera.png b/editor/icons/icon_character_camera.png Binary files differindex c238487942..c238487942 100644 --- a/tools/editor/icons/icon_character_camera.png +++ b/editor/icons/icon_character_camera.png diff --git a/tools/editor/icons/icon_check_box.png b/editor/icons/icon_check_box.png Binary files differindex f0e614d0e7..f0e614d0e7 100644 --- a/tools/editor/icons/icon_check_box.png +++ b/editor/icons/icon_check_box.png diff --git a/tools/editor/icons/icon_check_button.png b/editor/icons/icon_check_button.png Binary files differindex 968188f43d..968188f43d 100644 --- a/tools/editor/icons/icon_check_button.png +++ b/editor/icons/icon_check_button.png diff --git a/tools/editor/icons/icon_checkerboard.png b/editor/icons/icon_checkerboard.png Binary files differindex 5f658c765e..5f658c765e 100644 --- a/tools/editor/icons/icon_checkerboard.png +++ b/editor/icons/icon_checkerboard.png diff --git a/tools/editor/icons/icon_circle_shape_2d.png b/editor/icons/icon_circle_shape_2d.png Binary files differindex 7865ed3dbe..7865ed3dbe 100644 --- a/tools/editor/icons/icon_circle_shape_2d.png +++ b/editor/icons/icon_circle_shape_2d.png diff --git a/tools/editor/icons/icon_class_list.png b/editor/icons/icon_class_list.png Binary files differindex 5faff250d7..5faff250d7 100644 --- a/tools/editor/icons/icon_class_list.png +++ b/editor/icons/icon_class_list.png diff --git a/tools/editor/icons/icon_click2edit.png b/editor/icons/icon_click2edit.png Binary files differindex 795756dff0..795756dff0 100644 --- a/tools/editor/icons/icon_click2edit.png +++ b/editor/icons/icon_click2edit.png diff --git a/tools/editor/icons/icon_close.png b/editor/icons/icon_close.png Binary files differindex 20d9b5c810..20d9b5c810 100644 --- a/tools/editor/icons/icon_close.png +++ b/editor/icons/icon_close.png diff --git a/tools/editor/icons/icon_close_hover.png b/editor/icons/icon_close_hover.png Binary files differindex cb519691e5..cb519691e5 100644 --- a/tools/editor/icons/icon_close_hover.png +++ b/editor/icons/icon_close_hover.png diff --git a/tools/editor/icons/icon_collapse.png b/editor/icons/icon_collapse.png Binary files differindex ad2442183d..ad2442183d 100644 --- a/tools/editor/icons/icon_collapse.png +++ b/editor/icons/icon_collapse.png diff --git a/tools/editor/icons/icon_collapse_hl.png b/editor/icons/icon_collapse_hl.png Binary files differindex 0dfbc8b175..0dfbc8b175 100644 --- a/tools/editor/icons/icon_collapse_hl.png +++ b/editor/icons/icon_collapse_hl.png diff --git a/tools/editor/icons/icon_collision.png b/editor/icons/icon_collision.png Binary files differindex ccda8b6a25..ccda8b6a25 100644 --- a/tools/editor/icons/icon_collision.png +++ b/editor/icons/icon_collision.png diff --git a/tools/editor/icons/icon_collision_2d.png b/editor/icons/icon_collision_2d.png Binary files differindex b372749cb0..b372749cb0 100644 --- a/tools/editor/icons/icon_collision_2d.png +++ b/editor/icons/icon_collision_2d.png diff --git a/tools/editor/icons/icon_collision_polygon.png b/editor/icons/icon_collision_polygon.png Binary files differindex 738f80c3f3..738f80c3f3 100644 --- a/tools/editor/icons/icon_collision_polygon.png +++ b/editor/icons/icon_collision_polygon.png diff --git a/tools/editor/icons/icon_collision_polygon_2d.png b/editor/icons/icon_collision_polygon_2d.png Binary files differindex b372749cb0..b372749cb0 100644 --- a/tools/editor/icons/icon_collision_polygon_2d.png +++ b/editor/icons/icon_collision_polygon_2d.png diff --git a/tools/editor/icons/icon_collision_shape.png b/editor/icons/icon_collision_shape.png Binary files differindex 7bcd61c719..7bcd61c719 100644 --- a/tools/editor/icons/icon_collision_shape.png +++ b/editor/icons/icon_collision_shape.png diff --git a/tools/editor/icons/icon_collision_shape_2d.png b/editor/icons/icon_collision_shape_2d.png Binary files differindex afc1326959..afc1326959 100644 --- a/tools/editor/icons/icon_collision_shape_2d.png +++ b/editor/icons/icon_collision_shape_2d.png diff --git a/tools/editor/icons/icon_color.png b/editor/icons/icon_color.png Binary files differindex 589a6d3ffa..589a6d3ffa 100644 --- a/tools/editor/icons/icon_color.png +++ b/editor/icons/icon_color.png diff --git a/tools/editor/icons/icon_color_pick.png b/editor/icons/icon_color_pick.png Binary files differindex 15679a9558..15679a9558 100644 --- a/tools/editor/icons/icon_color_pick.png +++ b/editor/icons/icon_color_pick.png diff --git a/tools/editor/icons/icon_color_picker.png b/editor/icons/icon_color_picker.png Binary files differindex 6d1114054a..6d1114054a 100644 --- a/tools/editor/icons/icon_color_picker.png +++ b/editor/icons/icon_color_picker.png diff --git a/tools/editor/icons/icon_color_picker_button.png b/editor/icons/icon_color_picker_button.png Binary files differindex a399128773..a399128773 100644 --- a/tools/editor/icons/icon_color_picker_button.png +++ b/editor/icons/icon_color_picker_button.png diff --git a/tools/editor/icons/icon_color_ramp.png b/editor/icons/icon_color_ramp.png Binary files differindex 03d19a56bb..03d19a56bb 100644 --- a/tools/editor/icons/icon_color_ramp.png +++ b/editor/icons/icon_color_ramp.png diff --git a/tools/editor/icons/icon_color_rect.png b/editor/icons/icon_color_rect.png Binary files differindex 40b9dab605..40b9dab605 100644 --- a/tools/editor/icons/icon_color_rect.png +++ b/editor/icons/icon_color_rect.png diff --git a/tools/editor/icons/icon_concave_polygon_shape.png b/editor/icons/icon_concave_polygon_shape.png Binary files differindex dc1ff1d388..dc1ff1d388 100644 --- a/tools/editor/icons/icon_concave_polygon_shape.png +++ b/editor/icons/icon_concave_polygon_shape.png diff --git a/tools/editor/icons/icon_concave_polygon_shape_2d.png b/editor/icons/icon_concave_polygon_shape_2d.png Binary files differindex 2e87eea5aa..2e87eea5aa 100644 --- a/tools/editor/icons/icon_concave_polygon_shape_2d.png +++ b/editor/icons/icon_concave_polygon_shape_2d.png diff --git a/tools/editor/icons/icon_cone_twist_joint.png b/editor/icons/icon_cone_twist_joint.png Binary files differindex bbf93f2f71..bbf93f2f71 100644 --- a/tools/editor/icons/icon_cone_twist_joint.png +++ b/editor/icons/icon_cone_twist_joint.png diff --git a/tools/editor/icons/icon_confirmation_dialog.png b/editor/icons/icon_confirmation_dialog.png Binary files differindex 2dd4cd00fb..2dd4cd00fb 100644 --- a/tools/editor/icons/icon_confirmation_dialog.png +++ b/editor/icons/icon_confirmation_dialog.png diff --git a/tools/editor/icons/icon_connect.png b/editor/icons/icon_connect.png Binary files differindex 51615838a9..51615838a9 100644 --- a/tools/editor/icons/icon_connect.png +++ b/editor/icons/icon_connect.png diff --git a/tools/editor/icons/icon_connection_and_groups.png b/editor/icons/icon_connection_and_groups.png Binary files differindex 76e036e5bb..76e036e5bb 100644 --- a/tools/editor/icons/icon_connection_and_groups.png +++ b/editor/icons/icon_connection_and_groups.png diff --git a/tools/editor/icons/icon_console.png b/editor/icons/icon_console.png Binary files differindex 7dc7407ef7..7dc7407ef7 100644 --- a/tools/editor/icons/icon_console.png +++ b/editor/icons/icon_console.png diff --git a/tools/editor/icons/icon_container.png b/editor/icons/icon_container.png Binary files differindex ae0d76072b..ae0d76072b 100644 --- a/tools/editor/icons/icon_container.png +++ b/editor/icons/icon_container.png diff --git a/tools/editor/icons/icon_control.png b/editor/icons/icon_control.png Binary files differindex 0d2a82ad0e..0d2a82ad0e 100644 --- a/tools/editor/icons/icon_control.png +++ b/editor/icons/icon_control.png diff --git a/tools/editor/icons/icon_control_align_bottom_center.png b/editor/icons/icon_control_align_bottom_center.png Binary files differindex 166f122ace..166f122ace 100644 --- a/tools/editor/icons/icon_control_align_bottom_center.png +++ b/editor/icons/icon_control_align_bottom_center.png diff --git a/tools/editor/icons/icon_control_align_bottom_left.png b/editor/icons/icon_control_align_bottom_left.png Binary files differindex 238f33a098..238f33a098 100644 --- a/tools/editor/icons/icon_control_align_bottom_left.png +++ b/editor/icons/icon_control_align_bottom_left.png diff --git a/tools/editor/icons/icon_control_align_bottom_right.png b/editor/icons/icon_control_align_bottom_right.png Binary files differindex ff8b6a0177..ff8b6a0177 100644 --- a/tools/editor/icons/icon_control_align_bottom_right.png +++ b/editor/icons/icon_control_align_bottom_right.png diff --git a/tools/editor/icons/icon_control_align_bottom_wide.png b/editor/icons/icon_control_align_bottom_wide.png Binary files differindex 309907767e..309907767e 100644 --- a/tools/editor/icons/icon_control_align_bottom_wide.png +++ b/editor/icons/icon_control_align_bottom_wide.png diff --git a/tools/editor/icons/icon_control_align_center.png b/editor/icons/icon_control_align_center.png Binary files differindex 964f132ac3..964f132ac3 100644 --- a/tools/editor/icons/icon_control_align_center.png +++ b/editor/icons/icon_control_align_center.png diff --git a/tools/editor/icons/icon_control_align_center_left.png b/editor/icons/icon_control_align_center_left.png Binary files differindex 704b4f504f..704b4f504f 100644 --- a/tools/editor/icons/icon_control_align_center_left.png +++ b/editor/icons/icon_control_align_center_left.png diff --git a/tools/editor/icons/icon_control_align_center_right.png b/editor/icons/icon_control_align_center_right.png Binary files differindex bd7111aec3..bd7111aec3 100644 --- a/tools/editor/icons/icon_control_align_center_right.png +++ b/editor/icons/icon_control_align_center_right.png diff --git a/tools/editor/icons/icon_control_align_left_center.png b/editor/icons/icon_control_align_left_center.png Binary files differindex 75c2d8573f..75c2d8573f 100644 --- a/tools/editor/icons/icon_control_align_left_center.png +++ b/editor/icons/icon_control_align_left_center.png diff --git a/tools/editor/icons/icon_control_align_left_wide.png b/editor/icons/icon_control_align_left_wide.png Binary files differindex 92a13144cb..92a13144cb 100644 --- a/tools/editor/icons/icon_control_align_left_wide.png +++ b/editor/icons/icon_control_align_left_wide.png diff --git a/tools/editor/icons/icon_control_align_right_center.png b/editor/icons/icon_control_align_right_center.png Binary files differindex a859035439..a859035439 100644 --- a/tools/editor/icons/icon_control_align_right_center.png +++ b/editor/icons/icon_control_align_right_center.png diff --git a/tools/editor/icons/icon_control_align_right_wide.png b/editor/icons/icon_control_align_right_wide.png Binary files differindex b6fef9569e..b6fef9569e 100644 --- a/tools/editor/icons/icon_control_align_right_wide.png +++ b/editor/icons/icon_control_align_right_wide.png diff --git a/tools/editor/icons/icon_control_align_top_center.png b/editor/icons/icon_control_align_top_center.png Binary files differindex 5cdd6cd2fc..5cdd6cd2fc 100644 --- a/tools/editor/icons/icon_control_align_top_center.png +++ b/editor/icons/icon_control_align_top_center.png diff --git a/tools/editor/icons/icon_control_align_top_left.png b/editor/icons/icon_control_align_top_left.png Binary files differindex 558e3f08cb..558e3f08cb 100644 --- a/tools/editor/icons/icon_control_align_top_left.png +++ b/editor/icons/icon_control_align_top_left.png diff --git a/tools/editor/icons/icon_control_align_top_right.png b/editor/icons/icon_control_align_top_right.png Binary files differindex 5ca294de48..5ca294de48 100644 --- a/tools/editor/icons/icon_control_align_top_right.png +++ b/editor/icons/icon_control_align_top_right.png diff --git a/tools/editor/icons/icon_control_align_top_wide.png b/editor/icons/icon_control_align_top_wide.png Binary files differindex ec089d0174..ec089d0174 100644 --- a/tools/editor/icons/icon_control_align_top_wide.png +++ b/editor/icons/icon_control_align_top_wide.png diff --git a/tools/editor/icons/icon_control_align_wide.png b/editor/icons/icon_control_align_wide.png Binary files differindex 45552740bf..45552740bf 100644 --- a/tools/editor/icons/icon_control_align_wide.png +++ b/editor/icons/icon_control_align_wide.png diff --git a/tools/editor/icons/icon_control_hcenter_wide.png b/editor/icons/icon_control_hcenter_wide.png Binary files differindex f298b22f5f..f298b22f5f 100644 --- a/tools/editor/icons/icon_control_hcenter_wide.png +++ b/editor/icons/icon_control_hcenter_wide.png diff --git a/tools/editor/icons/icon_control_vcenter_wide.png b/editor/icons/icon_control_vcenter_wide.png Binary files differindex b6c90646fb..b6c90646fb 100644 --- a/tools/editor/icons/icon_control_vcenter_wide.png +++ b/editor/icons/icon_control_vcenter_wide.png diff --git a/tools/editor/icons/icon_convex_polygon_shape.png b/editor/icons/icon_convex_polygon_shape.png Binary files differindex 4dfc9acc9e..4dfc9acc9e 100644 --- a/tools/editor/icons/icon_convex_polygon_shape.png +++ b/editor/icons/icon_convex_polygon_shape.png diff --git a/tools/editor/icons/icon_convex_polygon_shape_2d.png b/editor/icons/icon_convex_polygon_shape_2d.png Binary files differindex e449c6930f..e449c6930f 100644 --- a/tools/editor/icons/icon_convex_polygon_shape_2d.png +++ b/editor/icons/icon_convex_polygon_shape_2d.png diff --git a/tools/editor/icons/icon_copy_node_path.png b/editor/icons/icon_copy_node_path.png Binary files differindex d777f132d8..d777f132d8 100644 --- a/tools/editor/icons/icon_copy_node_path.png +++ b/editor/icons/icon_copy_node_path.png diff --git a/tools/editor/icons/icon_create_new_scene_from.png b/editor/icons/icon_create_new_scene_from.png Binary files differindex 45df9b1e25..45df9b1e25 100644 --- a/tools/editor/icons/icon_create_new_scene_from.png +++ b/editor/icons/icon_create_new_scene_from.png diff --git a/tools/editor/icons/icon_cube_grid_map.png b/editor/icons/icon_cube_grid_map.png Binary files differindex fe13222691..fe13222691 100644 --- a/tools/editor/icons/icon_cube_grid_map.png +++ b/editor/icons/icon_cube_grid_map.png diff --git a/tools/editor/icons/icon_cube_map.png b/editor/icons/icon_cube_map.png Binary files differindex 9c4c6fdc9f..9c4c6fdc9f 100644 --- a/tools/editor/icons/icon_cube_map.png +++ b/editor/icons/icon_cube_map.png diff --git a/tools/editor/icons/icon_curve.png b/editor/icons/icon_curve.png Binary files differindex 27d423edcd..27d423edcd 100644 --- a/tools/editor/icons/icon_curve.png +++ b/editor/icons/icon_curve.png diff --git a/tools/editor/icons/icon_curve_2d.png b/editor/icons/icon_curve_2d.png Binary files differindex ce46dcaad4..ce46dcaad4 100644 --- a/tools/editor/icons/icon_curve_2d.png +++ b/editor/icons/icon_curve_2d.png diff --git a/tools/editor/icons/icon_curve_3d.png b/editor/icons/icon_curve_3d.png Binary files differindex 561837e4de..561837e4de 100644 --- a/tools/editor/icons/icon_curve_3d.png +++ b/editor/icons/icon_curve_3d.png diff --git a/tools/editor/icons/icon_curve_close.png b/editor/icons/icon_curve_close.png Binary files differindex 9a66015252..9a66015252 100644 --- a/tools/editor/icons/icon_curve_close.png +++ b/editor/icons/icon_curve_close.png diff --git a/tools/editor/icons/icon_curve_constant.png b/editor/icons/icon_curve_constant.png Binary files differindex 510a01c7ec..510a01c7ec 100644 --- a/tools/editor/icons/icon_curve_constant.png +++ b/editor/icons/icon_curve_constant.png diff --git a/tools/editor/icons/icon_curve_create.png b/editor/icons/icon_curve_create.png Binary files differindex b07820a5cd..b07820a5cd 100644 --- a/tools/editor/icons/icon_curve_create.png +++ b/editor/icons/icon_curve_create.png diff --git a/tools/editor/icons/icon_curve_curve.png b/editor/icons/icon_curve_curve.png Binary files differindex 7d71af0a23..7d71af0a23 100644 --- a/tools/editor/icons/icon_curve_curve.png +++ b/editor/icons/icon_curve_curve.png diff --git a/tools/editor/icons/icon_curve_delete.png b/editor/icons/icon_curve_delete.png Binary files differindex 108bfeac35..108bfeac35 100644 --- a/tools/editor/icons/icon_curve_delete.png +++ b/editor/icons/icon_curve_delete.png diff --git a/tools/editor/icons/icon_curve_edit.png b/editor/icons/icon_curve_edit.png Binary files differindex 51eb583384..51eb583384 100644 --- a/tools/editor/icons/icon_curve_edit.png +++ b/editor/icons/icon_curve_edit.png diff --git a/tools/editor/icons/icon_curve_in.png b/editor/icons/icon_curve_in.png Binary files differindex a809ee43d3..a809ee43d3 100644 --- a/tools/editor/icons/icon_curve_in.png +++ b/editor/icons/icon_curve_in.png diff --git a/tools/editor/icons/icon_curve_in_out.png b/editor/icons/icon_curve_in_out.png Binary files differindex 88e07d48a7..88e07d48a7 100644 --- a/tools/editor/icons/icon_curve_in_out.png +++ b/editor/icons/icon_curve_in_out.png diff --git a/tools/editor/icons/icon_curve_linear.png b/editor/icons/icon_curve_linear.png Binary files differindex 80306b6e04..80306b6e04 100644 --- a/tools/editor/icons/icon_curve_linear.png +++ b/editor/icons/icon_curve_linear.png diff --git a/tools/editor/icons/icon_curve_out.png b/editor/icons/icon_curve_out.png Binary files differindex aa05bc8f86..aa05bc8f86 100644 --- a/tools/editor/icons/icon_curve_out.png +++ b/editor/icons/icon_curve_out.png diff --git a/tools/editor/icons/icon_curve_out_in.png b/editor/icons/icon_curve_out_in.png Binary files differindex 7be46fc779..7be46fc779 100644 --- a/tools/editor/icons/icon_curve_out_in.png +++ b/editor/icons/icon_curve_out_in.png diff --git a/tools/editor/icons/icon_cylinder_shape.png b/editor/icons/icon_cylinder_shape.png Binary files differindex fd7d7e26e2..fd7d7e26e2 100644 --- a/tools/editor/icons/icon_cylinder_shape.png +++ b/editor/icons/icon_cylinder_shape.png diff --git a/tools/editor/icons/icon_d_o_f_blur_f_x.png b/editor/icons/icon_d_o_f_blur_f_x.png Binary files differindex fda7d48353..fda7d48353 100644 --- a/tools/editor/icons/icon_d_o_f_blur_f_x.png +++ b/editor/icons/icon_d_o_f_blur_f_x.png diff --git a/tools/editor/icons/icon_damped_spring_joint_2d.png b/editor/icons/icon_damped_spring_joint_2d.png Binary files differindex b6a9c2b3a1..b6a9c2b3a1 100644 --- a/tools/editor/icons/icon_damped_spring_joint_2d.png +++ b/editor/icons/icon_damped_spring_joint_2d.png diff --git a/tools/editor/icons/icon_debug.png b/editor/icons/icon_debug.png Binary files differindex 03b98aa9e4..03b98aa9e4 100644 --- a/tools/editor/icons/icon_debug.png +++ b/editor/icons/icon_debug.png diff --git a/tools/editor/icons/icon_debug_continue.png b/editor/icons/icon_debug_continue.png Binary files differindex 78a61aa98f..78a61aa98f 100644 --- a/tools/editor/icons/icon_debug_continue.png +++ b/editor/icons/icon_debug_continue.png diff --git a/tools/editor/icons/icon_debug_next.png b/editor/icons/icon_debug_next.png Binary files differindex c61f221562..c61f221562 100644 --- a/tools/editor/icons/icon_debug_next.png +++ b/editor/icons/icon_debug_next.png diff --git a/tools/editor/icons/icon_debug_step.png b/editor/icons/icon_debug_step.png Binary files differindex a1839d56d8..a1839d56d8 100644 --- a/tools/editor/icons/icon_debug_step.png +++ b/editor/icons/icon_debug_step.png diff --git a/tools/editor/icons/icon_default_project_icon.png b/editor/icons/icon_default_project_icon.png Binary files differindex e87a49bd28..e87a49bd28 100644 --- a/tools/editor/icons/icon_default_project_icon.png +++ b/editor/icons/icon_default_project_icon.png diff --git a/tools/editor/icons/icon_del.png b/editor/icons/icon_del.png Binary files differindex 10e56d5bb8..10e56d5bb8 100644 --- a/tools/editor/icons/icon_del.png +++ b/editor/icons/icon_del.png diff --git a/tools/editor/icons/icon_dependency_changed.png b/editor/icons/icon_dependency_changed.png Binary files differindex 1b396457d3..1b396457d3 100644 --- a/tools/editor/icons/icon_dependency_changed.png +++ b/editor/icons/icon_dependency_changed.png diff --git a/tools/editor/icons/icon_dependency_changed_hl.png b/editor/icons/icon_dependency_changed_hl.png Binary files differindex 51dfe6b39d..51dfe6b39d 100644 --- a/tools/editor/icons/icon_dependency_changed_hl.png +++ b/editor/icons/icon_dependency_changed_hl.png diff --git a/tools/editor/icons/icon_dependency_local_changed.png b/editor/icons/icon_dependency_local_changed.png Binary files differindex d8737fd2f4..d8737fd2f4 100644 --- a/tools/editor/icons/icon_dependency_local_changed.png +++ b/editor/icons/icon_dependency_local_changed.png diff --git a/tools/editor/icons/icon_dependency_local_changed_hl.png b/editor/icons/icon_dependency_local_changed_hl.png Binary files differindex a87c48ca3e..a87c48ca3e 100644 --- a/tools/editor/icons/icon_dependency_local_changed_hl.png +++ b/editor/icons/icon_dependency_local_changed_hl.png diff --git a/tools/editor/icons/icon_dependency_ok.png b/editor/icons/icon_dependency_ok.png Binary files differindex 2b9ac389ba..2b9ac389ba 100644 --- a/tools/editor/icons/icon_dependency_ok.png +++ b/editor/icons/icon_dependency_ok.png diff --git a/tools/editor/icons/icon_dependency_ok_hl.png b/editor/icons/icon_dependency_ok_hl.png Binary files differindex 62e48531e4..62e48531e4 100644 --- a/tools/editor/icons/icon_dependency_ok_hl.png +++ b/editor/icons/icon_dependency_ok_hl.png diff --git a/tools/editor/icons/icon_directional_light.png b/editor/icons/icon_directional_light.png Binary files differindex 31f47c974d..31f47c974d 100644 --- a/tools/editor/icons/icon_directional_light.png +++ b/editor/icons/icon_directional_light.png diff --git a/tools/editor/icons/icon_distraction_free.png b/editor/icons/icon_distraction_free.png Binary files differindex c6f8a08874..c6f8a08874 100644 --- a/tools/editor/icons/icon_distraction_free.png +++ b/editor/icons/icon_distraction_free.png diff --git a/tools/editor/icons/icon_doc_code_font.png b/editor/icons/icon_doc_code_font.png Binary files differindex 628654f6e8..628654f6e8 100644 --- a/tools/editor/icons/icon_doc_code_font.png +++ b/editor/icons/icon_doc_code_font.png diff --git a/tools/editor/icons/icon_doc_font.png b/editor/icons/icon_doc_font.png Binary files differindex 65fbcc5ccc..65fbcc5ccc 100644 --- a/tools/editor/icons/icon_doc_font.png +++ b/editor/icons/icon_doc_font.png diff --git a/tools/editor/icons/icon_doc_title_font.png b/editor/icons/icon_doc_title_font.png Binary files differindex d78b394da0..d78b394da0 100644 --- a/tools/editor/icons/icon_doc_title_font.png +++ b/editor/icons/icon_doc_title_font.png diff --git a/tools/editor/icons/icon_down.png b/editor/icons/icon_down.png Binary files differindex d2fcdb4c9f..d2fcdb4c9f 100644 --- a/tools/editor/icons/icon_down.png +++ b/editor/icons/icon_down.png diff --git a/tools/editor/icons/icon_dummy.png b/editor/icons/icon_dummy.png Binary files differindex 24998a28af..24998a28af 100644 --- a/tools/editor/icons/icon_dummy.png +++ b/editor/icons/icon_dummy.png diff --git a/tools/editor/icons/icon_duplicate.png b/editor/icons/icon_duplicate.png Binary files differindex 320b36504e..320b36504e 100644 --- a/tools/editor/icons/icon_duplicate.png +++ b/editor/icons/icon_duplicate.png diff --git a/tools/editor/icons/icon_dynamic_character_body.png b/editor/icons/icon_dynamic_character_body.png Binary files differindex b685841e35..b685841e35 100644 --- a/tools/editor/icons/icon_dynamic_character_body.png +++ b/editor/icons/icon_dynamic_character_body.png diff --git a/tools/editor/icons/icon_dynamic_custom_body.png b/editor/icons/icon_dynamic_custom_body.png Binary files differindex d383e7087f..d383e7087f 100644 --- a/tools/editor/icons/icon_dynamic_custom_body.png +++ b/editor/icons/icon_dynamic_custom_body.png diff --git a/tools/editor/icons/icon_dynamic_font.png b/editor/icons/icon_dynamic_font.png Binary files differindex e373553e4e..e373553e4e 100644 --- a/tools/editor/icons/icon_dynamic_font.png +++ b/editor/icons/icon_dynamic_font.png diff --git a/tools/editor/icons/icon_dynamic_font_data.png b/editor/icons/icon_dynamic_font_data.png Binary files differindex 5cff86c40c..5cff86c40c 100644 --- a/tools/editor/icons/icon_dynamic_font_data.png +++ b/editor/icons/icon_dynamic_font_data.png diff --git a/tools/editor/icons/icon_dynamic_rigid_body.png b/editor/icons/icon_dynamic_rigid_body.png Binary files differindex f804b29528..f804b29528 100644 --- a/tools/editor/icons/icon_dynamic_rigid_body.png +++ b/editor/icons/icon_dynamic_rigid_body.png diff --git a/tools/editor/icons/icon_edit.png b/editor/icons/icon_edit.png Binary files differindex c114d2f84d..c114d2f84d 100644 --- a/tools/editor/icons/icon_edit.png +++ b/editor/icons/icon_edit.png diff --git a/tools/editor/icons/icon_edit_key.png b/editor/icons/icon_edit_key.png Binary files differindex 3ebbe75f78..3ebbe75f78 100644 --- a/tools/editor/icons/icon_edit_key.png +++ b/editor/icons/icon_edit_key.png diff --git a/tools/editor/icons/icon_edit_pivot.png b/editor/icons/icon_edit_pivot.png Binary files differindex 230122b969..230122b969 100644 --- a/tools/editor/icons/icon_edit_pivot.png +++ b/editor/icons/icon_edit_pivot.png diff --git a/tools/editor/icons/icon_edit_resource.png b/editor/icons/icon_edit_resource.png Binary files differindex 9f064fea3f..9f064fea3f 100644 --- a/tools/editor/icons/icon_edit_resource.png +++ b/editor/icons/icon_edit_resource.png diff --git a/tools/editor/icons/icon_edit_small.png b/editor/icons/icon_edit_small.png Binary files differindex 19c83415f9..19c83415f9 100644 --- a/tools/editor/icons/icon_edit_small.png +++ b/editor/icons/icon_edit_small.png diff --git a/tools/editor/icons/icon_editor_2d.png b/editor/icons/icon_editor_2d.png Binary files differindex 1594f5adf0..1594f5adf0 100644 --- a/tools/editor/icons/icon_editor_2d.png +++ b/editor/icons/icon_editor_2d.png diff --git a/tools/editor/icons/icon_editor_3d_handle.png b/editor/icons/icon_editor_3d_handle.png Binary files differindex 6935cc9bc4..6935cc9bc4 100644 --- a/tools/editor/icons/icon_editor_3d_handle.png +++ b/editor/icons/icon_editor_3d_handle.png diff --git a/tools/editor/icons/icon_editor_focus.png b/editor/icons/icon_editor_focus.png Binary files differindex 40ce11f381..40ce11f381 100644 --- a/tools/editor/icons/icon_editor_focus.png +++ b/editor/icons/icon_editor_focus.png diff --git a/tools/editor/icons/icon_editor_handle.png b/editor/icons/icon_editor_handle.png Binary files differindex 8950a216da..8950a216da 100644 --- a/tools/editor/icons/icon_editor_handle.png +++ b/editor/icons/icon_editor_handle.png diff --git a/tools/editor/icons/icon_editor_node.png b/editor/icons/icon_editor_node.png Binary files differindex aec161ed54..aec161ed54 100644 --- a/tools/editor/icons/icon_editor_node.png +++ b/editor/icons/icon_editor_node.png diff --git a/tools/editor/icons/icon_editor_pivot.png b/editor/icons/icon_editor_pivot.png Binary files differindex db7feb0be6..db7feb0be6 100644 --- a/tools/editor/icons/icon_editor_pivot.png +++ b/editor/icons/icon_editor_pivot.png diff --git a/tools/editor/icons/icon_editor_plugin.png b/editor/icons/icon_editor_plugin.png Binary files differindex ff7004b993..ff7004b993 100644 --- a/tools/editor/icons/icon_editor_plugin.png +++ b/editor/icons/icon_editor_plugin.png diff --git a/tools/editor/icons/icon_editor_rect_2d.png b/editor/icons/icon_editor_rect_2d.png Binary files differindex f59d493587..f59d493587 100644 --- a/tools/editor/icons/icon_editor_rect_2d.png +++ b/editor/icons/icon_editor_rect_2d.png diff --git a/tools/editor/icons/icon_empty_control.png b/editor/icons/icon_empty_control.png Binary files differindex b43bb14d39..b43bb14d39 100644 --- a/tools/editor/icons/icon_empty_control.png +++ b/editor/icons/icon_empty_control.png diff --git a/tools/editor/icons/icon_enum.png b/editor/icons/icon_enum.png Binary files differindex a98a33aedf..a98a33aedf 100644 --- a/tools/editor/icons/icon_enum.png +++ b/editor/icons/icon_enum.png diff --git a/tools/editor/icons/icon_environment.png b/editor/icons/icon_environment.png Binary files differindex c8c4da3e8f..c8c4da3e8f 100644 --- a/tools/editor/icons/icon_environment.png +++ b/editor/icons/icon_environment.png diff --git a/tools/editor/icons/icon_error.png b/editor/icons/icon_error.png Binary files differindex 7a9bed43aa..7a9bed43aa 100644 --- a/tools/editor/icons/icon_error.png +++ b/editor/icons/icon_error.png diff --git a/tools/editor/icons/icon_error_sign.png b/editor/icons/icon_error_sign.png Binary files differindex 1bfb1f345c..1bfb1f345c 100644 --- a/tools/editor/icons/icon_error_sign.png +++ b/editor/icons/icon_error_sign.png diff --git a/tools/editor/icons/icon_event_player.png b/editor/icons/icon_event_player.png Binary files differindex b5478ca74e..b5478ca74e 100644 --- a/tools/editor/icons/icon_event_player.png +++ b/editor/icons/icon_event_player.png diff --git a/tools/editor/icons/icon_expand.png b/editor/icons/icon_expand.png Binary files differindex 8a604f945b..8a604f945b 100644 --- a/tools/editor/icons/icon_expand.png +++ b/editor/icons/icon_expand.png diff --git a/tools/editor/icons/icon_expand_hl.png b/editor/icons/icon_expand_hl.png Binary files differindex 6f51806db2..6f51806db2 100644 --- a/tools/editor/icons/icon_expand_hl.png +++ b/editor/icons/icon_expand_hl.png diff --git a/tools/editor/icons/icon_favorites.png b/editor/icons/icon_favorites.png Binary files differindex 14e05ad9b9..14e05ad9b9 100644 --- a/tools/editor/icons/icon_favorites.png +++ b/editor/icons/icon_favorites.png diff --git a/tools/editor/icons/icon_file.png b/editor/icons/icon_file.png Binary files differindex 69c6c90dc7..69c6c90dc7 100644 --- a/tools/editor/icons/icon_file.png +++ b/editor/icons/icon_file.png diff --git a/tools/editor/icons/icon_file_big.png b/editor/icons/icon_file_big.png Binary files differindex d429736b57..d429736b57 100644 --- a/tools/editor/icons/icon_file_big.png +++ b/editor/icons/icon_file_big.png diff --git a/tools/editor/icons/icon_file_dialog.png b/editor/icons/icon_file_dialog.png Binary files differindex 162827b2b0..162827b2b0 100644 --- a/tools/editor/icons/icon_file_dialog.png +++ b/editor/icons/icon_file_dialog.png diff --git a/tools/editor/icons/icon_file_list.png b/editor/icons/icon_file_list.png Binary files differindex a98a33aedf..a98a33aedf 100644 --- a/tools/editor/icons/icon_file_list.png +++ b/editor/icons/icon_file_list.png diff --git a/tools/editor/icons/icon_file_server.png b/editor/icons/icon_file_server.png Binary files differindex f5a18fc52d..f5a18fc52d 100644 --- a/tools/editor/icons/icon_file_server.png +++ b/editor/icons/icon_file_server.png diff --git a/tools/editor/icons/icon_file_server_active.png b/editor/icons/icon_file_server_active.png Binary files differindex af5fc0033a..af5fc0033a 100644 --- a/tools/editor/icons/icon_file_server_active.png +++ b/editor/icons/icon_file_server_active.png diff --git a/tools/editor/icons/icon_file_thumbnail.png b/editor/icons/icon_file_thumbnail.png Binary files differindex 6fb4b8f36f..6fb4b8f36f 100644 --- a/tools/editor/icons/icon_file_thumbnail.png +++ b/editor/icons/icon_file_thumbnail.png diff --git a/tools/editor/icons/icon_filesystem.png b/editor/icons/icon_filesystem.png Binary files differindex 5faff250d7..5faff250d7 100644 --- a/tools/editor/icons/icon_filesystem.png +++ b/editor/icons/icon_filesystem.png diff --git a/tools/editor/icons/icon_fixed_material.png b/editor/icons/icon_fixed_material.png Binary files differindex a9b0ebb568..a9b0ebb568 100644 --- a/tools/editor/icons/icon_fixed_material.png +++ b/editor/icons/icon_fixed_material.png diff --git a/tools/editor/icons/icon_fixed_spatial_material.png b/editor/icons/icon_fixed_spatial_material.png Binary files differindex f26ac3be37..f26ac3be37 100644 --- a/tools/editor/icons/icon_fixed_spatial_material.png +++ b/editor/icons/icon_fixed_spatial_material.png diff --git a/tools/editor/icons/icon_fog_f_x.png b/editor/icons/icon_fog_f_x.png Binary files differindex 54691aa9ab..54691aa9ab 100644 --- a/tools/editor/icons/icon_fog_f_x.png +++ b/editor/icons/icon_fog_f_x.png diff --git a/tools/editor/icons/icon_folder.png b/editor/icons/icon_folder.png Binary files differindex cc05e98ebb..cc05e98ebb 100644 --- a/tools/editor/icons/icon_folder.png +++ b/editor/icons/icon_folder.png diff --git a/tools/editor/icons/icon_folder_big.png b/editor/icons/icon_folder_big.png Binary files differindex 05c41720d8..05c41720d8 100644 --- a/tools/editor/icons/icon_folder_big.png +++ b/editor/icons/icon_folder_big.png diff --git a/tools/editor/icons/icon_folder_scene.png b/editor/icons/icon_folder_scene.png Binary files differindex 6f6d706dae..6f6d706dae 100644 --- a/tools/editor/icons/icon_folder_scene.png +++ b/editor/icons/icon_folder_scene.png diff --git a/tools/editor/icons/icon_font.png b/editor/icons/icon_font.png Binary files differindex 543ee01ae4..543ee01ae4 100644 --- a/tools/editor/icons/icon_font.png +++ b/editor/icons/icon_font.png diff --git a/tools/editor/icons/icon_forward.png b/editor/icons/icon_forward.png Binary files differindex 412ffa89d3..412ffa89d3 100644 --- a/tools/editor/icons/icon_forward.png +++ b/editor/icons/icon_forward.png diff --git a/tools/editor/icons/icon_forward_no.png b/editor/icons/icon_forward_no.png Binary files differindex bf62cd6ab2..bf62cd6ab2 100644 --- a/tools/editor/icons/icon_forward_no.png +++ b/editor/icons/icon_forward_no.png diff --git a/tools/editor/icons/icon_func.png b/editor/icons/icon_func.png Binary files differindex 45b32def8a..45b32def8a 100644 --- a/tools/editor/icons/icon_func.png +++ b/editor/icons/icon_func.png diff --git a/tools/editor/icons/icon_g_d_script.png b/editor/icons/icon_g_d_script.png Binary files differindex 4db4c53796..4db4c53796 100644 --- a/tools/editor/icons/icon_g_d_script.png +++ b/editor/icons/icon_g_d_script.png diff --git a/tools/editor/icons/icon_g_i_probe.png b/editor/icons/icon_g_i_probe.png Binary files differindex a15ae18675..a15ae18675 100644 --- a/tools/editor/icons/icon_g_i_probe.png +++ b/editor/icons/icon_g_i_probe.png diff --git a/tools/editor/icons/icon_g_i_probe_data.png b/editor/icons/icon_g_i_probe_data.png Binary files differindex 0aabcc49cb..0aabcc49cb 100644 --- a/tools/editor/icons/icon_g_i_probe_data.png +++ b/editor/icons/icon_g_i_probe_data.png diff --git a/tools/editor/icons/icon_gamma_f_x.png b/editor/icons/icon_gamma_f_x.png Binary files differindex 50474340d1..50474340d1 100644 --- a/tools/editor/icons/icon_gamma_f_x.png +++ b/editor/icons/icon_gamma_f_x.png diff --git a/tools/editor/icons/icon_generic_6_d_o_f_joint.png b/editor/icons/icon_generic_6_d_o_f_joint.png Binary files differindex 00ba76c098..00ba76c098 100644 --- a/tools/editor/icons/icon_generic_6_d_o_f_joint.png +++ b/editor/icons/icon_generic_6_d_o_f_joint.png diff --git a/tools/editor/icons/icon_gizmo_directional_light.png b/editor/icons/icon_gizmo_directional_light.png Binary files differindex bdeb120b43..bdeb120b43 100644 --- a/tools/editor/icons/icon_gizmo_directional_light.png +++ b/editor/icons/icon_gizmo_directional_light.png diff --git a/tools/editor/icons/icon_gizmo_light.png b/editor/icons/icon_gizmo_light.png Binary files differindex be9903f8c2..be9903f8c2 100644 --- a/tools/editor/icons/icon_gizmo_light.png +++ b/editor/icons/icon_gizmo_light.png diff --git a/tools/editor/icons/icon_gizmo_listener.png b/editor/icons/icon_gizmo_listener.png Binary files differindex 47e978be61..47e978be61 100644 --- a/tools/editor/icons/icon_gizmo_listener.png +++ b/editor/icons/icon_gizmo_listener.png diff --git a/tools/editor/icons/icon_gizmo_spatial_sample_player.png b/editor/icons/icon_gizmo_spatial_sample_player.png Binary files differindex 0119dbc433..0119dbc433 100644 --- a/tools/editor/icons/icon_gizmo_spatial_sample_player.png +++ b/editor/icons/icon_gizmo_spatial_sample_player.png diff --git a/tools/editor/icons/icon_gizmo_spatial_stream_player.png b/editor/icons/icon_gizmo_spatial_stream_player.png Binary files differindex 6a4f85d550..6a4f85d550 100644 --- a/tools/editor/icons/icon_gizmo_spatial_stream_player.png +++ b/editor/icons/icon_gizmo_spatial_stream_player.png diff --git a/tools/editor/icons/icon_glow_f_x.png b/editor/icons/icon_glow_f_x.png Binary files differindex c970204359..c970204359 100644 --- a/tools/editor/icons/icon_glow_f_x.png +++ b/editor/icons/icon_glow_f_x.png diff --git a/tools/editor/icons/icon_godot.png b/editor/icons/icon_godot.png Binary files differindex 0b72e6ecc7..0b72e6ecc7 100644 --- a/tools/editor/icons/icon_godot.png +++ b/editor/icons/icon_godot.png diff --git a/tools/editor/icons/icon_godot_asset_default.png b/editor/icons/icon_godot_asset_default.png Binary files differindex 7478399e8b..7478399e8b 100644 --- a/tools/editor/icons/icon_godot_asset_default.png +++ b/editor/icons/icon_godot_asset_default.png diff --git a/tools/editor/icons/icon_graph_color_ramp.png b/editor/icons/icon_graph_color_ramp.png Binary files differindex 03d19a56bb..03d19a56bb 100644 --- a/tools/editor/icons/icon_graph_color_ramp.png +++ b/editor/icons/icon_graph_color_ramp.png diff --git a/tools/editor/icons/icon_graph_comment.png b/editor/icons/icon_graph_comment.png Binary files differindex 1686837d1d..1686837d1d 100644 --- a/tools/editor/icons/icon_graph_comment.png +++ b/editor/icons/icon_graph_comment.png diff --git a/tools/editor/icons/icon_graph_cube_uniform.png b/editor/icons/icon_graph_cube_uniform.png Binary files differindex 8b4ad57c31..8b4ad57c31 100644 --- a/tools/editor/icons/icon_graph_cube_uniform.png +++ b/editor/icons/icon_graph_cube_uniform.png diff --git a/tools/editor/icons/icon_graph_curve_map.png b/editor/icons/icon_graph_curve_map.png Binary files differindex ced27bd62f..ced27bd62f 100644 --- a/tools/editor/icons/icon_graph_curve_map.png +++ b/editor/icons/icon_graph_curve_map.png diff --git a/tools/editor/icons/icon_graph_default_texture.png b/editor/icons/icon_graph_default_texture.png Binary files differindex cad05e8332..cad05e8332 100644 --- a/tools/editor/icons/icon_graph_default_texture.png +++ b/editor/icons/icon_graph_default_texture.png diff --git a/tools/editor/icons/icon_graph_edit.png b/editor/icons/icon_graph_edit.png Binary files differindex f6226b2193..f6226b2193 100644 --- a/tools/editor/icons/icon_graph_edit.png +++ b/editor/icons/icon_graph_edit.png diff --git a/tools/editor/icons/icon_graph_input.png b/editor/icons/icon_graph_input.png Binary files differindex 4725bcf7b1..4725bcf7b1 100644 --- a/tools/editor/icons/icon_graph_input.png +++ b/editor/icons/icon_graph_input.png diff --git a/tools/editor/icons/icon_graph_node.png b/editor/icons/icon_graph_node.png Binary files differindex fec38cb3eb..fec38cb3eb 100644 --- a/tools/editor/icons/icon_graph_node.png +++ b/editor/icons/icon_graph_node.png diff --git a/tools/editor/icons/icon_graph_rgb.png b/editor/icons/icon_graph_rgb.png Binary files differindex 3113a18e8c..3113a18e8c 100644 --- a/tools/editor/icons/icon_graph_rgb.png +++ b/editor/icons/icon_graph_rgb.png diff --git a/tools/editor/icons/icon_graph_rgb_op.png b/editor/icons/icon_graph_rgb_op.png Binary files differindex 09d633e722..09d633e722 100644 --- a/tools/editor/icons/icon_graph_rgb_op.png +++ b/editor/icons/icon_graph_rgb_op.png diff --git a/tools/editor/icons/icon_graph_rgb_uniform.png b/editor/icons/icon_graph_rgb_uniform.png Binary files differindex dbe10c9c8e..dbe10c9c8e 100644 --- a/tools/editor/icons/icon_graph_rgb_uniform.png +++ b/editor/icons/icon_graph_rgb_uniform.png diff --git a/tools/editor/icons/icon_graph_scalar.png b/editor/icons/icon_graph_scalar.png Binary files differindex d44fd34891..d44fd34891 100644 --- a/tools/editor/icons/icon_graph_scalar.png +++ b/editor/icons/icon_graph_scalar.png diff --git a/tools/editor/icons/icon_graph_scalar_interp.png b/editor/icons/icon_graph_scalar_interp.png Binary files differindex adcfc7d857..adcfc7d857 100644 --- a/tools/editor/icons/icon_graph_scalar_interp.png +++ b/editor/icons/icon_graph_scalar_interp.png diff --git a/tools/editor/icons/icon_graph_scalar_op.png b/editor/icons/icon_graph_scalar_op.png Binary files differindex 6459cb9759..6459cb9759 100644 --- a/tools/editor/icons/icon_graph_scalar_op.png +++ b/editor/icons/icon_graph_scalar_op.png diff --git a/tools/editor/icons/icon_graph_scalar_uniform.png b/editor/icons/icon_graph_scalar_uniform.png Binary files differindex e7e0b9a73c..e7e0b9a73c 100644 --- a/tools/editor/icons/icon_graph_scalar_uniform.png +++ b/editor/icons/icon_graph_scalar_uniform.png diff --git a/tools/editor/icons/icon_graph_scalars_to_vec.png b/editor/icons/icon_graph_scalars_to_vec.png Binary files differindex 231a25a02a..231a25a02a 100644 --- a/tools/editor/icons/icon_graph_scalars_to_vec.png +++ b/editor/icons/icon_graph_scalars_to_vec.png diff --git a/tools/editor/icons/icon_graph_texscreen.png b/editor/icons/icon_graph_texscreen.png Binary files differindex 628990553a..628990553a 100644 --- a/tools/editor/icons/icon_graph_texscreen.png +++ b/editor/icons/icon_graph_texscreen.png diff --git a/tools/editor/icons/icon_graph_texture_uniform.png b/editor/icons/icon_graph_texture_uniform.png Binary files differindex 9c0c758dc1..9c0c758dc1 100644 --- a/tools/editor/icons/icon_graph_texture_uniform.png +++ b/editor/icons/icon_graph_texture_uniform.png diff --git a/tools/editor/icons/icon_graph_time.png b/editor/icons/icon_graph_time.png Binary files differindex 2a9b73dc2b..2a9b73dc2b 100644 --- a/tools/editor/icons/icon_graph_time.png +++ b/editor/icons/icon_graph_time.png diff --git a/tools/editor/icons/icon_graph_vec_dp.png b/editor/icons/icon_graph_vec_dp.png Binary files differindex c395b61bb6..c395b61bb6 100644 --- a/tools/editor/icons/icon_graph_vec_dp.png +++ b/editor/icons/icon_graph_vec_dp.png diff --git a/tools/editor/icons/icon_graph_vec_interp.png b/editor/icons/icon_graph_vec_interp.png Binary files differindex 00cfe6ed29..00cfe6ed29 100644 --- a/tools/editor/icons/icon_graph_vec_interp.png +++ b/editor/icons/icon_graph_vec_interp.png diff --git a/tools/editor/icons/icon_graph_vec_length.png b/editor/icons/icon_graph_vec_length.png Binary files differindex af449109fd..af449109fd 100644 --- a/tools/editor/icons/icon_graph_vec_length.png +++ b/editor/icons/icon_graph_vec_length.png diff --git a/tools/editor/icons/icon_graph_vec_op.png b/editor/icons/icon_graph_vec_op.png Binary files differindex c4e3cf409a..c4e3cf409a 100644 --- a/tools/editor/icons/icon_graph_vec_op.png +++ b/editor/icons/icon_graph_vec_op.png diff --git a/tools/editor/icons/icon_graph_vec_scalar_op.png b/editor/icons/icon_graph_vec_scalar_op.png Binary files differindex f7fc3b054e..f7fc3b054e 100644 --- a/tools/editor/icons/icon_graph_vec_scalar_op.png +++ b/editor/icons/icon_graph_vec_scalar_op.png diff --git a/tools/editor/icons/icon_graph_vec_to_scalars.png b/editor/icons/icon_graph_vec_to_scalars.png Binary files differindex 33f9fdf9bd..33f9fdf9bd 100644 --- a/tools/editor/icons/icon_graph_vec_to_scalars.png +++ b/editor/icons/icon_graph_vec_to_scalars.png diff --git a/tools/editor/icons/icon_graph_vecs_to_xform.png b/editor/icons/icon_graph_vecs_to_xform.png Binary files differindex 82c32525dc..82c32525dc 100644 --- a/tools/editor/icons/icon_graph_vecs_to_xform.png +++ b/editor/icons/icon_graph_vecs_to_xform.png diff --git a/tools/editor/icons/icon_graph_vector.png b/editor/icons/icon_graph_vector.png Binary files differindex d78a3fdf5c..d78a3fdf5c 100644 --- a/tools/editor/icons/icon_graph_vector.png +++ b/editor/icons/icon_graph_vector.png diff --git a/tools/editor/icons/icon_graph_vector_uniform.png b/editor/icons/icon_graph_vector_uniform.png Binary files differindex a89166768b..a89166768b 100644 --- a/tools/editor/icons/icon_graph_vector_uniform.png +++ b/editor/icons/icon_graph_vector_uniform.png diff --git a/tools/editor/icons/icon_graph_xform.png b/editor/icons/icon_graph_xform.png Binary files differindex 142ec3eca5..142ec3eca5 100644 --- a/tools/editor/icons/icon_graph_xform.png +++ b/editor/icons/icon_graph_xform.png diff --git a/tools/editor/icons/icon_graph_xform_mult.png b/editor/icons/icon_graph_xform_mult.png Binary files differindex 94981d81af..94981d81af 100644 --- a/tools/editor/icons/icon_graph_xform_mult.png +++ b/editor/icons/icon_graph_xform_mult.png diff --git a/tools/editor/icons/icon_graph_xform_scalar_func.png b/editor/icons/icon_graph_xform_scalar_func.png Binary files differindex d0edded8b0..d0edded8b0 100644 --- a/tools/editor/icons/icon_graph_xform_scalar_func.png +++ b/editor/icons/icon_graph_xform_scalar_func.png diff --git a/tools/editor/icons/icon_graph_xform_to_vecs.png b/editor/icons/icon_graph_xform_to_vecs.png Binary files differindex 3d59c7957d..3d59c7957d 100644 --- a/tools/editor/icons/icon_graph_xform_to_vecs.png +++ b/editor/icons/icon_graph_xform_to_vecs.png diff --git a/tools/editor/icons/icon_graph_xform_uniform.png b/editor/icons/icon_graph_xform_uniform.png Binary files differindex 36ed91e427..36ed91e427 100644 --- a/tools/editor/icons/icon_graph_xform_uniform.png +++ b/editor/icons/icon_graph_xform_uniform.png diff --git a/tools/editor/icons/icon_graph_xform_vec_func.png b/editor/icons/icon_graph_xform_vec_func.png Binary files differindex 3866430f72..3866430f72 100644 --- a/tools/editor/icons/icon_graph_xform_vec_func.png +++ b/editor/icons/icon_graph_xform_vec_func.png diff --git a/tools/editor/icons/icon_graph_xform_vec_imult.png b/editor/icons/icon_graph_xform_vec_imult.png Binary files differindex 07a7e214c2..07a7e214c2 100644 --- a/tools/editor/icons/icon_graph_xform_vec_imult.png +++ b/editor/icons/icon_graph_xform_vec_imult.png diff --git a/tools/editor/icons/icon_graph_xform_vec_mult.png b/editor/icons/icon_graph_xform_vec_mult.png Binary files differindex 8048e755c5..8048e755c5 100644 --- a/tools/editor/icons/icon_graph_xform_vec_mult.png +++ b/editor/icons/icon_graph_xform_vec_mult.png diff --git a/tools/editor/icons/icon_grid.png b/editor/icons/icon_grid.png Binary files differindex 1366205fe0..1366205fe0 100644 --- a/tools/editor/icons/icon_grid.png +++ b/editor/icons/icon_grid.png diff --git a/tools/editor/icons/icon_grid_container.png b/editor/icons/icon_grid_container.png Binary files differindex 027e992770..027e992770 100644 --- a/tools/editor/icons/icon_grid_container.png +++ b/editor/icons/icon_grid_container.png diff --git a/tools/editor/icons/icon_grid_map.png b/editor/icons/icon_grid_map.png Binary files differindex 570b11d085..570b11d085 100644 --- a/tools/editor/icons/icon_grid_map.png +++ b/editor/icons/icon_grid_map.png diff --git a/tools/editor/icons/icon_grid_map_floor.png b/editor/icons/icon_grid_map_floor.png Binary files differindex a75871188b..a75871188b 100644 --- a/tools/editor/icons/icon_grid_map_floor.png +++ b/editor/icons/icon_grid_map_floor.png diff --git a/tools/editor/icons/icon_groove_joint_2d.png b/editor/icons/icon_groove_joint_2d.png Binary files differindex f65dc2b6b8..f65dc2b6b8 100644 --- a/tools/editor/icons/icon_groove_joint_2d.png +++ b/editor/icons/icon_groove_joint_2d.png diff --git a/tools/editor/icons/icon_group.png b/editor/icons/icon_group.png Binary files differindex 5ffc90455e..5ffc90455e 100644 --- a/tools/editor/icons/icon_group.png +++ b/editor/icons/icon_group.png diff --git a/tools/editor/icons/icon_groups.png b/editor/icons/icon_groups.png Binary files differindex 84a05560a9..84a05560a9 100644 --- a/tools/editor/icons/icon_groups.png +++ b/editor/icons/icon_groups.png diff --git a/tools/editor/icons/icon_h_box_container.png b/editor/icons/icon_h_box_container.png Binary files differindex 36cef0a03c..36cef0a03c 100644 --- a/tools/editor/icons/icon_h_box_container.png +++ b/editor/icons/icon_h_box_container.png diff --git a/tools/editor/icons/icon_h_button_array.png b/editor/icons/icon_h_button_array.png Binary files differindex baf3386801..baf3386801 100644 --- a/tools/editor/icons/icon_h_button_array.png +++ b/editor/icons/icon_h_button_array.png diff --git a/tools/editor/icons/icon_h_scroll_bar.png b/editor/icons/icon_h_scroll_bar.png Binary files differindex e4576c4ae3..e4576c4ae3 100644 --- a/tools/editor/icons/icon_h_scroll_bar.png +++ b/editor/icons/icon_h_scroll_bar.png diff --git a/tools/editor/icons/icon_h_separator.png b/editor/icons/icon_h_separator.png Binary files differindex 8ab1348c3b..8ab1348c3b 100644 --- a/tools/editor/icons/icon_h_separator.png +++ b/editor/icons/icon_h_separator.png diff --git a/tools/editor/icons/icon_h_slider.png b/editor/icons/icon_h_slider.png Binary files differindex 87cf585e14..87cf585e14 100644 --- a/tools/editor/icons/icon_h_slider.png +++ b/editor/icons/icon_h_slider.png diff --git a/tools/editor/icons/icon_h_split_container.png b/editor/icons/icon_h_split_container.png Binary files differindex 65ef8655dd..65ef8655dd 100644 --- a/tools/editor/icons/icon_h_split_container.png +++ b/editor/icons/icon_h_split_container.png diff --git a/tools/editor/icons/icon_h_t_t_p_request.png b/editor/icons/icon_h_t_t_p_request.png Binary files differindex 60c6845b33..60c6845b33 100644 --- a/tools/editor/icons/icon_h_t_t_p_request.png +++ b/editor/icons/icon_h_t_t_p_request.png diff --git a/tools/editor/icons/icon_headphones.png b/editor/icons/icon_headphones.png Binary files differindex 83309d91d5..83309d91d5 100644 --- a/tools/editor/icons/icon_headphones.png +++ b/editor/icons/icon_headphones.png diff --git a/tools/editor/icons/icon_help.png b/editor/icons/icon_help.png Binary files differindex f05b512f4c..f05b512f4c 100644 --- a/tools/editor/icons/icon_help.png +++ b/editor/icons/icon_help.png diff --git a/tools/editor/icons/icon_hidden.png b/editor/icons/icon_hidden.png Binary files differindex ef3039f580..ef3039f580 100644 --- a/tools/editor/icons/icon_hidden.png +++ b/editor/icons/icon_hidden.png diff --git a/tools/editor/icons/icon_hinge_joint.png b/editor/icons/icon_hinge_joint.png Binary files differindex 246ca1ba42..246ca1ba42 100644 --- a/tools/editor/icons/icon_hinge_joint.png +++ b/editor/icons/icon_hinge_joint.png diff --git a/tools/editor/icons/icon_history.png b/editor/icons/icon_history.png Binary files differindex 4782918233..4782918233 100644 --- a/tools/editor/icons/icon_history.png +++ b/editor/icons/icon_history.png diff --git a/tools/editor/icons/icon_hsize.png b/editor/icons/icon_hsize.png Binary files differindex 7be48946b4..7be48946b4 100644 --- a/tools/editor/icons/icon_hsize.png +++ b/editor/icons/icon_hsize.png diff --git a/tools/editor/icons/icon_iapi.png b/editor/icons/icon_iapi.png Binary files differindex dc2639da83..dc2639da83 100644 --- a/tools/editor/icons/icon_iapi.png +++ b/editor/icons/icon_iapi.png diff --git a/tools/editor/icons/icon_image.png b/editor/icons/icon_image.png Binary files differindex ddfabace25..ddfabace25 100644 --- a/tools/editor/icons/icon_image.png +++ b/editor/icons/icon_image.png diff --git a/tools/editor/icons/icon_image_sky_box.png b/editor/icons/icon_image_sky_box.png Binary files differindex cf80258577..cf80258577 100644 --- a/tools/editor/icons/icon_image_sky_box.png +++ b/editor/icons/icon_image_sky_box.png diff --git a/tools/editor/icons/icon_image_texture.png b/editor/icons/icon_image_texture.png Binary files differindex 7c4493395e..7c4493395e 100644 --- a/tools/editor/icons/icon_image_texture.png +++ b/editor/icons/icon_image_texture.png diff --git a/tools/editor/icons/icon_immediate_geometry.png b/editor/icons/icon_immediate_geometry.png Binary files differindex 1ff9976921..1ff9976921 100644 --- a/tools/editor/icons/icon_immediate_geometry.png +++ b/editor/icons/icon_immediate_geometry.png diff --git a/tools/editor/icons/icon_import_check.png b/editor/icons/icon_import_check.png Binary files differindex e72a30603d..e72a30603d 100644 --- a/tools/editor/icons/icon_import_check.png +++ b/editor/icons/icon_import_check.png diff --git a/tools/editor/icons/icon_import_fail.png b/editor/icons/icon_import_fail.png Binary files differindex f7dd6fd79a..f7dd6fd79a 100644 --- a/tools/editor/icons/icon_import_fail.png +++ b/editor/icons/icon_import_fail.png diff --git a/tools/editor/icons/icon_influence_zone.png b/editor/icons/icon_influence_zone.png Binary files differindex 6d687735e9..6d687735e9 100644 --- a/tools/editor/icons/icon_influence_zone.png +++ b/editor/icons/icon_influence_zone.png diff --git a/tools/editor/icons/icon_instance.png b/editor/icons/icon_instance.png Binary files differindex 51859a0425..51859a0425 100644 --- a/tools/editor/icons/icon_instance.png +++ b/editor/icons/icon_instance.png diff --git a/tools/editor/icons/icon_instance_options.png b/editor/icons/icon_instance_options.png Binary files differindex ce6810ad27..ce6810ad27 100644 --- a/tools/editor/icons/icon_instance_options.png +++ b/editor/icons/icon_instance_options.png diff --git a/tools/editor/icons/icon_integer.png b/editor/icons/icon_integer.png Binary files differindex 583b9bda0b..583b9bda0b 100644 --- a/tools/editor/icons/icon_integer.png +++ b/editor/icons/icon_integer.png diff --git a/tools/editor/icons/icon_interp_cubic.png b/editor/icons/icon_interp_cubic.png Binary files differindex c723f7b648..c723f7b648 100644 --- a/tools/editor/icons/icon_interp_cubic.png +++ b/editor/icons/icon_interp_cubic.png diff --git a/tools/editor/icons/icon_interp_linear.png b/editor/icons/icon_interp_linear.png Binary files differindex 9d130b4507..9d130b4507 100644 --- a/tools/editor/icons/icon_interp_linear.png +++ b/editor/icons/icon_interp_linear.png diff --git a/tools/editor/icons/icon_interp_raw.png b/editor/icons/icon_interp_raw.png Binary files differindex 93ade1d674..93ade1d674 100644 --- a/tools/editor/icons/icon_interp_raw.png +++ b/editor/icons/icon_interp_raw.png diff --git a/tools/editor/icons/icon_interp_wrap_clamp.png b/editor/icons/icon_interp_wrap_clamp.png Binary files differindex 1024bd7d29..1024bd7d29 100644 --- a/tools/editor/icons/icon_interp_wrap_clamp.png +++ b/editor/icons/icon_interp_wrap_clamp.png diff --git a/tools/editor/icons/icon_interp_wrap_loop.png b/editor/icons/icon_interp_wrap_loop.png Binary files differindex 3a7ddacdb2..3a7ddacdb2 100644 --- a/tools/editor/icons/icon_interp_wrap_loop.png +++ b/editor/icons/icon_interp_wrap_loop.png diff --git a/tools/editor/icons/icon_interpolated_camera.png b/editor/icons/icon_interpolated_camera.png Binary files differindex c66724f513..c66724f513 100644 --- a/tools/editor/icons/icon_interpolated_camera.png +++ b/editor/icons/icon_interpolated_camera.png diff --git a/tools/editor/icons/icon_invalid_key.png b/editor/icons/icon_invalid_key.png Binary files differindex 8ebc6d6add..8ebc6d6add 100644 --- a/tools/editor/icons/icon_invalid_key.png +++ b/editor/icons/icon_invalid_key.png diff --git a/tools/editor/icons/icon_inverse_kinematics.png b/editor/icons/icon_inverse_kinematics.png Binary files differindex dd404765d3..dd404765d3 100644 --- a/tools/editor/icons/icon_inverse_kinematics.png +++ b/editor/icons/icon_inverse_kinematics.png diff --git a/tools/editor/icons/icon_item_list.png b/editor/icons/icon_item_list.png Binary files differindex 3f5245d520..3f5245d520 100644 --- a/tools/editor/icons/icon_item_list.png +++ b/editor/icons/icon_item_list.png diff --git a/tools/editor/icons/icon_joy_axis.png b/editor/icons/icon_joy_axis.png Binary files differindex 8b1affd052..8b1affd052 100644 --- a/tools/editor/icons/icon_joy_axis.png +++ b/editor/icons/icon_joy_axis.png diff --git a/tools/editor/icons/icon_joy_button.png b/editor/icons/icon_joy_button.png Binary files differindex 150102b209..150102b209 100644 --- a/tools/editor/icons/icon_joy_button.png +++ b/editor/icons/icon_joy_button.png diff --git a/tools/editor/icons/icon_joypad.png b/editor/icons/icon_joypad.png Binary files differindex 5df471109a..5df471109a 100644 --- a/tools/editor/icons/icon_joypad.png +++ b/editor/icons/icon_joypad.png diff --git a/tools/editor/icons/icon_key.png b/editor/icons/icon_key.png Binary files differindex 564b474331..564b474331 100644 --- a/tools/editor/icons/icon_key.png +++ b/editor/icons/icon_key.png diff --git a/tools/editor/icons/icon_key_call.png b/editor/icons/icon_key_call.png Binary files differindex 044662eb92..044662eb92 100644 --- a/tools/editor/icons/icon_key_call.png +++ b/editor/icons/icon_key_call.png diff --git a/tools/editor/icons/icon_key_hover.png b/editor/icons/icon_key_hover.png Binary files differindex 7ab405bb07..7ab405bb07 100644 --- a/tools/editor/icons/icon_key_hover.png +++ b/editor/icons/icon_key_hover.png diff --git a/tools/editor/icons/icon_key_invalid.png b/editor/icons/icon_key_invalid.png Binary files differindex 8ebc6d6add..8ebc6d6add 100644 --- a/tools/editor/icons/icon_key_invalid.png +++ b/editor/icons/icon_key_invalid.png diff --git a/tools/editor/icons/icon_key_invalid_hover.png b/editor/icons/icon_key_invalid_hover.png Binary files differindex 6f0396d96a..6f0396d96a 100644 --- a/tools/editor/icons/icon_key_invalid_hover.png +++ b/editor/icons/icon_key_invalid_hover.png diff --git a/tools/editor/icons/icon_key_next.png b/editor/icons/icon_key_next.png Binary files differindex 288161d245..288161d245 100644 --- a/tools/editor/icons/icon_key_next.png +++ b/editor/icons/icon_key_next.png diff --git a/tools/editor/icons/icon_key_selected.png b/editor/icons/icon_key_selected.png Binary files differindex 1838dc95aa..1838dc95aa 100644 --- a/tools/editor/icons/icon_key_selected.png +++ b/editor/icons/icon_key_selected.png diff --git a/tools/editor/icons/icon_key_value.png b/editor/icons/icon_key_value.png Binary files differindex 5c0b25a264..5c0b25a264 100644 --- a/tools/editor/icons/icon_key_value.png +++ b/editor/icons/icon_key_value.png diff --git a/tools/editor/icons/icon_key_xform.png b/editor/icons/icon_key_xform.png Binary files differindex 1171bd80db..1171bd80db 100644 --- a/tools/editor/icons/icon_key_xform.png +++ b/editor/icons/icon_key_xform.png diff --git a/tools/editor/icons/icon_keyboard.png b/editor/icons/icon_keyboard.png Binary files differindex a275345577..a275345577 100644 --- a/tools/editor/icons/icon_keyboard.png +++ b/editor/icons/icon_keyboard.png diff --git a/tools/editor/icons/icon_keying.png b/editor/icons/icon_keying.png Binary files differindex de790a4f09..de790a4f09 100644 --- a/tools/editor/icons/icon_keying.png +++ b/editor/icons/icon_keying.png diff --git a/tools/editor/icons/icon_kinematic_body.png b/editor/icons/icon_kinematic_body.png Binary files differindex 19a401dbf8..19a401dbf8 100644 --- a/tools/editor/icons/icon_kinematic_body.png +++ b/editor/icons/icon_kinematic_body.png diff --git a/tools/editor/icons/icon_kinematic_body_2d.png b/editor/icons/icon_kinematic_body_2d.png Binary files differindex 2f9d834805..2f9d834805 100644 --- a/tools/editor/icons/icon_kinematic_body_2d.png +++ b/editor/icons/icon_kinematic_body_2d.png diff --git a/tools/editor/icons/icon_label.png b/editor/icons/icon_label.png Binary files differindex 16919a5fef..16919a5fef 100644 --- a/tools/editor/icons/icon_label.png +++ b/editor/icons/icon_label.png diff --git a/tools/editor/icons/icon_large_texture.png b/editor/icons/icon_large_texture.png Binary files differindex 1727e2409f..1727e2409f 100644 --- a/tools/editor/icons/icon_large_texture.png +++ b/editor/icons/icon_large_texture.png diff --git a/tools/editor/icons/icon_light_2d.png b/editor/icons/icon_light_2d.png Binary files differindex ebab16c1b1..ebab16c1b1 100644 --- a/tools/editor/icons/icon_light_2d.png +++ b/editor/icons/icon_light_2d.png diff --git a/tools/editor/icons/icon_light_map.png b/editor/icons/icon_light_map.png Binary files differindex e0333f06ea..e0333f06ea 100644 --- a/tools/editor/icons/icon_light_map.png +++ b/editor/icons/icon_light_map.png diff --git a/tools/editor/icons/icon_light_occluder_2d.png b/editor/icons/icon_light_occluder_2d.png Binary files differindex ceefbcbe2a..ceefbcbe2a 100644 --- a/tools/editor/icons/icon_light_occluder_2d.png +++ b/editor/icons/icon_light_occluder_2d.png diff --git a/tools/editor/icons/icon_lightr.png b/editor/icons/icon_lightr.png Binary files differindex 6de8c8de3f..6de8c8de3f 100644 --- a/tools/editor/icons/icon_lightr.png +++ b/editor/icons/icon_lightr.png diff --git a/editor/icons/icon_line_2d.png b/editor/icons/icon_line_2d.png Binary files differnew file mode 100644 index 0000000000..4ebf46af04 --- /dev/null +++ b/editor/icons/icon_line_2d.png diff --git a/tools/editor/icons/icon_line_edit.png b/editor/icons/icon_line_edit.png Binary files differindex 81b5efcf6c..81b5efcf6c 100644 --- a/tools/editor/icons/icon_line_edit.png +++ b/editor/icons/icon_line_edit.png diff --git a/tools/editor/icons/icon_line_shape_2d.png b/editor/icons/icon_line_shape_2d.png Binary files differindex e31722d69c..e31722d69c 100644 --- a/tools/editor/icons/icon_line_shape_2d.png +++ b/editor/icons/icon_line_shape_2d.png diff --git a/tools/editor/icons/icon_link_button.png b/editor/icons/icon_link_button.png Binary files differindex 7febe3c19a..7febe3c19a 100644 --- a/tools/editor/icons/icon_link_button.png +++ b/editor/icons/icon_link_button.png diff --git a/tools/editor/icons/icon_list_select.png b/editor/icons/icon_list_select.png Binary files differindex 9596d51e72..9596d51e72 100644 --- a/tools/editor/icons/icon_list_select.png +++ b/editor/icons/icon_list_select.png diff --git a/tools/editor/icons/icon_listener.png b/editor/icons/icon_listener.png Binary files differindex 3ce479e2fa..3ce479e2fa 100644 --- a/tools/editor/icons/icon_listener.png +++ b/editor/icons/icon_listener.png diff --git a/tools/editor/icons/icon_live_debug.png b/editor/icons/icon_live_debug.png Binary files differindex ad55646b9a..ad55646b9a 100644 --- a/tools/editor/icons/icon_live_debug.png +++ b/editor/icons/icon_live_debug.png diff --git a/tools/editor/icons/icon_load.png b/editor/icons/icon_load.png Binary files differindex 81835efa25..81835efa25 100644 --- a/tools/editor/icons/icon_load.png +++ b/editor/icons/icon_load.png diff --git a/tools/editor/icons/icon_lock.png b/editor/icons/icon_lock.png Binary files differindex a7059f5e7c..a7059f5e7c 100644 --- a/tools/editor/icons/icon_lock.png +++ b/editor/icons/icon_lock.png diff --git a/tools/editor/icons/icon_logo.png b/editor/icons/icon_logo.png Binary files differindex 9bbd7dc619..9bbd7dc619 100644 --- a/tools/editor/icons/icon_logo.png +++ b/editor/icons/icon_logo.png diff --git a/tools/editor/icons/icon_logo_small.png b/editor/icons/icon_logo_small.png Binary files differindex 9c7c7fe365..9c7c7fe365 100644 --- a/tools/editor/icons/icon_logo_small.png +++ b/editor/icons/icon_logo_small.png diff --git a/tools/editor/icons/icon_loop.png b/editor/icons/icon_loop.png Binary files differindex 91c3ad600e..91c3ad600e 100644 --- a/tools/editor/icons/icon_loop.png +++ b/editor/icons/icon_loop.png diff --git a/tools/editor/icons/icon_loop_interpolation.png b/editor/icons/icon_loop_interpolation.png Binary files differindex 488b33316e..488b33316e 100644 --- a/tools/editor/icons/icon_loop_interpolation.png +++ b/editor/icons/icon_loop_interpolation.png diff --git a/tools/editor/icons/icon_main_play.png b/editor/icons/icon_main_play.png Binary files differindex a72672f963..a72672f963 100644 --- a/tools/editor/icons/icon_main_play.png +++ b/editor/icons/icon_main_play.png diff --git a/tools/editor/icons/icon_main_stop.png b/editor/icons/icon_main_stop.png Binary files differindex 58387519dc..58387519dc 100644 --- a/tools/editor/icons/icon_main_stop.png +++ b/editor/icons/icon_main_stop.png diff --git a/tools/editor/icons/icon_margin_container.png b/editor/icons/icon_margin_container.png Binary files differindex 57f0cec42e..57f0cec42e 100644 --- a/tools/editor/icons/icon_margin_container.png +++ b/editor/icons/icon_margin_container.png diff --git a/tools/editor/icons/icon_material_preview_cube.png b/editor/icons/icon_material_preview_cube.png Binary files differindex f97c23b950..f97c23b950 100644 --- a/tools/editor/icons/icon_material_preview_cube.png +++ b/editor/icons/icon_material_preview_cube.png diff --git a/tools/editor/icons/icon_material_preview_cube_off.png b/editor/icons/icon_material_preview_cube_off.png Binary files differindex ad63218658..ad63218658 100644 --- a/tools/editor/icons/icon_material_preview_cube_off.png +++ b/editor/icons/icon_material_preview_cube_off.png diff --git a/tools/editor/icons/icon_material_preview_light_1.png b/editor/icons/icon_material_preview_light_1.png Binary files differindex 2a49a7530b..2a49a7530b 100644 --- a/tools/editor/icons/icon_material_preview_light_1.png +++ b/editor/icons/icon_material_preview_light_1.png diff --git a/tools/editor/icons/icon_material_preview_light_1_off.png b/editor/icons/icon_material_preview_light_1_off.png Binary files differindex 738dd75594..738dd75594 100644 --- a/tools/editor/icons/icon_material_preview_light_1_off.png +++ b/editor/icons/icon_material_preview_light_1_off.png diff --git a/tools/editor/icons/icon_material_preview_light_2.png b/editor/icons/icon_material_preview_light_2.png Binary files differindex 7e43b4425e..7e43b4425e 100644 --- a/tools/editor/icons/icon_material_preview_light_2.png +++ b/editor/icons/icon_material_preview_light_2.png diff --git a/tools/editor/icons/icon_material_preview_light_2_off.png b/editor/icons/icon_material_preview_light_2_off.png Binary files differindex e2f0e345a9..e2f0e345a9 100644 --- a/tools/editor/icons/icon_material_preview_light_2_off.png +++ b/editor/icons/icon_material_preview_light_2_off.png diff --git a/tools/editor/icons/icon_material_preview_sphere.png b/editor/icons/icon_material_preview_sphere.png Binary files differindex 80b06b39b7..80b06b39b7 100644 --- a/tools/editor/icons/icon_material_preview_sphere.png +++ b/editor/icons/icon_material_preview_sphere.png diff --git a/tools/editor/icons/icon_material_preview_sphere_off.png b/editor/icons/icon_material_preview_sphere_off.png Binary files differindex a5acfcb8c9..a5acfcb8c9 100644 --- a/tools/editor/icons/icon_material_preview_sphere_off.png +++ b/editor/icons/icon_material_preview_sphere_off.png diff --git a/tools/editor/icons/icon_material_shader.png b/editor/icons/icon_material_shader.png Binary files differindex 568a45d938..568a45d938 100644 --- a/tools/editor/icons/icon_material_shader.png +++ b/editor/icons/icon_material_shader.png diff --git a/tools/editor/icons/icon_material_shader_graph.png b/editor/icons/icon_material_shader_graph.png Binary files differindex f40e3755af..f40e3755af 100644 --- a/tools/editor/icons/icon_material_shader_graph.png +++ b/editor/icons/icon_material_shader_graph.png diff --git a/tools/editor/icons/icon_matrix.png b/editor/icons/icon_matrix.png Binary files differindex ba0772ff8a..ba0772ff8a 100644 --- a/tools/editor/icons/icon_matrix.png +++ b/editor/icons/icon_matrix.png diff --git a/tools/editor/icons/icon_menu_button.png b/editor/icons/icon_menu_button.png Binary files differindex 1fd2e41c23..1fd2e41c23 100644 --- a/tools/editor/icons/icon_menu_button.png +++ b/editor/icons/icon_menu_button.png diff --git a/tools/editor/icons/icon_mesh.png b/editor/icons/icon_mesh.png Binary files differindex 03e1501403..03e1501403 100644 --- a/tools/editor/icons/icon_mesh.png +++ b/editor/icons/icon_mesh.png diff --git a/tools/editor/icons/icon_mesh_instance.png b/editor/icons/icon_mesh_instance.png Binary files differindex c513feb1cd..c513feb1cd 100644 --- a/tools/editor/icons/icon_mesh_instance.png +++ b/editor/icons/icon_mesh_instance.png diff --git a/tools/editor/icons/icon_mesh_library.png b/editor/icons/icon_mesh_library.png Binary files differindex 0bb37b1da3..0bb37b1da3 100644 --- a/tools/editor/icons/icon_mesh_library.png +++ b/editor/icons/icon_mesh_library.png diff --git a/tools/editor/icons/icon_mesh_old.png b/editor/icons/icon_mesh_old.png Binary files differindex 18531ff844..18531ff844 100644 --- a/tools/editor/icons/icon_mesh_old.png +++ b/editor/icons/icon_mesh_old.png diff --git a/tools/editor/icons/icon_meshr.png b/editor/icons/icon_meshr.png Binary files differindex 1ed2a123e6..1ed2a123e6 100644 --- a/tools/editor/icons/icon_meshr.png +++ b/editor/icons/icon_meshr.png diff --git a/tools/editor/icons/icon_mini_aabb.png b/editor/icons/icon_mini_aabb.png Binary files differindex eebc4633e4..eebc4633e4 100644 --- a/tools/editor/icons/icon_mini_aabb.png +++ b/editor/icons/icon_mini_aabb.png diff --git a/tools/editor/icons/icon_mini_array.png b/editor/icons/icon_mini_array.png Binary files differindex ade885e4d4..ade885e4d4 100644 --- a/tools/editor/icons/icon_mini_array.png +++ b/editor/icons/icon_mini_array.png diff --git a/tools/editor/icons/icon_mini_boolean.png b/editor/icons/icon_mini_boolean.png Binary files differindex 9cb64fc983..9cb64fc983 100644 --- a/tools/editor/icons/icon_mini_boolean.png +++ b/editor/icons/icon_mini_boolean.png diff --git a/tools/editor/icons/icon_mini_color.png b/editor/icons/icon_mini_color.png Binary files differindex bebf64e262..bebf64e262 100644 --- a/tools/editor/icons/icon_mini_color.png +++ b/editor/icons/icon_mini_color.png diff --git a/tools/editor/icons/icon_mini_color_array.png b/editor/icons/icon_mini_color_array.png Binary files differindex 434b2f96f5..434b2f96f5 100644 --- a/tools/editor/icons/icon_mini_color_array.png +++ b/editor/icons/icon_mini_color_array.png diff --git a/tools/editor/icons/icon_mini_dictionary.png b/editor/icons/icon_mini_dictionary.png Binary files differindex 11fd536a83..11fd536a83 100644 --- a/tools/editor/icons/icon_mini_dictionary.png +++ b/editor/icons/icon_mini_dictionary.png diff --git a/tools/editor/icons/icon_mini_float.png b/editor/icons/icon_mini_float.png Binary files differindex f8c8d9a174..f8c8d9a174 100644 --- a/tools/editor/icons/icon_mini_float.png +++ b/editor/icons/icon_mini_float.png diff --git a/tools/editor/icons/icon_mini_float_array.png b/editor/icons/icon_mini_float_array.png Binary files differindex 8b8177e151..8b8177e151 100644 --- a/tools/editor/icons/icon_mini_float_array.png +++ b/editor/icons/icon_mini_float_array.png diff --git a/tools/editor/icons/icon_mini_image.png b/editor/icons/icon_mini_image.png Binary files differindex 2ad359bdbe..2ad359bdbe 100644 --- a/tools/editor/icons/icon_mini_image.png +++ b/editor/icons/icon_mini_image.png diff --git a/tools/editor/icons/icon_mini_input.png b/editor/icons/icon_mini_input.png Binary files differindex fec26dd68e..fec26dd68e 100644 --- a/tools/editor/icons/icon_mini_input.png +++ b/editor/icons/icon_mini_input.png diff --git a/tools/editor/icons/icon_mini_int_array.png b/editor/icons/icon_mini_int_array.png Binary files differindex d1bd2e82a7..d1bd2e82a7 100644 --- a/tools/editor/icons/icon_mini_int_array.png +++ b/editor/icons/icon_mini_int_array.png diff --git a/tools/editor/icons/icon_mini_integer.png b/editor/icons/icon_mini_integer.png Binary files differindex dad1bb160b..dad1bb160b 100644 --- a/tools/editor/icons/icon_mini_integer.png +++ b/editor/icons/icon_mini_integer.png diff --git a/tools/editor/icons/icon_mini_matrix3.png b/editor/icons/icon_mini_matrix3.png Binary files differindex dd59d093cc..dd59d093cc 100644 --- a/tools/editor/icons/icon_mini_matrix3.png +++ b/editor/icons/icon_mini_matrix3.png diff --git a/tools/editor/icons/icon_mini_matrix32.png b/editor/icons/icon_mini_matrix32.png Binary files differindex 6018a00747..6018a00747 100644 --- a/tools/editor/icons/icon_mini_matrix32.png +++ b/editor/icons/icon_mini_matrix32.png diff --git a/tools/editor/icons/icon_mini_object.png b/editor/icons/icon_mini_object.png Binary files differindex 4afe7cfca1..4afe7cfca1 100644 --- a/tools/editor/icons/icon_mini_object.png +++ b/editor/icons/icon_mini_object.png diff --git a/tools/editor/icons/icon_mini_path.png b/editor/icons/icon_mini_path.png Binary files differindex 9eb0632571..9eb0632571 100644 --- a/tools/editor/icons/icon_mini_path.png +++ b/editor/icons/icon_mini_path.png diff --git a/tools/editor/icons/icon_mini_plane.png b/editor/icons/icon_mini_plane.png Binary files differindex 45676236bd..45676236bd 100644 --- a/tools/editor/icons/icon_mini_plane.png +++ b/editor/icons/icon_mini_plane.png diff --git a/tools/editor/icons/icon_mini_quat.png b/editor/icons/icon_mini_quat.png Binary files differindex 4ed2f5695c..4ed2f5695c 100644 --- a/tools/editor/icons/icon_mini_quat.png +++ b/editor/icons/icon_mini_quat.png diff --git a/tools/editor/icons/icon_mini_raw_array.png b/editor/icons/icon_mini_raw_array.png Binary files differindex 66bcf7c740..66bcf7c740 100644 --- a/tools/editor/icons/icon_mini_raw_array.png +++ b/editor/icons/icon_mini_raw_array.png diff --git a/tools/editor/icons/icon_mini_rect2.png b/editor/icons/icon_mini_rect2.png Binary files differindex db13e1a48e..db13e1a48e 100644 --- a/tools/editor/icons/icon_mini_rect2.png +++ b/editor/icons/icon_mini_rect2.png diff --git a/tools/editor/icons/icon_mini_rid.png b/editor/icons/icon_mini_rid.png Binary files differindex 278a9d1ee6..278a9d1ee6 100644 --- a/tools/editor/icons/icon_mini_rid.png +++ b/editor/icons/icon_mini_rid.png diff --git a/tools/editor/icons/icon_mini_string.png b/editor/icons/icon_mini_string.png Binary files differindex 504556dd74..504556dd74 100644 --- a/tools/editor/icons/icon_mini_string.png +++ b/editor/icons/icon_mini_string.png diff --git a/tools/editor/icons/icon_mini_string_array.png b/editor/icons/icon_mini_string_array.png Binary files differindex 5177014185..5177014185 100644 --- a/tools/editor/icons/icon_mini_string_array.png +++ b/editor/icons/icon_mini_string_array.png diff --git a/tools/editor/icons/icon_mini_transform.png b/editor/icons/icon_mini_transform.png Binary files differindex 068ea0506c..068ea0506c 100644 --- a/tools/editor/icons/icon_mini_transform.png +++ b/editor/icons/icon_mini_transform.png diff --git a/tools/editor/icons/icon_mini_variant.png b/editor/icons/icon_mini_variant.png Binary files differindex 285f0bcd16..285f0bcd16 100644 --- a/tools/editor/icons/icon_mini_variant.png +++ b/editor/icons/icon_mini_variant.png diff --git a/tools/editor/icons/icon_mini_vector2.png b/editor/icons/icon_mini_vector2.png Binary files differindex a7caa1797f..a7caa1797f 100644 --- a/tools/editor/icons/icon_mini_vector2.png +++ b/editor/icons/icon_mini_vector2.png diff --git a/tools/editor/icons/icon_mini_vector2_array.png b/editor/icons/icon_mini_vector2_array.png Binary files differindex de546de16c..de546de16c 100644 --- a/tools/editor/icons/icon_mini_vector2_array.png +++ b/editor/icons/icon_mini_vector2_array.png diff --git a/tools/editor/icons/icon_mini_vector3.png b/editor/icons/icon_mini_vector3.png Binary files differindex 69baeb229b..69baeb229b 100644 --- a/tools/editor/icons/icon_mini_vector3.png +++ b/editor/icons/icon_mini_vector3.png diff --git a/tools/editor/icons/icon_mini_vector3_array.png b/editor/icons/icon_mini_vector3_array.png Binary files differindex 6bddbaf627..6bddbaf627 100644 --- a/tools/editor/icons/icon_mini_vector3_array.png +++ b/editor/icons/icon_mini_vector3_array.png diff --git a/tools/editor/icons/icon_mirror_x.png b/editor/icons/icon_mirror_x.png Binary files differindex 7be48946b4..7be48946b4 100644 --- a/tools/editor/icons/icon_mirror_x.png +++ b/editor/icons/icon_mirror_x.png diff --git a/tools/editor/icons/icon_mirror_y.png b/editor/icons/icon_mirror_y.png Binary files differindex ba924f7ae7..ba924f7ae7 100644 --- a/tools/editor/icons/icon_mirror_y.png +++ b/editor/icons/icon_mirror_y.png diff --git a/tools/editor/icons/icon_mouse.png b/editor/icons/icon_mouse.png Binary files differindex ad07a403a6..ad07a403a6 100644 --- a/tools/editor/icons/icon_mouse.png +++ b/editor/icons/icon_mouse.png diff --git a/tools/editor/icons/icon_move_down.png b/editor/icons/icon_move_down.png Binary files differindex 3934310964..3934310964 100644 --- a/tools/editor/icons/icon_move_down.png +++ b/editor/icons/icon_move_down.png diff --git a/tools/editor/icons/icon_move_down_hl.png b/editor/icons/icon_move_down_hl.png Binary files differindex f9de58a940..f9de58a940 100644 --- a/tools/editor/icons/icon_move_down_hl.png +++ b/editor/icons/icon_move_down_hl.png diff --git a/tools/editor/icons/icon_move_point.png b/editor/icons/icon_move_point.png Binary files differindex 00e4ea32bd..00e4ea32bd 100644 --- a/tools/editor/icons/icon_move_point.png +++ b/editor/icons/icon_move_point.png diff --git a/tools/editor/icons/icon_move_up.png b/editor/icons/icon_move_up.png Binary files differindex 684013dc40..684013dc40 100644 --- a/tools/editor/icons/icon_move_up.png +++ b/editor/icons/icon_move_up.png diff --git a/tools/editor/icons/icon_move_up_hl.png b/editor/icons/icon_move_up_hl.png Binary files differindex e076c9a265..e076c9a265 100644 --- a/tools/editor/icons/icon_move_up_hl.png +++ b/editor/icons/icon_move_up_hl.png diff --git a/tools/editor/icons/icon_multi_edit.png b/editor/icons/icon_multi_edit.png Binary files differindex 0256ae094a..0256ae094a 100644 --- a/tools/editor/icons/icon_multi_edit.png +++ b/editor/icons/icon_multi_edit.png diff --git a/tools/editor/icons/icon_multi_line.png b/editor/icons/icon_multi_line.png Binary files differindex 95a029cc6e..95a029cc6e 100644 --- a/tools/editor/icons/icon_multi_line.png +++ b/editor/icons/icon_multi_line.png diff --git a/tools/editor/icons/icon_multi_mesh.png b/editor/icons/icon_multi_mesh.png Binary files differindex 6ff9d22266..6ff9d22266 100644 --- a/tools/editor/icons/icon_multi_mesh.png +++ b/editor/icons/icon_multi_mesh.png diff --git a/tools/editor/icons/icon_multi_mesh_instance.png b/editor/icons/icon_multi_mesh_instance.png Binary files differindex 124bf81b5a..124bf81b5a 100644 --- a/tools/editor/icons/icon_multi_mesh_instance.png +++ b/editor/icons/icon_multi_mesh_instance.png diff --git a/tools/editor/icons/icon_multi_node_edit.png b/editor/icons/icon_multi_node_edit.png Binary files differindex 0256ae094a..0256ae094a 100644 --- a/tools/editor/icons/icon_multi_node_edit.png +++ b/editor/icons/icon_multi_node_edit.png diff --git a/tools/editor/icons/icon_navigation.png b/editor/icons/icon_navigation.png Binary files differindex 3c5a3bdc4a..3c5a3bdc4a 100644 --- a/tools/editor/icons/icon_navigation.png +++ b/editor/icons/icon_navigation.png diff --git a/tools/editor/icons/icon_navigation_2d.png b/editor/icons/icon_navigation_2d.png Binary files differindex a6ea55ef13..a6ea55ef13 100644 --- a/tools/editor/icons/icon_navigation_2d.png +++ b/editor/icons/icon_navigation_2d.png diff --git a/tools/editor/icons/icon_navigation_mesh.png b/editor/icons/icon_navigation_mesh.png Binary files differindex e3bb7f775f..e3bb7f775f 100644 --- a/tools/editor/icons/icon_navigation_mesh.png +++ b/editor/icons/icon_navigation_mesh.png diff --git a/tools/editor/icons/icon_navigation_mesh_instance.png b/editor/icons/icon_navigation_mesh_instance.png Binary files differindex f5f25ef421..f5f25ef421 100644 --- a/tools/editor/icons/icon_navigation_mesh_instance.png +++ b/editor/icons/icon_navigation_mesh_instance.png diff --git a/tools/editor/icons/icon_navigation_polygon.png b/editor/icons/icon_navigation_polygon.png Binary files differindex bfc4bfb542..bfc4bfb542 100644 --- a/tools/editor/icons/icon_navigation_polygon.png +++ b/editor/icons/icon_navigation_polygon.png diff --git a/tools/editor/icons/icon_navigation_polygon_instance.png b/editor/icons/icon_navigation_polygon_instance.png Binary files differindex 89d420ca14..89d420ca14 100644 --- a/tools/editor/icons/icon_navigation_polygon_instance.png +++ b/editor/icons/icon_navigation_polygon_instance.png diff --git a/tools/editor/icons/icon_new.png b/editor/icons/icon_new.png Binary files differindex 69c6c90dc7..69c6c90dc7 100644 --- a/tools/editor/icons/icon_new.png +++ b/editor/icons/icon_new.png diff --git a/tools/editor/icons/icon_nine_patch_rect.png b/editor/icons/icon_nine_patch_rect.png Binary files differindex bdd1467144..bdd1467144 100644 --- a/tools/editor/icons/icon_nine_patch_rect.png +++ b/editor/icons/icon_nine_patch_rect.png diff --git a/tools/editor/icons/icon_node.png b/editor/icons/icon_node.png Binary files differindex 628b632332..628b632332 100644 --- a/tools/editor/icons/icon_node.png +++ b/editor/icons/icon_node.png diff --git a/tools/editor/icons/icon_node_2d.png b/editor/icons/icon_node_2d.png Binary files differindex d6c8f1f988..d6c8f1f988 100644 --- a/tools/editor/icons/icon_node_2d.png +++ b/editor/icons/icon_node_2d.png diff --git a/tools/editor/icons/icon_node_real_slot.png b/editor/icons/icon_node_real_slot.png Binary files differindex 6373bc0fa5..6373bc0fa5 100644 --- a/tools/editor/icons/icon_node_real_slot.png +++ b/editor/icons/icon_node_real_slot.png diff --git a/tools/editor/icons/icon_node_vec_slot.png b/editor/icons/icon_node_vec_slot.png Binary files differindex aedd983fb4..aedd983fb4 100644 --- a/tools/editor/icons/icon_node_vec_slot.png +++ b/editor/icons/icon_node_vec_slot.png diff --git a/tools/editor/icons/icon_node_warning.png b/editor/icons/icon_node_warning.png Binary files differindex 8b1e9212a8..8b1e9212a8 100644 --- a/tools/editor/icons/icon_node_warning.png +++ b/editor/icons/icon_node_warning.png diff --git a/tools/editor/icons/icon_non_favorite.png b/editor/icons/icon_non_favorite.png Binary files differindex 92351bde04..92351bde04 100644 --- a/tools/editor/icons/icon_non_favorite.png +++ b/editor/icons/icon_non_favorite.png diff --git a/tools/editor/icons/icon_object.png b/editor/icons/icon_object.png Binary files differindex f4f018c863..f4f018c863 100644 --- a/tools/editor/icons/icon_object.png +++ b/editor/icons/icon_object.png diff --git a/tools/editor/icons/icon_occluder_polygon_2d.png b/editor/icons/icon_occluder_polygon_2d.png Binary files differindex bbfc9ac0a5..bbfc9ac0a5 100644 --- a/tools/editor/icons/icon_occluder_polygon_2d.png +++ b/editor/icons/icon_occluder_polygon_2d.png diff --git a/tools/editor/icons/icon_omni_light.png b/editor/icons/icon_omni_light.png Binary files differindex 286ce723a4..286ce723a4 100644 --- a/tools/editor/icons/icon_omni_light.png +++ b/editor/icons/icon_omni_light.png diff --git a/tools/editor/icons/icon_open.png b/editor/icons/icon_open.png Binary files differindex cc05e98ebb..cc05e98ebb 100644 --- a/tools/editor/icons/icon_open.png +++ b/editor/icons/icon_open.png diff --git a/tools/editor/icons/icon_option_button.png b/editor/icons/icon_option_button.png Binary files differindex c1155309aa..c1155309aa 100644 --- a/tools/editor/icons/icon_option_button.png +++ b/editor/icons/icon_option_button.png diff --git a/tools/editor/icons/icon_override.png b/editor/icons/icon_override.png Binary files differindex 9d917ede75..9d917ede75 100644 --- a/tools/editor/icons/icon_override.png +++ b/editor/icons/icon_override.png diff --git a/tools/editor/icons/icon_p_hash_translation.png b/editor/icons/icon_p_hash_translation.png Binary files differindex abca359eea..abca359eea 100644 --- a/tools/editor/icons/icon_p_hash_translation.png +++ b/editor/icons/icon_p_hash_translation.png diff --git a/tools/editor/icons/icon_packed_data_container.png b/editor/icons/icon_packed_data_container.png Binary files differindex af89da48a9..af89da48a9 100644 --- a/tools/editor/icons/icon_packed_data_container.png +++ b/editor/icons/icon_packed_data_container.png diff --git a/tools/editor/icons/icon_packed_scene.png b/editor/icons/icon_packed_scene.png Binary files differindex 9079762932..9079762932 100644 --- a/tools/editor/icons/icon_packed_scene.png +++ b/editor/icons/icon_packed_scene.png diff --git a/tools/editor/icons/icon_pane_drag.png b/editor/icons/icon_pane_drag.png Binary files differindex 57f8e49ba3..57f8e49ba3 100644 --- a/tools/editor/icons/icon_pane_drag.png +++ b/editor/icons/icon_pane_drag.png diff --git a/tools/editor/icons/icon_pane_drag_hover.png b/editor/icons/icon_pane_drag_hover.png Binary files differindex 068253ecef..068253ecef 100644 --- a/tools/editor/icons/icon_pane_drag_hover.png +++ b/editor/icons/icon_pane_drag_hover.png diff --git a/tools/editor/icons/icon_panel.png b/editor/icons/icon_panel.png Binary files differindex dca2da94f3..dca2da94f3 100644 --- a/tools/editor/icons/icon_panel.png +++ b/editor/icons/icon_panel.png diff --git a/tools/editor/icons/icon_panel_container.png b/editor/icons/icon_panel_container.png Binary files differindex 05bd1e082f..05bd1e082f 100644 --- a/tools/editor/icons/icon_panel_container.png +++ b/editor/icons/icon_panel_container.png diff --git a/tools/editor/icons/icon_panel_top.png b/editor/icons/icon_panel_top.png Binary files differindex 20e67fad1a..20e67fad1a 100644 --- a/tools/editor/icons/icon_panel_top.png +++ b/editor/icons/icon_panel_top.png diff --git a/tools/editor/icons/icon_panels_1.png b/editor/icons/icon_panels_1.png Binary files differindex a909e6aee8..a909e6aee8 100644 --- a/tools/editor/icons/icon_panels_1.png +++ b/editor/icons/icon_panels_1.png diff --git a/tools/editor/icons/icon_panels_2.png b/editor/icons/icon_panels_2.png Binary files differindex 28a1ca2a59..28a1ca2a59 100644 --- a/tools/editor/icons/icon_panels_2.png +++ b/editor/icons/icon_panels_2.png diff --git a/tools/editor/icons/icon_panels_2_alt.png b/editor/icons/icon_panels_2_alt.png Binary files differindex 14f21304c5..14f21304c5 100644 --- a/tools/editor/icons/icon_panels_2_alt.png +++ b/editor/icons/icon_panels_2_alt.png diff --git a/tools/editor/icons/icon_panels_3.png b/editor/icons/icon_panels_3.png Binary files differindex 76f1f53636..76f1f53636 100644 --- a/tools/editor/icons/icon_panels_3.png +++ b/editor/icons/icon_panels_3.png diff --git a/tools/editor/icons/icon_panels_3_alt.png b/editor/icons/icon_panels_3_alt.png Binary files differindex b121bc62c3..b121bc62c3 100644 --- a/tools/editor/icons/icon_panels_3_alt.png +++ b/editor/icons/icon_panels_3_alt.png diff --git a/tools/editor/icons/icon_panels_4.png b/editor/icons/icon_panels_4.png Binary files differindex 19a3bc0bf2..19a3bc0bf2 100644 --- a/tools/editor/icons/icon_panels_4.png +++ b/editor/icons/icon_panels_4.png diff --git a/tools/editor/icons/icon_parallax_background.png b/editor/icons/icon_parallax_background.png Binary files differindex 78d7484e8b..78d7484e8b 100644 --- a/tools/editor/icons/icon_parallax_background.png +++ b/editor/icons/icon_parallax_background.png diff --git a/tools/editor/icons/icon_parallax_layer.png b/editor/icons/icon_parallax_layer.png Binary files differindex 748c9164bb..748c9164bb 100644 --- a/tools/editor/icons/icon_parallax_layer.png +++ b/editor/icons/icon_parallax_layer.png diff --git a/tools/editor/icons/icon_particle_attractor_2d.png b/editor/icons/icon_particle_attractor_2d.png Binary files differindex 84be7dff3b..84be7dff3b 100644 --- a/tools/editor/icons/icon_particle_attractor_2d.png +++ b/editor/icons/icon_particle_attractor_2d.png diff --git a/tools/editor/icons/icon_particles.png b/editor/icons/icon_particles.png Binary files differindex 8d146b2946..8d146b2946 100644 --- a/tools/editor/icons/icon_particles.png +++ b/editor/icons/icon_particles.png diff --git a/tools/editor/icons/icon_particles_2d.png b/editor/icons/icon_particles_2d.png Binary files differindex e03ff1e189..e03ff1e189 100644 --- a/tools/editor/icons/icon_particles_2d.png +++ b/editor/icons/icon_particles_2d.png diff --git a/tools/editor/icons/icon_particles_frame.png b/editor/icons/icon_particles_frame.png Binary files differindex 968bbccf8a..968bbccf8a 100644 --- a/tools/editor/icons/icon_particles_frame.png +++ b/editor/icons/icon_particles_frame.png diff --git a/tools/editor/icons/icon_particles_shader.png b/editor/icons/icon_particles_shader.png Binary files differindex 3b5c5644b2..3b5c5644b2 100644 --- a/tools/editor/icons/icon_particles_shader.png +++ b/editor/icons/icon_particles_shader.png diff --git a/tools/editor/icons/icon_patch_9_rect.png b/editor/icons/icon_patch_9_rect.png Binary files differindex bdd1467144..bdd1467144 100644 --- a/tools/editor/icons/icon_patch_9_rect.png +++ b/editor/icons/icon_patch_9_rect.png diff --git a/tools/editor/icons/icon_path.png b/editor/icons/icon_path.png Binary files differindex 4ebdcbdc44..4ebdcbdc44 100644 --- a/tools/editor/icons/icon_path.png +++ b/editor/icons/icon_path.png diff --git a/tools/editor/icons/icon_path_2d.png b/editor/icons/icon_path_2d.png Binary files differindex c5b0d5d7c6..c5b0d5d7c6 100644 --- a/tools/editor/icons/icon_path_2d.png +++ b/editor/icons/icon_path_2d.png diff --git a/tools/editor/icons/icon_path_follow.png b/editor/icons/icon_path_follow.png Binary files differindex f71651d241..f71651d241 100644 --- a/tools/editor/icons/icon_path_follow.png +++ b/editor/icons/icon_path_follow.png diff --git a/tools/editor/icons/icon_path_follow_2d.png b/editor/icons/icon_path_follow_2d.png Binary files differindex d82e682dba..d82e682dba 100644 --- a/tools/editor/icons/icon_path_follow_2d.png +++ b/editor/icons/icon_path_follow_2d.png diff --git a/tools/editor/icons/icon_pause.png b/editor/icons/icon_pause.png Binary files differindex aec11d5c35..aec11d5c35 100644 --- a/tools/editor/icons/icon_pause.png +++ b/editor/icons/icon_pause.png diff --git a/tools/editor/icons/icon_pe_edit.png b/editor/icons/icon_pe_edit.png Binary files differindex 7082303a4e..7082303a4e 100644 --- a/tools/editor/icons/icon_pe_edit.png +++ b/editor/icons/icon_pe_edit.png diff --git a/tools/editor/icons/icon_physics_joint_pin.png b/editor/icons/icon_physics_joint_pin.png Binary files differindex 27ac67ed0a..27ac67ed0a 100644 --- a/tools/editor/icons/icon_physics_joint_pin.png +++ b/editor/icons/icon_physics_joint_pin.png diff --git a/tools/editor/icons/icon_pin.png b/editor/icons/icon_pin.png Binary files differindex cf89679f88..cf89679f88 100644 --- a/tools/editor/icons/icon_pin.png +++ b/editor/icons/icon_pin.png diff --git a/tools/editor/icons/icon_pin_joint.png b/editor/icons/icon_pin_joint.png Binary files differindex 78e8a83724..78e8a83724 100644 --- a/tools/editor/icons/icon_pin_joint.png +++ b/editor/icons/icon_pin_joint.png diff --git a/tools/editor/icons/icon_pin_joint_2d.png b/editor/icons/icon_pin_joint_2d.png Binary files differindex 355d5a2022..355d5a2022 100644 --- a/tools/editor/icons/icon_pin_joint_2d.png +++ b/editor/icons/icon_pin_joint_2d.png diff --git a/tools/editor/icons/icon_pin_pressed.png b/editor/icons/icon_pin_pressed.png Binary files differindex cf89679f88..cf89679f88 100644 --- a/tools/editor/icons/icon_pin_pressed.png +++ b/editor/icons/icon_pin_pressed.png diff --git a/tools/editor/icons/icon_plane.png b/editor/icons/icon_plane.png Binary files differindex 25d869f31e..25d869f31e 100644 --- a/tools/editor/icons/icon_plane.png +++ b/editor/icons/icon_plane.png diff --git a/tools/editor/icons/icon_plane_shape.png b/editor/icons/icon_plane_shape.png Binary files differindex e7ebe1fbcd..e7ebe1fbcd 100644 --- a/tools/editor/icons/icon_plane_shape.png +++ b/editor/icons/icon_plane_shape.png diff --git a/tools/editor/icons/icon_play.png b/editor/icons/icon_play.png Binary files differindex 864e4e4fb9..864e4e4fb9 100644 --- a/tools/editor/icons/icon_play.png +++ b/editor/icons/icon_play.png diff --git a/tools/editor/icons/icon_play_backwards.png b/editor/icons/icon_play_backwards.png Binary files differindex bab2858373..bab2858373 100644 --- a/tools/editor/icons/icon_play_backwards.png +++ b/editor/icons/icon_play_backwards.png diff --git a/tools/editor/icons/icon_play_custom.png b/editor/icons/icon_play_custom.png Binary files differindex b742e131ca..b742e131ca 100644 --- a/tools/editor/icons/icon_play_custom.png +++ b/editor/icons/icon_play_custom.png diff --git a/tools/editor/icons/icon_play_scene.png b/editor/icons/icon_play_scene.png Binary files differindex ebba318799..ebba318799 100644 --- a/tools/editor/icons/icon_play_scene.png +++ b/editor/icons/icon_play_scene.png diff --git a/tools/editor/icons/icon_play_start.png b/editor/icons/icon_play_start.png Binary files differindex dacc156614..dacc156614 100644 --- a/tools/editor/icons/icon_play_start.png +++ b/editor/icons/icon_play_start.png diff --git a/tools/editor/icons/icon_play_start_backwards.png b/editor/icons/icon_play_start_backwards.png Binary files differindex 7608e18cba..7608e18cba 100644 --- a/tools/editor/icons/icon_play_start_backwards.png +++ b/editor/icons/icon_play_start_backwards.png diff --git a/tools/editor/icons/icon_polygon_2d.png b/editor/icons/icon_polygon_2d.png Binary files differindex b372749cb0..b372749cb0 100644 --- a/tools/editor/icons/icon_polygon_2d.png +++ b/editor/icons/icon_polygon_2d.png diff --git a/tools/editor/icons/icon_polygon_path_finder.png b/editor/icons/icon_polygon_path_finder.png Binary files differindex 9d76d872db..9d76d872db 100644 --- a/tools/editor/icons/icon_polygon_path_finder.png +++ b/editor/icons/icon_polygon_path_finder.png diff --git a/tools/editor/icons/icon_popup.png b/editor/icons/icon_popup.png Binary files differindex 4dda9e50f9..4dda9e50f9 100644 --- a/tools/editor/icons/icon_popup.png +++ b/editor/icons/icon_popup.png diff --git a/tools/editor/icons/icon_popup_dialog.png b/editor/icons/icon_popup_dialog.png Binary files differindex 82b011e06c..82b011e06c 100644 --- a/tools/editor/icons/icon_popup_dialog.png +++ b/editor/icons/icon_popup_dialog.png diff --git a/tools/editor/icons/icon_popup_menu.png b/editor/icons/icon_popup_menu.png Binary files differindex 28d928a98e..28d928a98e 100644 --- a/tools/editor/icons/icon_popup_menu.png +++ b/editor/icons/icon_popup_menu.png diff --git a/tools/editor/icons/icon_popup_panel.png b/editor/icons/icon_popup_panel.png Binary files differindex 90c86c2c05..90c86c2c05 100644 --- a/tools/editor/icons/icon_popup_panel.png +++ b/editor/icons/icon_popup_panel.png diff --git a/tools/editor/icons/icon_portal.png b/editor/icons/icon_portal.png Binary files differindex b10aee650d..b10aee650d 100644 --- a/tools/editor/icons/icon_portal.png +++ b/editor/icons/icon_portal.png diff --git a/tools/editor/icons/icon_position_2d.png b/editor/icons/icon_position_2d.png Binary files differindex da7446e3e2..da7446e3e2 100644 --- a/tools/editor/icons/icon_position_2d.png +++ b/editor/icons/icon_position_2d.png diff --git a/tools/editor/icons/icon_position_3d.png b/editor/icons/icon_position_3d.png Binary files differindex a36bca3260..a36bca3260 100644 --- a/tools/editor/icons/icon_position_3d.png +++ b/editor/icons/icon_position_3d.png diff --git a/tools/editor/icons/icon_prev_scene.png b/editor/icons/icon_prev_scene.png Binary files differindex 9d8dda5180..9d8dda5180 100644 --- a/tools/editor/icons/icon_prev_scene.png +++ b/editor/icons/icon_prev_scene.png diff --git a/tools/editor/icons/icon_progress_1.png b/editor/icons/icon_progress_1.png Binary files differindex 34196ec2dd..34196ec2dd 100644 --- a/tools/editor/icons/icon_progress_1.png +++ b/editor/icons/icon_progress_1.png diff --git a/tools/editor/icons/icon_progress_2.png b/editor/icons/icon_progress_2.png Binary files differindex 6f683f2473..6f683f2473 100644 --- a/tools/editor/icons/icon_progress_2.png +++ b/editor/icons/icon_progress_2.png diff --git a/tools/editor/icons/icon_progress_3.png b/editor/icons/icon_progress_3.png Binary files differindex 82202d28a6..82202d28a6 100644 --- a/tools/editor/icons/icon_progress_3.png +++ b/editor/icons/icon_progress_3.png diff --git a/tools/editor/icons/icon_progress_4.png b/editor/icons/icon_progress_4.png Binary files differindex 70198ab26a..70198ab26a 100644 --- a/tools/editor/icons/icon_progress_4.png +++ b/editor/icons/icon_progress_4.png diff --git a/tools/editor/icons/icon_progress_5.png b/editor/icons/icon_progress_5.png Binary files differindex b5f4bdcdec..b5f4bdcdec 100644 --- a/tools/editor/icons/icon_progress_5.png +++ b/editor/icons/icon_progress_5.png diff --git a/tools/editor/icons/icon_progress_6.png b/editor/icons/icon_progress_6.png Binary files differindex df8f27c60d..df8f27c60d 100644 --- a/tools/editor/icons/icon_progress_6.png +++ b/editor/icons/icon_progress_6.png diff --git a/tools/editor/icons/icon_progress_7.png b/editor/icons/icon_progress_7.png Binary files differindex 892d5b53ba..892d5b53ba 100644 --- a/tools/editor/icons/icon_progress_7.png +++ b/editor/icons/icon_progress_7.png diff --git a/tools/editor/icons/icon_progress_8.png b/editor/icons/icon_progress_8.png Binary files differindex c593afb7dd..c593afb7dd 100644 --- a/tools/editor/icons/icon_progress_8.png +++ b/editor/icons/icon_progress_8.png diff --git a/tools/editor/icons/icon_progress_bar.png b/editor/icons/icon_progress_bar.png Binary files differindex 30822dd7a8..30822dd7a8 100644 --- a/tools/editor/icons/icon_progress_bar.png +++ b/editor/icons/icon_progress_bar.png diff --git a/tools/editor/icons/icon_property_editor.png b/editor/icons/icon_property_editor.png Binary files differindex 5ee0ab8068..5ee0ab8068 100644 --- a/tools/editor/icons/icon_property_editor.png +++ b/editor/icons/icon_property_editor.png diff --git a/tools/editor/icons/icon_proximity_group.png b/editor/icons/icon_proximity_group.png Binary files differindex 230ca752ec..230ca752ec 100644 --- a/tools/editor/icons/icon_proximity_group.png +++ b/editor/icons/icon_proximity_group.png diff --git a/tools/editor/icons/icon_quad.png b/editor/icons/icon_quad.png Binary files differindex a1b31b026b..a1b31b026b 100644 --- a/tools/editor/icons/icon_quad.png +++ b/editor/icons/icon_quad.png diff --git a/tools/editor/icons/icon_quat.png b/editor/icons/icon_quat.png Binary files differindex 0fcaa35b56..0fcaa35b56 100644 --- a/tools/editor/icons/icon_quat.png +++ b/editor/icons/icon_quat.png diff --git a/tools/editor/icons/icon_range.png b/editor/icons/icon_range.png Binary files differindex 6e46df9690..6e46df9690 100644 --- a/tools/editor/icons/icon_range.png +++ b/editor/icons/icon_range.png diff --git a/tools/editor/icons/icon_rating_no_star.png b/editor/icons/icon_rating_no_star.png Binary files differindex e7421bdb13..e7421bdb13 100644 --- a/tools/editor/icons/icon_rating_no_star.png +++ b/editor/icons/icon_rating_no_star.png diff --git a/tools/editor/icons/icon_rating_star.png b/editor/icons/icon_rating_star.png Binary files differindex b2a7e01322..b2a7e01322 100644 --- a/tools/editor/icons/icon_rating_star.png +++ b/editor/icons/icon_rating_star.png diff --git a/tools/editor/icons/icon_ray_cast.png b/editor/icons/icon_ray_cast.png Binary files differindex 19cba12d1d..19cba12d1d 100644 --- a/tools/editor/icons/icon_ray_cast.png +++ b/editor/icons/icon_ray_cast.png diff --git a/tools/editor/icons/icon_ray_cast_2d.png b/editor/icons/icon_ray_cast_2d.png Binary files differindex 2a5054ab00..2a5054ab00 100644 --- a/tools/editor/icons/icon_ray_cast_2d.png +++ b/editor/icons/icon_ray_cast_2d.png diff --git a/tools/editor/icons/icon_ray_shape.png b/editor/icons/icon_ray_shape.png Binary files differindex a3188d1a3a..a3188d1a3a 100644 --- a/tools/editor/icons/icon_ray_shape.png +++ b/editor/icons/icon_ray_shape.png diff --git a/tools/editor/icons/icon_ray_shape_2d.png b/editor/icons/icon_ray_shape_2d.png Binary files differindex c91a63570d..c91a63570d 100644 --- a/tools/editor/icons/icon_ray_shape_2d.png +++ b/editor/icons/icon_ray_shape_2d.png diff --git a/tools/editor/icons/icon_rayito.png b/editor/icons/icon_rayito.png Binary files differindex 1afb5975d1..1afb5975d1 100644 --- a/tools/editor/icons/icon_rayito.png +++ b/editor/icons/icon_rayito.png diff --git a/tools/editor/icons/icon_real.png b/editor/icons/icon_real.png Binary files differindex 555b61427f..555b61427f 100644 --- a/tools/editor/icons/icon_real.png +++ b/editor/icons/icon_real.png diff --git a/tools/editor/icons/icon_rect2.png b/editor/icons/icon_rect2.png Binary files differindex cf3cfe3b22..cf3cfe3b22 100644 --- a/tools/editor/icons/icon_rect2.png +++ b/editor/icons/icon_rect2.png diff --git a/tools/editor/icons/icon_rect3.png b/editor/icons/icon_rect3.png Binary files differindex 8eacfff207..8eacfff207 100644 --- a/tools/editor/icons/icon_rect3.png +++ b/editor/icons/icon_rect3.png diff --git a/tools/editor/icons/icon_rectangle_shape_2d.png b/editor/icons/icon_rectangle_shape_2d.png Binary files differindex 002730b942..002730b942 100644 --- a/tools/editor/icons/icon_rectangle_shape_2d.png +++ b/editor/icons/icon_rectangle_shape_2d.png diff --git a/tools/editor/icons/icon_reference_rect.png b/editor/icons/icon_reference_rect.png Binary files differindex b253af477f..b253af477f 100644 --- a/tools/editor/icons/icon_reference_rect.png +++ b/editor/icons/icon_reference_rect.png diff --git a/tools/editor/icons/icon_reflection_probe.png b/editor/icons/icon_reflection_probe.png Binary files differindex a6646114fb..a6646114fb 100644 --- a/tools/editor/icons/icon_reflection_probe.png +++ b/editor/icons/icon_reflection_probe.png diff --git a/tools/editor/icons/icon_region_edit.png b/editor/icons/icon_region_edit.png Binary files differindex 5f133072d4..5f133072d4 100644 --- a/tools/editor/icons/icon_region_edit.png +++ b/editor/icons/icon_region_edit.png diff --git a/tools/editor/icons/icon_reload.png b/editor/icons/icon_reload.png Binary files differindex 9303fabb9c..9303fabb9c 100644 --- a/tools/editor/icons/icon_reload.png +++ b/editor/icons/icon_reload.png diff --git a/tools/editor/icons/icon_reload_empty.png b/editor/icons/icon_reload_empty.png Binary files differindex d43582b2c4..d43582b2c4 100644 --- a/tools/editor/icons/icon_reload_empty.png +++ b/editor/icons/icon_reload_empty.png diff --git a/tools/editor/icons/icon_reload_small.png b/editor/icons/icon_reload_small.png Binary files differindex 1397ac6aa5..1397ac6aa5 100644 --- a/tools/editor/icons/icon_reload_small.png +++ b/editor/icons/icon_reload_small.png diff --git a/tools/editor/icons/icon_remote.png b/editor/icons/icon_remote.png Binary files differindex 7eb7608b13..7eb7608b13 100644 --- a/tools/editor/icons/icon_remote.png +++ b/editor/icons/icon_remote.png diff --git a/tools/editor/icons/icon_remote_transform.png b/editor/icons/icon_remote_transform.png Binary files differindex 2a8b5f4d0e..2a8b5f4d0e 100644 --- a/tools/editor/icons/icon_remote_transform.png +++ b/editor/icons/icon_remote_transform.png diff --git a/tools/editor/icons/icon_remote_transform_2d.png b/editor/icons/icon_remote_transform_2d.png Binary files differindex 16d2691832..16d2691832 100644 --- a/tools/editor/icons/icon_remote_transform_2d.png +++ b/editor/icons/icon_remote_transform_2d.png diff --git a/tools/editor/icons/icon_remove.png b/editor/icons/icon_remove.png Binary files differindex b6bf05a16d..b6bf05a16d 100644 --- a/tools/editor/icons/icon_remove.png +++ b/editor/icons/icon_remove.png diff --git a/tools/editor/icons/icon_remove_hl.png b/editor/icons/icon_remove_hl.png Binary files differindex 0d3b887e7f..0d3b887e7f 100644 --- a/tools/editor/icons/icon_remove_hl.png +++ b/editor/icons/icon_remove_hl.png diff --git a/tools/editor/icons/icon_remove_small.png b/editor/icons/icon_remove_small.png Binary files differindex e0903689cf..e0903689cf 100644 --- a/tools/editor/icons/icon_remove_small.png +++ b/editor/icons/icon_remove_small.png diff --git a/tools/editor/icons/icon_rename.png b/editor/icons/icon_rename.png Binary files differindex 2df503f100..2df503f100 100644 --- a/tools/editor/icons/icon_rename.png +++ b/editor/icons/icon_rename.png diff --git a/tools/editor/icons/icon_reparent.png b/editor/icons/icon_reparent.png Binary files differindex 135ccee4ad..135ccee4ad 100644 --- a/tools/editor/icons/icon_reparent.png +++ b/editor/icons/icon_reparent.png diff --git a/tools/editor/icons/icon_replace.png b/editor/icons/icon_replace.png Binary files differindex 662a58dc93..662a58dc93 100644 --- a/tools/editor/icons/icon_replace.png +++ b/editor/icons/icon_replace.png diff --git a/tools/editor/icons/icon_resource_preloader.png b/editor/icons/icon_resource_preloader.png Binary files differindex d3064f5e90..d3064f5e90 100644 --- a/tools/editor/icons/icon_resource_preloader.png +++ b/editor/icons/icon_resource_preloader.png diff --git a/tools/editor/icons/icon_rich_text_label.png b/editor/icons/icon_rich_text_label.png Binary files differindex 1aea6e8fa7..1aea6e8fa7 100644 --- a/tools/editor/icons/icon_rich_text_label.png +++ b/editor/icons/icon_rich_text_label.png diff --git a/tools/editor/icons/icon_rid.png b/editor/icons/icon_rid.png Binary files differindex f7bc02e128..f7bc02e128 100644 --- a/tools/editor/icons/icon_rid.png +++ b/editor/icons/icon_rid.png diff --git a/tools/editor/icons/icon_rigid_body.png b/editor/icons/icon_rigid_body.png Binary files differindex 4072308f71..4072308f71 100644 --- a/tools/editor/icons/icon_rigid_body.png +++ b/editor/icons/icon_rigid_body.png diff --git a/tools/editor/icons/icon_rigid_body_2_d.png b/editor/icons/icon_rigid_body_2_d.png Binary files differindex c296b88636..c296b88636 100644 --- a/tools/editor/icons/icon_rigid_body_2_d.png +++ b/editor/icons/icon_rigid_body_2_d.png diff --git a/tools/editor/icons/icon_rigid_body_2d.png b/editor/icons/icon_rigid_body_2d.png Binary files differindex 8d11d536c1..8d11d536c1 100644 --- a/tools/editor/icons/icon_rigid_body_2d.png +++ b/editor/icons/icon_rigid_body_2d.png diff --git a/tools/editor/icons/icon_room.png b/editor/icons/icon_room.png Binary files differindex 840db145fd..840db145fd 100644 --- a/tools/editor/icons/icon_room.png +++ b/editor/icons/icon_room.png diff --git a/tools/editor/icons/icon_room_bounds.png b/editor/icons/icon_room_bounds.png Binary files differindex 15b198e821..15b198e821 100644 --- a/tools/editor/icons/icon_room_bounds.png +++ b/editor/icons/icon_room_bounds.png diff --git a/tools/editor/icons/icon_room_instance.png b/editor/icons/icon_room_instance.png Binary files differindex f0c46e689c..f0c46e689c 100644 --- a/tools/editor/icons/icon_room_instance.png +++ b/editor/icons/icon_room_instance.png diff --git a/tools/editor/icons/icon_rotate_0.png b/editor/icons/icon_rotate_0.png Binary files differindex 75bd667845..75bd667845 100644 --- a/tools/editor/icons/icon_rotate_0.png +++ b/editor/icons/icon_rotate_0.png diff --git a/tools/editor/icons/icon_rotate_180.png b/editor/icons/icon_rotate_180.png Binary files differindex dd9333207e..dd9333207e 100644 --- a/tools/editor/icons/icon_rotate_180.png +++ b/editor/icons/icon_rotate_180.png diff --git a/tools/editor/icons/icon_rotate_270.png b/editor/icons/icon_rotate_270.png Binary files differindex 551fd3afb9..551fd3afb9 100644 --- a/tools/editor/icons/icon_rotate_270.png +++ b/editor/icons/icon_rotate_270.png diff --git a/tools/editor/icons/icon_rotate_90.png b/editor/icons/icon_rotate_90.png Binary files differindex 55a084cc4e..55a084cc4e 100644 --- a/tools/editor/icons/icon_rotate_90.png +++ b/editor/icons/icon_rotate_90.png diff --git a/tools/editor/icons/icon_run.png b/editor/icons/icon_run.png Binary files differindex 133d383d9e..133d383d9e 100644 --- a/tools/editor/icons/icon_run.png +++ b/editor/icons/icon_run.png diff --git a/tools/editor/icons/icon_s_s_a_o_f_x.png b/editor/icons/icon_s_s_a_o_f_x.png Binary files differindex 36eccedca5..36eccedca5 100644 --- a/tools/editor/icons/icon_s_s_a_o_f_x.png +++ b/editor/icons/icon_s_s_a_o_f_x.png diff --git a/tools/editor/icons/icon_sample.png b/editor/icons/icon_sample.png Binary files differindex 25755699be..25755699be 100644 --- a/tools/editor/icons/icon_sample.png +++ b/editor/icons/icon_sample.png diff --git a/tools/editor/icons/icon_sample_library.png b/editor/icons/icon_sample_library.png Binary files differindex 5921aa86e7..5921aa86e7 100644 --- a/tools/editor/icons/icon_sample_library.png +++ b/editor/icons/icon_sample_library.png diff --git a/tools/editor/icons/icon_sample_player.png b/editor/icons/icon_sample_player.png Binary files differindex 4056cceeff..4056cceeff 100644 --- a/tools/editor/icons/icon_sample_player.png +++ b/editor/icons/icon_sample_player.png diff --git a/tools/editor/icons/icon_sample_player_2d.png b/editor/icons/icon_sample_player_2d.png Binary files differindex eb70340db8..eb70340db8 100644 --- a/tools/editor/icons/icon_sample_player_2d.png +++ b/editor/icons/icon_sample_player_2d.png diff --git a/tools/editor/icons/icon_save.png b/editor/icons/icon_save.png Binary files differindex 8695b7839d..8695b7839d 100644 --- a/tools/editor/icons/icon_save.png +++ b/editor/icons/icon_save.png diff --git a/tools/editor/icons/icon_scene.png b/editor/icons/icon_scene.png Binary files differindex 9629bb91c2..9629bb91c2 100644 --- a/tools/editor/icons/icon_scene.png +++ b/editor/icons/icon_scene.png diff --git a/tools/editor/icons/icon_scene_instance.png b/editor/icons/icon_scene_instance.png Binary files differindex 05df811aa0..05df811aa0 100644 --- a/tools/editor/icons/icon_scene_instance.png +++ b/editor/icons/icon_scene_instance.png diff --git a/tools/editor/icons/icon_scene_tree_editor.png b/editor/icons/icon_scene_tree_editor.png Binary files differindex 0b51763555..0b51763555 100644 --- a/tools/editor/icons/icon_scene_tree_editor.png +++ b/editor/icons/icon_scene_tree_editor.png diff --git a/tools/editor/icons/icon_script.png b/editor/icons/icon_script.png Binary files differindex 5aa673fcd6..5aa673fcd6 100644 --- a/tools/editor/icons/icon_script.png +++ b/editor/icons/icon_script.png diff --git a/tools/editor/icons/icon_script_control.png b/editor/icons/icon_script_control.png Binary files differindex cd1cc9b9af..cd1cc9b9af 100644 --- a/tools/editor/icons/icon_script_control.png +++ b/editor/icons/icon_script_control.png diff --git a/tools/editor/icons/icon_script_create.png b/editor/icons/icon_script_create.png Binary files differindex 86c19f748b..86c19f748b 100644 --- a/tools/editor/icons/icon_script_create.png +++ b/editor/icons/icon_script_create.png diff --git a/tools/editor/icons/icon_script_error.png b/editor/icons/icon_script_error.png Binary files differindex 3532c2c379..3532c2c379 100644 --- a/tools/editor/icons/icon_script_error.png +++ b/editor/icons/icon_script_error.png diff --git a/tools/editor/icons/icon_script_list.png b/editor/icons/icon_script_list.png Binary files differindex cdea1e161e..cdea1e161e 100644 --- a/tools/editor/icons/icon_script_list.png +++ b/editor/icons/icon_script_list.png diff --git a/tools/editor/icons/icon_script_node.png b/editor/icons/icon_script_node.png Binary files differindex fcf205b2e9..fcf205b2e9 100644 --- a/tools/editor/icons/icon_script_node.png +++ b/editor/icons/icon_script_node.png diff --git a/tools/editor/icons/icon_script_remove.png b/editor/icons/icon_script_remove.png Binary files differindex c200b01690..c200b01690 100644 --- a/tools/editor/icons/icon_script_remove.png +++ b/editor/icons/icon_script_remove.png diff --git a/tools/editor/icons/icon_scroll_bar.png b/editor/icons/icon_scroll_bar.png Binary files differindex e4576c4ae3..e4576c4ae3 100644 --- a/tools/editor/icons/icon_scroll_bar.png +++ b/editor/icons/icon_scroll_bar.png diff --git a/tools/editor/icons/icon_scroll_container.png b/editor/icons/icon_scroll_container.png Binary files differindex 4e42d84ab1..4e42d84ab1 100644 --- a/tools/editor/icons/icon_scroll_container.png +++ b/editor/icons/icon_scroll_container.png diff --git a/tools/editor/icons/icon_segment_shape_2d.png b/editor/icons/icon_segment_shape_2d.png Binary files differindex 8f3771be7a..8f3771be7a 100644 --- a/tools/editor/icons/icon_segment_shape_2d.png +++ b/editor/icons/icon_segment_shape_2d.png diff --git a/tools/editor/icons/icon_shader.png b/editor/icons/icon_shader.png Binary files differindex 568a45d938..568a45d938 100644 --- a/tools/editor/icons/icon_shader.png +++ b/editor/icons/icon_shader.png diff --git a/tools/editor/icons/icon_shader_material.png b/editor/icons/icon_shader_material.png Binary files differindex 568a45d938..568a45d938 100644 --- a/tools/editor/icons/icon_shader_material.png +++ b/editor/icons/icon_shader_material.png diff --git a/tools/editor/icons/icon_short_cut.png b/editor/icons/icon_short_cut.png Binary files differindex 22e15c3889..22e15c3889 100644 --- a/tools/editor/icons/icon_short_cut.png +++ b/editor/icons/icon_short_cut.png diff --git a/tools/editor/icons/icon_signal.png b/editor/icons/icon_signal.png Binary files differindex c2f393228c..c2f393228c 100644 --- a/tools/editor/icons/icon_signal.png +++ b/editor/icons/icon_signal.png diff --git a/tools/editor/icons/icon_skeleton.png b/editor/icons/icon_skeleton.png Binary files differindex 17b003caac..17b003caac 100644 --- a/tools/editor/icons/icon_skeleton.png +++ b/editor/icons/icon_skeleton.png diff --git a/tools/editor/icons/icon_skeletonr.png b/editor/icons/icon_skeletonr.png Binary files differindex dcb2d512ab..dcb2d512ab 100644 --- a/tools/editor/icons/icon_skeletonr.png +++ b/editor/icons/icon_skeletonr.png diff --git a/tools/editor/icons/icon_sky_box_f_x.png b/editor/icons/icon_sky_box_f_x.png Binary files differindex cabd19e550..cabd19e550 100644 --- a/tools/editor/icons/icon_sky_box_f_x.png +++ b/editor/icons/icon_sky_box_f_x.png diff --git a/tools/editor/icons/icon_slider_joint.png b/editor/icons/icon_slider_joint.png Binary files differindex d65fb3650d..d65fb3650d 100644 --- a/tools/editor/icons/icon_slider_joint.png +++ b/editor/icons/icon_slider_joint.png diff --git a/tools/editor/icons/icon_slot.png b/editor/icons/icon_slot.png Binary files differindex 856bf72281..856bf72281 100644 --- a/tools/editor/icons/icon_slot.png +++ b/editor/icons/icon_slot.png diff --git a/tools/editor/icons/icon_small_next.png b/editor/icons/icon_small_next.png Binary files differindex f853d100b5..f853d100b5 100644 --- a/tools/editor/icons/icon_small_next.png +++ b/editor/icons/icon_small_next.png diff --git a/tools/editor/icons/icon_snap.png b/editor/icons/icon_snap.png Binary files differindex 93194d34e7..93194d34e7 100644 --- a/tools/editor/icons/icon_snap.png +++ b/editor/icons/icon_snap.png diff --git a/tools/editor/icons/icon_sound_room_params.png b/editor/icons/icon_sound_room_params.png Binary files differindex 6f66da2e43..6f66da2e43 100644 --- a/tools/editor/icons/icon_sound_room_params.png +++ b/editor/icons/icon_sound_room_params.png diff --git a/tools/editor/icons/icon_spatial.png b/editor/icons/icon_spatial.png Binary files differindex 7c9f721053..7c9f721053 100644 --- a/tools/editor/icons/icon_spatial.png +++ b/editor/icons/icon_spatial.png diff --git a/tools/editor/icons/icon_spatial_add.png b/editor/icons/icon_spatial_add.png Binary files differindex 47950fbbb5..47950fbbb5 100644 --- a/tools/editor/icons/icon_spatial_add.png +++ b/editor/icons/icon_spatial_add.png diff --git a/tools/editor/icons/icon_spatial_sample_player.png b/editor/icons/icon_spatial_sample_player.png Binary files differindex bb2451da99..bb2451da99 100644 --- a/tools/editor/icons/icon_spatial_sample_player.png +++ b/editor/icons/icon_spatial_sample_player.png diff --git a/tools/editor/icons/icon_spatial_shader.png b/editor/icons/icon_spatial_shader.png Binary files differindex 7608fc9036..7608fc9036 100644 --- a/tools/editor/icons/icon_spatial_shader.png +++ b/editor/icons/icon_spatial_shader.png diff --git a/tools/editor/icons/icon_spatial_stream_player.png b/editor/icons/icon_spatial_stream_player.png Binary files differindex a6f9851548..a6f9851548 100644 --- a/tools/editor/icons/icon_spatial_stream_player.png +++ b/editor/icons/icon_spatial_stream_player.png diff --git a/tools/editor/icons/icon_sphere_shape.png b/editor/icons/icon_sphere_shape.png Binary files differindex 23300a0da1..23300a0da1 100644 --- a/tools/editor/icons/icon_sphere_shape.png +++ b/editor/icons/icon_sphere_shape.png diff --git a/tools/editor/icons/icon_spin_box.png b/editor/icons/icon_spin_box.png Binary files differindex 6da0dbec79..6da0dbec79 100644 --- a/tools/editor/icons/icon_spin_box.png +++ b/editor/icons/icon_spin_box.png diff --git a/tools/editor/icons/icon_spline.png b/editor/icons/icon_spline.png Binary files differindex 3239aff383..3239aff383 100644 --- a/tools/editor/icons/icon_spline.png +++ b/editor/icons/icon_spline.png diff --git a/tools/editor/icons/icon_spot_light.png b/editor/icons/icon_spot_light.png Binary files differindex f52570a5cd..f52570a5cd 100644 --- a/tools/editor/icons/icon_spot_light.png +++ b/editor/icons/icon_spot_light.png diff --git a/tools/editor/icons/icon_sprite.png b/editor/icons/icon_sprite.png Binary files differindex b698d32d4c..b698d32d4c 100644 --- a/tools/editor/icons/icon_sprite.png +++ b/editor/icons/icon_sprite.png diff --git a/tools/editor/icons/icon_sprite_3d.png b/editor/icons/icon_sprite_3d.png Binary files differindex 47a3ff429b..47a3ff429b 100644 --- a/tools/editor/icons/icon_sprite_3d.png +++ b/editor/icons/icon_sprite_3d.png diff --git a/tools/editor/icons/icon_sprite_frames.png b/editor/icons/icon_sprite_frames.png Binary files differindex 5576b24f2e..5576b24f2e 100644 --- a/tools/editor/icons/icon_sprite_frames.png +++ b/editor/icons/icon_sprite_frames.png diff --git a/tools/editor/icons/icon_squirrel_script.png b/editor/icons/icon_squirrel_script.png Binary files differindex 32926b5975..32926b5975 100644 --- a/tools/editor/icons/icon_squirrel_script.png +++ b/editor/icons/icon_squirrel_script.png diff --git a/tools/editor/icons/icon_static_body.png b/editor/icons/icon_static_body.png Binary files differindex 62948f97cd..62948f97cd 100644 --- a/tools/editor/icons/icon_static_body.png +++ b/editor/icons/icon_static_body.png diff --git a/tools/editor/icons/icon_static_body_2_d.png b/editor/icons/icon_static_body_2_d.png Binary files differindex 9af0274a65..9af0274a65 100644 --- a/tools/editor/icons/icon_static_body_2_d.png +++ b/editor/icons/icon_static_body_2_d.png diff --git a/tools/editor/icons/icon_static_body_2d.png b/editor/icons/icon_static_body_2d.png Binary files differindex b7bad4f742..b7bad4f742 100644 --- a/tools/editor/icons/icon_static_body_2d.png +++ b/editor/icons/icon_static_body_2d.png diff --git a/tools/editor/icons/icon_stop.png b/editor/icons/icon_stop.png Binary files differindex 0fd43b403a..0fd43b403a 100644 --- a/tools/editor/icons/icon_stop.png +++ b/editor/icons/icon_stop.png diff --git a/tools/editor/icons/icon_stream_player.png b/editor/icons/icon_stream_player.png Binary files differindex 15bdbdf440..15bdbdf440 100644 --- a/tools/editor/icons/icon_stream_player.png +++ b/editor/icons/icon_stream_player.png diff --git a/tools/editor/icons/icon_string.png b/editor/icons/icon_string.png Binary files differindex 8d01b738da..8d01b738da 100644 --- a/tools/editor/icons/icon_string.png +++ b/editor/icons/icon_string.png diff --git a/tools/editor/icons/icon_style_box_empty.png b/editor/icons/icon_style_box_empty.png Binary files differindex f595eaaa57..f595eaaa57 100644 --- a/tools/editor/icons/icon_style_box_empty.png +++ b/editor/icons/icon_style_box_empty.png diff --git a/tools/editor/icons/icon_style_box_flat.png b/editor/icons/icon_style_box_flat.png Binary files differindex 6ec6a6dd35..6ec6a6dd35 100644 --- a/tools/editor/icons/icon_style_box_flat.png +++ b/editor/icons/icon_style_box_flat.png diff --git a/tools/editor/icons/icon_style_box_texture.png b/editor/icons/icon_style_box_texture.png Binary files differindex f649508418..f649508418 100644 --- a/tools/editor/icons/icon_style_box_texture.png +++ b/editor/icons/icon_style_box_texture.png diff --git a/tools/editor/icons/icon_surface.png b/editor/icons/icon_surface.png Binary files differindex e7af8e9444..e7af8e9444 100644 --- a/tools/editor/icons/icon_surface.png +++ b/editor/icons/icon_surface.png diff --git a/tools/editor/icons/icon_tab_container.png b/editor/icons/icon_tab_container.png Binary files differindex 7ff3081ec1..7ff3081ec1 100644 --- a/tools/editor/icons/icon_tab_container.png +++ b/editor/icons/icon_tab_container.png diff --git a/tools/editor/icons/icon_tab_menu.png b/editor/icons/icon_tab_menu.png Binary files differindex 29edd02f01..29edd02f01 100644 --- a/tools/editor/icons/icon_tab_menu.png +++ b/editor/icons/icon_tab_menu.png diff --git a/tools/editor/icons/icon_tabs.png b/editor/icons/icon_tabs.png Binary files differindex bef0f60660..bef0f60660 100644 --- a/tools/editor/icons/icon_tabs.png +++ b/editor/icons/icon_tabs.png diff --git a/tools/editor/icons/icon_test_cube.png b/editor/icons/icon_test_cube.png Binary files differindex 4d11a69c3e..4d11a69c3e 100644 --- a/tools/editor/icons/icon_test_cube.png +++ b/editor/icons/icon_test_cube.png diff --git a/tools/editor/icons/icon_text_edit.png b/editor/icons/icon_text_edit.png Binary files differindex 7599e89eb1..7599e89eb1 100644 --- a/tools/editor/icons/icon_text_edit.png +++ b/editor/icons/icon_text_edit.png diff --git a/tools/editor/icons/icon_texture.png b/editor/icons/icon_texture.png Binary files differindex 7c4493395e..7c4493395e 100644 --- a/tools/editor/icons/icon_texture.png +++ b/editor/icons/icon_texture.png diff --git a/tools/editor/icons/icon_texture_button.png b/editor/icons/icon_texture_button.png Binary files differindex ea1d8235e1..ea1d8235e1 100644 --- a/tools/editor/icons/icon_texture_button.png +++ b/editor/icons/icon_texture_button.png diff --git a/tools/editor/icons/icon_texture_progress.png b/editor/icons/icon_texture_progress.png Binary files differindex ea3cc35da8..ea3cc35da8 100644 --- a/tools/editor/icons/icon_texture_progress.png +++ b/editor/icons/icon_texture_progress.png diff --git a/tools/editor/icons/icon_texture_rect.png b/editor/icons/icon_texture_rect.png Binary files differindex 84e4a90bfb..84e4a90bfb 100644 --- a/tools/editor/icons/icon_texture_rect.png +++ b/editor/icons/icon_texture_rect.png diff --git a/tools/editor/icons/icon_theme.png b/editor/icons/icon_theme.png Binary files differindex 55d799c722..55d799c722 100644 --- a/tools/editor/icons/icon_theme.png +++ b/editor/icons/icon_theme.png diff --git a/tools/editor/icons/icon_thumbnail_wait.png b/editor/icons/icon_thumbnail_wait.png Binary files differindex 96a7d424e3..96a7d424e3 100644 --- a/tools/editor/icons/icon_thumbnail_wait.png +++ b/editor/icons/icon_thumbnail_wait.png diff --git a/tools/editor/icons/icon_tile_map.png b/editor/icons/icon_tile_map.png Binary files differindex 0ba6276e25..0ba6276e25 100644 --- a/tools/editor/icons/icon_tile_map.png +++ b/editor/icons/icon_tile_map.png diff --git a/tools/editor/icons/icon_tile_set.png b/editor/icons/icon_tile_set.png Binary files differindex a1c3fccddd..a1c3fccddd 100644 --- a/tools/editor/icons/icon_tile_set.png +++ b/editor/icons/icon_tile_set.png diff --git a/tools/editor/icons/icon_time.png b/editor/icons/icon_time.png Binary files differindex a8e97ea7b8..a8e97ea7b8 100644 --- a/tools/editor/icons/icon_time.png +++ b/editor/icons/icon_time.png diff --git a/tools/editor/icons/icon_timer.png b/editor/icons/icon_timer.png Binary files differindex d3eb6a4b49..d3eb6a4b49 100644 --- a/tools/editor/icons/icon_timer.png +++ b/editor/icons/icon_timer.png diff --git a/tools/editor/icons/icon_tool_button.png b/editor/icons/icon_tool_button.png Binary files differindex b2f3f6103f..b2f3f6103f 100644 --- a/tools/editor/icons/icon_tool_button.png +++ b/editor/icons/icon_tool_button.png diff --git a/tools/editor/icons/icon_tool_move.png b/editor/icons/icon_tool_move.png Binary files differindex 2b6984e8b2..2b6984e8b2 100644 --- a/tools/editor/icons/icon_tool_move.png +++ b/editor/icons/icon_tool_move.png diff --git a/tools/editor/icons/icon_tool_pan.png b/editor/icons/icon_tool_pan.png Binary files differindex a24545a6d4..a24545a6d4 100644 --- a/tools/editor/icons/icon_tool_pan.png +++ b/editor/icons/icon_tool_pan.png diff --git a/tools/editor/icons/icon_tool_rotate.png b/editor/icons/icon_tool_rotate.png Binary files differindex 9303fabb9c..9303fabb9c 100644 --- a/tools/editor/icons/icon_tool_rotate.png +++ b/editor/icons/icon_tool_rotate.png diff --git a/tools/editor/icons/icon_tool_scale.png b/editor/icons/icon_tool_scale.png Binary files differindex b389c40746..b389c40746 100644 --- a/tools/editor/icons/icon_tool_scale.png +++ b/editor/icons/icon_tool_scale.png diff --git a/tools/editor/icons/icon_tool_select.png b/editor/icons/icon_tool_select.png Binary files differindex dcf6fcd2c8..dcf6fcd2c8 100644 --- a/tools/editor/icons/icon_tool_select.png +++ b/editor/icons/icon_tool_select.png diff --git a/tools/editor/icons/icon_tools.png b/editor/icons/icon_tools.png Binary files differindex 4db4c53796..4db4c53796 100644 --- a/tools/editor/icons/icon_tools.png +++ b/editor/icons/icon_tools.png diff --git a/tools/editor/icons/icon_touch_screen_button.png b/editor/icons/icon_touch_screen_button.png Binary files differindex 6bd0af3f47..6bd0af3f47 100644 --- a/tools/editor/icons/icon_touch_screen_button.png +++ b/editor/icons/icon_touch_screen_button.png diff --git a/tools/editor/icons/icon_track_add_key.png b/editor/icons/icon_track_add_key.png Binary files differindex 02d92439a3..02d92439a3 100644 --- a/tools/editor/icons/icon_track_add_key.png +++ b/editor/icons/icon_track_add_key.png diff --git a/tools/editor/icons/icon_track_add_key_hl.png b/editor/icons/icon_track_add_key_hl.png Binary files differindex 0e857f5fe2..0e857f5fe2 100644 --- a/tools/editor/icons/icon_track_add_key_hl.png +++ b/editor/icons/icon_track_add_key_hl.png diff --git a/tools/editor/icons/icon_track_continuous.png b/editor/icons/icon_track_continuous.png Binary files differindex dabdc718d5..dabdc718d5 100644 --- a/tools/editor/icons/icon_track_continuous.png +++ b/editor/icons/icon_track_continuous.png diff --git a/tools/editor/icons/icon_track_discrete.png b/editor/icons/icon_track_discrete.png Binary files differindex 3f580ac5fc..3f580ac5fc 100644 --- a/tools/editor/icons/icon_track_discrete.png +++ b/editor/icons/icon_track_discrete.png diff --git a/tools/editor/icons/icon_track_method.png b/editor/icons/icon_track_method.png Binary files differindex 1355c84e67..1355c84e67 100644 --- a/tools/editor/icons/icon_track_method.png +++ b/editor/icons/icon_track_method.png diff --git a/tools/editor/icons/icon_track_prop.png b/editor/icons/icon_track_prop.png Binary files differindex de8f549cd2..de8f549cd2 100644 --- a/tools/editor/icons/icon_track_prop.png +++ b/editor/icons/icon_track_prop.png diff --git a/tools/editor/icons/icon_track_trigger.png b/editor/icons/icon_track_trigger.png Binary files differindex e89f95561a..e89f95561a 100644 --- a/tools/editor/icons/icon_track_trigger.png +++ b/editor/icons/icon_track_trigger.png diff --git a/tools/editor/icons/icon_track_value.png b/editor/icons/icon_track_value.png Binary files differindex 5f5dc0d315..5f5dc0d315 100644 --- a/tools/editor/icons/icon_track_value.png +++ b/editor/icons/icon_track_value.png diff --git a/tools/editor/icons/icon_translation.png b/editor/icons/icon_translation.png Binary files differindex abca359eea..abca359eea 100644 --- a/tools/editor/icons/icon_translation.png +++ b/editor/icons/icon_translation.png diff --git a/tools/editor/icons/icon_transparent.png b/editor/icons/icon_transparent.png Binary files differindex 07e9b52b5c..07e9b52b5c 100644 --- a/tools/editor/icons/icon_transparent.png +++ b/editor/icons/icon_transparent.png diff --git a/tools/editor/icons/icon_transpose.png b/editor/icons/icon_transpose.png Binary files differindex 7a126c8428..7a126c8428 100644 --- a/tools/editor/icons/icon_transpose.png +++ b/editor/icons/icon_transpose.png diff --git a/tools/editor/icons/icon_tree.png b/editor/icons/icon_tree.png Binary files differindex 50ec1df98b..50ec1df98b 100644 --- a/tools/editor/icons/icon_tree.png +++ b/editor/icons/icon_tree.png diff --git a/tools/editor/icons/icon_tween.png b/editor/icons/icon_tween.png Binary files differindex 36717c0922..36717c0922 100644 --- a/tools/editor/icons/icon_tween.png +++ b/editor/icons/icon_tween.png diff --git a/tools/editor/icons/icon_unbone.png b/editor/icons/icon_unbone.png Binary files differindex 919e13ad6b..919e13ad6b 100644 --- a/tools/editor/icons/icon_unbone.png +++ b/editor/icons/icon_unbone.png diff --git a/tools/editor/icons/icon_ungroup.png b/editor/icons/icon_ungroup.png Binary files differindex b4c2e01814..b4c2e01814 100644 --- a/tools/editor/icons/icon_ungroup.png +++ b/editor/icons/icon_ungroup.png diff --git a/tools/editor/icons/icon_uninstance.png b/editor/icons/icon_uninstance.png Binary files differindex de8b2f9a40..de8b2f9a40 100644 --- a/tools/editor/icons/icon_uninstance.png +++ b/editor/icons/icon_uninstance.png diff --git a/tools/editor/icons/icon_unlock.png b/editor/icons/icon_unlock.png Binary files differindex d314aa46fe..d314aa46fe 100644 --- a/tools/editor/icons/icon_unlock.png +++ b/editor/icons/icon_unlock.png diff --git a/tools/editor/icons/icon_up.png b/editor/icons/icon_up.png Binary files differindex 346c4cdba8..346c4cdba8 100644 --- a/tools/editor/icons/icon_up.png +++ b/editor/icons/icon_up.png diff --git a/tools/editor/icons/icon_updown.png b/editor/icons/icon_updown.png Binary files differindex 3141dc56ae..3141dc56ae 100644 --- a/tools/editor/icons/icon_updown.png +++ b/editor/icons/icon_updown.png diff --git a/tools/editor/icons/icon_uv.png b/editor/icons/icon_uv.png Binary files differindex f5d901ab91..f5d901ab91 100644 --- a/tools/editor/icons/icon_uv.png +++ b/editor/icons/icon_uv.png diff --git a/tools/editor/icons/icon_v_box_container.png b/editor/icons/icon_v_box_container.png Binary files differindex 4d9bdb67b8..4d9bdb67b8 100644 --- a/tools/editor/icons/icon_v_box_container.png +++ b/editor/icons/icon_v_box_container.png diff --git a/tools/editor/icons/icon_v_button_array.png b/editor/icons/icon_v_button_array.png Binary files differindex d7ea9cc375..d7ea9cc375 100644 --- a/tools/editor/icons/icon_v_button_array.png +++ b/editor/icons/icon_v_button_array.png diff --git a/tools/editor/icons/icon_v_scroll_bar.png b/editor/icons/icon_v_scroll_bar.png Binary files differindex 91e00f4619..91e00f4619 100644 --- a/tools/editor/icons/icon_v_scroll_bar.png +++ b/editor/icons/icon_v_scroll_bar.png diff --git a/tools/editor/icons/icon_v_separator.png b/editor/icons/icon_v_separator.png Binary files differindex f0122d197f..f0122d197f 100644 --- a/tools/editor/icons/icon_v_separator.png +++ b/editor/icons/icon_v_separator.png diff --git a/tools/editor/icons/icon_v_slider.png b/editor/icons/icon_v_slider.png Binary files differindex 545c126d23..545c126d23 100644 --- a/tools/editor/icons/icon_v_slider.png +++ b/editor/icons/icon_v_slider.png diff --git a/tools/editor/icons/icon_v_split_container.png b/editor/icons/icon_v_split_container.png Binary files differindex 23093e334f..23093e334f 100644 --- a/tools/editor/icons/icon_v_split_container.png +++ b/editor/icons/icon_v_split_container.png diff --git a/tools/editor/icons/icon_variant.png b/editor/icons/icon_variant.png Binary files differindex 1ae2812ff7..1ae2812ff7 100644 --- a/tools/editor/icons/icon_variant.png +++ b/editor/icons/icon_variant.png diff --git a/tools/editor/icons/icon_vector.png b/editor/icons/icon_vector.png Binary files differindex 8dba948daf..8dba948daf 100644 --- a/tools/editor/icons/icon_vector.png +++ b/editor/icons/icon_vector.png diff --git a/tools/editor/icons/icon_vector2.png b/editor/icons/icon_vector2.png Binary files differindex f84052cda0..f84052cda0 100644 --- a/tools/editor/icons/icon_vector2.png +++ b/editor/icons/icon_vector2.png diff --git a/tools/editor/icons/icon_vehicle_body.png b/editor/icons/icon_vehicle_body.png Binary files differindex c404218911..c404218911 100644 --- a/tools/editor/icons/icon_vehicle_body.png +++ b/editor/icons/icon_vehicle_body.png diff --git a/tools/editor/icons/icon_vehicle_wheel.png b/editor/icons/icon_vehicle_wheel.png Binary files differindex 23299a0425..23299a0425 100644 --- a/tools/editor/icons/icon_vehicle_wheel.png +++ b/editor/icons/icon_vehicle_wheel.png diff --git a/tools/editor/icons/icon_video_player.png b/editor/icons/icon_video_player.png Binary files differindex 5fd3723b22..5fd3723b22 100644 --- a/tools/editor/icons/icon_video_player.png +++ b/editor/icons/icon_video_player.png diff --git a/tools/editor/icons/icon_video_stream_theora.png b/editor/icons/icon_video_stream_theora.png Binary files differindex 3f019f9b61..3f019f9b61 100644 --- a/tools/editor/icons/icon_video_stream_theora.png +++ b/editor/icons/icon_video_stream_theora.png diff --git a/tools/editor/icons/icon_view.png b/editor/icons/icon_view.png Binary files differindex c7975ed461..c7975ed461 100644 --- a/tools/editor/icons/icon_view.png +++ b/editor/icons/icon_view.png diff --git a/tools/editor/icons/icon_viewport.png b/editor/icons/icon_viewport.png Binary files differindex 8b25ea8764..8b25ea8764 100644 --- a/tools/editor/icons/icon_viewport.png +++ b/editor/icons/icon_viewport.png diff --git a/tools/editor/icons/icon_viewport_container.png b/editor/icons/icon_viewport_container.png Binary files differindex c70dee3698..c70dee3698 100644 --- a/tools/editor/icons/icon_viewport_container.png +++ b/editor/icons/icon_viewport_container.png diff --git a/tools/editor/icons/icon_viewport_sprite.png b/editor/icons/icon_viewport_sprite.png Binary files differindex 9aefb471d6..9aefb471d6 100644 --- a/tools/editor/icons/icon_viewport_sprite.png +++ b/editor/icons/icon_viewport_sprite.png diff --git a/tools/editor/icons/icon_viewport_texture.png b/editor/icons/icon_viewport_texture.png Binary files differindex ae744cc407..ae744cc407 100644 --- a/tools/editor/icons/icon_viewport_texture.png +++ b/editor/icons/icon_viewport_texture.png diff --git a/tools/editor/icons/icon_visibility_area.png b/editor/icons/icon_visibility_area.png Binary files differindex f3ca05711b..f3ca05711b 100644 --- a/tools/editor/icons/icon_visibility_area.png +++ b/editor/icons/icon_visibility_area.png diff --git a/tools/editor/icons/icon_visibility_enabler.png b/editor/icons/icon_visibility_enabler.png Binary files differindex 66dffd3483..66dffd3483 100644 --- a/tools/editor/icons/icon_visibility_enabler.png +++ b/editor/icons/icon_visibility_enabler.png diff --git a/tools/editor/icons/icon_visibility_enabler_2d.png b/editor/icons/icon_visibility_enabler_2d.png Binary files differindex e198b9785b..e198b9785b 100644 --- a/tools/editor/icons/icon_visibility_enabler_2d.png +++ b/editor/icons/icon_visibility_enabler_2d.png diff --git a/tools/editor/icons/icon_visibility_notifier.png b/editor/icons/icon_visibility_notifier.png Binary files differindex 624122fb4c..624122fb4c 100644 --- a/tools/editor/icons/icon_visibility_notifier.png +++ b/editor/icons/icon_visibility_notifier.png diff --git a/tools/editor/icons/icon_visibility_notifier_2d.png b/editor/icons/icon_visibility_notifier_2d.png Binary files differindex f904223edf..f904223edf 100644 --- a/tools/editor/icons/icon_visibility_notifier_2d.png +++ b/editor/icons/icon_visibility_notifier_2d.png diff --git a/tools/editor/icons/icon_visible.png b/editor/icons/icon_visible.png Binary files differindex 4e79dd3245..4e79dd3245 100644 --- a/tools/editor/icons/icon_visible.png +++ b/editor/icons/icon_visible.png diff --git a/tools/editor/icons/icon_visual_script.png b/editor/icons/icon_visual_script.png Binary files differindex 1678998d17..1678998d17 100644 --- a/tools/editor/icons/icon_visual_script.png +++ b/editor/icons/icon_visual_script.png diff --git a/tools/editor/icons/icon_visual_shader_port.png b/editor/icons/icon_visual_shader_port.png Binary files differindex 27daedbdd0..27daedbdd0 100644 --- a/tools/editor/icons/icon_visual_shader_port.png +++ b/editor/icons/icon_visual_shader_port.png diff --git a/tools/editor/icons/icon_volume.png b/editor/icons/icon_volume.png Binary files differindex 2ce013cb03..2ce013cb03 100644 --- a/tools/editor/icons/icon_volume.png +++ b/editor/icons/icon_volume.png diff --git a/tools/editor/icons/icon_vu_db.png b/editor/icons/icon_vu_db.png Binary files differindex 405a929e2a..405a929e2a 100644 --- a/tools/editor/icons/icon_vu_db.png +++ b/editor/icons/icon_vu_db.png diff --git a/tools/editor/icons/icon_vu_empty.png b/editor/icons/icon_vu_empty.png Binary files differindex b749e1f2ca..b749e1f2ca 100644 --- a/tools/editor/icons/icon_vu_empty.png +++ b/editor/icons/icon_vu_empty.png diff --git a/tools/editor/icons/icon_vu_full.png b/editor/icons/icon_vu_full.png Binary files differindex cb2b30d397..cb2b30d397 100644 --- a/tools/editor/icons/icon_vu_full.png +++ b/editor/icons/icon_vu_full.png diff --git a/tools/editor/icons/icon_wait_no_preview.png b/editor/icons/icon_wait_no_preview.png Binary files differindex 5d20cd99ec..5d20cd99ec 100644 --- a/tools/editor/icons/icon_wait_no_preview.png +++ b/editor/icons/icon_wait_no_preview.png diff --git a/tools/editor/icons/icon_wait_preview_1.png b/editor/icons/icon_wait_preview_1.png Binary files differindex 0aab42e04a..0aab42e04a 100644 --- a/tools/editor/icons/icon_wait_preview_1.png +++ b/editor/icons/icon_wait_preview_1.png diff --git a/tools/editor/icons/icon_wait_preview_2.png b/editor/icons/icon_wait_preview_2.png Binary files differindex f476b9ce1f..f476b9ce1f 100644 --- a/tools/editor/icons/icon_wait_preview_2.png +++ b/editor/icons/icon_wait_preview_2.png diff --git a/tools/editor/icons/icon_wait_preview_3.png b/editor/icons/icon_wait_preview_3.png Binary files differindex 2775d1ef43..2775d1ef43 100644 --- a/tools/editor/icons/icon_wait_preview_3.png +++ b/editor/icons/icon_wait_preview_3.png diff --git a/tools/editor/icons/icon_wait_preview_4.png b/editor/icons/icon_wait_preview_4.png Binary files differindex 2eaa86fec9..2eaa86fec9 100644 --- a/tools/editor/icons/icon_wait_preview_4.png +++ b/editor/icons/icon_wait_preview_4.png diff --git a/tools/editor/icons/icon_wait_preview_5.png b/editor/icons/icon_wait_preview_5.png Binary files differindex 6590644bc1..6590644bc1 100644 --- a/tools/editor/icons/icon_wait_preview_5.png +++ b/editor/icons/icon_wait_preview_5.png diff --git a/tools/editor/icons/icon_wait_preview_6.png b/editor/icons/icon_wait_preview_6.png Binary files differindex 307e412310..307e412310 100644 --- a/tools/editor/icons/icon_wait_preview_6.png +++ b/editor/icons/icon_wait_preview_6.png diff --git a/tools/editor/icons/icon_wait_preview_7.png b/editor/icons/icon_wait_preview_7.png Binary files differindex b0edc94d93..b0edc94d93 100644 --- a/tools/editor/icons/icon_wait_preview_7.png +++ b/editor/icons/icon_wait_preview_7.png diff --git a/tools/editor/icons/icon_wait_preview_8.png b/editor/icons/icon_wait_preview_8.png Binary files differindex 67a2f48ec3..67a2f48ec3 100644 --- a/tools/editor/icons/icon_wait_preview_8.png +++ b/editor/icons/icon_wait_preview_8.png diff --git a/tools/editor/icons/icon_warning.png b/editor/icons/icon_warning.png Binary files differindex 451beba820..451beba820 100644 --- a/tools/editor/icons/icon_warning.png +++ b/editor/icons/icon_warning.png diff --git a/tools/editor/icons/icon_window_dialog.png b/editor/icons/icon_window_dialog.png Binary files differindex 8591b15613..8591b15613 100644 --- a/tools/editor/icons/icon_window_dialog.png +++ b/editor/icons/icon_window_dialog.png diff --git a/tools/editor/icons/icon_world.png b/editor/icons/icon_world.png Binary files differindex d54b979cad..d54b979cad 100644 --- a/tools/editor/icons/icon_world.png +++ b/editor/icons/icon_world.png diff --git a/tools/editor/icons/icon_world_2d.png b/editor/icons/icon_world_2d.png Binary files differindex ebe54262ff..ebe54262ff 100644 --- a/tools/editor/icons/icon_world_2d.png +++ b/editor/icons/icon_world_2d.png diff --git a/tools/editor/icons/icon_world_environment.png b/editor/icons/icon_world_environment.png Binary files differindex d9f1323386..d9f1323386 100644 --- a/tools/editor/icons/icon_world_environment.png +++ b/editor/icons/icon_world_environment.png diff --git a/tools/editor/icons/icon_y_sort.png b/editor/icons/icon_y_sort.png Binary files differindex 585956983c..585956983c 100644 --- a/tools/editor/icons/icon_y_sort.png +++ b/editor/icons/icon_y_sort.png diff --git a/tools/editor/icons/icon_zoom.png b/editor/icons/icon_zoom.png Binary files differindex f3748803cf..f3748803cf 100644 --- a/tools/editor/icons/icon_zoom.png +++ b/editor/icons/icon_zoom.png diff --git a/tools/editor/icons/icon_zoom_less.png b/editor/icons/icon_zoom_less.png Binary files differindex fd8ef9075e..fd8ef9075e 100644 --- a/tools/editor/icons/icon_zoom_less.png +++ b/editor/icons/icon_zoom_less.png diff --git a/tools/editor/icons/icon_zoom_more.png b/editor/icons/icon_zoom_more.png Binary files differindex 8e818db1ee..8e818db1ee 100644 --- a/tools/editor/icons/icon_zoom_more.png +++ b/editor/icons/icon_zoom_more.png diff --git a/tools/editor/icons/icon_zoom_reset.png b/editor/icons/icon_zoom_reset.png Binary files differindex fa8a9d197e..fa8a9d197e 100644 --- a/tools/editor/icons/icon_zoom_reset.png +++ b/editor/icons/icon_zoom_reset.png diff --git a/tools/editor/icons/source/icon_accept_dialog.svg b/editor/icons/source/icon_accept_dialog.svg index 9f82b30c94..9f82b30c94 100644 --- a/tools/editor/icons/source/icon_accept_dialog.svg +++ b/editor/icons/source/icon_accept_dialog.svg diff --git a/tools/editor/icons/source/icon_add_track.svg b/editor/icons/source/icon_add_track.svg index d19448efb0..d19448efb0 100644 --- a/tools/editor/icons/source/icon_add_track.svg +++ b/editor/icons/source/icon_add_track.svg diff --git a/tools/editor/icons/source/icon_anchor.svg b/editor/icons/source/icon_anchor.svg index 6b10be040b..6b10be040b 100644 --- a/tools/editor/icons/source/icon_anchor.svg +++ b/editor/icons/source/icon_anchor.svg diff --git a/tools/editor/icons/source/icon_animated_sprite.svg b/editor/icons/source/icon_animated_sprite.svg index 36ccd8bca2..36ccd8bca2 100644 --- a/tools/editor/icons/source/icon_animated_sprite.svg +++ b/editor/icons/source/icon_animated_sprite.svg diff --git a/tools/editor/icons/source/icon_animated_sprite_3d.svg b/editor/icons/source/icon_animated_sprite_3d.svg index f088c9e32d..f088c9e32d 100644 --- a/tools/editor/icons/source/icon_animated_sprite_3d.svg +++ b/editor/icons/source/icon_animated_sprite_3d.svg diff --git a/tools/editor/icons/source/icon_animation.svg b/editor/icons/source/icon_animation.svg index 371979345f..371979345f 100644 --- a/tools/editor/icons/source/icon_animation.svg +++ b/editor/icons/source/icon_animation.svg diff --git a/tools/editor/icons/source/icon_animation_player.svg b/editor/icons/source/icon_animation_player.svg index add4d5ac42..add4d5ac42 100644 --- a/tools/editor/icons/source/icon_animation_player.svg +++ b/editor/icons/source/icon_animation_player.svg diff --git a/tools/editor/icons/source/icon_animation_tree_player.svg b/editor/icons/source/icon_animation_tree_player.svg index ab81cb226a..ab81cb226a 100644 --- a/tools/editor/icons/source/icon_animation_tree_player.svg +++ b/editor/icons/source/icon_animation_tree_player.svg diff --git a/tools/editor/icons/source/icon_area.svg b/editor/icons/source/icon_area.svg index d16ad26e23..d16ad26e23 100644 --- a/tools/editor/icons/source/icon_area.svg +++ b/editor/icons/source/icon_area.svg diff --git a/tools/editor/icons/source/icon_area_2d.svg b/editor/icons/source/icon_area_2d.svg index ef7b16dd06..ef7b16dd06 100644 --- a/tools/editor/icons/source/icon_area_2d.svg +++ b/editor/icons/source/icon_area_2d.svg diff --git a/tools/editor/icons/source/icon_arrow_left.svg b/editor/icons/source/icon_arrow_left.svg index 75a9ef0d68..75a9ef0d68 100644 --- a/tools/editor/icons/source/icon_arrow_left.svg +++ b/editor/icons/source/icon_arrow_left.svg diff --git a/tools/editor/icons/source/icon_arrow_right.svg b/editor/icons/source/icon_arrow_right.svg index a7600699f7..a7600699f7 100644 --- a/tools/editor/icons/source/icon_arrow_right.svg +++ b/editor/icons/source/icon_arrow_right.svg diff --git a/tools/editor/icons/source/icon_arrow_up.svg b/editor/icons/source/icon_arrow_up.svg index c1839cd69e..c1839cd69e 100644 --- a/tools/editor/icons/source/icon_arrow_up.svg +++ b/editor/icons/source/icon_arrow_up.svg diff --git a/tools/editor/icons/source/icon_atlas_texture.svg b/editor/icons/source/icon_atlas_texture.svg index 10c8b745b6..10c8b745b6 100644 --- a/tools/editor/icons/source/icon_atlas_texture.svg +++ b/editor/icons/source/icon_atlas_texture.svg diff --git a/tools/editor/icons/source/icon_audio_stream_gibberish.svg b/editor/icons/source/icon_audio_stream_gibberish.svg index 82b48c7004..82b48c7004 100644 --- a/tools/editor/icons/source/icon_audio_stream_gibberish.svg +++ b/editor/icons/source/icon_audio_stream_gibberish.svg diff --git a/tools/editor/icons/source/icon_auto_play.svg b/editor/icons/source/icon_auto_play.svg index d4e1068ebf..d4e1068ebf 100644 --- a/tools/editor/icons/source/icon_auto_play.svg +++ b/editor/icons/source/icon_auto_play.svg diff --git a/tools/editor/icons/source/icon_back.svg b/editor/icons/source/icon_back.svg index 597a1c3068..597a1c3068 100644 --- a/tools/editor/icons/source/icon_back.svg +++ b/editor/icons/source/icon_back.svg diff --git a/tools/editor/icons/source/icon_back_buffer_copy.svg b/editor/icons/source/icon_back_buffer_copy.svg index 17d83ed73f..17d83ed73f 100644 --- a/tools/editor/icons/source/icon_back_buffer_copy.svg +++ b/editor/icons/source/icon_back_buffer_copy.svg diff --git a/tools/editor/icons/source/icon_bake.svg b/editor/icons/source/icon_bake.svg index ca07bca379..ca07bca379 100644 --- a/tools/editor/icons/source/icon_bake.svg +++ b/editor/icons/source/icon_bake.svg diff --git a/tools/editor/icons/source/icon_baked_light.svg b/editor/icons/source/icon_baked_light.svg index 98dc3135f6..98dc3135f6 100644 --- a/tools/editor/icons/source/icon_baked_light.svg +++ b/editor/icons/source/icon_baked_light.svg diff --git a/tools/editor/icons/source/icon_baked_light_instance.svg b/editor/icons/source/icon_baked_light_instance.svg index d854378f12..d854378f12 100644 --- a/tools/editor/icons/source/icon_baked_light_instance.svg +++ b/editor/icons/source/icon_baked_light_instance.svg diff --git a/tools/editor/icons/source/icon_baked_light_sampler.svg b/editor/icons/source/icon_baked_light_sampler.svg index 2dc7c39621..2dc7c39621 100644 --- a/tools/editor/icons/source/icon_baked_light_sampler.svg +++ b/editor/icons/source/icon_baked_light_sampler.svg diff --git a/tools/editor/icons/source/icon_bit_map.svg b/editor/icons/source/icon_bit_map.svg index fbaf573af6..fbaf573af6 100644 --- a/tools/editor/icons/source/icon_bit_map.svg +++ b/editor/icons/source/icon_bit_map.svg diff --git a/tools/editor/icons/source/icon_bitmap_font.svg b/editor/icons/source/icon_bitmap_font.svg index 70749923d5..70749923d5 100644 --- a/tools/editor/icons/source/icon_bitmap_font.svg +++ b/editor/icons/source/icon_bitmap_font.svg diff --git a/tools/editor/icons/source/icon_blend.svg b/editor/icons/source/icon_blend.svg index 64d2aeec83..64d2aeec83 100644 --- a/tools/editor/icons/source/icon_blend.svg +++ b/editor/icons/source/icon_blend.svg diff --git a/tools/editor/icons/source/icon_bone.svg b/editor/icons/source/icon_bone.svg index c87902a336..c87902a336 100644 --- a/tools/editor/icons/source/icon_bone.svg +++ b/editor/icons/source/icon_bone.svg diff --git a/tools/editor/icons/source/icon_bone_attachment.svg b/editor/icons/source/icon_bone_attachment.svg index 5cb85c3c17..5cb85c3c17 100644 --- a/tools/editor/icons/source/icon_bone_attachment.svg +++ b/editor/icons/source/icon_bone_attachment.svg diff --git a/tools/editor/icons/source/icon_bone_track.svg b/editor/icons/source/icon_bone_track.svg index cdaab7e34a..cdaab7e34a 100644 --- a/tools/editor/icons/source/icon_bone_track.svg +++ b/editor/icons/source/icon_bone_track.svg diff --git a/tools/editor/icons/source/icon_bool.svg b/editor/icons/source/icon_bool.svg index e471871adf..e471871adf 100644 --- a/tools/editor/icons/source/icon_bool.svg +++ b/editor/icons/source/icon_bool.svg diff --git a/tools/editor/icons/source/icon_box_shape.svg b/editor/icons/source/icon_box_shape.svg index 04aaf16ebc..04aaf16ebc 100644 --- a/tools/editor/icons/source/icon_box_shape.svg +++ b/editor/icons/source/icon_box_shape.svg diff --git a/tools/editor/icons/source/icon_button.svg b/editor/icons/source/icon_button.svg index 54644ecb9b..54644ecb9b 100644 --- a/tools/editor/icons/source/icon_button.svg +++ b/editor/icons/source/icon_button.svg diff --git a/tools/editor/icons/source/icon_button_group.svg b/editor/icons/source/icon_button_group.svg index 9d5df99deb..9d5df99deb 100644 --- a/tools/editor/icons/source/icon_button_group.svg +++ b/editor/icons/source/icon_button_group.svg diff --git a/tools/editor/icons/source/icon_camera.svg b/editor/icons/source/icon_camera.svg index 55d4aa698d..55d4aa698d 100644 --- a/tools/editor/icons/source/icon_camera.svg +++ b/editor/icons/source/icon_camera.svg diff --git a/tools/editor/icons/source/icon_camera_2d.svg b/editor/icons/source/icon_camera_2d.svg index 1be8c0f984..1be8c0f984 100644 --- a/tools/editor/icons/source/icon_camera_2d.svg +++ b/editor/icons/source/icon_camera_2d.svg diff --git a/tools/editor/icons/source/icon_canvas_item.svg b/editor/icons/source/icon_canvas_item.svg index d15a9a71b7..d15a9a71b7 100644 --- a/tools/editor/icons/source/icon_canvas_item.svg +++ b/editor/icons/source/icon_canvas_item.svg diff --git a/tools/editor/icons/source/icon_canvas_item_material.svg b/editor/icons/source/icon_canvas_item_material.svg index ce8fd4b7de..ce8fd4b7de 100644 --- a/tools/editor/icons/source/icon_canvas_item_material.svg +++ b/editor/icons/source/icon_canvas_item_material.svg diff --git a/tools/editor/icons/source/icon_canvas_item_shader.svg b/editor/icons/source/icon_canvas_item_shader.svg index 6d1d7e6bb1..6d1d7e6bb1 100644 --- a/tools/editor/icons/source/icon_canvas_item_shader.svg +++ b/editor/icons/source/icon_canvas_item_shader.svg diff --git a/tools/editor/icons/source/icon_canvas_item_shader_graph.svg b/editor/icons/source/icon_canvas_item_shader_graph.svg index 84575ad388..84575ad388 100644 --- a/tools/editor/icons/source/icon_canvas_item_shader_graph.svg +++ b/editor/icons/source/icon_canvas_item_shader_graph.svg diff --git a/tools/editor/icons/source/icon_canvas_layer.svg b/editor/icons/source/icon_canvas_layer.svg index 794d832eea..794d832eea 100644 --- a/tools/editor/icons/source/icon_canvas_layer.svg +++ b/editor/icons/source/icon_canvas_layer.svg diff --git a/tools/editor/icons/source/icon_canvas_modulate.svg b/editor/icons/source/icon_canvas_modulate.svg index 8f8bd55f82..8f8bd55f82 100644 --- a/tools/editor/icons/source/icon_canvas_modulate.svg +++ b/editor/icons/source/icon_canvas_modulate.svg diff --git a/tools/editor/icons/source/icon_capsule_shape.svg b/editor/icons/source/icon_capsule_shape.svg index dcc6e8c00f..dcc6e8c00f 100644 --- a/tools/editor/icons/source/icon_capsule_shape.svg +++ b/editor/icons/source/icon_capsule_shape.svg diff --git a/tools/editor/icons/source/icon_capsule_shape_2d.svg b/editor/icons/source/icon_capsule_shape_2d.svg index 13c6648368..13c6648368 100644 --- a/tools/editor/icons/source/icon_capsule_shape_2d.svg +++ b/editor/icons/source/icon_capsule_shape_2d.svg diff --git a/tools/editor/icons/source/icon_center_container.svg b/editor/icons/source/icon_center_container.svg index 31262f8494..31262f8494 100644 --- a/tools/editor/icons/source/icon_center_container.svg +++ b/editor/icons/source/icon_center_container.svg diff --git a/tools/editor/icons/source/icon_check_box.svg b/editor/icons/source/icon_check_box.svg index 1068b424bd..1068b424bd 100644 --- a/tools/editor/icons/source/icon_check_box.svg +++ b/editor/icons/source/icon_check_box.svg diff --git a/tools/editor/icons/source/icon_check_button.svg b/editor/icons/source/icon_check_button.svg index 1dddc7bf43..1dddc7bf43 100644 --- a/tools/editor/icons/source/icon_check_button.svg +++ b/editor/icons/source/icon_check_button.svg diff --git a/tools/editor/icons/source/icon_circle_shape_2d.svg b/editor/icons/source/icon_circle_shape_2d.svg index 56ac538672..56ac538672 100644 --- a/tools/editor/icons/source/icon_circle_shape_2d.svg +++ b/editor/icons/source/icon_circle_shape_2d.svg diff --git a/tools/editor/icons/source/icon_class_list.svg b/editor/icons/source/icon_class_list.svg index 326174e566..326174e566 100644 --- a/tools/editor/icons/source/icon_class_list.svg +++ b/editor/icons/source/icon_class_list.svg diff --git a/tools/editor/icons/source/icon_close.svg b/editor/icons/source/icon_close.svg index 65b71ae860..65b71ae860 100644 --- a/tools/editor/icons/source/icon_close.svg +++ b/editor/icons/source/icon_close.svg diff --git a/tools/editor/icons/source/icon_collapse.svg b/editor/icons/source/icon_collapse.svg index a1c55e92de..a1c55e92de 100644 --- a/tools/editor/icons/source/icon_collapse.svg +++ b/editor/icons/source/icon_collapse.svg diff --git a/tools/editor/icons/source/icon_collision_2d.svg b/editor/icons/source/icon_collision_2d.svg index 29905795bd..29905795bd 100644 --- a/tools/editor/icons/source/icon_collision_2d.svg +++ b/editor/icons/source/icon_collision_2d.svg diff --git a/tools/editor/icons/source/icon_collision_polygon.svg b/editor/icons/source/icon_collision_polygon.svg index 41f20abb5f..41f20abb5f 100644 --- a/tools/editor/icons/source/icon_collision_polygon.svg +++ b/editor/icons/source/icon_collision_polygon.svg diff --git a/tools/editor/icons/source/icon_collision_shape.svg b/editor/icons/source/icon_collision_shape.svg index 066e3bc0fd..066e3bc0fd 100644 --- a/tools/editor/icons/source/icon_collision_shape.svg +++ b/editor/icons/source/icon_collision_shape.svg diff --git a/tools/editor/icons/source/icon_collision_shape_2d.svg b/editor/icons/source/icon_collision_shape_2d.svg index e0a750c946..e0a750c946 100644 --- a/tools/editor/icons/source/icon_collision_shape_2d.svg +++ b/editor/icons/source/icon_collision_shape_2d.svg diff --git a/tools/editor/icons/source/icon_color.svg b/editor/icons/source/icon_color.svg index c46f64b8ed..c46f64b8ed 100644 --- a/tools/editor/icons/source/icon_color.svg +++ b/editor/icons/source/icon_color.svg diff --git a/tools/editor/icons/source/icon_color_pick.svg b/editor/icons/source/icon_color_pick.svg index bbb05fc6b6..bbb05fc6b6 100644 --- a/tools/editor/icons/source/icon_color_pick.svg +++ b/editor/icons/source/icon_color_pick.svg diff --git a/tools/editor/icons/source/icon_color_picker.svg b/editor/icons/source/icon_color_picker.svg index 0efd276c50..0efd276c50 100644 --- a/tools/editor/icons/source/icon_color_picker.svg +++ b/editor/icons/source/icon_color_picker.svg diff --git a/tools/editor/icons/source/icon_color_picker_button.svg b/editor/icons/source/icon_color_picker_button.svg index 4e4fb8cc1b..4e4fb8cc1b 100644 --- a/tools/editor/icons/source/icon_color_picker_button.svg +++ b/editor/icons/source/icon_color_picker_button.svg diff --git a/tools/editor/icons/source/icon_color_ramp.svg b/editor/icons/source/icon_color_ramp.svg index ff23cdba8d..ff23cdba8d 100644 --- a/tools/editor/icons/source/icon_color_ramp.svg +++ b/editor/icons/source/icon_color_ramp.svg diff --git a/tools/editor/icons/source/icon_color_rect.svg b/editor/icons/source/icon_color_rect.svg index 76bf6596a9..76bf6596a9 100644 --- a/tools/editor/icons/source/icon_color_rect.svg +++ b/editor/icons/source/icon_color_rect.svg diff --git a/tools/editor/icons/source/icon_concave_polygon_shape.svg b/editor/icons/source/icon_concave_polygon_shape.svg index b0e0fe63ce..b0e0fe63ce 100644 --- a/tools/editor/icons/source/icon_concave_polygon_shape.svg +++ b/editor/icons/source/icon_concave_polygon_shape.svg diff --git a/tools/editor/icons/source/icon_concave_polygon_shape_2d.svg b/editor/icons/source/icon_concave_polygon_shape_2d.svg index 624105e5a8..624105e5a8 100644 --- a/tools/editor/icons/source/icon_concave_polygon_shape_2d.svg +++ b/editor/icons/source/icon_concave_polygon_shape_2d.svg diff --git a/tools/editor/icons/source/icon_cone_twist_joint.svg b/editor/icons/source/icon_cone_twist_joint.svg index 4799deb1d5..4799deb1d5 100644 --- a/tools/editor/icons/source/icon_cone_twist_joint.svg +++ b/editor/icons/source/icon_cone_twist_joint.svg diff --git a/tools/editor/icons/source/icon_confirmation_dialog.svg b/editor/icons/source/icon_confirmation_dialog.svg index 49dbc21e92..49dbc21e92 100644 --- a/tools/editor/icons/source/icon_confirmation_dialog.svg +++ b/editor/icons/source/icon_confirmation_dialog.svg diff --git a/tools/editor/icons/source/icon_connect.svg b/editor/icons/source/icon_connect.svg index 745d3cc436..745d3cc436 100644 --- a/tools/editor/icons/source/icon_connect.svg +++ b/editor/icons/source/icon_connect.svg diff --git a/tools/editor/icons/source/icon_connection_and_groups.svg b/editor/icons/source/icon_connection_and_groups.svg index 5468312b4b..5468312b4b 100644 --- a/tools/editor/icons/source/icon_connection_and_groups.svg +++ b/editor/icons/source/icon_connection_and_groups.svg diff --git a/tools/editor/icons/source/icon_container.svg b/editor/icons/source/icon_container.svg index 2d39efafee..2d39efafee 100644 --- a/tools/editor/icons/source/icon_container.svg +++ b/editor/icons/source/icon_container.svg diff --git a/tools/editor/icons/source/icon_control.svg b/editor/icons/source/icon_control.svg index 675a9f5c43..675a9f5c43 100644 --- a/tools/editor/icons/source/icon_control.svg +++ b/editor/icons/source/icon_control.svg diff --git a/tools/editor/icons/source/icon_control_align_bottom_center.svg b/editor/icons/source/icon_control_align_bottom_center.svg index d6c660bb2d..d6c660bb2d 100644 --- a/tools/editor/icons/source/icon_control_align_bottom_center.svg +++ b/editor/icons/source/icon_control_align_bottom_center.svg diff --git a/tools/editor/icons/source/icon_control_align_bottom_left.svg b/editor/icons/source/icon_control_align_bottom_left.svg index 7a234b10ad..7a234b10ad 100644 --- a/tools/editor/icons/source/icon_control_align_bottom_left.svg +++ b/editor/icons/source/icon_control_align_bottom_left.svg diff --git a/tools/editor/icons/source/icon_control_align_bottom_right.svg b/editor/icons/source/icon_control_align_bottom_right.svg index a4ba9a552a..a4ba9a552a 100644 --- a/tools/editor/icons/source/icon_control_align_bottom_right.svg +++ b/editor/icons/source/icon_control_align_bottom_right.svg diff --git a/tools/editor/icons/source/icon_control_align_bottom_wide.svg b/editor/icons/source/icon_control_align_bottom_wide.svg index 93352dd3f5..93352dd3f5 100644 --- a/tools/editor/icons/source/icon_control_align_bottom_wide.svg +++ b/editor/icons/source/icon_control_align_bottom_wide.svg diff --git a/tools/editor/icons/source/icon_control_align_center.svg b/editor/icons/source/icon_control_align_center.svg index 0c34d13def..0c34d13def 100644 --- a/tools/editor/icons/source/icon_control_align_center.svg +++ b/editor/icons/source/icon_control_align_center.svg diff --git a/tools/editor/icons/source/icon_control_align_center_left.svg b/editor/icons/source/icon_control_align_center_left.svg index ea62c9457d..ea62c9457d 100644 --- a/tools/editor/icons/source/icon_control_align_center_left.svg +++ b/editor/icons/source/icon_control_align_center_left.svg diff --git a/tools/editor/icons/source/icon_control_align_center_right.svg b/editor/icons/source/icon_control_align_center_right.svg index 3212ce8538..3212ce8538 100644 --- a/tools/editor/icons/source/icon_control_align_center_right.svg +++ b/editor/icons/source/icon_control_align_center_right.svg diff --git a/tools/editor/icons/source/icon_control_align_left_center.svg b/editor/icons/source/icon_control_align_left_center.svg index 716b6a2fd0..716b6a2fd0 100644 --- a/tools/editor/icons/source/icon_control_align_left_center.svg +++ b/editor/icons/source/icon_control_align_left_center.svg diff --git a/tools/editor/icons/source/icon_control_align_left_wide.svg b/editor/icons/source/icon_control_align_left_wide.svg index 7092c78508..7092c78508 100644 --- a/tools/editor/icons/source/icon_control_align_left_wide.svg +++ b/editor/icons/source/icon_control_align_left_wide.svg diff --git a/tools/editor/icons/source/icon_control_align_right_center.svg b/editor/icons/source/icon_control_align_right_center.svg index 7e7e4f2b23..7e7e4f2b23 100644 --- a/tools/editor/icons/source/icon_control_align_right_center.svg +++ b/editor/icons/source/icon_control_align_right_center.svg diff --git a/tools/editor/icons/source/icon_control_align_right_wide.svg b/editor/icons/source/icon_control_align_right_wide.svg index ef2d105bd8..ef2d105bd8 100644 --- a/tools/editor/icons/source/icon_control_align_right_wide.svg +++ b/editor/icons/source/icon_control_align_right_wide.svg diff --git a/tools/editor/icons/source/icon_control_align_top_center.svg b/editor/icons/source/icon_control_align_top_center.svg index a5b60846f4..a5b60846f4 100644 --- a/tools/editor/icons/source/icon_control_align_top_center.svg +++ b/editor/icons/source/icon_control_align_top_center.svg diff --git a/tools/editor/icons/source/icon_control_align_top_left.svg b/editor/icons/source/icon_control_align_top_left.svg index 9f4631cf31..9f4631cf31 100644 --- a/tools/editor/icons/source/icon_control_align_top_left.svg +++ b/editor/icons/source/icon_control_align_top_left.svg diff --git a/tools/editor/icons/source/icon_control_align_top_right.svg b/editor/icons/source/icon_control_align_top_right.svg index d968ba3d09..d968ba3d09 100644 --- a/tools/editor/icons/source/icon_control_align_top_right.svg +++ b/editor/icons/source/icon_control_align_top_right.svg diff --git a/tools/editor/icons/source/icon_control_align_top_wide.svg b/editor/icons/source/icon_control_align_top_wide.svg index 886ef60fe0..886ef60fe0 100644 --- a/tools/editor/icons/source/icon_control_align_top_wide.svg +++ b/editor/icons/source/icon_control_align_top_wide.svg diff --git a/tools/editor/icons/source/icon_control_align_wide.svg b/editor/icons/source/icon_control_align_wide.svg index 3f58ed93b6..3f58ed93b6 100644 --- a/tools/editor/icons/source/icon_control_align_wide.svg +++ b/editor/icons/source/icon_control_align_wide.svg diff --git a/tools/editor/icons/source/icon_control_hcenter_wide.svg b/editor/icons/source/icon_control_hcenter_wide.svg index 3aafa0340e..3aafa0340e 100644 --- a/tools/editor/icons/source/icon_control_hcenter_wide.svg +++ b/editor/icons/source/icon_control_hcenter_wide.svg diff --git a/tools/editor/icons/source/icon_control_vcenter_wide.svg b/editor/icons/source/icon_control_vcenter_wide.svg index 96fd44f3c8..96fd44f3c8 100644 --- a/tools/editor/icons/source/icon_control_vcenter_wide.svg +++ b/editor/icons/source/icon_control_vcenter_wide.svg diff --git a/tools/editor/icons/source/icon_convex_polygon_shape.svg b/editor/icons/source/icon_convex_polygon_shape.svg index b867a58f6f..b867a58f6f 100644 --- a/tools/editor/icons/source/icon_convex_polygon_shape.svg +++ b/editor/icons/source/icon_convex_polygon_shape.svg diff --git a/tools/editor/icons/source/icon_convex_polygon_shape_2d.svg b/editor/icons/source/icon_convex_polygon_shape_2d.svg index 3b55df7fba..3b55df7fba 100644 --- a/tools/editor/icons/source/icon_convex_polygon_shape_2d.svg +++ b/editor/icons/source/icon_convex_polygon_shape_2d.svg diff --git a/tools/editor/icons/source/icon_copy_node_path.svg b/editor/icons/source/icon_copy_node_path.svg index 9f33c5e54d..9f33c5e54d 100644 --- a/tools/editor/icons/source/icon_copy_node_path.svg +++ b/editor/icons/source/icon_copy_node_path.svg diff --git a/tools/editor/icons/source/icon_create_new_scene_from.svg b/editor/icons/source/icon_create_new_scene_from.svg index 529553bbd3..529553bbd3 100644 --- a/tools/editor/icons/source/icon_create_new_scene_from.svg +++ b/editor/icons/source/icon_create_new_scene_from.svg diff --git a/tools/editor/icons/source/icon_cube_map.svg b/editor/icons/source/icon_cube_map.svg index 4fd86b1233..4fd86b1233 100644 --- a/tools/editor/icons/source/icon_cube_map.svg +++ b/editor/icons/source/icon_cube_map.svg diff --git a/tools/editor/icons/source/icon_curve_2d.svg b/editor/icons/source/icon_curve_2d.svg index 34719e37de..34719e37de 100644 --- a/tools/editor/icons/source/icon_curve_2d.svg +++ b/editor/icons/source/icon_curve_2d.svg diff --git a/tools/editor/icons/source/icon_curve_3d.svg b/editor/icons/source/icon_curve_3d.svg index 66034968b2..66034968b2 100644 --- a/tools/editor/icons/source/icon_curve_3d.svg +++ b/editor/icons/source/icon_curve_3d.svg diff --git a/tools/editor/icons/source/icon_curve_close.svg b/editor/icons/source/icon_curve_close.svg index 15909df7c8..15909df7c8 100644 --- a/tools/editor/icons/source/icon_curve_close.svg +++ b/editor/icons/source/icon_curve_close.svg diff --git a/tools/editor/icons/source/icon_curve_constant.svg b/editor/icons/source/icon_curve_constant.svg index 6d9a7dc959..6d9a7dc959 100644 --- a/tools/editor/icons/source/icon_curve_constant.svg +++ b/editor/icons/source/icon_curve_constant.svg diff --git a/tools/editor/icons/source/icon_curve_create.svg b/editor/icons/source/icon_curve_create.svg index 8ab578e9a0..8ab578e9a0 100644 --- a/tools/editor/icons/source/icon_curve_create.svg +++ b/editor/icons/source/icon_curve_create.svg diff --git a/tools/editor/icons/source/icon_curve_curve.svg b/editor/icons/source/icon_curve_curve.svg index e3b6b64a4c..e3b6b64a4c 100644 --- a/tools/editor/icons/source/icon_curve_curve.svg +++ b/editor/icons/source/icon_curve_curve.svg diff --git a/tools/editor/icons/source/icon_curve_delete.svg b/editor/icons/source/icon_curve_delete.svg index f40dd1eeb1..f40dd1eeb1 100644 --- a/tools/editor/icons/source/icon_curve_delete.svg +++ b/editor/icons/source/icon_curve_delete.svg diff --git a/tools/editor/icons/source/icon_curve_edit.svg b/editor/icons/source/icon_curve_edit.svg index f695e96b8c..f695e96b8c 100644 --- a/tools/editor/icons/source/icon_curve_edit.svg +++ b/editor/icons/source/icon_curve_edit.svg diff --git a/tools/editor/icons/source/icon_curve_in.svg b/editor/icons/source/icon_curve_in.svg index 9dc033aa95..9dc033aa95 100644 --- a/tools/editor/icons/source/icon_curve_in.svg +++ b/editor/icons/source/icon_curve_in.svg diff --git a/tools/editor/icons/source/icon_curve_in_out.svg b/editor/icons/source/icon_curve_in_out.svg index c68f906423..c68f906423 100644 --- a/tools/editor/icons/source/icon_curve_in_out.svg +++ b/editor/icons/source/icon_curve_in_out.svg diff --git a/tools/editor/icons/source/icon_curve_linear.svg b/editor/icons/source/icon_curve_linear.svg index ae7a889a71..ae7a889a71 100644 --- a/tools/editor/icons/source/icon_curve_linear.svg +++ b/editor/icons/source/icon_curve_linear.svg diff --git a/tools/editor/icons/source/icon_curve_out.svg b/editor/icons/source/icon_curve_out.svg index 080aa755dc..080aa755dc 100644 --- a/tools/editor/icons/source/icon_curve_out.svg +++ b/editor/icons/source/icon_curve_out.svg diff --git a/tools/editor/icons/source/icon_curve_out_in.svg b/editor/icons/source/icon_curve_out_in.svg index d2b4d06e5f..d2b4d06e5f 100644 --- a/tools/editor/icons/source/icon_curve_out_in.svg +++ b/editor/icons/source/icon_curve_out_in.svg diff --git a/tools/editor/icons/source/icon_damped_spring_joint_2d.svg b/editor/icons/source/icon_damped_spring_joint_2d.svg index bf12810a6c..bf12810a6c 100644 --- a/tools/editor/icons/source/icon_damped_spring_joint_2d.svg +++ b/editor/icons/source/icon_damped_spring_joint_2d.svg diff --git a/tools/editor/icons/source/icon_debug_continue.svg b/editor/icons/source/icon_debug_continue.svg index 5d9ccd5a7e..5d9ccd5a7e 100644 --- a/tools/editor/icons/source/icon_debug_continue.svg +++ b/editor/icons/source/icon_debug_continue.svg diff --git a/tools/editor/icons/source/icon_debug_next.svg b/editor/icons/source/icon_debug_next.svg index 4dd9bb8c4b..4dd9bb8c4b 100644 --- a/tools/editor/icons/source/icon_debug_next.svg +++ b/editor/icons/source/icon_debug_next.svg diff --git a/tools/editor/icons/source/icon_debug_step.svg b/editor/icons/source/icon_debug_step.svg index 20d11f8710..20d11f8710 100644 --- a/tools/editor/icons/source/icon_debug_step.svg +++ b/editor/icons/source/icon_debug_step.svg diff --git a/tools/editor/icons/source/icon_dependency_changed.svg b/editor/icons/source/icon_dependency_changed.svg index bbcd3f0c0a..bbcd3f0c0a 100644 --- a/tools/editor/icons/source/icon_dependency_changed.svg +++ b/editor/icons/source/icon_dependency_changed.svg diff --git a/tools/editor/icons/source/icon_dependency_changed_hl.svg b/editor/icons/source/icon_dependency_changed_hl.svg index 54a37695ef..54a37695ef 100644 --- a/tools/editor/icons/source/icon_dependency_changed_hl.svg +++ b/editor/icons/source/icon_dependency_changed_hl.svg diff --git a/tools/editor/icons/source/icon_dependency_local_changed.svg b/editor/icons/source/icon_dependency_local_changed.svg index 799d69c4e0..799d69c4e0 100644 --- a/tools/editor/icons/source/icon_dependency_local_changed.svg +++ b/editor/icons/source/icon_dependency_local_changed.svg diff --git a/tools/editor/icons/source/icon_dependency_local_changed_hl.svg b/editor/icons/source/icon_dependency_local_changed_hl.svg index 67c04c312a..67c04c312a 100644 --- a/tools/editor/icons/source/icon_dependency_local_changed_hl.svg +++ b/editor/icons/source/icon_dependency_local_changed_hl.svg diff --git a/tools/editor/icons/source/icon_dependency_ok.svg b/editor/icons/source/icon_dependency_ok.svg index 76d7f54065..76d7f54065 100644 --- a/tools/editor/icons/source/icon_dependency_ok.svg +++ b/editor/icons/source/icon_dependency_ok.svg diff --git a/tools/editor/icons/source/icon_dependency_ok_hl.svg b/editor/icons/source/icon_dependency_ok_hl.svg index 190458c532..190458c532 100644 --- a/tools/editor/icons/source/icon_dependency_ok_hl.svg +++ b/editor/icons/source/icon_dependency_ok_hl.svg diff --git a/tools/editor/icons/source/icon_directional_light.svg b/editor/icons/source/icon_directional_light.svg index dbec755039..dbec755039 100644 --- a/tools/editor/icons/source/icon_directional_light.svg +++ b/editor/icons/source/icon_directional_light.svg diff --git a/tools/editor/icons/source/icon_distraction_free.svg b/editor/icons/source/icon_distraction_free.svg index 4ae48b2fb6..4ae48b2fb6 100644 --- a/tools/editor/icons/source/icon_distraction_free.svg +++ b/editor/icons/source/icon_distraction_free.svg diff --git a/tools/editor/icons/source/icon_duplicate.svg b/editor/icons/source/icon_duplicate.svg index b1d5544fc0..b1d5544fc0 100644 --- a/tools/editor/icons/source/icon_duplicate.svg +++ b/editor/icons/source/icon_duplicate.svg diff --git a/tools/editor/icons/source/icon_dynamic_font.svg b/editor/icons/source/icon_dynamic_font.svg index a40c0e3408..a40c0e3408 100644 --- a/tools/editor/icons/source/icon_dynamic_font.svg +++ b/editor/icons/source/icon_dynamic_font.svg diff --git a/tools/editor/icons/source/icon_dynamic_font_data.svg b/editor/icons/source/icon_dynamic_font_data.svg index 9f06172fef..9f06172fef 100644 --- a/tools/editor/icons/source/icon_dynamic_font_data.svg +++ b/editor/icons/source/icon_dynamic_font_data.svg diff --git a/tools/editor/icons/source/icon_edit.svg b/editor/icons/source/icon_edit.svg index 6da05a6603..6da05a6603 100644 --- a/tools/editor/icons/source/icon_edit.svg +++ b/editor/icons/source/icon_edit.svg diff --git a/tools/editor/icons/source/icon_edit_key.svg b/editor/icons/source/icon_edit_key.svg index 46795bef35..46795bef35 100644 --- a/tools/editor/icons/source/icon_edit_key.svg +++ b/editor/icons/source/icon_edit_key.svg diff --git a/tools/editor/icons/source/icon_edit_pivot.svg b/editor/icons/source/icon_edit_pivot.svg index 8ae55ad8b7..8ae55ad8b7 100644 --- a/tools/editor/icons/source/icon_edit_pivot.svg +++ b/editor/icons/source/icon_edit_pivot.svg diff --git a/tools/editor/icons/source/icon_edit_resource.svg b/editor/icons/source/icon_edit_resource.svg index 1950988ca2..1950988ca2 100644 --- a/tools/editor/icons/source/icon_edit_resource.svg +++ b/editor/icons/source/icon_edit_resource.svg diff --git a/tools/editor/icons/source/icon_editor_3d_handle.svg b/editor/icons/source/icon_editor_3d_handle.svg index 255d1801a9..255d1801a9 100644 --- a/tools/editor/icons/source/icon_editor_3d_handle.svg +++ b/editor/icons/source/icon_editor_3d_handle.svg diff --git a/tools/editor/icons/source/icon_editor_handle.svg b/editor/icons/source/icon_editor_handle.svg index 17ed2a61e7..17ed2a61e7 100644 --- a/tools/editor/icons/source/icon_editor_handle.svg +++ b/editor/icons/source/icon_editor_handle.svg diff --git a/tools/editor/icons/source/icon_editor_pivot.svg b/editor/icons/source/icon_editor_pivot.svg index 8ce7d48970..8ce7d48970 100644 --- a/tools/editor/icons/source/icon_editor_pivot.svg +++ b/editor/icons/source/icon_editor_pivot.svg diff --git a/tools/editor/icons/source/icon_editor_plugin.svg b/editor/icons/source/icon_editor_plugin.svg index b9460de683..b9460de683 100644 --- a/tools/editor/icons/source/icon_editor_plugin.svg +++ b/editor/icons/source/icon_editor_plugin.svg diff --git a/tools/editor/icons/source/icon_environment.svg b/editor/icons/source/icon_environment.svg index 45add2c7f7..45add2c7f7 100644 --- a/tools/editor/icons/source/icon_environment.svg +++ b/editor/icons/source/icon_environment.svg diff --git a/tools/editor/icons/source/icon_error.svg b/editor/icons/source/icon_error.svg index a0b04a98cb..a0b04a98cb 100644 --- a/tools/editor/icons/source/icon_error.svg +++ b/editor/icons/source/icon_error.svg diff --git a/tools/editor/icons/source/icon_error_sign.svg b/editor/icons/source/icon_error_sign.svg index 01c1dbb4d5..01c1dbb4d5 100644 --- a/tools/editor/icons/source/icon_error_sign.svg +++ b/editor/icons/source/icon_error_sign.svg diff --git a/tools/editor/icons/source/icon_event_player.svg b/editor/icons/source/icon_event_player.svg index 3f5f7da693..3f5f7da693 100644 --- a/tools/editor/icons/source/icon_event_player.svg +++ b/editor/icons/source/icon_event_player.svg diff --git a/tools/editor/icons/source/icon_favorites.svg b/editor/icons/source/icon_favorites.svg index 12d4b56897..12d4b56897 100644 --- a/tools/editor/icons/source/icon_favorites.svg +++ b/editor/icons/source/icon_favorites.svg diff --git a/tools/editor/icons/source/icon_file_big.svg b/editor/icons/source/icon_file_big.svg index 38ad9b707a..38ad9b707a 100644 --- a/tools/editor/icons/source/icon_file_big.svg +++ b/editor/icons/source/icon_file_big.svg diff --git a/tools/editor/icons/source/icon_file_dialog.svg b/editor/icons/source/icon_file_dialog.svg index 9dee04c220..9dee04c220 100644 --- a/tools/editor/icons/source/icon_file_dialog.svg +++ b/editor/icons/source/icon_file_dialog.svg diff --git a/tools/editor/icons/source/icon_file_list.svg b/editor/icons/source/icon_file_list.svg index 82dad29aac..82dad29aac 100644 --- a/tools/editor/icons/source/icon_file_list.svg +++ b/editor/icons/source/icon_file_list.svg diff --git a/tools/editor/icons/source/icon_file_server.svg b/editor/icons/source/icon_file_server.svg index 1e1f9b6e42..1e1f9b6e42 100644 --- a/tools/editor/icons/source/icon_file_server.svg +++ b/editor/icons/source/icon_file_server.svg diff --git a/tools/editor/icons/source/icon_file_server_active.svg b/editor/icons/source/icon_file_server_active.svg index f01ba578da..f01ba578da 100644 --- a/tools/editor/icons/source/icon_file_server_active.svg +++ b/editor/icons/source/icon_file_server_active.svg diff --git a/tools/editor/icons/source/icon_file_thumbnail.svg b/editor/icons/source/icon_file_thumbnail.svg index 48d90dd3c6..48d90dd3c6 100644 --- a/tools/editor/icons/source/icon_file_thumbnail.svg +++ b/editor/icons/source/icon_file_thumbnail.svg diff --git a/tools/editor/icons/source/icon_fixed_material.svg b/editor/icons/source/icon_fixed_material.svg index 5be74f490d..5be74f490d 100644 --- a/tools/editor/icons/source/icon_fixed_material.svg +++ b/editor/icons/source/icon_fixed_material.svg diff --git a/tools/editor/icons/source/icon_fixed_spatial_material.svg b/editor/icons/source/icon_fixed_spatial_material.svg index 7ae0f93ffc..7ae0f93ffc 100644 --- a/tools/editor/icons/source/icon_fixed_spatial_material.svg +++ b/editor/icons/source/icon_fixed_spatial_material.svg diff --git a/tools/editor/icons/source/icon_folder.svg b/editor/icons/source/icon_folder.svg index ca16a5737f..ca16a5737f 100644 --- a/tools/editor/icons/source/icon_folder.svg +++ b/editor/icons/source/icon_folder.svg diff --git a/tools/editor/icons/source/icon_folder_big.svg b/editor/icons/source/icon_folder_big.svg index 818eaa2ba3..818eaa2ba3 100644 --- a/tools/editor/icons/source/icon_folder_big.svg +++ b/editor/icons/source/icon_folder_big.svg diff --git a/tools/editor/icons/source/icon_font.svg b/editor/icons/source/icon_font.svg index 36567fe10c..36567fe10c 100644 --- a/tools/editor/icons/source/icon_font.svg +++ b/editor/icons/source/icon_font.svg diff --git a/tools/editor/icons/source/icon_forward.svg b/editor/icons/source/icon_forward.svg index f6cb351cc1..f6cb351cc1 100644 --- a/tools/editor/icons/source/icon_forward.svg +++ b/editor/icons/source/icon_forward.svg diff --git a/tools/editor/icons/source/icon_g_d_script.svg b/editor/icons/source/icon_g_d_script.svg index f2b8cd9343..f2b8cd9343 100644 --- a/tools/editor/icons/source/icon_g_d_script.svg +++ b/editor/icons/source/icon_g_d_script.svg diff --git a/tools/editor/icons/source/icon_g_i_probe.svg b/editor/icons/source/icon_g_i_probe.svg index d803a5f63d..d803a5f63d 100644 --- a/tools/editor/icons/source/icon_g_i_probe.svg +++ b/editor/icons/source/icon_g_i_probe.svg diff --git a/tools/editor/icons/source/icon_g_i_probe_data.svg b/editor/icons/source/icon_g_i_probe_data.svg index 96fa62723c..96fa62723c 100644 --- a/tools/editor/icons/source/icon_g_i_probe_data.svg +++ b/editor/icons/source/icon_g_i_probe_data.svg diff --git a/tools/editor/icons/source/icon_generic_6_d_o_f_joint.svg b/editor/icons/source/icon_generic_6_d_o_f_joint.svg index 485040c6dc..485040c6dc 100644 --- a/tools/editor/icons/source/icon_generic_6_d_o_f_joint.svg +++ b/editor/icons/source/icon_generic_6_d_o_f_joint.svg diff --git a/tools/editor/icons/source/icon_gizmo_directional_light.svg b/editor/icons/source/icon_gizmo_directional_light.svg index 65202877a0..65202877a0 100644 --- a/tools/editor/icons/source/icon_gizmo_directional_light.svg +++ b/editor/icons/source/icon_gizmo_directional_light.svg diff --git a/tools/editor/icons/source/icon_gizmo_light.svg b/editor/icons/source/icon_gizmo_light.svg index c42d6e1f76..c42d6e1f76 100644 --- a/tools/editor/icons/source/icon_gizmo_light.svg +++ b/editor/icons/source/icon_gizmo_light.svg diff --git a/tools/editor/icons/source/icon_gizmo_listener.svg b/editor/icons/source/icon_gizmo_listener.svg index 3667cbc69b..3667cbc69b 100644 --- a/tools/editor/icons/source/icon_gizmo_listener.svg +++ b/editor/icons/source/icon_gizmo_listener.svg diff --git a/tools/editor/icons/source/icon_gizmo_spatial_sample_player.svg b/editor/icons/source/icon_gizmo_spatial_sample_player.svg index a734095268..a734095268 100644 --- a/tools/editor/icons/source/icon_gizmo_spatial_sample_player.svg +++ b/editor/icons/source/icon_gizmo_spatial_sample_player.svg diff --git a/tools/editor/icons/source/icon_gizmo_spatial_stream_player.svg b/editor/icons/source/icon_gizmo_spatial_stream_player.svg index c333641249..c333641249 100644 --- a/tools/editor/icons/source/icon_gizmo_spatial_stream_player.svg +++ b/editor/icons/source/icon_gizmo_spatial_stream_player.svg diff --git a/tools/editor/icons/source/icon_godot.svg b/editor/icons/source/icon_godot.svg index 419f23125b..419f23125b 100644 --- a/tools/editor/icons/source/icon_godot.svg +++ b/editor/icons/source/icon_godot.svg diff --git a/tools/editor/icons/source/icon_graph_comment.svg b/editor/icons/source/icon_graph_comment.svg index 5ad8fc8253..5ad8fc8253 100644 --- a/tools/editor/icons/source/icon_graph_comment.svg +++ b/editor/icons/source/icon_graph_comment.svg diff --git a/tools/editor/icons/source/icon_graph_cube_uniform.svg b/editor/icons/source/icon_graph_cube_uniform.svg index 63774a7431..63774a7431 100644 --- a/tools/editor/icons/source/icon_graph_cube_uniform.svg +++ b/editor/icons/source/icon_graph_cube_uniform.svg diff --git a/tools/editor/icons/source/icon_graph_curve_map.svg b/editor/icons/source/icon_graph_curve_map.svg index 6c3594cb1b..6c3594cb1b 100644 --- a/tools/editor/icons/source/icon_graph_curve_map.svg +++ b/editor/icons/source/icon_graph_curve_map.svg diff --git a/tools/editor/icons/source/icon_graph_default_texture.svg b/editor/icons/source/icon_graph_default_texture.svg index 8d1c78ddd7..8d1c78ddd7 100644 --- a/tools/editor/icons/source/icon_graph_default_texture.svg +++ b/editor/icons/source/icon_graph_default_texture.svg diff --git a/tools/editor/icons/source/icon_graph_edit.svg b/editor/icons/source/icon_graph_edit.svg index 30d3ad96f6..30d3ad96f6 100644 --- a/tools/editor/icons/source/icon_graph_edit.svg +++ b/editor/icons/source/icon_graph_edit.svg diff --git a/tools/editor/icons/source/icon_graph_input.svg b/editor/icons/source/icon_graph_input.svg index 265fb7279e..265fb7279e 100644 --- a/tools/editor/icons/source/icon_graph_input.svg +++ b/editor/icons/source/icon_graph_input.svg diff --git a/tools/editor/icons/source/icon_graph_node.svg b/editor/icons/source/icon_graph_node.svg index 078b0ffe9e..078b0ffe9e 100644 --- a/tools/editor/icons/source/icon_graph_node.svg +++ b/editor/icons/source/icon_graph_node.svg diff --git a/tools/editor/icons/source/icon_graph_rgb.svg b/editor/icons/source/icon_graph_rgb.svg index a00e97a104..a00e97a104 100644 --- a/tools/editor/icons/source/icon_graph_rgb.svg +++ b/editor/icons/source/icon_graph_rgb.svg diff --git a/tools/editor/icons/source/icon_graph_rgb_op.svg b/editor/icons/source/icon_graph_rgb_op.svg index fdd3d3a9f4..fdd3d3a9f4 100644 --- a/tools/editor/icons/source/icon_graph_rgb_op.svg +++ b/editor/icons/source/icon_graph_rgb_op.svg diff --git a/tools/editor/icons/source/icon_graph_rgb_uniform.svg b/editor/icons/source/icon_graph_rgb_uniform.svg index 359c86d61a..359c86d61a 100644 --- a/tools/editor/icons/source/icon_graph_rgb_uniform.svg +++ b/editor/icons/source/icon_graph_rgb_uniform.svg diff --git a/tools/editor/icons/source/icon_graph_scalar.svg b/editor/icons/source/icon_graph_scalar.svg index 7a75ddba78..7a75ddba78 100644 --- a/tools/editor/icons/source/icon_graph_scalar.svg +++ b/editor/icons/source/icon_graph_scalar.svg diff --git a/tools/editor/icons/source/icon_graph_scalar_interp.svg b/editor/icons/source/icon_graph_scalar_interp.svg index 47b619d608..47b619d608 100644 --- a/tools/editor/icons/source/icon_graph_scalar_interp.svg +++ b/editor/icons/source/icon_graph_scalar_interp.svg diff --git a/tools/editor/icons/source/icon_graph_scalar_op.svg b/editor/icons/source/icon_graph_scalar_op.svg index fcb54f9aa0..fcb54f9aa0 100644 --- a/tools/editor/icons/source/icon_graph_scalar_op.svg +++ b/editor/icons/source/icon_graph_scalar_op.svg diff --git a/tools/editor/icons/source/icon_graph_scalar_uniform.svg b/editor/icons/source/icon_graph_scalar_uniform.svg index e5e5edea9c..e5e5edea9c 100644 --- a/tools/editor/icons/source/icon_graph_scalar_uniform.svg +++ b/editor/icons/source/icon_graph_scalar_uniform.svg diff --git a/tools/editor/icons/source/icon_graph_scalars_to_vec.svg b/editor/icons/source/icon_graph_scalars_to_vec.svg index 0f2994a606..0f2994a606 100644 --- a/tools/editor/icons/source/icon_graph_scalars_to_vec.svg +++ b/editor/icons/source/icon_graph_scalars_to_vec.svg diff --git a/tools/editor/icons/source/icon_graph_texscreen.svg b/editor/icons/source/icon_graph_texscreen.svg index 89d000d7cb..89d000d7cb 100644 --- a/tools/editor/icons/source/icon_graph_texscreen.svg +++ b/editor/icons/source/icon_graph_texscreen.svg diff --git a/tools/editor/icons/source/icon_graph_texture_uniform.svg b/editor/icons/source/icon_graph_texture_uniform.svg index 440f83642c..440f83642c 100644 --- a/tools/editor/icons/source/icon_graph_texture_uniform.svg +++ b/editor/icons/source/icon_graph_texture_uniform.svg diff --git a/tools/editor/icons/source/icon_graph_time.svg b/editor/icons/source/icon_graph_time.svg index 77b80e920b..77b80e920b 100644 --- a/tools/editor/icons/source/icon_graph_time.svg +++ b/editor/icons/source/icon_graph_time.svg diff --git a/tools/editor/icons/source/icon_graph_vec_dp.svg b/editor/icons/source/icon_graph_vec_dp.svg index 8994d8ce59..8994d8ce59 100644 --- a/tools/editor/icons/source/icon_graph_vec_dp.svg +++ b/editor/icons/source/icon_graph_vec_dp.svg diff --git a/tools/editor/icons/source/icon_graph_vec_interp.svg b/editor/icons/source/icon_graph_vec_interp.svg index 885b342a54..885b342a54 100644 --- a/tools/editor/icons/source/icon_graph_vec_interp.svg +++ b/editor/icons/source/icon_graph_vec_interp.svg diff --git a/tools/editor/icons/source/icon_graph_vec_length.svg b/editor/icons/source/icon_graph_vec_length.svg index aa01e3ef2a..aa01e3ef2a 100644 --- a/tools/editor/icons/source/icon_graph_vec_length.svg +++ b/editor/icons/source/icon_graph_vec_length.svg diff --git a/tools/editor/icons/source/icon_graph_vec_op.svg b/editor/icons/source/icon_graph_vec_op.svg index da7540ce86..da7540ce86 100644 --- a/tools/editor/icons/source/icon_graph_vec_op.svg +++ b/editor/icons/source/icon_graph_vec_op.svg diff --git a/tools/editor/icons/source/icon_graph_vec_scalar_op.svg b/editor/icons/source/icon_graph_vec_scalar_op.svg index aeb2626120..aeb2626120 100644 --- a/tools/editor/icons/source/icon_graph_vec_scalar_op.svg +++ b/editor/icons/source/icon_graph_vec_scalar_op.svg diff --git a/tools/editor/icons/source/icon_graph_vec_to_scalars.svg b/editor/icons/source/icon_graph_vec_to_scalars.svg index fb58db9d78..fb58db9d78 100644 --- a/tools/editor/icons/source/icon_graph_vec_to_scalars.svg +++ b/editor/icons/source/icon_graph_vec_to_scalars.svg diff --git a/tools/editor/icons/source/icon_graph_vecs_to_xform.svg b/editor/icons/source/icon_graph_vecs_to_xform.svg index f8ba3eb4b8..f8ba3eb4b8 100644 --- a/tools/editor/icons/source/icon_graph_vecs_to_xform.svg +++ b/editor/icons/source/icon_graph_vecs_to_xform.svg diff --git a/tools/editor/icons/source/icon_graph_vector.svg b/editor/icons/source/icon_graph_vector.svg index e7f6bd927f..e7f6bd927f 100644 --- a/tools/editor/icons/source/icon_graph_vector.svg +++ b/editor/icons/source/icon_graph_vector.svg diff --git a/tools/editor/icons/source/icon_graph_vector_uniform.svg b/editor/icons/source/icon_graph_vector_uniform.svg index 2310938af5..2310938af5 100644 --- a/tools/editor/icons/source/icon_graph_vector_uniform.svg +++ b/editor/icons/source/icon_graph_vector_uniform.svg diff --git a/tools/editor/icons/source/icon_graph_xform.svg b/editor/icons/source/icon_graph_xform.svg index c9b027ee2d..c9b027ee2d 100644 --- a/tools/editor/icons/source/icon_graph_xform.svg +++ b/editor/icons/source/icon_graph_xform.svg diff --git a/tools/editor/icons/source/icon_graph_xform_mult.svg b/editor/icons/source/icon_graph_xform_mult.svg index 71fca83f3d..71fca83f3d 100644 --- a/tools/editor/icons/source/icon_graph_xform_mult.svg +++ b/editor/icons/source/icon_graph_xform_mult.svg diff --git a/tools/editor/icons/source/icon_graph_xform_scalar_func.svg b/editor/icons/source/icon_graph_xform_scalar_func.svg index 45fd97a671..45fd97a671 100644 --- a/tools/editor/icons/source/icon_graph_xform_scalar_func.svg +++ b/editor/icons/source/icon_graph_xform_scalar_func.svg diff --git a/tools/editor/icons/source/icon_graph_xform_to_vecs.svg b/editor/icons/source/icon_graph_xform_to_vecs.svg index cc113e72fd..cc113e72fd 100644 --- a/tools/editor/icons/source/icon_graph_xform_to_vecs.svg +++ b/editor/icons/source/icon_graph_xform_to_vecs.svg diff --git a/tools/editor/icons/source/icon_graph_xform_uniform.svg b/editor/icons/source/icon_graph_xform_uniform.svg index f1cdcd408c..f1cdcd408c 100644 --- a/tools/editor/icons/source/icon_graph_xform_uniform.svg +++ b/editor/icons/source/icon_graph_xform_uniform.svg diff --git a/tools/editor/icons/source/icon_graph_xform_vec_func.svg b/editor/icons/source/icon_graph_xform_vec_func.svg index 0d141bc646..0d141bc646 100644 --- a/tools/editor/icons/source/icon_graph_xform_vec_func.svg +++ b/editor/icons/source/icon_graph_xform_vec_func.svg diff --git a/tools/editor/icons/source/icon_graph_xform_vec_imult.svg b/editor/icons/source/icon_graph_xform_vec_imult.svg index 74dc1ba7e3..74dc1ba7e3 100644 --- a/tools/editor/icons/source/icon_graph_xform_vec_imult.svg +++ b/editor/icons/source/icon_graph_xform_vec_imult.svg diff --git a/tools/editor/icons/source/icon_graph_xform_vec_mult.svg b/editor/icons/source/icon_graph_xform_vec_mult.svg index c3e59abd46..c3e59abd46 100644 --- a/tools/editor/icons/source/icon_graph_xform_vec_mult.svg +++ b/editor/icons/source/icon_graph_xform_vec_mult.svg diff --git a/tools/editor/icons/source/icon_grid.svg b/editor/icons/source/icon_grid.svg index 2d9288de14..2d9288de14 100644 --- a/tools/editor/icons/source/icon_grid.svg +++ b/editor/icons/source/icon_grid.svg diff --git a/tools/editor/icons/source/icon_grid_container.svg b/editor/icons/source/icon_grid_container.svg index a27578f196..a27578f196 100644 --- a/tools/editor/icons/source/icon_grid_container.svg +++ b/editor/icons/source/icon_grid_container.svg diff --git a/tools/editor/icons/source/icon_grid_map.svg b/editor/icons/source/icon_grid_map.svg index 5bbea0ff2c..5bbea0ff2c 100644 --- a/tools/editor/icons/source/icon_grid_map.svg +++ b/editor/icons/source/icon_grid_map.svg diff --git a/tools/editor/icons/source/icon_groove_joint_2d.svg b/editor/icons/source/icon_groove_joint_2d.svg index d05bebef48..d05bebef48 100644 --- a/tools/editor/icons/source/icon_groove_joint_2d.svg +++ b/editor/icons/source/icon_groove_joint_2d.svg diff --git a/tools/editor/icons/source/icon_group.svg b/editor/icons/source/icon_group.svg index a0a2f02af5..a0a2f02af5 100644 --- a/tools/editor/icons/source/icon_group.svg +++ b/editor/icons/source/icon_group.svg diff --git a/tools/editor/icons/source/icon_groups.svg b/editor/icons/source/icon_groups.svg index 00249597a4..00249597a4 100644 --- a/tools/editor/icons/source/icon_groups.svg +++ b/editor/icons/source/icon_groups.svg diff --git a/tools/editor/icons/source/icon_h_box_container.svg b/editor/icons/source/icon_h_box_container.svg index f180dde93a..f180dde93a 100644 --- a/tools/editor/icons/source/icon_h_box_container.svg +++ b/editor/icons/source/icon_h_box_container.svg diff --git a/tools/editor/icons/source/icon_h_button_array.svg b/editor/icons/source/icon_h_button_array.svg index 9470aeb370..9470aeb370 100644 --- a/tools/editor/icons/source/icon_h_button_array.svg +++ b/editor/icons/source/icon_h_button_array.svg diff --git a/tools/editor/icons/source/icon_h_scroll_bar.svg b/editor/icons/source/icon_h_scroll_bar.svg index 2f007c7c94..2f007c7c94 100644 --- a/tools/editor/icons/source/icon_h_scroll_bar.svg +++ b/editor/icons/source/icon_h_scroll_bar.svg diff --git a/tools/editor/icons/source/icon_h_separator.svg b/editor/icons/source/icon_h_separator.svg index 461299731d..461299731d 100644 --- a/tools/editor/icons/source/icon_h_separator.svg +++ b/editor/icons/source/icon_h_separator.svg diff --git a/tools/editor/icons/source/icon_h_slider.svg b/editor/icons/source/icon_h_slider.svg index beee5f8b6a..beee5f8b6a 100644 --- a/tools/editor/icons/source/icon_h_slider.svg +++ b/editor/icons/source/icon_h_slider.svg diff --git a/tools/editor/icons/source/icon_h_split_container.svg b/editor/icons/source/icon_h_split_container.svg index 9ca2df0ff1..9ca2df0ff1 100644 --- a/tools/editor/icons/source/icon_h_split_container.svg +++ b/editor/icons/source/icon_h_split_container.svg diff --git a/tools/editor/icons/source/icon_h_t_t_p_request.svg b/editor/icons/source/icon_h_t_t_p_request.svg index f43141dd7c..f43141dd7c 100644 --- a/tools/editor/icons/source/icon_h_t_t_p_request.svg +++ b/editor/icons/source/icon_h_t_t_p_request.svg diff --git a/tools/editor/icons/source/icon_headphones.svg b/editor/icons/source/icon_headphones.svg index 456a9b8d4e..456a9b8d4e 100644 --- a/tools/editor/icons/source/icon_headphones.svg +++ b/editor/icons/source/icon_headphones.svg diff --git a/tools/editor/icons/source/icon_help.svg b/editor/icons/source/icon_help.svg index 01e85e0f55..01e85e0f55 100644 --- a/tools/editor/icons/source/icon_help.svg +++ b/editor/icons/source/icon_help.svg diff --git a/tools/editor/icons/source/icon_hidden.svg b/editor/icons/source/icon_hidden.svg index 1d504f02fb..1d504f02fb 100644 --- a/tools/editor/icons/source/icon_hidden.svg +++ b/editor/icons/source/icon_hidden.svg diff --git a/tools/editor/icons/source/icon_hinge_joint.svg b/editor/icons/source/icon_hinge_joint.svg index 767feac9d5..767feac9d5 100644 --- a/tools/editor/icons/source/icon_hinge_joint.svg +++ b/editor/icons/source/icon_hinge_joint.svg diff --git a/tools/editor/icons/source/icon_history.svg b/editor/icons/source/icon_history.svg index f81390f0f5..f81390f0f5 100644 --- a/tools/editor/icons/source/icon_history.svg +++ b/editor/icons/source/icon_history.svg diff --git a/tools/editor/icons/source/icon_hsize.svg b/editor/icons/source/icon_hsize.svg index f24a630770..f24a630770 100644 --- a/tools/editor/icons/source/icon_hsize.svg +++ b/editor/icons/source/icon_hsize.svg diff --git a/tools/editor/icons/source/icon_image.svg b/editor/icons/source/icon_image.svg index bb15e96251..bb15e96251 100644 --- a/tools/editor/icons/source/icon_image.svg +++ b/editor/icons/source/icon_image.svg diff --git a/tools/editor/icons/source/icon_image_sky_box.svg b/editor/icons/source/icon_image_sky_box.svg index 9a89c04e58..9a89c04e58 100644 --- a/tools/editor/icons/source/icon_image_sky_box.svg +++ b/editor/icons/source/icon_image_sky_box.svg diff --git a/tools/editor/icons/source/icon_image_texture.svg b/editor/icons/source/icon_image_texture.svg index 39e88e592b..39e88e592b 100644 --- a/tools/editor/icons/source/icon_image_texture.svg +++ b/editor/icons/source/icon_image_texture.svg diff --git a/tools/editor/icons/source/icon_immediate_geometry.svg b/editor/icons/source/icon_immediate_geometry.svg index 54bc4766d9..54bc4766d9 100644 --- a/tools/editor/icons/source/icon_immediate_geometry.svg +++ b/editor/icons/source/icon_immediate_geometry.svg diff --git a/tools/editor/icons/source/icon_import_check.svg b/editor/icons/source/icon_import_check.svg index 606236d82e..606236d82e 100644 --- a/tools/editor/icons/source/icon_import_check.svg +++ b/editor/icons/source/icon_import_check.svg diff --git a/tools/editor/icons/source/icon_import_fail.svg b/editor/icons/source/icon_import_fail.svg index b5d142f968..b5d142f968 100644 --- a/tools/editor/icons/source/icon_import_fail.svg +++ b/editor/icons/source/icon_import_fail.svg diff --git a/tools/editor/icons/source/icon_instance.svg b/editor/icons/source/icon_instance.svg index f12e067e7a..f12e067e7a 100644 --- a/tools/editor/icons/source/icon_instance.svg +++ b/editor/icons/source/icon_instance.svg diff --git a/tools/editor/icons/source/icon_instance_options.svg b/editor/icons/source/icon_instance_options.svg index a8c00bc43f..a8c00bc43f 100644 --- a/tools/editor/icons/source/icon_instance_options.svg +++ b/editor/icons/source/icon_instance_options.svg diff --git a/tools/editor/icons/source/icon_integer.svg b/editor/icons/source/icon_integer.svg index d4e7a9860a..d4e7a9860a 100644 --- a/tools/editor/icons/source/icon_integer.svg +++ b/editor/icons/source/icon_integer.svg diff --git a/tools/editor/icons/source/icon_interp_cubic.svg b/editor/icons/source/icon_interp_cubic.svg index 7d8d5ef70d..7d8d5ef70d 100644 --- a/tools/editor/icons/source/icon_interp_cubic.svg +++ b/editor/icons/source/icon_interp_cubic.svg diff --git a/tools/editor/icons/source/icon_interp_linear.svg b/editor/icons/source/icon_interp_linear.svg index 7b1e4f2dd1..7b1e4f2dd1 100644 --- a/tools/editor/icons/source/icon_interp_linear.svg +++ b/editor/icons/source/icon_interp_linear.svg diff --git a/tools/editor/icons/source/icon_interp_raw.svg b/editor/icons/source/icon_interp_raw.svg index e2e2070449..e2e2070449 100644 --- a/tools/editor/icons/source/icon_interp_raw.svg +++ b/editor/icons/source/icon_interp_raw.svg diff --git a/tools/editor/icons/source/icon_interp_wrap_clamp.svg b/editor/icons/source/icon_interp_wrap_clamp.svg index 068e79ace0..068e79ace0 100644 --- a/tools/editor/icons/source/icon_interp_wrap_clamp.svg +++ b/editor/icons/source/icon_interp_wrap_clamp.svg diff --git a/tools/editor/icons/source/icon_interp_wrap_loop.svg b/editor/icons/source/icon_interp_wrap_loop.svg index bfca46331b..bfca46331b 100644 --- a/tools/editor/icons/source/icon_interp_wrap_loop.svg +++ b/editor/icons/source/icon_interp_wrap_loop.svg diff --git a/tools/editor/icons/source/icon_interpolated_camera.svg b/editor/icons/source/icon_interpolated_camera.svg index 16fc731c12..16fc731c12 100644 --- a/tools/editor/icons/source/icon_interpolated_camera.svg +++ b/editor/icons/source/icon_interpolated_camera.svg diff --git a/tools/editor/icons/source/icon_invalid_key.svg b/editor/icons/source/icon_invalid_key.svg index cbccff571a..cbccff571a 100644 --- a/tools/editor/icons/source/icon_invalid_key.svg +++ b/editor/icons/source/icon_invalid_key.svg diff --git a/tools/editor/icons/source/icon_inverse_kinematics.svg b/editor/icons/source/icon_inverse_kinematics.svg index 227d22f911..227d22f911 100644 --- a/tools/editor/icons/source/icon_inverse_kinematics.svg +++ b/editor/icons/source/icon_inverse_kinematics.svg diff --git a/tools/editor/icons/source/icon_item_list.svg b/editor/icons/source/icon_item_list.svg index 943f6fe435..943f6fe435 100644 --- a/tools/editor/icons/source/icon_item_list.svg +++ b/editor/icons/source/icon_item_list.svg diff --git a/tools/editor/icons/source/icon_joy_axis.svg b/editor/icons/source/icon_joy_axis.svg index 9313342a53..9313342a53 100644 --- a/tools/editor/icons/source/icon_joy_axis.svg +++ b/editor/icons/source/icon_joy_axis.svg diff --git a/tools/editor/icons/source/icon_joy_button.svg b/editor/icons/source/icon_joy_button.svg index f6d4344807..f6d4344807 100644 --- a/tools/editor/icons/source/icon_joy_button.svg +++ b/editor/icons/source/icon_joy_button.svg diff --git a/tools/editor/icons/source/icon_joypad.svg b/editor/icons/source/icon_joypad.svg index fb84462919..fb84462919 100644 --- a/tools/editor/icons/source/icon_joypad.svg +++ b/editor/icons/source/icon_joypad.svg diff --git a/tools/editor/icons/source/icon_key.svg b/editor/icons/source/icon_key.svg index f5d7b85381..f5d7b85381 100644 --- a/tools/editor/icons/source/icon_key.svg +++ b/editor/icons/source/icon_key.svg diff --git a/tools/editor/icons/source/icon_key_hover.svg b/editor/icons/source/icon_key_hover.svg index c3f34a781b..c3f34a781b 100644 --- a/tools/editor/icons/source/icon_key_hover.svg +++ b/editor/icons/source/icon_key_hover.svg diff --git a/tools/editor/icons/source/icon_key_invalid.svg b/editor/icons/source/icon_key_invalid.svg index b6407dc178..b6407dc178 100644 --- a/tools/editor/icons/source/icon_key_invalid.svg +++ b/editor/icons/source/icon_key_invalid.svg diff --git a/tools/editor/icons/source/icon_key_next.svg b/editor/icons/source/icon_key_next.svg index 942245305c..942245305c 100644 --- a/tools/editor/icons/source/icon_key_next.svg +++ b/editor/icons/source/icon_key_next.svg diff --git a/tools/editor/icons/source/icon_key_selected.svg b/editor/icons/source/icon_key_selected.svg index c3f01dbec8..c3f01dbec8 100644 --- a/tools/editor/icons/source/icon_key_selected.svg +++ b/editor/icons/source/icon_key_selected.svg diff --git a/tools/editor/icons/source/icon_key_value.svg b/editor/icons/source/icon_key_value.svg index 5e6333e54b..5e6333e54b 100644 --- a/tools/editor/icons/source/icon_key_value.svg +++ b/editor/icons/source/icon_key_value.svg diff --git a/tools/editor/icons/source/icon_key_xform.svg b/editor/icons/source/icon_key_xform.svg index 06a282f705..06a282f705 100644 --- a/tools/editor/icons/source/icon_key_xform.svg +++ b/editor/icons/source/icon_key_xform.svg diff --git a/tools/editor/icons/source/icon_keyboard.svg b/editor/icons/source/icon_keyboard.svg index a03798e4a4..a03798e4a4 100644 --- a/tools/editor/icons/source/icon_keyboard.svg +++ b/editor/icons/source/icon_keyboard.svg diff --git a/tools/editor/icons/source/icon_kinematic_body.svg b/editor/icons/source/icon_kinematic_body.svg index 6a4c8965ab..6a4c8965ab 100644 --- a/tools/editor/icons/source/icon_kinematic_body.svg +++ b/editor/icons/source/icon_kinematic_body.svg diff --git a/tools/editor/icons/source/icon_kinematic_body_2d.svg b/editor/icons/source/icon_kinematic_body_2d.svg index 04f140b930..04f140b930 100644 --- a/tools/editor/icons/source/icon_kinematic_body_2d.svg +++ b/editor/icons/source/icon_kinematic_body_2d.svg diff --git a/tools/editor/icons/source/icon_label.svg b/editor/icons/source/icon_label.svg index ac9b52be6f..ac9b52be6f 100644 --- a/tools/editor/icons/source/icon_label.svg +++ b/editor/icons/source/icon_label.svg diff --git a/tools/editor/icons/source/icon_large_texture.svg b/editor/icons/source/icon_large_texture.svg index 4db0342041..4db0342041 100644 --- a/tools/editor/icons/source/icon_large_texture.svg +++ b/editor/icons/source/icon_large_texture.svg diff --git a/tools/editor/icons/source/icon_light_2d.svg b/editor/icons/source/icon_light_2d.svg index 27e07a649a..27e07a649a 100644 --- a/tools/editor/icons/source/icon_light_2d.svg +++ b/editor/icons/source/icon_light_2d.svg diff --git a/tools/editor/icons/source/icon_light_occluder_2d.svg b/editor/icons/source/icon_light_occluder_2d.svg index 3558f3f2da..3558f3f2da 100644 --- a/tools/editor/icons/source/icon_light_occluder_2d.svg +++ b/editor/icons/source/icon_light_occluder_2d.svg diff --git a/editor/icons/source/icon_line_2d.svg b/editor/icons/source/icon_line_2d.svg new file mode 100644 index 0000000000..7f833f4a9c --- /dev/null +++ b/editor/icons/source/icon_line_2d.svg @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="D:\PROJETS\INFO\GODOT\ENGINE\godot_fork\tools\editor\icons\2x\icon_line_2d.png" + inkscape:export-xdpi="180" + inkscape:export-ydpi="180" + sodipodi:docname="icon_line_2d.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="31.999999" + inkscape:cx="7.5587317" + inkscape:cy="9.1781644" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1017" + inkscape:window-x="-8" + inkscape:window-y="32" + inkscape:window-maximized="1" + inkscape:snap-grids="true" + inkscape:object-nodes="true" + showguides="false"> + <inkscape:grid + type="xygrid" + id="grid3336" + empspacing="4" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#a5b7f3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.98823529" + d="m 2,1045.3622 3,4 3,-10 3,6 3,-2" + id="path4135" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccc" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_line_edit.svg b/editor/icons/source/icon_line_edit.svg index 61ba1ebe7e..61ba1ebe7e 100644 --- a/tools/editor/icons/source/icon_line_edit.svg +++ b/editor/icons/source/icon_line_edit.svg diff --git a/tools/editor/icons/source/icon_line_shape_2d.svg b/editor/icons/source/icon_line_shape_2d.svg index 6a8ab39ef3..6a8ab39ef3 100644 --- a/tools/editor/icons/source/icon_line_shape_2d.svg +++ b/editor/icons/source/icon_line_shape_2d.svg diff --git a/tools/editor/icons/source/icon_link_button.svg b/editor/icons/source/icon_link_button.svg index 3872e43b29..3872e43b29 100644 --- a/tools/editor/icons/source/icon_link_button.svg +++ b/editor/icons/source/icon_link_button.svg diff --git a/tools/editor/icons/source/icon_list_select.svg b/editor/icons/source/icon_list_select.svg index 569a0c6fea..569a0c6fea 100644 --- a/tools/editor/icons/source/icon_list_select.svg +++ b/editor/icons/source/icon_list_select.svg diff --git a/tools/editor/icons/source/icon_listener.svg b/editor/icons/source/icon_listener.svg index f815cb842a..f815cb842a 100644 --- a/tools/editor/icons/source/icon_listener.svg +++ b/editor/icons/source/icon_listener.svg diff --git a/tools/editor/icons/source/icon_load.svg b/editor/icons/source/icon_load.svg index 395a5c1b8a..395a5c1b8a 100644 --- a/tools/editor/icons/source/icon_load.svg +++ b/editor/icons/source/icon_load.svg diff --git a/tools/editor/icons/source/icon_lock.svg b/editor/icons/source/icon_lock.svg index 140b073e83..140b073e83 100644 --- a/tools/editor/icons/source/icon_lock.svg +++ b/editor/icons/source/icon_lock.svg diff --git a/tools/editor/icons/source/icon_loop.svg b/editor/icons/source/icon_loop.svg index fe7f648648..fe7f648648 100644 --- a/tools/editor/icons/source/icon_loop.svg +++ b/editor/icons/source/icon_loop.svg diff --git a/tools/editor/icons/source/icon_loop_interpolation.svg b/editor/icons/source/icon_loop_interpolation.svg index 3733acb253..3733acb253 100644 --- a/tools/editor/icons/source/icon_loop_interpolation.svg +++ b/editor/icons/source/icon_loop_interpolation.svg diff --git a/tools/editor/icons/source/icon_main_play.svg b/editor/icons/source/icon_main_play.svg index 0fb48bb155..0fb48bb155 100644 --- a/tools/editor/icons/source/icon_main_play.svg +++ b/editor/icons/source/icon_main_play.svg diff --git a/tools/editor/icons/source/icon_main_stop.svg b/editor/icons/source/icon_main_stop.svg index 9d01bd5cf5..9d01bd5cf5 100644 --- a/tools/editor/icons/source/icon_main_stop.svg +++ b/editor/icons/source/icon_main_stop.svg diff --git a/tools/editor/icons/source/icon_margin_container.svg b/editor/icons/source/icon_margin_container.svg index 68a6971bd7..68a6971bd7 100644 --- a/tools/editor/icons/source/icon_margin_container.svg +++ b/editor/icons/source/icon_margin_container.svg diff --git a/tools/editor/icons/source/icon_material_preview_cube.svg b/editor/icons/source/icon_material_preview_cube.svg index 2e8e5a6457..2e8e5a6457 100644 --- a/tools/editor/icons/source/icon_material_preview_cube.svg +++ b/editor/icons/source/icon_material_preview_cube.svg diff --git a/tools/editor/icons/source/icon_material_preview_cube_off.svg b/editor/icons/source/icon_material_preview_cube_off.svg index e03905ed05..e03905ed05 100644 --- a/tools/editor/icons/source/icon_material_preview_cube_off.svg +++ b/editor/icons/source/icon_material_preview_cube_off.svg diff --git a/tools/editor/icons/source/icon_material_preview_light_1.svg b/editor/icons/source/icon_material_preview_light_1.svg index d8335641f6..d8335641f6 100644 --- a/tools/editor/icons/source/icon_material_preview_light_1.svg +++ b/editor/icons/source/icon_material_preview_light_1.svg diff --git a/tools/editor/icons/source/icon_material_preview_light_1_off.svg b/editor/icons/source/icon_material_preview_light_1_off.svg index c387b1845b..c387b1845b 100644 --- a/tools/editor/icons/source/icon_material_preview_light_1_off.svg +++ b/editor/icons/source/icon_material_preview_light_1_off.svg diff --git a/tools/editor/icons/source/icon_material_preview_light_2.svg b/editor/icons/source/icon_material_preview_light_2.svg index f192c19959..f192c19959 100644 --- a/tools/editor/icons/source/icon_material_preview_light_2.svg +++ b/editor/icons/source/icon_material_preview_light_2.svg diff --git a/tools/editor/icons/source/icon_material_preview_light_2_off.svg b/editor/icons/source/icon_material_preview_light_2_off.svg index 9d71248cba..9d71248cba 100644 --- a/tools/editor/icons/source/icon_material_preview_light_2_off.svg +++ b/editor/icons/source/icon_material_preview_light_2_off.svg diff --git a/tools/editor/icons/source/icon_material_preview_sphere.svg b/editor/icons/source/icon_material_preview_sphere.svg index 76a6ec97bd..76a6ec97bd 100644 --- a/tools/editor/icons/source/icon_material_preview_sphere.svg +++ b/editor/icons/source/icon_material_preview_sphere.svg diff --git a/tools/editor/icons/source/icon_material_preview_sphere_off.svg b/editor/icons/source/icon_material_preview_sphere_off.svg index f9c8cadb34..f9c8cadb34 100644 --- a/tools/editor/icons/source/icon_material_preview_sphere_off.svg +++ b/editor/icons/source/icon_material_preview_sphere_off.svg diff --git a/tools/editor/icons/source/icon_matrix.svg b/editor/icons/source/icon_matrix.svg index eacf2cdc9d..eacf2cdc9d 100644 --- a/tools/editor/icons/source/icon_matrix.svg +++ b/editor/icons/source/icon_matrix.svg diff --git a/tools/editor/icons/source/icon_menu_button.svg b/editor/icons/source/icon_menu_button.svg index 9cfbf2d502..9cfbf2d502 100644 --- a/tools/editor/icons/source/icon_menu_button.svg +++ b/editor/icons/source/icon_menu_button.svg diff --git a/tools/editor/icons/source/icon_mesh.svg b/editor/icons/source/icon_mesh.svg index f3c33a37b1..f3c33a37b1 100644 --- a/tools/editor/icons/source/icon_mesh.svg +++ b/editor/icons/source/icon_mesh.svg diff --git a/tools/editor/icons/source/icon_mesh_instance.svg b/editor/icons/source/icon_mesh_instance.svg index 51e6447eb2..51e6447eb2 100644 --- a/tools/editor/icons/source/icon_mesh_instance.svg +++ b/editor/icons/source/icon_mesh_instance.svg diff --git a/tools/editor/icons/source/icon_mesh_library.svg b/editor/icons/source/icon_mesh_library.svg index b908a4db6e..b908a4db6e 100644 --- a/tools/editor/icons/source/icon_mesh_library.svg +++ b/editor/icons/source/icon_mesh_library.svg diff --git a/tools/editor/icons/source/icon_mini_aabb.svg b/editor/icons/source/icon_mini_aabb.svg index ebfd505bea..ebfd505bea 100644 --- a/tools/editor/icons/source/icon_mini_aabb.svg +++ b/editor/icons/source/icon_mini_aabb.svg diff --git a/tools/editor/icons/source/icon_mini_array.svg b/editor/icons/source/icon_mini_array.svg index a0a2014fbb..a0a2014fbb 100644 --- a/tools/editor/icons/source/icon_mini_array.svg +++ b/editor/icons/source/icon_mini_array.svg diff --git a/tools/editor/icons/source/icon_mini_boolean.svg b/editor/icons/source/icon_mini_boolean.svg index eb17279a62..eb17279a62 100644 --- a/tools/editor/icons/source/icon_mini_boolean.svg +++ b/editor/icons/source/icon_mini_boolean.svg diff --git a/tools/editor/icons/source/icon_mini_color.svg b/editor/icons/source/icon_mini_color.svg index cdc176e00c..cdc176e00c 100644 --- a/tools/editor/icons/source/icon_mini_color.svg +++ b/editor/icons/source/icon_mini_color.svg diff --git a/tools/editor/icons/source/icon_mini_color_array.svg b/editor/icons/source/icon_mini_color_array.svg index 2ec0e186b5..2ec0e186b5 100644 --- a/tools/editor/icons/source/icon_mini_color_array.svg +++ b/editor/icons/source/icon_mini_color_array.svg diff --git a/tools/editor/icons/source/icon_mini_dictionary.svg b/editor/icons/source/icon_mini_dictionary.svg index 813ba97613..813ba97613 100644 --- a/tools/editor/icons/source/icon_mini_dictionary.svg +++ b/editor/icons/source/icon_mini_dictionary.svg diff --git a/tools/editor/icons/source/icon_mini_float.svg b/editor/icons/source/icon_mini_float.svg index 1007955ea9..1007955ea9 100644 --- a/tools/editor/icons/source/icon_mini_float.svg +++ b/editor/icons/source/icon_mini_float.svg diff --git a/tools/editor/icons/source/icon_mini_float_array.svg b/editor/icons/source/icon_mini_float_array.svg index 86807ca731..86807ca731 100644 --- a/tools/editor/icons/source/icon_mini_float_array.svg +++ b/editor/icons/source/icon_mini_float_array.svg diff --git a/tools/editor/icons/source/icon_mini_image.svg b/editor/icons/source/icon_mini_image.svg index 57faded5c8..57faded5c8 100644 --- a/tools/editor/icons/source/icon_mini_image.svg +++ b/editor/icons/source/icon_mini_image.svg diff --git a/tools/editor/icons/source/icon_mini_input.svg b/editor/icons/source/icon_mini_input.svg index 9e966f77d1..9e966f77d1 100644 --- a/tools/editor/icons/source/icon_mini_input.svg +++ b/editor/icons/source/icon_mini_input.svg diff --git a/tools/editor/icons/source/icon_mini_int_array.svg b/editor/icons/source/icon_mini_int_array.svg index 23b086d5e1..23b086d5e1 100644 --- a/tools/editor/icons/source/icon_mini_int_array.svg +++ b/editor/icons/source/icon_mini_int_array.svg diff --git a/tools/editor/icons/source/icon_mini_integer.svg b/editor/icons/source/icon_mini_integer.svg index c21322adb2..c21322adb2 100644 --- a/tools/editor/icons/source/icon_mini_integer.svg +++ b/editor/icons/source/icon_mini_integer.svg diff --git a/tools/editor/icons/source/icon_mini_matrix3.svg b/editor/icons/source/icon_mini_matrix3.svg index 592230d13c..592230d13c 100644 --- a/tools/editor/icons/source/icon_mini_matrix3.svg +++ b/editor/icons/source/icon_mini_matrix3.svg diff --git a/tools/editor/icons/source/icon_mini_matrix32.svg b/editor/icons/source/icon_mini_matrix32.svg index 5159ea0b87..5159ea0b87 100644 --- a/tools/editor/icons/source/icon_mini_matrix32.svg +++ b/editor/icons/source/icon_mini_matrix32.svg diff --git a/tools/editor/icons/source/icon_mini_object.svg b/editor/icons/source/icon_mini_object.svg index 380be34903..380be34903 100644 --- a/tools/editor/icons/source/icon_mini_object.svg +++ b/editor/icons/source/icon_mini_object.svg diff --git a/tools/editor/icons/source/icon_mini_path.svg b/editor/icons/source/icon_mini_path.svg index ef247b8b8c..ef247b8b8c 100644 --- a/tools/editor/icons/source/icon_mini_path.svg +++ b/editor/icons/source/icon_mini_path.svg diff --git a/tools/editor/icons/source/icon_mini_plane.svg b/editor/icons/source/icon_mini_plane.svg index bc3992cdd6..bc3992cdd6 100644 --- a/tools/editor/icons/source/icon_mini_plane.svg +++ b/editor/icons/source/icon_mini_plane.svg diff --git a/tools/editor/icons/source/icon_mini_quat.svg b/editor/icons/source/icon_mini_quat.svg index 27188a3410..27188a3410 100644 --- a/tools/editor/icons/source/icon_mini_quat.svg +++ b/editor/icons/source/icon_mini_quat.svg diff --git a/tools/editor/icons/source/icon_mini_raw_array.svg b/editor/icons/source/icon_mini_raw_array.svg index cb735b5615..cb735b5615 100644 --- a/tools/editor/icons/source/icon_mini_raw_array.svg +++ b/editor/icons/source/icon_mini_raw_array.svg diff --git a/tools/editor/icons/source/icon_mini_rect2.svg b/editor/icons/source/icon_mini_rect2.svg index ded27f049f..ded27f049f 100644 --- a/tools/editor/icons/source/icon_mini_rect2.svg +++ b/editor/icons/source/icon_mini_rect2.svg diff --git a/tools/editor/icons/source/icon_mini_rid.svg b/editor/icons/source/icon_mini_rid.svg index 6df13ae43d..6df13ae43d 100644 --- a/tools/editor/icons/source/icon_mini_rid.svg +++ b/editor/icons/source/icon_mini_rid.svg diff --git a/tools/editor/icons/source/icon_mini_string.svg b/editor/icons/source/icon_mini_string.svg index a655f70d33..a655f70d33 100644 --- a/tools/editor/icons/source/icon_mini_string.svg +++ b/editor/icons/source/icon_mini_string.svg diff --git a/tools/editor/icons/source/icon_mini_string_array.svg b/editor/icons/source/icon_mini_string_array.svg index cd2e850c49..cd2e850c49 100644 --- a/tools/editor/icons/source/icon_mini_string_array.svg +++ b/editor/icons/source/icon_mini_string_array.svg diff --git a/tools/editor/icons/source/icon_mini_transform.svg b/editor/icons/source/icon_mini_transform.svg index 6da4eb806d..6da4eb806d 100644 --- a/tools/editor/icons/source/icon_mini_transform.svg +++ b/editor/icons/source/icon_mini_transform.svg diff --git a/tools/editor/icons/source/icon_mini_variant.svg b/editor/icons/source/icon_mini_variant.svg index 6883baa584..6883baa584 100644 --- a/tools/editor/icons/source/icon_mini_variant.svg +++ b/editor/icons/source/icon_mini_variant.svg diff --git a/tools/editor/icons/source/icon_mini_vector2.svg b/editor/icons/source/icon_mini_vector2.svg index 5c9aaeccff..5c9aaeccff 100644 --- a/tools/editor/icons/source/icon_mini_vector2.svg +++ b/editor/icons/source/icon_mini_vector2.svg diff --git a/tools/editor/icons/source/icon_mini_vector2_array.svg b/editor/icons/source/icon_mini_vector2_array.svg index 03850f7c86..03850f7c86 100644 --- a/tools/editor/icons/source/icon_mini_vector2_array.svg +++ b/editor/icons/source/icon_mini_vector2_array.svg diff --git a/tools/editor/icons/source/icon_mini_vector3.svg b/editor/icons/source/icon_mini_vector3.svg index e99a211ae0..e99a211ae0 100644 --- a/tools/editor/icons/source/icon_mini_vector3.svg +++ b/editor/icons/source/icon_mini_vector3.svg diff --git a/tools/editor/icons/source/icon_mini_vector3_array.svg b/editor/icons/source/icon_mini_vector3_array.svg index bbac554614..bbac554614 100644 --- a/tools/editor/icons/source/icon_mini_vector3_array.svg +++ b/editor/icons/source/icon_mini_vector3_array.svg diff --git a/tools/editor/icons/source/icon_mirror_x.svg b/editor/icons/source/icon_mirror_x.svg index f24a630770..f24a630770 100644 --- a/tools/editor/icons/source/icon_mirror_x.svg +++ b/editor/icons/source/icon_mirror_x.svg diff --git a/tools/editor/icons/source/icon_mirror_y.svg b/editor/icons/source/icon_mirror_y.svg index bb913b84af..bb913b84af 100644 --- a/tools/editor/icons/source/icon_mirror_y.svg +++ b/editor/icons/source/icon_mirror_y.svg diff --git a/tools/editor/icons/source/icon_mouse.svg b/editor/icons/source/icon_mouse.svg index 731ceeefd8..731ceeefd8 100644 --- a/tools/editor/icons/source/icon_mouse.svg +++ b/editor/icons/source/icon_mouse.svg diff --git a/tools/editor/icons/source/icon_move_down.svg b/editor/icons/source/icon_move_down.svg index e83a69ad50..e83a69ad50 100644 --- a/tools/editor/icons/source/icon_move_down.svg +++ b/editor/icons/source/icon_move_down.svg diff --git a/tools/editor/icons/source/icon_move_point.svg b/editor/icons/source/icon_move_point.svg index c951d6b90a..c951d6b90a 100644 --- a/tools/editor/icons/source/icon_move_point.svg +++ b/editor/icons/source/icon_move_point.svg diff --git a/tools/editor/icons/source/icon_move_up.svg b/editor/icons/source/icon_move_up.svg index 8f671a0d72..8f671a0d72 100644 --- a/tools/editor/icons/source/icon_move_up.svg +++ b/editor/icons/source/icon_move_up.svg diff --git a/tools/editor/icons/source/icon_multi_edit.svg b/editor/icons/source/icon_multi_edit.svg index ef63861e97..ef63861e97 100644 --- a/tools/editor/icons/source/icon_multi_edit.svg +++ b/editor/icons/source/icon_multi_edit.svg diff --git a/tools/editor/icons/source/icon_multi_line.svg b/editor/icons/source/icon_multi_line.svg index 542e311286..542e311286 100644 --- a/tools/editor/icons/source/icon_multi_line.svg +++ b/editor/icons/source/icon_multi_line.svg diff --git a/tools/editor/icons/source/icon_multi_mesh.svg b/editor/icons/source/icon_multi_mesh.svg index 22f843a686..22f843a686 100644 --- a/tools/editor/icons/source/icon_multi_mesh.svg +++ b/editor/icons/source/icon_multi_mesh.svg diff --git a/tools/editor/icons/source/icon_multi_mesh_instance.svg b/editor/icons/source/icon_multi_mesh_instance.svg index deceae5a03..deceae5a03 100644 --- a/tools/editor/icons/source/icon_multi_mesh_instance.svg +++ b/editor/icons/source/icon_multi_mesh_instance.svg diff --git a/tools/editor/icons/source/icon_navigation.svg b/editor/icons/source/icon_navigation.svg index 42e8f59165..42e8f59165 100644 --- a/tools/editor/icons/source/icon_navigation.svg +++ b/editor/icons/source/icon_navigation.svg diff --git a/tools/editor/icons/source/icon_navigation_2d.svg b/editor/icons/source/icon_navigation_2d.svg index 5252541e70..5252541e70 100644 --- a/tools/editor/icons/source/icon_navigation_2d.svg +++ b/editor/icons/source/icon_navigation_2d.svg diff --git a/tools/editor/icons/source/icon_navigation_mesh.svg b/editor/icons/source/icon_navigation_mesh.svg index 31ab5df8ad..31ab5df8ad 100644 --- a/tools/editor/icons/source/icon_navigation_mesh.svg +++ b/editor/icons/source/icon_navigation_mesh.svg diff --git a/tools/editor/icons/source/icon_navigation_mesh_instance.svg b/editor/icons/source/icon_navigation_mesh_instance.svg index 5c4e0f1579..5c4e0f1579 100644 --- a/tools/editor/icons/source/icon_navigation_mesh_instance.svg +++ b/editor/icons/source/icon_navigation_mesh_instance.svg diff --git a/tools/editor/icons/source/icon_navigation_polygon.svg b/editor/icons/source/icon_navigation_polygon.svg index f3b6fcbcc3..f3b6fcbcc3 100644 --- a/tools/editor/icons/source/icon_navigation_polygon.svg +++ b/editor/icons/source/icon_navigation_polygon.svg diff --git a/tools/editor/icons/source/icon_navigation_polygon_instance.svg b/editor/icons/source/icon_navigation_polygon_instance.svg index 5153227b15..5153227b15 100644 --- a/tools/editor/icons/source/icon_navigation_polygon_instance.svg +++ b/editor/icons/source/icon_navigation_polygon_instance.svg diff --git a/tools/editor/icons/source/icon_new.svg b/editor/icons/source/icon_new.svg index a37ba1be3f..a37ba1be3f 100644 --- a/tools/editor/icons/source/icon_new.svg +++ b/editor/icons/source/icon_new.svg diff --git a/tools/editor/icons/source/icon_nine_patch_rect.svg b/editor/icons/source/icon_nine_patch_rect.svg index f12789c19e..f12789c19e 100644 --- a/tools/editor/icons/source/icon_nine_patch_rect.svg +++ b/editor/icons/source/icon_nine_patch_rect.svg diff --git a/tools/editor/icons/source/icon_node.svg b/editor/icons/source/icon_node.svg index 02e2774669..02e2774669 100644 --- a/tools/editor/icons/source/icon_node.svg +++ b/editor/icons/source/icon_node.svg diff --git a/tools/editor/icons/source/icon_node_2d.svg b/editor/icons/source/icon_node_2d.svg index e546f68539..e546f68539 100644 --- a/tools/editor/icons/source/icon_node_2d.svg +++ b/editor/icons/source/icon_node_2d.svg diff --git a/tools/editor/icons/source/icon_node_warning.svg b/editor/icons/source/icon_node_warning.svg index 89d3663fb0..89d3663fb0 100644 --- a/tools/editor/icons/source/icon_node_warning.svg +++ b/editor/icons/source/icon_node_warning.svg diff --git a/tools/editor/icons/source/icon_non_favorite.svg b/editor/icons/source/icon_non_favorite.svg index 54fcb8577e..54fcb8577e 100644 --- a/tools/editor/icons/source/icon_non_favorite.svg +++ b/editor/icons/source/icon_non_favorite.svg diff --git a/tools/editor/icons/source/icon_object.svg b/editor/icons/source/icon_object.svg index 6b36b61168..6b36b61168 100644 --- a/tools/editor/icons/source/icon_object.svg +++ b/editor/icons/source/icon_object.svg diff --git a/tools/editor/icons/source/icon_occluder_polygon_2d.svg b/editor/icons/source/icon_occluder_polygon_2d.svg index 8ae6dc176d..8ae6dc176d 100644 --- a/tools/editor/icons/source/icon_occluder_polygon_2d.svg +++ b/editor/icons/source/icon_occluder_polygon_2d.svg diff --git a/tools/editor/icons/source/icon_omni_light.svg b/editor/icons/source/icon_omni_light.svg index e1049d0039..e1049d0039 100644 --- a/tools/editor/icons/source/icon_omni_light.svg +++ b/editor/icons/source/icon_omni_light.svg diff --git a/tools/editor/icons/source/icon_option_button.svg b/editor/icons/source/icon_option_button.svg index 4537b14616..4537b14616 100644 --- a/tools/editor/icons/source/icon_option_button.svg +++ b/editor/icons/source/icon_option_button.svg diff --git a/tools/editor/icons/source/icon_override.svg b/editor/icons/source/icon_override.svg index b7948c531c..b7948c531c 100644 --- a/tools/editor/icons/source/icon_override.svg +++ b/editor/icons/source/icon_override.svg diff --git a/tools/editor/icons/source/icon_packed_data_container.svg b/editor/icons/source/icon_packed_data_container.svg index 70aed22f2c..70aed22f2c 100644 --- a/tools/editor/icons/source/icon_packed_data_container.svg +++ b/editor/icons/source/icon_packed_data_container.svg diff --git a/tools/editor/icons/source/icon_packed_scene.svg b/editor/icons/source/icon_packed_scene.svg index 910a274841..910a274841 100644 --- a/tools/editor/icons/source/icon_packed_scene.svg +++ b/editor/icons/source/icon_packed_scene.svg diff --git a/tools/editor/icons/source/icon_panel.svg b/editor/icons/source/icon_panel.svg index 28921c4031..28921c4031 100644 --- a/tools/editor/icons/source/icon_panel.svg +++ b/editor/icons/source/icon_panel.svg diff --git a/tools/editor/icons/source/icon_panel_container.svg b/editor/icons/source/icon_panel_container.svg index decf220705..decf220705 100644 --- a/tools/editor/icons/source/icon_panel_container.svg +++ b/editor/icons/source/icon_panel_container.svg diff --git a/tools/editor/icons/source/icon_panels_1.svg b/editor/icons/source/icon_panels_1.svg index fa8bbe9fad..fa8bbe9fad 100644 --- a/tools/editor/icons/source/icon_panels_1.svg +++ b/editor/icons/source/icon_panels_1.svg diff --git a/tools/editor/icons/source/icon_panels_2.svg b/editor/icons/source/icon_panels_2.svg index f00cc4b339..f00cc4b339 100644 --- a/tools/editor/icons/source/icon_panels_2.svg +++ b/editor/icons/source/icon_panels_2.svg diff --git a/tools/editor/icons/source/icon_panels_2_alt.svg b/editor/icons/source/icon_panels_2_alt.svg index cc3a634a3e..cc3a634a3e 100644 --- a/tools/editor/icons/source/icon_panels_2_alt.svg +++ b/editor/icons/source/icon_panels_2_alt.svg diff --git a/tools/editor/icons/source/icon_panels_3.svg b/editor/icons/source/icon_panels_3.svg index 04517c5a66..04517c5a66 100644 --- a/tools/editor/icons/source/icon_panels_3.svg +++ b/editor/icons/source/icon_panels_3.svg diff --git a/tools/editor/icons/source/icon_panels_3_alt.svg b/editor/icons/source/icon_panels_3_alt.svg index e5a9493287..e5a9493287 100644 --- a/tools/editor/icons/source/icon_panels_3_alt.svg +++ b/editor/icons/source/icon_panels_3_alt.svg diff --git a/tools/editor/icons/source/icon_panels_4.svg b/editor/icons/source/icon_panels_4.svg index 6d07a0b6d5..6d07a0b6d5 100644 --- a/tools/editor/icons/source/icon_panels_4.svg +++ b/editor/icons/source/icon_panels_4.svg diff --git a/tools/editor/icons/source/icon_parallax_background.svg b/editor/icons/source/icon_parallax_background.svg index e1b6a4fb2f..e1b6a4fb2f 100644 --- a/tools/editor/icons/source/icon_parallax_background.svg +++ b/editor/icons/source/icon_parallax_background.svg diff --git a/tools/editor/icons/source/icon_parallax_layer.svg b/editor/icons/source/icon_parallax_layer.svg index 022fdd5339..022fdd5339 100644 --- a/tools/editor/icons/source/icon_parallax_layer.svg +++ b/editor/icons/source/icon_parallax_layer.svg diff --git a/tools/editor/icons/source/icon_particle_attractor_2d.svg b/editor/icons/source/icon_particle_attractor_2d.svg index f755d7fc37..f755d7fc37 100644 --- a/tools/editor/icons/source/icon_particle_attractor_2d.svg +++ b/editor/icons/source/icon_particle_attractor_2d.svg diff --git a/tools/editor/icons/source/icon_particles.svg b/editor/icons/source/icon_particles.svg index f48929a7ef..f48929a7ef 100644 --- a/tools/editor/icons/source/icon_particles.svg +++ b/editor/icons/source/icon_particles.svg diff --git a/tools/editor/icons/source/icon_particles_2d.svg b/editor/icons/source/icon_particles_2d.svg index 1ad1d511f8..1ad1d511f8 100644 --- a/tools/editor/icons/source/icon_particles_2d.svg +++ b/editor/icons/source/icon_particles_2d.svg diff --git a/tools/editor/icons/source/icon_particles_shader.svg b/editor/icons/source/icon_particles_shader.svg index b4c2ef7ccd..b4c2ef7ccd 100644 --- a/tools/editor/icons/source/icon_particles_shader.svg +++ b/editor/icons/source/icon_particles_shader.svg diff --git a/tools/editor/icons/source/icon_patch_9_rect.svg b/editor/icons/source/icon_patch_9_rect.svg index c5a09603a6..c5a09603a6 100644 --- a/tools/editor/icons/source/icon_patch_9_rect.svg +++ b/editor/icons/source/icon_patch_9_rect.svg diff --git a/tools/editor/icons/source/icon_path.svg b/editor/icons/source/icon_path.svg index 39c63eac8a..39c63eac8a 100644 --- a/tools/editor/icons/source/icon_path.svg +++ b/editor/icons/source/icon_path.svg diff --git a/tools/editor/icons/source/icon_path_2d.svg b/editor/icons/source/icon_path_2d.svg index 6887834048..6887834048 100644 --- a/tools/editor/icons/source/icon_path_2d.svg +++ b/editor/icons/source/icon_path_2d.svg diff --git a/tools/editor/icons/source/icon_path_follow.svg b/editor/icons/source/icon_path_follow.svg index 6999df33de..6999df33de 100644 --- a/tools/editor/icons/source/icon_path_follow.svg +++ b/editor/icons/source/icon_path_follow.svg diff --git a/tools/editor/icons/source/icon_path_follow_2d.svg b/editor/icons/source/icon_path_follow_2d.svg index 020a094c0a..020a094c0a 100644 --- a/tools/editor/icons/source/icon_path_follow_2d.svg +++ b/editor/icons/source/icon_path_follow_2d.svg diff --git a/tools/editor/icons/source/icon_pause.svg b/editor/icons/source/icon_pause.svg index 411f1b22da..411f1b22da 100644 --- a/tools/editor/icons/source/icon_pause.svg +++ b/editor/icons/source/icon_pause.svg diff --git a/tools/editor/icons/source/icon_pin.svg b/editor/icons/source/icon_pin.svg index 8281b6438b..8281b6438b 100644 --- a/tools/editor/icons/source/icon_pin.svg +++ b/editor/icons/source/icon_pin.svg diff --git a/tools/editor/icons/source/icon_pin_joint.svg b/editor/icons/source/icon_pin_joint.svg index 47dbe6be60..47dbe6be60 100644 --- a/tools/editor/icons/source/icon_pin_joint.svg +++ b/editor/icons/source/icon_pin_joint.svg diff --git a/tools/editor/icons/source/icon_pin_joint_2d.svg b/editor/icons/source/icon_pin_joint_2d.svg index 90e1579903..90e1579903 100644 --- a/tools/editor/icons/source/icon_pin_joint_2d.svg +++ b/editor/icons/source/icon_pin_joint_2d.svg diff --git a/tools/editor/icons/source/icon_pin_pressed.svg b/editor/icons/source/icon_pin_pressed.svg index 8281b6438b..8281b6438b 100644 --- a/tools/editor/icons/source/icon_pin_pressed.svg +++ b/editor/icons/source/icon_pin_pressed.svg diff --git a/tools/editor/icons/source/icon_plane.svg b/editor/icons/source/icon_plane.svg index de5b5efc82..de5b5efc82 100644 --- a/tools/editor/icons/source/icon_plane.svg +++ b/editor/icons/source/icon_plane.svg diff --git a/tools/editor/icons/source/icon_plane_shape.svg b/editor/icons/source/icon_plane_shape.svg index b2d5e18b8f..b2d5e18b8f 100644 --- a/tools/editor/icons/source/icon_plane_shape.svg +++ b/editor/icons/source/icon_plane_shape.svg diff --git a/tools/editor/icons/source/icon_play.svg b/editor/icons/source/icon_play.svg index 9d3beab97d..9d3beab97d 100644 --- a/tools/editor/icons/source/icon_play.svg +++ b/editor/icons/source/icon_play.svg diff --git a/tools/editor/icons/source/icon_play_backwards.svg b/editor/icons/source/icon_play_backwards.svg index d93d529dd8..d93d529dd8 100644 --- a/tools/editor/icons/source/icon_play_backwards.svg +++ b/editor/icons/source/icon_play_backwards.svg diff --git a/tools/editor/icons/source/icon_play_custom.svg b/editor/icons/source/icon_play_custom.svg index 62ff7fe710..62ff7fe710 100644 --- a/tools/editor/icons/source/icon_play_custom.svg +++ b/editor/icons/source/icon_play_custom.svg diff --git a/tools/editor/icons/source/icon_play_scene.svg b/editor/icons/source/icon_play_scene.svg index 599cd14981..599cd14981 100644 --- a/tools/editor/icons/source/icon_play_scene.svg +++ b/editor/icons/source/icon_play_scene.svg diff --git a/tools/editor/icons/source/icon_play_start.svg b/editor/icons/source/icon_play_start.svg index 7157f59f35..7157f59f35 100644 --- a/tools/editor/icons/source/icon_play_start.svg +++ b/editor/icons/source/icon_play_start.svg diff --git a/tools/editor/icons/source/icon_play_start_backwards.svg b/editor/icons/source/icon_play_start_backwards.svg index 06998f1043..06998f1043 100644 --- a/tools/editor/icons/source/icon_play_start_backwards.svg +++ b/editor/icons/source/icon_play_start_backwards.svg diff --git a/tools/editor/icons/source/icon_polygon_path_finder.svg b/editor/icons/source/icon_polygon_path_finder.svg index c2f8d80c3d..c2f8d80c3d 100644 --- a/tools/editor/icons/source/icon_polygon_path_finder.svg +++ b/editor/icons/source/icon_polygon_path_finder.svg diff --git a/tools/editor/icons/source/icon_popup.svg b/editor/icons/source/icon_popup.svg index 1681e537f6..1681e537f6 100644 --- a/tools/editor/icons/source/icon_popup.svg +++ b/editor/icons/source/icon_popup.svg diff --git a/tools/editor/icons/source/icon_popup_dialog.svg b/editor/icons/source/icon_popup_dialog.svg index 54e14accc7..54e14accc7 100644 --- a/tools/editor/icons/source/icon_popup_dialog.svg +++ b/editor/icons/source/icon_popup_dialog.svg diff --git a/tools/editor/icons/source/icon_popup_menu.svg b/editor/icons/source/icon_popup_menu.svg index e812ca695b..e812ca695b 100644 --- a/tools/editor/icons/source/icon_popup_menu.svg +++ b/editor/icons/source/icon_popup_menu.svg diff --git a/tools/editor/icons/source/icon_popup_panel.svg b/editor/icons/source/icon_popup_panel.svg index c307257efe..c307257efe 100644 --- a/tools/editor/icons/source/icon_popup_panel.svg +++ b/editor/icons/source/icon_popup_panel.svg diff --git a/tools/editor/icons/source/icon_portal.svg b/editor/icons/source/icon_portal.svg index 2f3d22025f..2f3d22025f 100644 --- a/tools/editor/icons/source/icon_portal.svg +++ b/editor/icons/source/icon_portal.svg diff --git a/tools/editor/icons/source/icon_position_2d.svg b/editor/icons/source/icon_position_2d.svg index 4dbb2c188a..4dbb2c188a 100644 --- a/tools/editor/icons/source/icon_position_2d.svg +++ b/editor/icons/source/icon_position_2d.svg diff --git a/tools/editor/icons/source/icon_position_3d.svg b/editor/icons/source/icon_position_3d.svg index b735af4ac3..b735af4ac3 100644 --- a/tools/editor/icons/source/icon_position_3d.svg +++ b/editor/icons/source/icon_position_3d.svg diff --git a/tools/editor/icons/source/icon_progress_1.svg b/editor/icons/source/icon_progress_1.svg index 4b4694d0d4..4b4694d0d4 100644 --- a/tools/editor/icons/source/icon_progress_1.svg +++ b/editor/icons/source/icon_progress_1.svg diff --git a/tools/editor/icons/source/icon_progress_2.svg b/editor/icons/source/icon_progress_2.svg index 1edad60e03..1edad60e03 100644 --- a/tools/editor/icons/source/icon_progress_2.svg +++ b/editor/icons/source/icon_progress_2.svg diff --git a/tools/editor/icons/source/icon_progress_3.svg b/editor/icons/source/icon_progress_3.svg index 405a16854e..405a16854e 100644 --- a/tools/editor/icons/source/icon_progress_3.svg +++ b/editor/icons/source/icon_progress_3.svg diff --git a/tools/editor/icons/source/icon_progress_4.svg b/editor/icons/source/icon_progress_4.svg index 26e97928ee..26e97928ee 100644 --- a/tools/editor/icons/source/icon_progress_4.svg +++ b/editor/icons/source/icon_progress_4.svg diff --git a/tools/editor/icons/source/icon_progress_5.svg b/editor/icons/source/icon_progress_5.svg index 024190e9fd..024190e9fd 100644 --- a/tools/editor/icons/source/icon_progress_5.svg +++ b/editor/icons/source/icon_progress_5.svg diff --git a/tools/editor/icons/source/icon_progress_6.svg b/editor/icons/source/icon_progress_6.svg index 3783c528e7..3783c528e7 100644 --- a/tools/editor/icons/source/icon_progress_6.svg +++ b/editor/icons/source/icon_progress_6.svg diff --git a/tools/editor/icons/source/icon_progress_7.svg b/editor/icons/source/icon_progress_7.svg index 2a2c744b5b..2a2c744b5b 100644 --- a/tools/editor/icons/source/icon_progress_7.svg +++ b/editor/icons/source/icon_progress_7.svg diff --git a/tools/editor/icons/source/icon_progress_8.svg b/editor/icons/source/icon_progress_8.svg index 2331aee2e7..2331aee2e7 100644 --- a/tools/editor/icons/source/icon_progress_8.svg +++ b/editor/icons/source/icon_progress_8.svg diff --git a/tools/editor/icons/source/icon_progress_bar.svg b/editor/icons/source/icon_progress_bar.svg index 1a5458080b..1a5458080b 100644 --- a/tools/editor/icons/source/icon_progress_bar.svg +++ b/editor/icons/source/icon_progress_bar.svg diff --git a/tools/editor/icons/source/icon_proximity_group.svg b/editor/icons/source/icon_proximity_group.svg index 041d0c5ee2..041d0c5ee2 100644 --- a/tools/editor/icons/source/icon_proximity_group.svg +++ b/editor/icons/source/icon_proximity_group.svg diff --git a/tools/editor/icons/source/icon_quad.svg b/editor/icons/source/icon_quad.svg index 86bb1979e7..86bb1979e7 100644 --- a/tools/editor/icons/source/icon_quad.svg +++ b/editor/icons/source/icon_quad.svg diff --git a/tools/editor/icons/source/icon_quat.svg b/editor/icons/source/icon_quat.svg index 36560d9d8f..36560d9d8f 100644 --- a/tools/editor/icons/source/icon_quat.svg +++ b/editor/icons/source/icon_quat.svg diff --git a/tools/editor/icons/source/icon_range.svg b/editor/icons/source/icon_range.svg index 1dd857ff32..1dd857ff32 100644 --- a/tools/editor/icons/source/icon_range.svg +++ b/editor/icons/source/icon_range.svg diff --git a/tools/editor/icons/source/icon_rating_no_star.svg b/editor/icons/source/icon_rating_no_star.svg index 09a9efa112..09a9efa112 100644 --- a/tools/editor/icons/source/icon_rating_no_star.svg +++ b/editor/icons/source/icon_rating_no_star.svg diff --git a/tools/editor/icons/source/icon_rating_star.svg b/editor/icons/source/icon_rating_star.svg index 7ed3f9fbfa..7ed3f9fbfa 100644 --- a/tools/editor/icons/source/icon_rating_star.svg +++ b/editor/icons/source/icon_rating_star.svg diff --git a/tools/editor/icons/source/icon_ray_cast.svg b/editor/icons/source/icon_ray_cast.svg index b8cab72d07..b8cab72d07 100644 --- a/tools/editor/icons/source/icon_ray_cast.svg +++ b/editor/icons/source/icon_ray_cast.svg diff --git a/tools/editor/icons/source/icon_ray_cast_2d.svg b/editor/icons/source/icon_ray_cast_2d.svg index faadd41a17..faadd41a17 100644 --- a/tools/editor/icons/source/icon_ray_cast_2d.svg +++ b/editor/icons/source/icon_ray_cast_2d.svg diff --git a/tools/editor/icons/source/icon_ray_shape.svg b/editor/icons/source/icon_ray_shape.svg index 0e0f2940ae..0e0f2940ae 100644 --- a/tools/editor/icons/source/icon_ray_shape.svg +++ b/editor/icons/source/icon_ray_shape.svg diff --git a/tools/editor/icons/source/icon_ray_shape_2d.svg b/editor/icons/source/icon_ray_shape_2d.svg index 7ffc2ff3b5..7ffc2ff3b5 100644 --- a/tools/editor/icons/source/icon_ray_shape_2d.svg +++ b/editor/icons/source/icon_ray_shape_2d.svg diff --git a/tools/editor/icons/source/icon_rayito.svg b/editor/icons/source/icon_rayito.svg index 56988b9e4f..56988b9e4f 100644 --- a/tools/editor/icons/source/icon_rayito.svg +++ b/editor/icons/source/icon_rayito.svg diff --git a/tools/editor/icons/source/icon_real.svg b/editor/icons/source/icon_real.svg index 1a3406ed48..1a3406ed48 100644 --- a/tools/editor/icons/source/icon_real.svg +++ b/editor/icons/source/icon_real.svg diff --git a/tools/editor/icons/source/icon_rectangle_shape_2d.svg b/editor/icons/source/icon_rectangle_shape_2d.svg index d362944e7a..d362944e7a 100644 --- a/tools/editor/icons/source/icon_rectangle_shape_2d.svg +++ b/editor/icons/source/icon_rectangle_shape_2d.svg diff --git a/tools/editor/icons/source/icon_reference_rect.svg b/editor/icons/source/icon_reference_rect.svg index cee814360d..cee814360d 100644 --- a/tools/editor/icons/source/icon_reference_rect.svg +++ b/editor/icons/source/icon_reference_rect.svg diff --git a/tools/editor/icons/source/icon_reflection_probe.svg b/editor/icons/source/icon_reflection_probe.svg index 64b6493d6d..64b6493d6d 100644 --- a/tools/editor/icons/source/icon_reflection_probe.svg +++ b/editor/icons/source/icon_reflection_probe.svg diff --git a/tools/editor/icons/source/icon_region_edit.svg b/editor/icons/source/icon_region_edit.svg index b42a53e88d..b42a53e88d 100644 --- a/tools/editor/icons/source/icon_region_edit.svg +++ b/editor/icons/source/icon_region_edit.svg diff --git a/tools/editor/icons/source/icon_reload_small.svg b/editor/icons/source/icon_reload_small.svg index 2d891c2238..2d891c2238 100644 --- a/tools/editor/icons/source/icon_reload_small.svg +++ b/editor/icons/source/icon_reload_small.svg diff --git a/tools/editor/icons/source/icon_remote.svg b/editor/icons/source/icon_remote.svg index f5b458c348..f5b458c348 100644 --- a/tools/editor/icons/source/icon_remote.svg +++ b/editor/icons/source/icon_remote.svg diff --git a/tools/editor/icons/source/icon_remote_transform.svg b/editor/icons/source/icon_remote_transform.svg index fbbfacf629..fbbfacf629 100644 --- a/tools/editor/icons/source/icon_remote_transform.svg +++ b/editor/icons/source/icon_remote_transform.svg diff --git a/tools/editor/icons/source/icon_remote_transform_2d.svg b/editor/icons/source/icon_remote_transform_2d.svg index 479cc0eb25..479cc0eb25 100644 --- a/tools/editor/icons/source/icon_remote_transform_2d.svg +++ b/editor/icons/source/icon_remote_transform_2d.svg diff --git a/tools/editor/icons/source/icon_remove.svg b/editor/icons/source/icon_remove.svg index 9d75f1e921..9d75f1e921 100644 --- a/tools/editor/icons/source/icon_remove.svg +++ b/editor/icons/source/icon_remove.svg diff --git a/tools/editor/icons/source/icon_rename.svg b/editor/icons/source/icon_rename.svg index 41eb10c7fc..41eb10c7fc 100644 --- a/tools/editor/icons/source/icon_rename.svg +++ b/editor/icons/source/icon_rename.svg diff --git a/tools/editor/icons/source/icon_reparent.svg b/editor/icons/source/icon_reparent.svg index 79543fe066..79543fe066 100644 --- a/tools/editor/icons/source/icon_reparent.svg +++ b/editor/icons/source/icon_reparent.svg diff --git a/tools/editor/icons/source/icon_resource_preloader.svg b/editor/icons/source/icon_resource_preloader.svg index bab1bb4e1e..bab1bb4e1e 100644 --- a/tools/editor/icons/source/icon_resource_preloader.svg +++ b/editor/icons/source/icon_resource_preloader.svg diff --git a/tools/editor/icons/source/icon_rich_text_label.svg b/editor/icons/source/icon_rich_text_label.svg index 4a77dbe672..4a77dbe672 100644 --- a/tools/editor/icons/source/icon_rich_text_label.svg +++ b/editor/icons/source/icon_rich_text_label.svg diff --git a/tools/editor/icons/source/icon_rigid_body.svg b/editor/icons/source/icon_rigid_body.svg index 6bebb5250f..6bebb5250f 100644 --- a/tools/editor/icons/source/icon_rigid_body.svg +++ b/editor/icons/source/icon_rigid_body.svg diff --git a/tools/editor/icons/source/icon_rigid_body_2d.svg b/editor/icons/source/icon_rigid_body_2d.svg index 9c8309ecfb..9c8309ecfb 100644 --- a/tools/editor/icons/source/icon_rigid_body_2d.svg +++ b/editor/icons/source/icon_rigid_body_2d.svg diff --git a/tools/editor/icons/source/icon_room.svg b/editor/icons/source/icon_room.svg index 599bbeb770..599bbeb770 100644 --- a/tools/editor/icons/source/icon_room.svg +++ b/editor/icons/source/icon_room.svg diff --git a/tools/editor/icons/source/icon_room_bounds.svg b/editor/icons/source/icon_room_bounds.svg index 8f7e6e6c83..8f7e6e6c83 100644 --- a/tools/editor/icons/source/icon_room_bounds.svg +++ b/editor/icons/source/icon_room_bounds.svg diff --git a/tools/editor/icons/source/icon_rotate_0.svg b/editor/icons/source/icon_rotate_0.svg index 710edc8fee..710edc8fee 100644 --- a/tools/editor/icons/source/icon_rotate_0.svg +++ b/editor/icons/source/icon_rotate_0.svg diff --git a/tools/editor/icons/source/icon_rotate_180.svg b/editor/icons/source/icon_rotate_180.svg index ba44fa295d..ba44fa295d 100644 --- a/tools/editor/icons/source/icon_rotate_180.svg +++ b/editor/icons/source/icon_rotate_180.svg diff --git a/tools/editor/icons/source/icon_rotate_270.svg b/editor/icons/source/icon_rotate_270.svg index 403321cb89..403321cb89 100644 --- a/tools/editor/icons/source/icon_rotate_270.svg +++ b/editor/icons/source/icon_rotate_270.svg diff --git a/tools/editor/icons/source/icon_rotate_90.svg b/editor/icons/source/icon_rotate_90.svg index f6b7d84032..f6b7d84032 100644 --- a/tools/editor/icons/source/icon_rotate_90.svg +++ b/editor/icons/source/icon_rotate_90.svg diff --git a/tools/editor/icons/source/icon_sample.svg b/editor/icons/source/icon_sample.svg index 782e07a012..782e07a012 100644 --- a/tools/editor/icons/source/icon_sample.svg +++ b/editor/icons/source/icon_sample.svg diff --git a/tools/editor/icons/source/icon_sample_library.svg b/editor/icons/source/icon_sample_library.svg index 78b01430c2..78b01430c2 100644 --- a/tools/editor/icons/source/icon_sample_library.svg +++ b/editor/icons/source/icon_sample_library.svg diff --git a/tools/editor/icons/source/icon_sample_player.svg b/editor/icons/source/icon_sample_player.svg index 2254718a9b..2254718a9b 100644 --- a/tools/editor/icons/source/icon_sample_player.svg +++ b/editor/icons/source/icon_sample_player.svg diff --git a/tools/editor/icons/source/icon_sample_player_2d.svg b/editor/icons/source/icon_sample_player_2d.svg index 33a7eba019..33a7eba019 100644 --- a/tools/editor/icons/source/icon_sample_player_2d.svg +++ b/editor/icons/source/icon_sample_player_2d.svg diff --git a/tools/editor/icons/source/icon_save.svg b/editor/icons/source/icon_save.svg index 9307537d4b..9307537d4b 100644 --- a/tools/editor/icons/source/icon_save.svg +++ b/editor/icons/source/icon_save.svg diff --git a/tools/editor/icons/source/icon_script.svg b/editor/icons/source/icon_script.svg index 8073692ce8..8073692ce8 100644 --- a/tools/editor/icons/source/icon_script.svg +++ b/editor/icons/source/icon_script.svg diff --git a/tools/editor/icons/source/icon_script_create.svg b/editor/icons/source/icon_script_create.svg index 0cf16a9c3b..0cf16a9c3b 100644 --- a/tools/editor/icons/source/icon_script_create.svg +++ b/editor/icons/source/icon_script_create.svg diff --git a/tools/editor/icons/source/icon_script_remove.svg b/editor/icons/source/icon_script_remove.svg index 1a0a0eebe3..1a0a0eebe3 100644 --- a/tools/editor/icons/source/icon_script_remove.svg +++ b/editor/icons/source/icon_script_remove.svg diff --git a/tools/editor/icons/source/icon_scroll_bar.svg b/editor/icons/source/icon_scroll_bar.svg index 2f007c7c94..2f007c7c94 100644 --- a/tools/editor/icons/source/icon_scroll_bar.svg +++ b/editor/icons/source/icon_scroll_bar.svg diff --git a/tools/editor/icons/source/icon_scroll_container.svg b/editor/icons/source/icon_scroll_container.svg index d694b646e0..d694b646e0 100644 --- a/tools/editor/icons/source/icon_scroll_container.svg +++ b/editor/icons/source/icon_scroll_container.svg diff --git a/tools/editor/icons/source/icon_segment_shape_2d.svg b/editor/icons/source/icon_segment_shape_2d.svg index b509a31362..b509a31362 100644 --- a/tools/editor/icons/source/icon_segment_shape_2d.svg +++ b/editor/icons/source/icon_segment_shape_2d.svg diff --git a/tools/editor/icons/source/icon_shader.svg b/editor/icons/source/icon_shader.svg index 1a2393fec2..1a2393fec2 100644 --- a/tools/editor/icons/source/icon_shader.svg +++ b/editor/icons/source/icon_shader.svg diff --git a/tools/editor/icons/source/icon_short_cut.svg b/editor/icons/source/icon_short_cut.svg index 05069e8ea1..05069e8ea1 100644 --- a/tools/editor/icons/source/icon_short_cut.svg +++ b/editor/icons/source/icon_short_cut.svg diff --git a/tools/editor/icons/source/icon_signal.svg b/editor/icons/source/icon_signal.svg index b4d3ff5ac8..b4d3ff5ac8 100644 --- a/tools/editor/icons/source/icon_signal.svg +++ b/editor/icons/source/icon_signal.svg diff --git a/tools/editor/icons/source/icon_skeleton.svg b/editor/icons/source/icon_skeleton.svg index 2850b0331d..2850b0331d 100644 --- a/tools/editor/icons/source/icon_skeleton.svg +++ b/editor/icons/source/icon_skeleton.svg diff --git a/tools/editor/icons/source/icon_slider_joint.svg b/editor/icons/source/icon_slider_joint.svg index 021a295186..021a295186 100644 --- a/tools/editor/icons/source/icon_slider_joint.svg +++ b/editor/icons/source/icon_slider_joint.svg diff --git a/tools/editor/icons/source/icon_slot.svg b/editor/icons/source/icon_slot.svg index d613f1e1a4..d613f1e1a4 100644 --- a/tools/editor/icons/source/icon_slot.svg +++ b/editor/icons/source/icon_slot.svg diff --git a/tools/editor/icons/source/icon_snap.svg b/editor/icons/source/icon_snap.svg index 321dedf6b6..321dedf6b6 100644 --- a/tools/editor/icons/source/icon_snap.svg +++ b/editor/icons/source/icon_snap.svg diff --git a/tools/editor/icons/source/icon_sound_room_params.svg b/editor/icons/source/icon_sound_room_params.svg index a71c126ddc..a71c126ddc 100644 --- a/tools/editor/icons/source/icon_sound_room_params.svg +++ b/editor/icons/source/icon_sound_room_params.svg diff --git a/tools/editor/icons/source/icon_spatial.svg b/editor/icons/source/icon_spatial.svg index 0d03754016..0d03754016 100644 --- a/tools/editor/icons/source/icon_spatial.svg +++ b/editor/icons/source/icon_spatial.svg diff --git a/tools/editor/icons/source/icon_spatial_sample_player.svg b/editor/icons/source/icon_spatial_sample_player.svg index 9b5f5d9af6..9b5f5d9af6 100644 --- a/tools/editor/icons/source/icon_spatial_sample_player.svg +++ b/editor/icons/source/icon_spatial_sample_player.svg diff --git a/tools/editor/icons/source/icon_spatial_shader.svg b/editor/icons/source/icon_spatial_shader.svg index 329354b716..329354b716 100644 --- a/tools/editor/icons/source/icon_spatial_shader.svg +++ b/editor/icons/source/icon_spatial_shader.svg diff --git a/tools/editor/icons/source/icon_spatial_stream_player.svg b/editor/icons/source/icon_spatial_stream_player.svg index bd081a3dc2..bd081a3dc2 100644 --- a/tools/editor/icons/source/icon_spatial_stream_player.svg +++ b/editor/icons/source/icon_spatial_stream_player.svg diff --git a/tools/editor/icons/source/icon_sphere_shape.svg b/editor/icons/source/icon_sphere_shape.svg index b1bca49f97..b1bca49f97 100644 --- a/tools/editor/icons/source/icon_sphere_shape.svg +++ b/editor/icons/source/icon_sphere_shape.svg diff --git a/tools/editor/icons/source/icon_spin_box.svg b/editor/icons/source/icon_spin_box.svg index e0086ed12e..e0086ed12e 100644 --- a/tools/editor/icons/source/icon_spin_box.svg +++ b/editor/icons/source/icon_spin_box.svg diff --git a/tools/editor/icons/source/icon_spot_light.svg b/editor/icons/source/icon_spot_light.svg index 04f5b42f4d..04f5b42f4d 100644 --- a/tools/editor/icons/source/icon_spot_light.svg +++ b/editor/icons/source/icon_spot_light.svg diff --git a/tools/editor/icons/source/icon_sprite.svg b/editor/icons/source/icon_sprite.svg index 488bbf934d..488bbf934d 100644 --- a/tools/editor/icons/source/icon_sprite.svg +++ b/editor/icons/source/icon_sprite.svg diff --git a/tools/editor/icons/source/icon_sprite_3d.svg b/editor/icons/source/icon_sprite_3d.svg index 4ea81f7ea2..4ea81f7ea2 100644 --- a/tools/editor/icons/source/icon_sprite_3d.svg +++ b/editor/icons/source/icon_sprite_3d.svg diff --git a/tools/editor/icons/source/icon_sprite_frames.svg b/editor/icons/source/icon_sprite_frames.svg index dc445da773..dc445da773 100644 --- a/tools/editor/icons/source/icon_sprite_frames.svg +++ b/editor/icons/source/icon_sprite_frames.svg diff --git a/tools/editor/icons/source/icon_static_body.svg b/editor/icons/source/icon_static_body.svg index fcaa2b7d3e..fcaa2b7d3e 100644 --- a/tools/editor/icons/source/icon_static_body.svg +++ b/editor/icons/source/icon_static_body.svg diff --git a/tools/editor/icons/source/icon_static_body_2d.svg b/editor/icons/source/icon_static_body_2d.svg index 0ed3ef7cf0..0ed3ef7cf0 100644 --- a/tools/editor/icons/source/icon_static_body_2d.svg +++ b/editor/icons/source/icon_static_body_2d.svg diff --git a/tools/editor/icons/source/icon_stream_player.svg b/editor/icons/source/icon_stream_player.svg index 618646bbed..618646bbed 100644 --- a/tools/editor/icons/source/icon_stream_player.svg +++ b/editor/icons/source/icon_stream_player.svg diff --git a/tools/editor/icons/source/icon_string.svg b/editor/icons/source/icon_string.svg index f32e82256f..f32e82256f 100644 --- a/tools/editor/icons/source/icon_string.svg +++ b/editor/icons/source/icon_string.svg diff --git a/tools/editor/icons/source/icon_style_box_empty.svg b/editor/icons/source/icon_style_box_empty.svg index c881fe1c10..c881fe1c10 100644 --- a/tools/editor/icons/source/icon_style_box_empty.svg +++ b/editor/icons/source/icon_style_box_empty.svg diff --git a/tools/editor/icons/source/icon_style_box_flat.svg b/editor/icons/source/icon_style_box_flat.svg index 9071014ff3..9071014ff3 100644 --- a/tools/editor/icons/source/icon_style_box_flat.svg +++ b/editor/icons/source/icon_style_box_flat.svg diff --git a/tools/editor/icons/source/icon_style_box_texture.svg b/editor/icons/source/icon_style_box_texture.svg index 30b1f1af68..30b1f1af68 100644 --- a/tools/editor/icons/source/icon_style_box_texture.svg +++ b/editor/icons/source/icon_style_box_texture.svg diff --git a/tools/editor/icons/source/icon_tab_container.svg b/editor/icons/source/icon_tab_container.svg index 6c197a86f6..6c197a86f6 100644 --- a/tools/editor/icons/source/icon_tab_container.svg +++ b/editor/icons/source/icon_tab_container.svg diff --git a/tools/editor/icons/source/icon_tabs.svg b/editor/icons/source/icon_tabs.svg index 79ed1e5910..79ed1e5910 100644 --- a/tools/editor/icons/source/icon_tabs.svg +++ b/editor/icons/source/icon_tabs.svg diff --git a/tools/editor/icons/source/icon_test_cube.svg b/editor/icons/source/icon_test_cube.svg index c42c0bb674..c42c0bb674 100644 --- a/tools/editor/icons/source/icon_test_cube.svg +++ b/editor/icons/source/icon_test_cube.svg diff --git a/tools/editor/icons/source/icon_text_edit.svg b/editor/icons/source/icon_text_edit.svg index 4d08e9e3b2..4d08e9e3b2 100644 --- a/tools/editor/icons/source/icon_text_edit.svg +++ b/editor/icons/source/icon_text_edit.svg diff --git a/tools/editor/icons/source/icon_texture.svg b/editor/icons/source/icon_texture.svg index 39e88e592b..39e88e592b 100644 --- a/tools/editor/icons/source/icon_texture.svg +++ b/editor/icons/source/icon_texture.svg diff --git a/tools/editor/icons/source/icon_texture_button.svg b/editor/icons/source/icon_texture_button.svg index ef447af082..ef447af082 100644 --- a/tools/editor/icons/source/icon_texture_button.svg +++ b/editor/icons/source/icon_texture_button.svg diff --git a/tools/editor/icons/source/icon_texture_progress.svg b/editor/icons/source/icon_texture_progress.svg index 493dd7fd63..493dd7fd63 100644 --- a/tools/editor/icons/source/icon_texture_progress.svg +++ b/editor/icons/source/icon_texture_progress.svg diff --git a/tools/editor/icons/source/icon_texture_rect.svg b/editor/icons/source/icon_texture_rect.svg index 88d9b4081f..88d9b4081f 100644 --- a/tools/editor/icons/source/icon_texture_rect.svg +++ b/editor/icons/source/icon_texture_rect.svg diff --git a/tools/editor/icons/source/icon_theme.svg b/editor/icons/source/icon_theme.svg index 2cacb9755a..2cacb9755a 100644 --- a/tools/editor/icons/source/icon_theme.svg +++ b/editor/icons/source/icon_theme.svg diff --git a/tools/editor/icons/source/icon_tile_map.svg b/editor/icons/source/icon_tile_map.svg index 28f75a97e5..28f75a97e5 100644 --- a/tools/editor/icons/source/icon_tile_map.svg +++ b/editor/icons/source/icon_tile_map.svg diff --git a/tools/editor/icons/source/icon_tile_set.svg b/editor/icons/source/icon_tile_set.svg index e697f03888..e697f03888 100644 --- a/tools/editor/icons/source/icon_tile_set.svg +++ b/editor/icons/source/icon_tile_set.svg diff --git a/tools/editor/icons/source/icon_timer.svg b/editor/icons/source/icon_timer.svg index 0615ab865a..0615ab865a 100644 --- a/tools/editor/icons/source/icon_timer.svg +++ b/editor/icons/source/icon_timer.svg diff --git a/tools/editor/icons/source/icon_tool_button.svg b/editor/icons/source/icon_tool_button.svg index 1c5176c8c9..1c5176c8c9 100644 --- a/tools/editor/icons/source/icon_tool_button.svg +++ b/editor/icons/source/icon_tool_button.svg diff --git a/tools/editor/icons/source/icon_tool_move.svg b/editor/icons/source/icon_tool_move.svg index 243b680dfe..243b680dfe 100644 --- a/tools/editor/icons/source/icon_tool_move.svg +++ b/editor/icons/source/icon_tool_move.svg diff --git a/tools/editor/icons/source/icon_tool_pan.svg b/editor/icons/source/icon_tool_pan.svg index a93fc3d29d..a93fc3d29d 100644 --- a/tools/editor/icons/source/icon_tool_pan.svg +++ b/editor/icons/source/icon_tool_pan.svg diff --git a/tools/editor/icons/source/icon_tool_rotate.svg b/editor/icons/source/icon_tool_rotate.svg index 817aee3995..817aee3995 100644 --- a/tools/editor/icons/source/icon_tool_rotate.svg +++ b/editor/icons/source/icon_tool_rotate.svg diff --git a/tools/editor/icons/source/icon_tool_scale.svg b/editor/icons/source/icon_tool_scale.svg index 515bef3bb7..515bef3bb7 100644 --- a/tools/editor/icons/source/icon_tool_scale.svg +++ b/editor/icons/source/icon_tool_scale.svg diff --git a/tools/editor/icons/source/icon_tool_select.svg b/editor/icons/source/icon_tool_select.svg index 2da6a3e6ba..2da6a3e6ba 100644 --- a/tools/editor/icons/source/icon_tool_select.svg +++ b/editor/icons/source/icon_tool_select.svg diff --git a/tools/editor/icons/source/icon_tools.svg b/editor/icons/source/icon_tools.svg index f2b8cd9343..f2b8cd9343 100644 --- a/tools/editor/icons/source/icon_tools.svg +++ b/editor/icons/source/icon_tools.svg diff --git a/tools/editor/icons/source/icon_touch_screen_button.svg b/editor/icons/source/icon_touch_screen_button.svg index 70abc964aa..70abc964aa 100644 --- a/tools/editor/icons/source/icon_touch_screen_button.svg +++ b/editor/icons/source/icon_touch_screen_button.svg diff --git a/tools/editor/icons/source/icon_track_add_key.svg b/editor/icons/source/icon_track_add_key.svg index f550f922bb..f550f922bb 100644 --- a/tools/editor/icons/source/icon_track_add_key.svg +++ b/editor/icons/source/icon_track_add_key.svg diff --git a/tools/editor/icons/source/icon_track_add_key_hl.svg b/editor/icons/source/icon_track_add_key_hl.svg index 1b45cf8c4a..1b45cf8c4a 100644 --- a/tools/editor/icons/source/icon_track_add_key_hl.svg +++ b/editor/icons/source/icon_track_add_key_hl.svg diff --git a/tools/editor/icons/source/icon_track_continuous.svg b/editor/icons/source/icon_track_continuous.svg index 78b9dd3f4b..78b9dd3f4b 100644 --- a/tools/editor/icons/source/icon_track_continuous.svg +++ b/editor/icons/source/icon_track_continuous.svg diff --git a/tools/editor/icons/source/icon_track_discrete.svg b/editor/icons/source/icon_track_discrete.svg index 381782cf6f..381782cf6f 100644 --- a/tools/editor/icons/source/icon_track_discrete.svg +++ b/editor/icons/source/icon_track_discrete.svg diff --git a/tools/editor/icons/source/icon_track_trigger.svg b/editor/icons/source/icon_track_trigger.svg index 9c13791f70..9c13791f70 100644 --- a/tools/editor/icons/source/icon_track_trigger.svg +++ b/editor/icons/source/icon_track_trigger.svg diff --git a/tools/editor/icons/source/icon_translation.svg b/editor/icons/source/icon_translation.svg index 389b8a40de..389b8a40de 100644 --- a/tools/editor/icons/source/icon_translation.svg +++ b/editor/icons/source/icon_translation.svg diff --git a/tools/editor/icons/source/icon_transpose.svg b/editor/icons/source/icon_transpose.svg index ceccfecfa3..ceccfecfa3 100644 --- a/tools/editor/icons/source/icon_transpose.svg +++ b/editor/icons/source/icon_transpose.svg diff --git a/tools/editor/icons/source/icon_tree.svg b/editor/icons/source/icon_tree.svg index b31fd38097..b31fd38097 100644 --- a/tools/editor/icons/source/icon_tree.svg +++ b/editor/icons/source/icon_tree.svg diff --git a/tools/editor/icons/source/icon_tween.svg b/editor/icons/source/icon_tween.svg index 5cb5cad227..5cb5cad227 100644 --- a/tools/editor/icons/source/icon_tween.svg +++ b/editor/icons/source/icon_tween.svg diff --git a/tools/editor/icons/source/icon_unbone.svg b/editor/icons/source/icon_unbone.svg index 7e4109f2ec..7e4109f2ec 100644 --- a/tools/editor/icons/source/icon_unbone.svg +++ b/editor/icons/source/icon_unbone.svg diff --git a/tools/editor/icons/source/icon_ungroup.svg b/editor/icons/source/icon_ungroup.svg index f0b33465cd..f0b33465cd 100644 --- a/tools/editor/icons/source/icon_ungroup.svg +++ b/editor/icons/source/icon_ungroup.svg diff --git a/tools/editor/icons/source/icon_unlock.svg b/editor/icons/source/icon_unlock.svg index b821d486ed..b821d486ed 100644 --- a/tools/editor/icons/source/icon_unlock.svg +++ b/editor/icons/source/icon_unlock.svg diff --git a/tools/editor/icons/source/icon_uv.svg b/editor/icons/source/icon_uv.svg index 698a57fc0a..698a57fc0a 100644 --- a/tools/editor/icons/source/icon_uv.svg +++ b/editor/icons/source/icon_uv.svg diff --git a/tools/editor/icons/source/icon_v_box_container.svg b/editor/icons/source/icon_v_box_container.svg index 9773b253fb..9773b253fb 100644 --- a/tools/editor/icons/source/icon_v_box_container.svg +++ b/editor/icons/source/icon_v_box_container.svg diff --git a/tools/editor/icons/source/icon_v_button_array.svg b/editor/icons/source/icon_v_button_array.svg index aded4b401b..aded4b401b 100644 --- a/tools/editor/icons/source/icon_v_button_array.svg +++ b/editor/icons/source/icon_v_button_array.svg diff --git a/tools/editor/icons/source/icon_v_scroll_bar.svg b/editor/icons/source/icon_v_scroll_bar.svg index 659dc39b0b..659dc39b0b 100644 --- a/tools/editor/icons/source/icon_v_scroll_bar.svg +++ b/editor/icons/source/icon_v_scroll_bar.svg diff --git a/tools/editor/icons/source/icon_v_separator.svg b/editor/icons/source/icon_v_separator.svg index 7e5ce39ba0..7e5ce39ba0 100644 --- a/tools/editor/icons/source/icon_v_separator.svg +++ b/editor/icons/source/icon_v_separator.svg diff --git a/tools/editor/icons/source/icon_v_slider.svg b/editor/icons/source/icon_v_slider.svg index 74b59cfce5..74b59cfce5 100644 --- a/tools/editor/icons/source/icon_v_slider.svg +++ b/editor/icons/source/icon_v_slider.svg diff --git a/tools/editor/icons/source/icon_v_split_container.svg b/editor/icons/source/icon_v_split_container.svg index 4e7704eb4e..4e7704eb4e 100644 --- a/tools/editor/icons/source/icon_v_split_container.svg +++ b/editor/icons/source/icon_v_split_container.svg diff --git a/tools/editor/icons/source/icon_vector.svg b/editor/icons/source/icon_vector.svg index 3260aa77ac..3260aa77ac 100644 --- a/tools/editor/icons/source/icon_vector.svg +++ b/editor/icons/source/icon_vector.svg diff --git a/tools/editor/icons/source/icon_vector2.svg b/editor/icons/source/icon_vector2.svg index b7b157db01..b7b157db01 100644 --- a/tools/editor/icons/source/icon_vector2.svg +++ b/editor/icons/source/icon_vector2.svg diff --git a/tools/editor/icons/source/icon_vehicle_body.svg b/editor/icons/source/icon_vehicle_body.svg index a168b98a99..a168b98a99 100644 --- a/tools/editor/icons/source/icon_vehicle_body.svg +++ b/editor/icons/source/icon_vehicle_body.svg diff --git a/tools/editor/icons/source/icon_vehicle_wheel.svg b/editor/icons/source/icon_vehicle_wheel.svg index dff80c4d00..dff80c4d00 100644 --- a/tools/editor/icons/source/icon_vehicle_wheel.svg +++ b/editor/icons/source/icon_vehicle_wheel.svg diff --git a/tools/editor/icons/source/icon_video_player.svg b/editor/icons/source/icon_video_player.svg index bfb499518b..bfb499518b 100644 --- a/tools/editor/icons/source/icon_video_player.svg +++ b/editor/icons/source/icon_video_player.svg diff --git a/tools/editor/icons/source/icon_viewport.svg b/editor/icons/source/icon_viewport.svg index 631260ab33..631260ab33 100644 --- a/tools/editor/icons/source/icon_viewport.svg +++ b/editor/icons/source/icon_viewport.svg diff --git a/tools/editor/icons/source/icon_viewport_container.svg b/editor/icons/source/icon_viewport_container.svg index 300b8390c4..300b8390c4 100644 --- a/tools/editor/icons/source/icon_viewport_container.svg +++ b/editor/icons/source/icon_viewport_container.svg diff --git a/tools/editor/icons/source/icon_viewport_sprite.svg b/editor/icons/source/icon_viewport_sprite.svg index ab1ac198ce..ab1ac198ce 100644 --- a/tools/editor/icons/source/icon_viewport_sprite.svg +++ b/editor/icons/source/icon_viewport_sprite.svg diff --git a/tools/editor/icons/source/icon_viewport_texture.svg b/editor/icons/source/icon_viewport_texture.svg index 4cf6532059..4cf6532059 100644 --- a/tools/editor/icons/source/icon_viewport_texture.svg +++ b/editor/icons/source/icon_viewport_texture.svg diff --git a/tools/editor/icons/source/icon_visibility_enabler.svg b/editor/icons/source/icon_visibility_enabler.svg index 7c3bc54c99..7c3bc54c99 100644 --- a/tools/editor/icons/source/icon_visibility_enabler.svg +++ b/editor/icons/source/icon_visibility_enabler.svg diff --git a/tools/editor/icons/source/icon_visibility_enabler_2d.svg b/editor/icons/source/icon_visibility_enabler_2d.svg index 1e7d1a751f..1e7d1a751f 100644 --- a/tools/editor/icons/source/icon_visibility_enabler_2d.svg +++ b/editor/icons/source/icon_visibility_enabler_2d.svg diff --git a/tools/editor/icons/source/icon_visibility_notifier.svg b/editor/icons/source/icon_visibility_notifier.svg index b307a6162d..b307a6162d 100644 --- a/tools/editor/icons/source/icon_visibility_notifier.svg +++ b/editor/icons/source/icon_visibility_notifier.svg diff --git a/tools/editor/icons/source/icon_visibility_notifier_2d.svg b/editor/icons/source/icon_visibility_notifier_2d.svg index dc2482f9e1..dc2482f9e1 100644 --- a/tools/editor/icons/source/icon_visibility_notifier_2d.svg +++ b/editor/icons/source/icon_visibility_notifier_2d.svg diff --git a/tools/editor/icons/source/icon_visible.svg b/editor/icons/source/icon_visible.svg index 0185e1f3a9..0185e1f3a9 100644 --- a/tools/editor/icons/source/icon_visible.svg +++ b/editor/icons/source/icon_visible.svg diff --git a/tools/editor/icons/source/icon_visual_script.svg b/editor/icons/source/icon_visual_script.svg index be4b47ca54..be4b47ca54 100644 --- a/tools/editor/icons/source/icon_visual_script.svg +++ b/editor/icons/source/icon_visual_script.svg diff --git a/tools/editor/icons/source/icon_visual_shader_port.svg b/editor/icons/source/icon_visual_shader_port.svg index 9e80e0e9e9..9e80e0e9e9 100644 --- a/tools/editor/icons/source/icon_visual_shader_port.svg +++ b/editor/icons/source/icon_visual_shader_port.svg diff --git a/tools/editor/icons/source/icon_vu_empty.svg b/editor/icons/source/icon_vu_empty.svg index c4c7a4e625..c4c7a4e625 100644 --- a/tools/editor/icons/source/icon_vu_empty.svg +++ b/editor/icons/source/icon_vu_empty.svg diff --git a/tools/editor/icons/source/icon_vu_full.svg b/editor/icons/source/icon_vu_full.svg index 7084ddf204..7084ddf204 100644 --- a/tools/editor/icons/source/icon_vu_full.svg +++ b/editor/icons/source/icon_vu_full.svg diff --git a/tools/editor/icons/source/icon_warning.svg b/editor/icons/source/icon_warning.svg index 4d39141a58..4d39141a58 100644 --- a/tools/editor/icons/source/icon_warning.svg +++ b/editor/icons/source/icon_warning.svg diff --git a/tools/editor/icons/source/icon_window_dialog.svg b/editor/icons/source/icon_window_dialog.svg index 433ae48a55..433ae48a55 100644 --- a/tools/editor/icons/source/icon_window_dialog.svg +++ b/editor/icons/source/icon_window_dialog.svg diff --git a/tools/editor/icons/source/icon_world.svg b/editor/icons/source/icon_world.svg index b2be396217..b2be396217 100644 --- a/tools/editor/icons/source/icon_world.svg +++ b/editor/icons/source/icon_world.svg diff --git a/tools/editor/icons/source/icon_world_2d.svg b/editor/icons/source/icon_world_2d.svg index cb4427808a..cb4427808a 100644 --- a/tools/editor/icons/source/icon_world_2d.svg +++ b/editor/icons/source/icon_world_2d.svg diff --git a/tools/editor/icons/source/icon_world_environment.svg b/editor/icons/source/icon_world_environment.svg index 912e348c81..912e348c81 100644 --- a/tools/editor/icons/source/icon_world_environment.svg +++ b/editor/icons/source/icon_world_environment.svg diff --git a/tools/editor/icons/source/icon_y_sort.svg b/editor/icons/source/icon_y_sort.svg index 65990097c6..65990097c6 100644 --- a/tools/editor/icons/source/icon_y_sort.svg +++ b/editor/icons/source/icon_y_sort.svg diff --git a/tools/editor/icons/source/icon_zoom.svg b/editor/icons/source/icon_zoom.svg index 811036b370..811036b370 100644 --- a/tools/editor/icons/source/icon_zoom.svg +++ b/editor/icons/source/icon_zoom.svg diff --git a/tools/editor/icons/source/icon_zoom_less.svg b/editor/icons/source/icon_zoom_less.svg index 970b1954bb..970b1954bb 100644 --- a/tools/editor/icons/source/icon_zoom_less.svg +++ b/editor/icons/source/icon_zoom_less.svg diff --git a/tools/editor/icons/source/icon_zoom_more.svg b/editor/icons/source/icon_zoom_more.svg index 87acdfb021..87acdfb021 100644 --- a/tools/editor/icons/source/icon_zoom_more.svg +++ b/editor/icons/source/icon_zoom_more.svg diff --git a/tools/editor/icons/source/icon_zoom_reset.svg b/editor/icons/source/icon_zoom_reset.svg index a82f93dfea..a82f93dfea 100644 --- a/tools/editor/icons/source/icon_zoom_reset.svg +++ b/editor/icons/source/icon_zoom_reset.svg diff --git a/tools/editor/icons/xpmfix.sh b/editor/icons/xpmfix.sh index a24dede3c9..a24dede3c9 100755 --- a/tools/editor/icons/xpmfix.sh +++ b/editor/icons/xpmfix.sh diff --git a/tools/editor/import/SCsub b/editor/import/SCsub index f1fa50148f..f1fa50148f 100644 --- a/tools/editor/import/SCsub +++ b/editor/import/SCsub diff --git a/tools/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index a901de1faf..7098e8812b 100644 --- a/tools/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -39,8 +39,8 @@ #include "scene/resources/animation.h" #include "scene/resources/packed_scene.h" #include "os/os.h" -#include "tools/editor/collada/collada.h" -#include "tools/editor/editor_node.h" +#include "editor/collada/collada.h" +#include "editor/editor_node.h" #include <iostream> diff --git a/tools/editor/import/editor_import_collada.h b/editor/import/editor_import_collada.h index cd3614bb40..5c7624bd33 100644 --- a/tools/editor/import/editor_import_collada.h +++ b/editor/import/editor_import_collada.h @@ -29,7 +29,7 @@ #ifndef EDITOR_IMPORT_COLLADA_H #define EDITOR_IMPORT_COLLADA_H -#include "tools/editor/import/resource_importer_scene.h" +#include "editor/import/resource_importer_scene.h" diff --git a/tools/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp index f14c10fb99..faf62d2839 100644 --- a/tools/editor/import/resource_importer_csv_translation.cpp +++ b/editor/import/resource_importer_csv_translation.cpp @@ -1,5 +1,33 @@ - +/*************************************************************************/ +/* resource_importer_csv_translation.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "resource_importer_csv_translation.h" + #include "os/file_access.h" #include "translation.h" #include "io/resource_saver.h" diff --git a/editor/import/resource_importer_csv_translation.h b/editor/import/resource_importer_csv_translation.h new file mode 100644 index 0000000000..a25e6a0fa8 --- /dev/null +++ b/editor/import/resource_importer_csv_translation.h @@ -0,0 +1,55 @@ +/*************************************************************************/ +/* resource_importer_csv_translation.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RESOURCEIMPORTERCSVTRANSLATION_H +#define RESOURCEIMPORTERCSVTRANSLATION_H + +#include "io/resource_import.h" + + +class ResourceImporterCSVTranslation : public ResourceImporter { + GDCLASS(ResourceImporterCSVTranslation,ResourceImporter) +public: + virtual String get_importer_name() const; + virtual String get_visible_name() const; + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual String get_save_extension() const; + virtual String get_resource_type() const; + + virtual int get_preset_count() const; + virtual String get_preset_name(int p_idx) const; + + virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; + virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; + + virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); + + ResourceImporterCSVTranslation(); +}; + +#endif // RESOURCEIMPORTERCSVTRANSLATION_H diff --git a/tools/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index e6e23366f6..3b3e0e3a00 100644 --- a/tools/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* resource_importer_obj.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "resource_importer_obj.h" #include "io/resource_saver.h" @@ -118,7 +146,7 @@ Error ResourceImporterOBJ::import(const String& p_source_file, const String& p_s nrm.y=v[2].to_float(); nrm.z=v[3].to_float(); normals.push_back(nrm); - } if (l.begins_with("f ")) { + } else if (l.begins_with("f ")) { //vertex has_index_data=true; diff --git a/editor/import/resource_importer_obj.h b/editor/import/resource_importer_obj.h new file mode 100644 index 0000000000..e4e426f9e8 --- /dev/null +++ b/editor/import/resource_importer_obj.h @@ -0,0 +1,56 @@ +/*************************************************************************/ +/* resource_importer_obj.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RESOURCEIMPORTEROBJ_H +#define RESOURCEIMPORTEROBJ_H + + +#include "io/resource_import.h" + +class ResourceImporterOBJ : public ResourceImporter { + GDCLASS(ResourceImporterOBJ,ResourceImporter) +public: + virtual String get_importer_name() const; + virtual String get_visible_name() const; + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual String get_save_extension() const; + virtual String get_resource_type() const; + + virtual int get_preset_count() const; + virtual String get_preset_name(int p_idx) const; + + virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; + virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; + + virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); + + ResourceImporterOBJ(); +}; + + +#endif // RESOURCEIMPORTEROBJ_H diff --git a/tools/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index ae840e9e16..3f81b30bf6 100644 --- a/tools/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -1,8 +1,36 @@ +/*************************************************************************/ +/* resource_importer_scene.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "resource_importer_scene.h" #include "scene/resources/packed_scene.h" #include "io/resource_saver.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_node.h" #include "scene/3d/mesh_instance.h" #include "scene/3d/navigation.h" @@ -1279,7 +1307,7 @@ Error ResourceImporterScene::import(const String& p_source_file, const String& p Ref<EditorScenePostImport> post_import_script; if (post_import_script_path!="") { - post_import_script_path = post_import_script_path; + post_import_script_path = post_import_script_path; // FIXME: is there a good reason for this? Ref<Script> scr = ResourceLoader::load(post_import_script_path); if (!scr.is_valid()) { EditorNode::add_io_error(TTR("Couldn't load post-import script:")+" "+post_import_script_path); diff --git a/tools/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index cfa44b160a..ab6b223839 100644 --- a/tools/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* resource_importer_scene.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RESOURCEIMPORTERSCENE_H #define RESOURCEIMPORTERSCENE_H diff --git a/tools/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 21e434fa11..f7bd944ceb 100644 --- a/tools/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -1,7 +1,36 @@ +/*************************************************************************/ +/* resource_importer_texture.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "resource_importer_texture.h" + #include "io/image_loader.h" #include "scene/resources/texture.h" -#include "tools/editor/editor_file_system.h" +#include "editor/editor_file_system.h" #include "io/config_file.h" diff --git a/editor/import/resource_importer_texture.h b/editor/import/resource_importer_texture.h new file mode 100644 index 0000000000..2667fb1601 --- /dev/null +++ b/editor/import/resource_importer_texture.h @@ -0,0 +1,98 @@ +/*************************************************************************/ +/* resource_importer_texture.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RESOURCEIMPORTTEXTURE_H +#define RESOURCEIMPORTTEXTURE_H + +#include "io/resource_import.h" +class StreamTexture; + +class ResourceImporterTexture : public ResourceImporter { + GDCLASS(ResourceImporterTexture,ResourceImporter) + + + +protected: + + enum { + MAKE_3D_FLAG=1, + MAKE_SRGB_FLAG=2 + }; + + Mutex *mutex; + Map<StringName,int> make_flags; + + static void _texture_reimport_srgb(const Ref<StreamTexture>& p_tex); + static void _texture_reimport_3d(const Ref<StreamTexture>& p_tex); + + + + + static ResourceImporterTexture *singleton; +public: + + static ResourceImporterTexture *get_singleton() { return singleton; } + virtual String get_importer_name() const; + virtual String get_visible_name() const; + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual String get_save_extension() const; + virtual String get_resource_type() const; + + + enum Preset { + PRESET_DETECT, + PRESET_2D, + PRESET_2D_PIXEL, + PRESET_3D, + }; + + enum CompressMode { + COMPRESS_LOSSLESS, + COMPRESS_LOSSY, + COMPRESS_VIDEO_RAM, + COMPRESS_UNCOMPRESSED + }; + + virtual int get_preset_count() const; + virtual String get_preset_name(int p_idx) const; + + virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; + virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; + + void _save_stex(const Image& p_image, const String& p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable,bool p_detect_3d,bool p_detect_srgb); + + virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); + + + void update_imports(); + + ResourceImporterTexture(); + ~ResourceImporterTexture(); +}; + +#endif // RESOURCEIMPORTTEXTURE_H diff --git a/tools/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index ee53b740ca..684ef4dc5c 100644 --- a/tools/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* resource_importer_wav.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "resource_importer_wav.h" #include "scene/resources/audio_stream_sample.h" diff --git a/editor/import/resource_importer_wav.h b/editor/import/resource_importer_wav.h new file mode 100644 index 0000000000..bc93799fee --- /dev/null +++ b/editor/import/resource_importer_wav.h @@ -0,0 +1,58 @@ +/*************************************************************************/ +/* resource_importer_wav.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RESOURCEIMPORTWAV_H +#define RESOURCEIMPORTWAV_H + + +#include "io/resource_import.h" + +class ResourceImporterWAV : public ResourceImporter { + GDCLASS(ResourceImporterWAV,ResourceImporter) +public: + virtual String get_importer_name() const; + virtual String get_visible_name() const; + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual String get_save_extension() const; + virtual String get_resource_type() const; + + + virtual int get_preset_count() const; + virtual String get_preset_name(int p_idx) const; + + virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; + virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; + + void _compress_ima_adpcm(const Vector<float>& p_data,PoolVector<uint8_t>& dst_data); + + virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); + + ResourceImporterWAV(); +}; + +#endif // RESOURCEIMPORTWAV_H diff --git a/tools/editor/import_dock.cpp b/editor/import_dock.cpp index b1bd698239..910274a13e 100644 --- a/tools/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* import_dock.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "import_dock.h" class ImportDockParameters : public Object { @@ -285,8 +313,8 @@ void ImportDock::_reimport() { void ImportDock::_bind_methods() { - ClassDB::bind_method(_MD("_reimport"),&ImportDock::_reimport); - ClassDB::bind_method(_MD("_preset_selected"),&ImportDock::_preset_selected); + ClassDB::bind_method(D_METHOD("_reimport"),&ImportDock::_reimport); + ClassDB::bind_method(D_METHOD("_preset_selected"),&ImportDock::_preset_selected); } ImportDock::ImportDock() { diff --git a/editor/import_dock.h b/editor/import_dock.h new file mode 100644 index 0000000000..0153955d32 --- /dev/null +++ b/editor/import_dock.h @@ -0,0 +1,70 @@ +/*************************************************************************/ +/* import_dock.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 IMPORTDOCK_H +#define IMPORTDOCK_H + +#include "io/resource_import.h" +#include "editor_file_system.h" +#include "scene/gui/box_container.h" +#include "scene/gui/option_button.h" +#include "scene/gui/popup_menu.h" +#include "property_editor.h" + +class ImportDockParameters; +class ImportDock : public VBoxContainer { + GDCLASS(ImportDock,VBoxContainer) + + LineEdit *imported; + OptionButton *import_as; + MenuButton *preset; + PropertyEditor *import_opts; + + List<PropertyInfo> properties; + Map<StringName,Variant> property_values; + + Button *import; + + ImportDockParameters *params; + + void _preset_selected(int p_idx); + + void _reimport(); +protected: + static void _bind_methods(); +public: + + void set_edit_path(const String& p_path); + void set_edit_multiple_paths(const Vector<String>& p_paths); + void clear(); + + ImportDock(); + ~ImportDock(); +}; + +#endif // IMPORTDOCK_H diff --git a/tools/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 253f9bcc01..253f9bcc01 100644 --- a/tools/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp diff --git a/tools/editor/inspector_dock.h b/editor/inspector_dock.h index be6ed5fa87..be6ed5fa87 100644 --- a/tools/editor/inspector_dock.h +++ b/editor/inspector_dock.h diff --git a/tools/editor/io_plugins/SCsub b/editor/io_plugins/SCsub index f1fa50148f..f1fa50148f 100644 --- a/tools/editor/io_plugins/SCsub +++ b/editor/io_plugins/SCsub diff --git a/tools/editor/io_plugins/editor_atlas.cpp b/editor/io_plugins/editor_atlas.cpp index c5f1ee73cf..c5f1ee73cf 100644 --- a/tools/editor/io_plugins/editor_atlas.cpp +++ b/editor/io_plugins/editor_atlas.cpp diff --git a/tools/editor/io_plugins/editor_atlas.h b/editor/io_plugins/editor_atlas.h index e0cf76576e..e0cf76576e 100644 --- a/tools/editor/io_plugins/editor_atlas.h +++ b/editor/io_plugins/editor_atlas.h diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp b/editor/io_plugins/editor_bitmask_import_plugin.cpp index 587353fef8..7282cbe4e7 100644 --- a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp +++ b/editor/io_plugins/editor_bitmask_import_plugin.cpp @@ -29,14 +29,14 @@ #include "editor_bitmask_import_plugin.h" #if 0 #include "io/image_loader.h" -#include "tools/editor/editor_file_dialog.h" -#include "tools/editor/editor_dir_dialog.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/property_editor.h" +#include "editor/editor_file_dialog.h" +#include "editor/editor_dir_dialog.h" +#include "editor/editor_node.h" +#include "editor/property_editor.h" #include "io/resource_saver.h" #include "os/file_access.h" #include "io/marshalls.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" class _EditorBitMaskImportOptions : public Object { diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.h b/editor/io_plugins/editor_bitmask_import_plugin.h index 89ff58ec93..d1618d7843 100644 --- a/tools/editor/io_plugins/editor_bitmask_import_plugin.h +++ b/editor/io_plugins/editor_bitmask_import_plugin.h @@ -29,7 +29,7 @@ #ifndef EDITOR_BITMASK_IMPORT_PLUGIN_H #define EDITOR_BITMASK_IMPORT_PLUGIN_H #if 0 -#include "tools/editor/editor_import_export.h" +#include "editor/editor_import_export.h" #include "scene/resources/font.h" class EditorNode; diff --git a/tools/editor/io_plugins/editor_export_scene.cpp b/editor/io_plugins/editor_export_scene.cpp index f4ab9880ff..a593b870f9 100644 --- a/tools/editor/io_plugins/editor_export_scene.cpp +++ b/editor/io_plugins/editor_export_scene.cpp @@ -32,9 +32,9 @@ #include "io/resource_saver.h" #include "os/dir_access.h" #include "os/file_access.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "scene/resources/packed_scene.h" -#include "globals.h" +#include "global_config.h" Vector<uint8_t> EditorSceneExportPlugin::custom_export(String& p_path,const Ref<EditorExportPlatform> &p_platform) { diff --git a/tools/editor/io_plugins/editor_export_scene.h b/editor/io_plugins/editor_export_scene.h index 191029bd84..ac425fbedd 100644 --- a/tools/editor/io_plugins/editor_export_scene.h +++ b/editor/io_plugins/editor_export_scene.h @@ -29,7 +29,7 @@ #ifndef EDITOR_EXPORT_SCENE_H #define EDITOR_EXPORT_SCENE_H -#include "tools/editor/editor_import_export.h" +#include "editor/editor_export.h" #if 0 class EditorSceneExportPlugin : public EditorExportPlugin { diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/editor/io_plugins/editor_font_import_plugin.cpp index 417aad0db8..c792ad717a 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/editor/io_plugins/editor_font_import_plugin.cpp @@ -29,8 +29,8 @@ #include "editor_font_import_plugin.h" #if 0 #include "scene/gui/dialogs.h" -#include "tools/editor/editor_file_dialog.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_file_dialog.h" +#include "editor/editor_node.h" #include "os/file_access.h" #include "editor_atlas.h" #include "io/image_loader.h" diff --git a/tools/editor/io_plugins/editor_font_import_plugin.h b/editor/io_plugins/editor_font_import_plugin.h index a5b265736f..315a80e8cd 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.h +++ b/editor/io_plugins/editor_font_import_plugin.h @@ -29,7 +29,7 @@ #ifndef EDITOR_FONT_IMPORT_PLUGIN_H #define EDITOR_FONT_IMPORT_PLUGIN_H -#include "tools/editor/editor_import_export.h" +#include "editor/editor_export.h" #include "scene/resources/font.h" #if 0 class EditorNode; diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/editor/io_plugins/editor_mesh_import_plugin.cpp index fc3f8fd8c9..df9d0a62e6 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp +++ b/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -30,10 +30,10 @@ #if 0 -#include "tools/editor/editor_file_dialog.h" -#include "tools/editor/editor_dir_dialog.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/property_editor.h" +#include "editor/editor_file_dialog.h" +#include "editor/editor_dir_dialog.h" +#include "editor/editor_node.h" +#include "editor/property_editor.h" //#include "scene/resources/sample.h" #include "io/resource_saver.h" #include "os/file_access.h" diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.h b/editor/io_plugins/editor_mesh_import_plugin.h index ba8ec58191..df374549d4 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.h +++ b/editor/io_plugins/editor_mesh_import_plugin.h @@ -30,7 +30,7 @@ #define EDITOR_MESH_IMPORT_PLUGIN_H #if 0 -#include "tools/editor/editor_import_export.h" +#include "editor/editor_import_export.h" #include "scene/resources/font.h" class EditorNode; diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/editor/io_plugins/editor_sample_import_plugin.cpp index 631291ec1b..d446d39027 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/editor/io_plugins/editor_sample_import_plugin.cpp @@ -28,14 +28,14 @@ /*************************************************************************/ #include "editor_sample_import_plugin.h" -#include "tools/editor/editor_file_dialog.h" -#include "tools/editor/editor_dir_dialog.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/property_editor.h" +#include "editor/editor_file_dialog.h" +#include "editor/editor_dir_dialog.h" +#include "editor/editor_node.h" +#include "editor/property_editor.h" #include "io/resource_saver.h" #include "os/file_access.h" #include "io/marshalls.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #if 0 diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.h b/editor/io_plugins/editor_sample_import_plugin.h index 8e02d0e11d..6085043a83 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.h +++ b/editor/io_plugins/editor_sample_import_plugin.h @@ -30,7 +30,7 @@ #define EDITOR_SAMPLE_IMPORT_PLUGIN_H #if 0 -#include "tools/editor/editor_import_export.h" +#include "editor/editor_import_export.h" #include "scene/resources/font.h" class EditorNode; diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/editor/io_plugins/editor_scene_import_plugin.cpp index bffccb9072..963968ce47 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/editor/io_plugins/editor_scene_import_plugin.cpp @@ -28,8 +28,8 @@ /*************************************************************************/ #include "editor_scene_import_plugin.h" #if 0 -#include "globals.h" -#include "tools/editor/editor_node.h" +#include "global_config.h" +#include "editor/editor_node.h" #include "scene/resources/packed_scene.h" #include "scene/resources/box_shape.h" #include "os/file_access.h" @@ -47,7 +47,7 @@ #include <scene/resources/box_shape.h> #include <scene/resources/ray_shape.h> #include <scene/resources/plane_shape.h> -#include "tools/editor/create_dialog.h" +#include "editor/create_dialog.h" #include "os/os.h" diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.h b/editor/io_plugins/editor_scene_import_plugin.h index bbafc126bb..2ae0693600 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.h +++ b/editor/io_plugins/editor_scene_import_plugin.h @@ -39,10 +39,10 @@ #include "scene/gui/slider.h" #include "scene/gui/spin_box.h" #include "scene/resources/mesh.h" -#include "tools/editor/editor_file_system.h" -#include "tools/editor/editor_dir_dialog.h" -#include "tools/editor/editor_import_export.h" -#include "tools/editor/io_plugins/editor_texture_import_plugin.h" +#include "editor/editor_file_system.h" +#include "editor/editor_dir_dialog.h" +#include "editor/editor_import_export.h" +#include "editor/io_plugins/editor_texture_import_plugin.h" #include "scene/resources/animation.h" diff --git a/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp b/editor/io_plugins/editor_scene_importer_fbxconv.cpp index af12d85650..d75a26a948 100644 --- a/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp +++ b/editor/io_plugins/editor_scene_importer_fbxconv.cpp @@ -30,7 +30,7 @@ #include "os/file_access.h" #include "os/os.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "scene/3d/mesh_instance.h" #include "scene/animation/animation_player.h" diff --git a/tools/editor/io_plugins/editor_scene_importer_fbxconv.h b/editor/io_plugins/editor_scene_importer_fbxconv.h index 1bf96ba0e5..da7058ad88 100644 --- a/tools/editor/io_plugins/editor_scene_importer_fbxconv.h +++ b/editor/io_plugins/editor_scene_importer_fbxconv.h @@ -29,7 +29,7 @@ #ifndef EDITOR_SCENE_IMPORTER_FBXCONV_H #define EDITOR_SCENE_IMPORTER_FBXCONV_H -#include "tools/editor/io_plugins/editor_scene_import_plugin.h" +#include "editor/io_plugins/editor_scene_import_plugin.h" #include "scene/3d/skeleton.h" #if 0 diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/editor/io_plugins/editor_texture_import_plugin.cpp index c41199f291..8bafe80673 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/editor/io_plugins/editor_texture_import_plugin.cpp @@ -29,13 +29,13 @@ #include "editor_texture_import_plugin.h" #if 0 #include "io/image_loader.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_node.h" #include "io/resource_saver.h" #include "editor_atlas.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "io/md5.h" #include "io/marshalls.h" -#include "globals.h" +#include "global_config.h" #include "scene/gui/check_button.h" #include "scene/gui/button_group.h" #include "scene/gui/margin_container.h" diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.h b/editor/io_plugins/editor_texture_import_plugin.h index ce15df0f18..f63bc57ecd 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.h +++ b/editor/io_plugins/editor_texture_import_plugin.h @@ -35,7 +35,7 @@ #if 0 -#include "tools/editor/editor_import_export.h" +#include "editor/editor_import_export.h" #include "scene/gui/dialogs.h" #include "scene/gui/tree.h" #include "scene/gui/label.h" @@ -45,8 +45,8 @@ #include "scene/gui/progress_bar.h" #include "scene/gui/slider.h" #include "scene/gui/spin_box.h" -#include "tools/editor/editor_file_system.h" -#include "tools/editor/editor_dir_dialog.h" +#include "editor/editor_file_system.h" +#include "editor/editor_dir_dialog.h" diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.cpp b/editor/io_plugins/editor_translation_import_plugin.cpp index 5ecb0b1abf..0fd298d6d3 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.cpp +++ b/editor/io_plugins/editor_translation_import_plugin.cpp @@ -30,15 +30,15 @@ #if 0 #include "scene/gui/file_dialog.h" -#include "tools/editor/editor_dir_dialog.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/property_editor.h" +#include "editor/editor_dir_dialog.h" +#include "editor/editor_node.h" +#include "editor/property_editor.h" //#include "scene/resources/sample.h" #include "io/resource_saver.h" #include "os/file_access.h" #include "translation.h" #include "compressed_translation.h" -#include "tools/editor/project_settings.h" +#include "editor/project_settings.h" class EditorTranslationImportDialog : public ConfirmationDialog { diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.h b/editor/io_plugins/editor_translation_import_plugin.h index 4884ea71c5..030c5bbf6f 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.h +++ b/editor/io_plugins/editor_translation_import_plugin.h @@ -29,7 +29,7 @@ #ifndef EDITOR_TRANSLATION_IMPORT_PLUGIN_H #define EDITOR_TRANSLATION_IMPORT_PLUGIN_H -#include "tools/editor/editor_import_export.h" +#include "editor/editor_export.h" #include "scene/resources/font.h" #if 0 class EditorNode; diff --git a/tools/editor/multi_node_edit.cpp b/editor/multi_node_edit.cpp index 97a996fe48..0428d7ef30 100644 --- a/tools/editor/multi_node_edit.cpp +++ b/editor/multi_node_edit.cpp @@ -29,17 +29,23 @@ #include "multi_node_edit.h" #include "editor_node.h" +#include "core/helper/math_fieldwise.h" bool MultiNodeEdit::_set(const StringName& p_name, const Variant& p_value){ + return _set_impl(p_name, p_value, ""); +} + +bool MultiNodeEdit::_set_impl(const StringName& p_name, const Variant& p_value, const String& p_field) { + Node *es = EditorNode::get_singleton()->get_edited_scene(); if (!es) return false; String name = p_name; - if (name=="scripts/script") { // script/script set is intercepted at object level (check Variant Object::get() ) ,so use a different name - name="script/script"; + if (name=="scripts") { // script set is intercepted at object level (check Variant Object::get() ) ,so use a different name + name="script"; } UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); @@ -59,7 +65,15 @@ bool MultiNodeEdit::_set(const StringName& p_name, const Variant& p_value){ NodePath p_path = n->get_path_to(tonode); ur->add_do_property(n,name,p_path); } else { - ur->add_do_property(n,name,p_value); + Variant new_value; + if (p_field=="") { + // whole value + new_value=p_value; + } else { + // only one field + new_value=fieldwise_assign(n->get(name),p_value,p_field); + } + ur->add_do_property(n,name,new_value); } ur->add_undo_property(n,name,n->get(name)); @@ -80,8 +94,8 @@ bool MultiNodeEdit::_get(const StringName& p_name,Variant &r_ret) const { return false; String name=p_name; - if (name=="scripts/script") { // script/script set is intercepted at object level (check Variant Object::get() ) ,so use a different name - name="script/script"; + if (name=="scripts") { // script set is intercepted at object level (check Variant Object::get() ) ,so use a different name + name="script"; } for (const List<NodePath>::Element *E=nodes.front();E;E=E->next()) { @@ -129,7 +143,7 @@ void MultiNodeEdit::_get_property_list( List<PropertyInfo> *p_list) const{ for(List<PropertyInfo>::Element *F=plist.front();F;F=F->next()) { - if (F->get().name=="script/script") + if (F->get().name=="script") continue; //added later manually, since this is intercepted before being set (check Variant Object::get() ) if (!usage.has(F->get().name)) { PLData pld; @@ -152,7 +166,7 @@ void MultiNodeEdit::_get_property_list( List<PropertyInfo> *p_list) const{ } } - p_list->push_back(PropertyInfo(Variant::OBJECT,"scripts/script",PROPERTY_HINT_RESOURCE_TYPE,"Script")); + p_list->push_back(PropertyInfo(Variant::OBJECT,"scripts",PROPERTY_HINT_RESOURCE_TYPE,"Script")); } @@ -167,6 +181,11 @@ void MultiNodeEdit::add_node(const NodePath& p_node){ nodes.push_back(p_node); } +void MultiNodeEdit::set_property_field(const StringName& p_property, const Variant& p_value, const String& p_field) { + + _set_impl(p_property, p_value, p_field); +} + MultiNodeEdit::MultiNodeEdit() { } diff --git a/tools/editor/multi_node_edit.h b/editor/multi_node_edit.h index 290c529d48..26e557c1cb 100644 --- a/tools/editor/multi_node_edit.h +++ b/editor/multi_node_edit.h @@ -41,6 +41,8 @@ class MultiNodeEdit : public Reference { PropertyInfo info; }; + bool _set_impl(const StringName& p_name, const Variant& p_value, const String& p_field); + protected: @@ -55,6 +57,8 @@ public: void clear_nodes(); void add_node(const NodePath& p_node); + void set_property_field(const StringName& p_property, const Variant& p_value, const String& p_field); + MultiNodeEdit(); }; diff --git a/tools/editor/node_dock.cpp b/editor/node_dock.cpp index 3d906cf960..fed3d2efb4 100644 --- a/tools/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -49,8 +49,8 @@ void NodeDock::show_connections(){ void NodeDock::_bind_methods() { - ClassDB::bind_method(_MD("show_groups"),&NodeDock::show_groups); - ClassDB::bind_method(_MD("show_connections"),&NodeDock::show_connections); + ClassDB::bind_method(D_METHOD("show_groups"),&NodeDock::show_groups); + ClassDB::bind_method(D_METHOD("show_connections"),&NodeDock::show_connections); } void NodeDock::_notification(int p_what) { diff --git a/tools/editor/node_dock.h b/editor/node_dock.h index df41ecf5bd..df41ecf5bd 100644 --- a/tools/editor/node_dock.h +++ b/editor/node_dock.h diff --git a/tools/editor/output_strings.cpp b/editor/output_strings.cpp index cb43bb9230..cb43bb9230 100644 --- a/tools/editor/output_strings.cpp +++ b/editor/output_strings.cpp diff --git a/tools/editor/output_strings.h b/editor/output_strings.h index cc721ef652..cc721ef652 100644 --- a/tools/editor/output_strings.h +++ b/editor/output_strings.h diff --git a/tools/editor/pane_drag.cpp b/editor/pane_drag.cpp index 122abd37b9..122abd37b9 100644 --- a/tools/editor/pane_drag.cpp +++ b/editor/pane_drag.cpp diff --git a/tools/editor/pane_drag.h b/editor/pane_drag.h index 8796fc2594..8796fc2594 100644 --- a/tools/editor/pane_drag.h +++ b/editor/pane_drag.h diff --git a/tools/editor/plugins/SCsub b/editor/plugins/SCsub index f1fa50148f..f1fa50148f 100644 --- a/tools/editor/plugins/SCsub +++ b/editor/plugins/SCsub diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index f10526fb77..2e6792bbaa 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -28,12 +28,12 @@ /*************************************************************************/ #include "animation_player_editor_plugin.h" -#include "globals.h" +#include "global_config.h" #include "io/resource_loader.h" #include "io/resource_saver.h" #include "os/keyboard.h" -#include "tools/editor/editor_settings.h" -#include "tools/editor/animation_editor.h" +#include "editor/editor_settings.h" +#include "editor/animation_editor.h" void AnimationPlayerEditor::_node_removed(Node *p_node) { @@ -1258,43 +1258,43 @@ void AnimationPlayerEditor::_unhandled_key_input(const InputEvent& p_ev) { void AnimationPlayerEditor::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&AnimationPlayerEditor::_gui_input); - ClassDB::bind_method(_MD("_node_removed"),&AnimationPlayerEditor::_node_removed); - ClassDB::bind_method(_MD("_play_pressed"),&AnimationPlayerEditor::_play_pressed); - ClassDB::bind_method(_MD("_play_from_pressed"),&AnimationPlayerEditor::_play_from_pressed); - ClassDB::bind_method(_MD("_play_bw_pressed"),&AnimationPlayerEditor::_play_bw_pressed); - ClassDB::bind_method(_MD("_play_bw_from_pressed"),&AnimationPlayerEditor::_play_bw_from_pressed); - ClassDB::bind_method(_MD("_stop_pressed"),&AnimationPlayerEditor::_stop_pressed); - ClassDB::bind_method(_MD("_autoplay_pressed"),&AnimationPlayerEditor::_autoplay_pressed); - ClassDB::bind_method(_MD("_pause_pressed"),&AnimationPlayerEditor::_pause_pressed); - ClassDB::bind_method(_MD("_animation_selected"),&AnimationPlayerEditor::_animation_selected); - ClassDB::bind_method(_MD("_animation_name_edited"),&AnimationPlayerEditor::_animation_name_edited); - ClassDB::bind_method(_MD("_animation_new"),&AnimationPlayerEditor::_animation_new); - ClassDB::bind_method(_MD("_animation_rename"),&AnimationPlayerEditor::_animation_rename); - ClassDB::bind_method(_MD("_animation_load"),&AnimationPlayerEditor::_animation_load); - ClassDB::bind_method(_MD("_animation_remove"),&AnimationPlayerEditor::_animation_remove); - ClassDB::bind_method(_MD("_animation_remove_confirmed"),&AnimationPlayerEditor::_animation_remove_confirmed); - ClassDB::bind_method(_MD("_animation_blend"),&AnimationPlayerEditor::_animation_blend); - ClassDB::bind_method(_MD("_animation_edit"),&AnimationPlayerEditor::_animation_edit); - ClassDB::bind_method(_MD("_animation_resource_edit"),&AnimationPlayerEditor::_animation_resource_edit); - ClassDB::bind_method(_MD("_dialog_action"),&AnimationPlayerEditor::_dialog_action); - ClassDB::bind_method(_MD("_seek_value_changed"),&AnimationPlayerEditor::_seek_value_changed,DEFVAL(true)); - ClassDB::bind_method(_MD("_animation_player_changed"),&AnimationPlayerEditor::_animation_player_changed); - ClassDB::bind_method(_MD("_blend_edited"),&AnimationPlayerEditor::_blend_edited); - //ClassDB::bind_method(_MD("_seek_frame_changed"),&AnimationPlayerEditor::_seek_frame_changed); - ClassDB::bind_method(_MD("_scale_changed"),&AnimationPlayerEditor::_scale_changed); - //ClassDB::bind_method(_MD("_editor_store_all"),&AnimationPlayerEditor::_editor_store_all); - ///jectTypeDB::bind_method(_MD("_editor_load_all"),&AnimationPlayerEditor::_editor_load_all); - ClassDB::bind_method(_MD("_list_changed"),&AnimationPlayerEditor::_list_changed); - ClassDB::bind_method(_MD("_animation_key_editor_seek"),&AnimationPlayerEditor::_animation_key_editor_seek); - ClassDB::bind_method(_MD("_animation_key_editor_anim_len_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_len_changed); - ClassDB::bind_method(_MD("_animation_key_editor_anim_step_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_step_changed); - ClassDB::bind_method(_MD("_hide_anim_editors"),&AnimationPlayerEditor::_hide_anim_editors); - ClassDB::bind_method(_MD("_animation_duplicate"),&AnimationPlayerEditor::_animation_duplicate); - ClassDB::bind_method(_MD("_blend_editor_next_changed"),&AnimationPlayerEditor::_blend_editor_next_changed); - ClassDB::bind_method(_MD("_unhandled_key_input"),&AnimationPlayerEditor::_unhandled_key_input); - ClassDB::bind_method(_MD("_animation_tool_menu"),&AnimationPlayerEditor::_animation_tool_menu); - ClassDB::bind_method(_MD("_animation_save_menu"), &AnimationPlayerEditor::_animation_save_menu); + ClassDB::bind_method(D_METHOD("_gui_input"),&AnimationPlayerEditor::_gui_input); + ClassDB::bind_method(D_METHOD("_node_removed"),&AnimationPlayerEditor::_node_removed); + ClassDB::bind_method(D_METHOD("_play_pressed"),&AnimationPlayerEditor::_play_pressed); + ClassDB::bind_method(D_METHOD("_play_from_pressed"),&AnimationPlayerEditor::_play_from_pressed); + ClassDB::bind_method(D_METHOD("_play_bw_pressed"),&AnimationPlayerEditor::_play_bw_pressed); + ClassDB::bind_method(D_METHOD("_play_bw_from_pressed"),&AnimationPlayerEditor::_play_bw_from_pressed); + ClassDB::bind_method(D_METHOD("_stop_pressed"),&AnimationPlayerEditor::_stop_pressed); + ClassDB::bind_method(D_METHOD("_autoplay_pressed"),&AnimationPlayerEditor::_autoplay_pressed); + ClassDB::bind_method(D_METHOD("_pause_pressed"),&AnimationPlayerEditor::_pause_pressed); + ClassDB::bind_method(D_METHOD("_animation_selected"),&AnimationPlayerEditor::_animation_selected); + ClassDB::bind_method(D_METHOD("_animation_name_edited"),&AnimationPlayerEditor::_animation_name_edited); + ClassDB::bind_method(D_METHOD("_animation_new"),&AnimationPlayerEditor::_animation_new); + ClassDB::bind_method(D_METHOD("_animation_rename"),&AnimationPlayerEditor::_animation_rename); + ClassDB::bind_method(D_METHOD("_animation_load"),&AnimationPlayerEditor::_animation_load); + ClassDB::bind_method(D_METHOD("_animation_remove"),&AnimationPlayerEditor::_animation_remove); + ClassDB::bind_method(D_METHOD("_animation_remove_confirmed"),&AnimationPlayerEditor::_animation_remove_confirmed); + ClassDB::bind_method(D_METHOD("_animation_blend"),&AnimationPlayerEditor::_animation_blend); + ClassDB::bind_method(D_METHOD("_animation_edit"),&AnimationPlayerEditor::_animation_edit); + ClassDB::bind_method(D_METHOD("_animation_resource_edit"),&AnimationPlayerEditor::_animation_resource_edit); + ClassDB::bind_method(D_METHOD("_dialog_action"),&AnimationPlayerEditor::_dialog_action); + ClassDB::bind_method(D_METHOD("_seek_value_changed"),&AnimationPlayerEditor::_seek_value_changed,DEFVAL(true)); + ClassDB::bind_method(D_METHOD("_animation_player_changed"),&AnimationPlayerEditor::_animation_player_changed); + ClassDB::bind_method(D_METHOD("_blend_edited"),&AnimationPlayerEditor::_blend_edited); + //ClassDB::bind_method(D_METHOD("_seek_frame_changed"),&AnimationPlayerEditor::_seek_frame_changed); + ClassDB::bind_method(D_METHOD("_scale_changed"),&AnimationPlayerEditor::_scale_changed); + //ClassDB::bind_method(D_METHOD("_editor_store_all"),&AnimationPlayerEditor::_editor_store_all); + //ClassDB::bind_method(D_METHOD("_editor_load_all"),&AnimationPlayerEditor::_editor_load_all); + ClassDB::bind_method(D_METHOD("_list_changed"),&AnimationPlayerEditor::_list_changed); + ClassDB::bind_method(D_METHOD("_animation_key_editor_seek"),&AnimationPlayerEditor::_animation_key_editor_seek); + ClassDB::bind_method(D_METHOD("_animation_key_editor_anim_len_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_len_changed); + ClassDB::bind_method(D_METHOD("_animation_key_editor_anim_step_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_step_changed); + ClassDB::bind_method(D_METHOD("_hide_anim_editors"),&AnimationPlayerEditor::_hide_anim_editors); + ClassDB::bind_method(D_METHOD("_animation_duplicate"),&AnimationPlayerEditor::_animation_duplicate); + ClassDB::bind_method(D_METHOD("_blend_editor_next_changed"),&AnimationPlayerEditor::_blend_editor_next_changed); + ClassDB::bind_method(D_METHOD("_unhandled_key_input"),&AnimationPlayerEditor::_unhandled_key_input); + ClassDB::bind_method(D_METHOD("_animation_tool_menu"),&AnimationPlayerEditor::_animation_tool_menu); + ClassDB::bind_method(D_METHOD("_animation_save_menu"), &AnimationPlayerEditor::_animation_save_menu); diff --git a/tools/editor/plugins/animation_player_editor_plugin.h b/editor/plugins/animation_player_editor_plugin.h index e28600a7ab..d9b6ad52ff 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.h +++ b/editor/plugins/animation_player_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef ANIMATION_PLAYER_EDITOR_PLUGIN_H #define ANIMATION_PLAYER_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/animation/animation_player.h" #include "scene/gui/dialogs.h" #include "scene/gui/texture_button.h" diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index 1ed52d2df6..988136d475 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -32,7 +32,7 @@ #include "scene/gui/panel.h" #include "scene/main/viewport.h" #include "core/io/resource_loader.h" -#include "core/globals.h" +#include "core/global_config.h" #include "os/input.h" #include "os/keyboard.h" diff --git a/tools/editor/plugins/animation_tree_editor_plugin.h b/editor/plugins/animation_tree_editor_plugin.h index 253ad1878d..4e5fb871f1 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.h +++ b/editor/plugins/animation_tree_editor_plugin.h @@ -29,13 +29,13 @@ #ifndef ANIMATION_TREE_EDITOR_PLUGIN_H #define ANIMATION_TREE_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/animation/animation_tree_player.h" #include "scene/gui/tree.h" #include "scene/gui/button.h" #include "scene/gui/popup.h" -#include "tools/editor/property_editor.h" +#include "editor/property_editor.h" /** @author Juan Linietsky <reduzio@gmail.com> */ diff --git a/tools/editor/plugins/baked_light_baker.cpp b/editor/plugins/baked_light_baker.cpp index 52220839d9..e491fe012e 100644 --- a/tools/editor/plugins/baked_light_baker.cpp +++ b/editor/plugins/baked_light_baker.cpp @@ -31,8 +31,8 @@ #include <stdlib.h> #include <cmath> #include "io/marshalls.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_node.h" +#include "editor/editor_settings.h" #if 0 void baked_light_baker_add_64f(double *dst,double value); @@ -1334,7 +1334,7 @@ void BakedLightBaker::_make_octree_texture() { base<<=16; base|=int((pos.z+cell_size*0.5)/cell_size); - uint32_t hash = HashMapHahserDefault::hash(base); + uint32_t hash = HashMapHasherDefault::hash(base); uint32_t idx = hash % hash_table_size; octhashptr[oct_idx].next=hashptr[idx]; octhashptr[oct_idx].hash=hash; @@ -1362,7 +1362,7 @@ void BakedLightBaker::_make_octree_texture() { base<<=16; base|=int((pos.z+cell_size*0.5)/cell_size); - uint32_t hash = HashMapHahserDefault::hash(base); + uint32_t hash = HashMapHasherDefault::hash(base); uint32_t idx = hash % hash_table_size; uint32_t bucket = hashptr[idx]; diff --git a/tools/editor/plugins/baked_light_baker.h b/editor/plugins/baked_light_baker.h index 89788338d9..89788338d9 100644 --- a/tools/editor/plugins/baked_light_baker.h +++ b/editor/plugins/baked_light_baker.h diff --git a/tools/editor/plugins/baked_light_baker_cmpxchg.cpp b/editor/plugins/baked_light_baker_cmpxchg.cpp index 5e9228b7de..5e9228b7de 100644 --- a/tools/editor/plugins/baked_light_baker_cmpxchg.cpp +++ b/editor/plugins/baked_light_baker_cmpxchg.cpp diff --git a/tools/editor/plugins/baked_light_editor_plugin.cpp b/editor/plugins/baked_light_editor_plugin.cpp index 6a7e708b85..6a7e708b85 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.cpp +++ b/editor/plugins/baked_light_editor_plugin.cpp diff --git a/tools/editor/plugins/baked_light_editor_plugin.h b/editor/plugins/baked_light_editor_plugin.h index e311fe9f17..a71de12bcc 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.h +++ b/editor/plugins/baked_light_editor_plugin.h @@ -29,9 +29,9 @@ #ifndef BAKED_LIGHT_EDITOR_PLUGIN_H #define BAKED_LIGHT_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/plugins/baked_light_baker.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" +#include "editor/plugins/baked_light_baker.h" #include "scene/gui/spin_box.h" diff --git a/tools/editor/plugins/camera_editor_plugin.cpp b/editor/plugins/camera_editor_plugin.cpp index 1e0ec2b4a0..7073acd2c0 100644 --- a/tools/editor/plugins/camera_editor_plugin.cpp +++ b/editor/plugins/camera_editor_plugin.cpp @@ -62,7 +62,7 @@ void CameraEditor::_pressed() { void CameraEditor::_bind_methods() { - ClassDB::bind_method(_MD("_pressed"),&CameraEditor::_pressed); + ClassDB::bind_method(D_METHOD("_pressed"),&CameraEditor::_pressed); } diff --git a/tools/editor/plugins/camera_editor_plugin.h b/editor/plugins/camera_editor_plugin.h index 7e79d0ec74..b5817b9960 100644 --- a/tools/editor/plugins/camera_editor_plugin.h +++ b/editor/plugins/camera_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef CAMERA_EDITOR_PLUGIN_H #define CAMERA_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/3d/camera.h" /** diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index bec7956b8c..1a0791d864 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -29,7 +29,7 @@ #include "canvas_item_editor_plugin.h" #include "print_string.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_node.h" #include "os/keyboard.h" #include "scene/main/viewport.h" #include "scene/main/canvas_layer.h" @@ -38,15 +38,15 @@ #include "scene/2d/particles_2d.h" #include "scene/2d/polygon_2d.h" #include "scene/2d/screen_button.h" -#include "globals.h" +#include "global_config.h" #include "os/input.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "scene/gui/grid_container.h" #include "scene/gui/patch_9_rect.h" -#include "tools/editor/animation_editor.h" -#include "tools/editor/plugins/animation_player_editor_plugin.h" -#include "tools/editor/script_editor_debugger.h" -#include "tools/editor/plugins/script_editor_plugin.h" +#include "editor/animation_editor.h" +#include "editor/plugins/animation_player_editor_plugin.h" +#include "editor/script_editor_debugger.h" +#include "editor/plugins/script_editor_plugin.h" #include "scene/resources/packed_scene.h" @@ -3212,8 +3212,8 @@ void CanvasItemEditor::_bind_methods() { ClassDB::bind_method("_viewport_draw",&CanvasItemEditor::_viewport_draw); ClassDB::bind_method("_viewport_gui_input",&CanvasItemEditor::_viewport_gui_input); ClassDB::bind_method("_snap_changed",&CanvasItemEditor::_snap_changed); - ClassDB::bind_method(_MD("_selection_result_pressed"),&CanvasItemEditor::_selection_result_pressed); - ClassDB::bind_method(_MD("_selection_menu_hide"),&CanvasItemEditor::_selection_menu_hide); + ClassDB::bind_method(D_METHOD("_selection_result_pressed"),&CanvasItemEditor::_selection_result_pressed); + ClassDB::bind_method(D_METHOD("_selection_menu_hide"),&CanvasItemEditor::_selection_menu_hide); ADD_SIGNAL( MethodInfo("item_lock_status_changed") ); ADD_SIGNAL( MethodInfo("item_group_status_changed") ); @@ -3984,9 +3984,9 @@ void CanvasItemEditorViewport::_notification(int p_what) { } void CanvasItemEditorViewport::_bind_methods() { - ClassDB::bind_method(_MD("_on_select_type"),&CanvasItemEditorViewport::_on_select_type); - ClassDB::bind_method(_MD("_on_change_type"),&CanvasItemEditorViewport::_on_change_type); - ClassDB::bind_method(_MD("_on_mouse_exit"),&CanvasItemEditorViewport::_on_mouse_exit); + ClassDB::bind_method(D_METHOD("_on_select_type"),&CanvasItemEditorViewport::_on_select_type); + ClassDB::bind_method(D_METHOD("_on_change_type"),&CanvasItemEditorViewport::_on_change_type); + ClassDB::bind_method(D_METHOD("_on_mouse_exit"),&CanvasItemEditorViewport::_on_mouse_exit); } CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasItemEditor* p_canvas) { diff --git a/tools/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index dac8af5ae9..0c2dcdff3d 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef CONTROL_EDITOR_PLUGIN_H #define CONTROL_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/gui/button_group.h" #include "scene/gui/check_box.h" #include "scene/gui/label.h" diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/editor/plugins/collision_polygon_2d_editor_plugin.cpp index 263d96ecdf..5a45267c85 100644 --- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "canvas_item_editor_plugin.h" #include "os/file_access.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" void CollisionPolygon2DEditor::_notification(int p_what) { @@ -268,7 +268,7 @@ bool CollisionPolygon2DEditor::forward_gui_input(const InputEvent& p_event) { return true; } } - } if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) { + } else if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) { @@ -398,9 +398,9 @@ void CollisionPolygon2DEditor::edit(Node *p_collision_polygon) { void CollisionPolygon2DEditor::_bind_methods() { - ClassDB::bind_method(_MD("_menu_option"),&CollisionPolygon2DEditor::_menu_option); - ClassDB::bind_method(_MD("_canvas_draw"),&CollisionPolygon2DEditor::_canvas_draw); - ClassDB::bind_method(_MD("_node_removed"),&CollisionPolygon2DEditor::_node_removed); + ClassDB::bind_method(D_METHOD("_menu_option"),&CollisionPolygon2DEditor::_menu_option); + ClassDB::bind_method(D_METHOD("_canvas_draw"),&CollisionPolygon2DEditor::_canvas_draw); + ClassDB::bind_method(D_METHOD("_node_removed"),&CollisionPolygon2DEditor::_node_removed); } diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h b/editor/plugins/collision_polygon_2d_editor_plugin.h index 2c573c1dcf..796328753d 100644 --- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h +++ b/editor/plugins/collision_polygon_2d_editor_plugin.h @@ -30,8 +30,8 @@ #define COLLISION_POLYGON_2D_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/2d/collision_polygon_2d.h" #include "scene/gui/tool_button.h" #include "scene/gui/button_group.h" diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp index c5cd15cf72..3aad53b420 100644 --- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "spatial_editor_plugin.h" #include "os/file_access.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "scene/3d/camera.h" #include "canvas_item_editor_plugin.h" @@ -530,9 +530,9 @@ void CollisionPolygonEditor::edit(Node *p_collision_polygon) { void CollisionPolygonEditor::_bind_methods() { - ClassDB::bind_method(_MD("_menu_option"),&CollisionPolygonEditor::_menu_option); - ClassDB::bind_method(_MD("_polygon_draw"),&CollisionPolygonEditor::_polygon_draw); - ClassDB::bind_method(_MD("_node_removed"),&CollisionPolygonEditor::_node_removed); + ClassDB::bind_method(D_METHOD("_menu_option"),&CollisionPolygonEditor::_menu_option); + ClassDB::bind_method(D_METHOD("_polygon_draw"),&CollisionPolygonEditor::_polygon_draw); + ClassDB::bind_method(D_METHOD("_node_removed"),&CollisionPolygonEditor::_node_removed); } diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.h b/editor/plugins/collision_polygon_editor_plugin.h index cd722048db..aaad2174fe 100644 --- a/tools/editor/plugins/collision_polygon_editor_plugin.h +++ b/editor/plugins/collision_polygon_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef COLLISION_POLYGON_EDITOR_PLUGIN_H #define COLLISION_POLYGON_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/3d/collision_polygon.h" #include "scene/3d/immediate_geometry.h" #include "scene/3d/mesh_instance.h" diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp index a05eeb7a27..a05eeb7a27 100644 --- a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.h b/editor/plugins/collision_shape_2d_editor_plugin.h index 37708db5e0..f7e6da8b4e 100644 --- a/tools/editor/plugins/collision_shape_2d_editor_plugin.h +++ b/editor/plugins/collision_shape_2d_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef COLLISION_SHAPE_2D_EDITOR_PLUGIN_H #define COLLISION_SHAPE_2D_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/2d/collision_shape_2d.h" diff --git a/tools/editor/plugins/color_ramp_editor_plugin.cpp b/editor/plugins/color_ramp_editor_plugin.cpp index 9509eb1b03..82674fabb8 100644 --- a/tools/editor/plugins/color_ramp_editor_plugin.cpp +++ b/editor/plugins/color_ramp_editor_plugin.cpp @@ -107,6 +107,6 @@ ColorRampEditorPlugin::~ColorRampEditorPlugin(){ } void ColorRampEditorPlugin::_bind_methods() { - ClassDB::bind_method(_MD("ramp_changed"),&ColorRampEditorPlugin::_ramp_changed); - ClassDB::bind_method(_MD("undo_redo_color_ramp","offsets","colors"),&ColorRampEditorPlugin::_undo_redo_color_ramp); + ClassDB::bind_method(D_METHOD("ramp_changed"),&ColorRampEditorPlugin::_ramp_changed); + ClassDB::bind_method(D_METHOD("undo_redo_color_ramp","offsets","colors"),&ColorRampEditorPlugin::_undo_redo_color_ramp); } diff --git a/tools/editor/plugins/color_ramp_editor_plugin.h b/editor/plugins/color_ramp_editor_plugin.h index 2f55ad65f1..0323bd7a46 100644 --- a/tools/editor/plugins/color_ramp_editor_plugin.h +++ b/editor/plugins/color_ramp_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef TOOLS_EDITOR_PLUGINS_COLOR_RAMP_EDITOR_PLUGIN_H_ #define TOOLS_EDITOR_PLUGINS_COLOR_RAMP_EDITOR_PLUGIN_H_ -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/gui/color_ramp_edit.h" class ColorRampEditorPlugin : public EditorPlugin { diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp b/editor/plugins/cube_grid_theme_editor_plugin.cpp index 563b8298eb..b8abd2e9cc 100644 --- a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp +++ b/editor/plugins/cube_grid_theme_editor_plugin.cpp @@ -33,9 +33,9 @@ #include "scene/3d/physics_body.h" #include "scene/main/viewport.h" #include "scene/resources/packed_scene.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_node.h" #include "main/main.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "scene/3d/navigation_mesh.h" void MeshLibraryEditor::edit(const Ref<MeshLibrary>& p_theme) { diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.h b/editor/plugins/cube_grid_theme_editor_plugin.h index f32f601023..07e7c7cadd 100644 --- a/tools/editor/plugins/cube_grid_theme_editor_plugin.h +++ b/editor/plugins/cube_grid_theme_editor_plugin.h @@ -30,7 +30,7 @@ #define CUBE_GRID_THEME_EDITOR_PLUGIN_H #include "scene/resources/mesh_library.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_node.h" #if 0 class MeshLibraryEditor : public Control { diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 5d9b281874..3f31f1e0f1 100644 --- a/tools/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -29,14 +29,14 @@ #include "editor_preview_plugins.h" #include "io/resource_loader.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "io/file_access_memory.h" #include "os/os.h" #include "scene/resources/material.h" //#include "scene/resources/sample.h" #include "scene/resources/mesh.h" #include "scene/resources/bit_mask.h" -#include "tools/editor/editor_scale.h" +#include "editor/editor_scale.h" #if 0 bool EditorTexturePreviewPlugin::handles(const String& p_type) const { diff --git a/tools/editor/plugins/editor_preview_plugins.h b/editor/plugins/editor_preview_plugins.h index 078e4cf8b5..b1d4fa0b38 100644 --- a/tools/editor/plugins/editor_preview_plugins.h +++ b/editor/plugins/editor_preview_plugins.h @@ -29,7 +29,7 @@ #ifndef EDITORPREVIEWPLUGINS_H #define EDITORPREVIEWPLUGINS_H -#include "tools/editor/editor_resource_preview.h" +#include "editor/editor_resource_preview.h" #if 0 class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator { diff --git a/tools/editor/plugins/gi_probe_editor_plugin.cpp b/editor/plugins/gi_probe_editor_plugin.cpp index 39f32d0dc7..925ac8ef11 100644 --- a/tools/editor/plugins/gi_probe_editor_plugin.cpp +++ b/editor/plugins/gi_probe_editor_plugin.cpp @@ -80,6 +80,4 @@ GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) { GIProbeEditorPlugin::~GIProbeEditorPlugin() { - - memdelete(bake); } diff --git a/tools/editor/plugins/gi_probe_editor_plugin.h b/editor/plugins/gi_probe_editor_plugin.h index 35e0b93aae..982a549368 100644 --- a/tools/editor/plugins/gi_probe_editor_plugin.h +++ b/editor/plugins/gi_probe_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef GIPROBEEDITORPLUGIN_H #define GIPROBEEDITORPLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/resources/material.h" #include "scene/3d/gi_probe.h" diff --git a/tools/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp index f31074a9dc..f31074a9dc 100644 --- a/tools/editor/plugins/item_list_editor_plugin.cpp +++ b/editor/plugins/item_list_editor_plugin.cpp diff --git a/tools/editor/plugins/item_list_editor_plugin.h b/editor/plugins/item_list_editor_plugin.h index 74700d615e..25d6ed6757 100644 --- a/tools/editor/plugins/item_list_editor_plugin.h +++ b/editor/plugins/item_list_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef ITEM_LIST_EDITOR_PLUGIN_H #define ITEM_LIST_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "canvas_item_editor_plugin.h" #include "scene/gui/option_button.h" diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp b/editor/plugins/light_occluder_2d_editor_plugin.cpp index f6a51632a0..be9e52e241 100644 --- a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "canvas_item_editor_plugin.h" #include "os/file_access.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" void LightOccluder2DEditor::_notification(int p_what) { @@ -283,7 +283,7 @@ bool LightOccluder2DEditor::forward_gui_input(const InputEvent& p_event) { return true; } } - } if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) { + } else if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) { @@ -427,10 +427,10 @@ void LightOccluder2DEditor::_create_poly() { void LightOccluder2DEditor::_bind_methods() { - ClassDB::bind_method(_MD("_menu_option"),&LightOccluder2DEditor::_menu_option); - ClassDB::bind_method(_MD("_canvas_draw"),&LightOccluder2DEditor::_canvas_draw); - ClassDB::bind_method(_MD("_node_removed"),&LightOccluder2DEditor::_node_removed); - ClassDB::bind_method(_MD("_create_poly"),&LightOccluder2DEditor::_create_poly); + ClassDB::bind_method(D_METHOD("_menu_option"),&LightOccluder2DEditor::_menu_option); + ClassDB::bind_method(D_METHOD("_canvas_draw"),&LightOccluder2DEditor::_canvas_draw); + ClassDB::bind_method(D_METHOD("_node_removed"),&LightOccluder2DEditor::_node_removed); + ClassDB::bind_method(D_METHOD("_create_poly"),&LightOccluder2DEditor::_create_poly); } diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.h b/editor/plugins/light_occluder_2d_editor_plugin.h index 431c01fe75..1f1c6e86eb 100644 --- a/tools/editor/plugins/light_occluder_2d_editor_plugin.h +++ b/editor/plugins/light_occluder_2d_editor_plugin.h @@ -31,8 +31,8 @@ -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/2d/light_occluder_2d.h" #include "scene/gui/tool_button.h" #include "scene/gui/button_group.h" diff --git a/editor/plugins/line_2d_editor_plugin.cpp b/editor/plugins/line_2d_editor_plugin.cpp new file mode 100644 index 0000000000..4a0f90a2b4 --- /dev/null +++ b/editor/plugins/line_2d_editor_plugin.cpp @@ -0,0 +1,311 @@ +/*************************************************************************/ +/* line_2d_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "line_2d_editor_plugin.h" + +#include "canvas_item_editor_plugin.h" +#include "os/file_access.h" +#include "editor/editor_settings.h" +#include "os/keyboard.h" + + +//---------------------------------------------------------------------------- +// Line2DEditor +//---------------------------------------------------------------------------- + +void Line2DEditor::_node_removed(Node *p_node) { + if(p_node == node) { + node=NULL; + hide(); + } +} + +void Line2DEditor::_notification(int p_what) { + switch(p_what) { + case NOTIFICATION_VISIBILITY_CHANGED: + // This widget is not a child but should have the same visibility state + base_hb->set_visible(is_visible()); + break; + } +} + +Vector2 Line2DEditor::mouse_to_local_pos(Vector2 gpoint, bool alt) { + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + return !alt? canvas_item_editor->snap_point(xform.affine_inverse().xform(gpoint)) + : node->get_global_transform().affine_inverse().xform( + canvas_item_editor->snap_point( + canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint)) ); +} + +int Line2DEditor::get_point_index_at(Vector2 gpos) { + ERR_FAIL_COND_V(node == 0, -1); + + real_t grab_treshold = EDITOR_DEF("poly_editor/point_grab_radius", 8); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + + for(int i = 0; i < node->get_point_count(); ++i) { + Point2 p = xform.xform( node->get_point_pos(i) ); + if(gpos.distance_to(p) < grab_treshold) { + return i; + } + } + + return -1; +} + +bool Line2DEditor::forward_gui_input(const InputEvent& p_event) { + + if (!node) + return false; + + if (!node->is_visible()) + return false; + + switch(p_event.type) { + + case InputEvent::MOUSE_BUTTON: { + + const InputEventMouseButton &mb = p_event.mouse_button; + + Vector2 gpoint = Point2(mb.x,mb.y); + Vector2 cpoint = mouse_to_local_pos(gpoint, mb.mod.alt); + + if(mb.pressed && _dragging == false) { + int i = get_point_index_at(gpoint); + if(i != -1) { + if (mb.button_index == BUTTON_LEFT && !mb.mod.shift && mode == MODE_EDIT) { + _dragging = true; + action_point = i; + moving_from = node->get_point_pos(i); + moving_screen_from = gpoint; + } + else if((mb.button_index == BUTTON_RIGHT && mode == MODE_EDIT) || (mb.button_index == BUTTON_LEFT && mode == MODE_DELETE)) { + undo_redo->create_action(TTR("Remove Point from Line2D")); + undo_redo->add_do_method(node, "remove_point", i); + undo_redo->add_undo_method(node, "add_point", node->get_point_pos(i), i); + undo_redo->add_do_method(canvas_item_editor->get_viewport_control(), "update"); + undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(), "update"); + undo_redo->commit_action(); + } + return true; + } + } + + if(mb.pressed && mb.button_index == BUTTON_LEFT && ((mb.mod.command && mode == MODE_EDIT) || mode == MODE_CREATE)) { + + undo_redo->create_action(TTR("Add Point to Line2D")); + undo_redo->add_do_method(node, "add_point", cpoint); + undo_redo->add_undo_method(node, "remove_point", node->get_point_count()); + undo_redo->add_do_method(canvas_item_editor->get_viewport_control(), "update"); + undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(), "update"); + undo_redo->commit_action(); + + _dragging = true; + action_point = node->get_point_count()-1; + moving_from = node->get_point_pos(action_point); + moving_screen_from = gpoint; + + canvas_item_editor->get_viewport_control()->update(); + + return true; + } + + if(!mb.pressed && mb.button_index == BUTTON_LEFT && _dragging) { + undo_redo->create_action(TTR("Move Point in Line2D")); + undo_redo->add_do_method(node, "set_point_pos", action_point, cpoint); + undo_redo->add_undo_method(node, "set_point_pos", action_point, moving_from); + undo_redo->add_do_method(canvas_item_editor->get_viewport_control(), "update"); + undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(), "update"); + undo_redo->commit_action(); + _dragging = false; + return true; + } + } + break; + + case InputEvent::MOUSE_MOTION: { + if (_dragging) { + const InputEventMouseMotion &mm = p_event.mouse_motion; + Vector2 cpoint = mouse_to_local_pos(Vector2(mm.x, mm.y), mm.mod.alt); + node->set_point_pos(action_point,cpoint); + canvas_item_editor->get_viewport_control()->update(); + return true; + } + } + break; + } + + return false; +} + +void Line2DEditor::_canvas_draw() { + + if (!node) + return; + + if (!node->is_visible()) + return; + + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Ref<Texture> handle = get_icon("EditorHandle", "EditorIcons"); + Size2 handle_size = handle->get_size(); + + int len = node->get_point_count(); + Control *vpc = canvas_item_editor->get_viewport_control(); + + for(int i=0; i < len; ++i) { + Vector2 point = xform.xform(node->get_point_pos(i)); + vpc->draw_texture_rect(handle, Rect2(point - handle_size * 0.5, handle_size), false); + } +} + +void Line2DEditor::_node_visibility_changed() { + if (!node) + return; + canvas_item_editor->get_viewport_control()->update(); +} + +void Line2DEditor::edit(Node *p_line2d) { + + if (!canvas_item_editor) + canvas_item_editor = CanvasItemEditor::get_singleton(); + + if (p_line2d) { + node = p_line2d->cast_to<Line2D>(); + if (!canvas_item_editor->get_viewport_control()->is_connected("draw", this, "_canvas_draw")) + canvas_item_editor->get_viewport_control()->connect("draw", this, "_canvas_draw"); + 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")) + canvas_item_editor->get_viewport_control()->disconnect("draw", this, "_canvas_draw"); + // node may have been deleted at this point + if (node && node->is_connected("visibility_changed", this, "_node_visibility_changed")) + node->disconnect("visibility_changed", this, "_node_visibility_changed"); + node = NULL; + } +} + +void Line2DEditor::_bind_methods() { + ClassDB::bind_method(D_METHOD("_canvas_draw"), &Line2DEditor::_canvas_draw); + ClassDB::bind_method(D_METHOD("_node_visibility_changed"), &Line2DEditor::_node_visibility_changed); + ClassDB::bind_method(D_METHOD("_mode_selected"), &Line2DEditor::_mode_selected); +} + +void Line2DEditor::_mode_selected(int p_mode) { + for(unsigned int i = 0; i < _MODE_COUNT; ++i) { + toolbar_buttons[i]->set_pressed(i == p_mode); + } + mode = Mode(p_mode); +} + +Line2DEditor::Line2DEditor(EditorNode *p_editor) { + + canvas_item_editor = NULL; + editor = p_editor; + undo_redo = editor->get_undo_redo(); + + _dragging = false; + + base_hb = memnew( HBoxContainer ); + CanvasItemEditor::get_singleton()->add_control_to_menu_panel(base_hb); + + sep = memnew( VSeparator); + base_hb->add_child(sep); + + { + ToolButton * b = memnew(ToolButton); + b->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveEdit", "EditorIcons")); + b->set_toggle_mode(true); + b->set_focus_mode(Control::FOCUS_NONE); + b->set_tooltip( + TTR("Select Points")+"\n" + + TTR("Shift+Drag: Select Control Points")+"\n" + + keycode_get_string(KEY_MASK_CMD) + + TTR("Click: Add Point")+"\n" + + TTR("Right Click: Delete Point")); + b->connect("pressed", this, "_mode_selected", varray(MODE_EDIT)); + toolbar_buttons[MODE_EDIT] = b; + base_hb->add_child(b); + } + + { + ToolButton * b = memnew(ToolButton); + b->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveCreate", "EditorIcons")); + b->set_toggle_mode(true); + b->set_focus_mode(Control::FOCUS_NONE); + b->set_tooltip(TTR("Add Point (in empty space)")+"\n"+TTR("Split Segment (in line)")); + b->connect("pressed", this, "_mode_selected", varray(MODE_CREATE)); + toolbar_buttons[MODE_CREATE] = b; + base_hb->add_child(b); + } + + { + ToolButton * b = memnew( ToolButton ); + b->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("CurveDelete", "EditorIcons")); + b->set_toggle_mode(true); + b->set_focus_mode(Control::FOCUS_NONE); + b->set_tooltip(TTR("Delete Point")); + b->connect("pressed", this, "_mode_selected", varray(MODE_DELETE)); + toolbar_buttons[MODE_DELETE] = b; + base_hb->add_child(b); + } + + base_hb->hide(); + hide(); + + _mode_selected(MODE_CREATE); +} + +//---------------------------------------------------------------------------- +// Line2DEditorPlugin +//---------------------------------------------------------------------------- + +void Line2DEditorPlugin::edit(Object *p_object) { + line2d_editor->edit(p_object->cast_to<Node>()); +} + +bool Line2DEditorPlugin::handles(Object *p_object) const { + return p_object->is_class("Line2D"); +} + +void Line2DEditorPlugin::make_visible(bool p_visible) { + line2d_editor->set_visible(p_visible); + if(p_visible == false) + line2d_editor->edit(NULL); +} + +Line2DEditorPlugin::Line2DEditorPlugin(EditorNode *p_node) { + editor=p_node; + line2d_editor = memnew( Line2DEditor(p_node) ); + CanvasItemEditor::get_singleton()->add_control_to_menu_panel(line2d_editor); + line2d_editor->hide(); +} + + diff --git a/editor/plugins/line_2d_editor_plugin.h b/editor/plugins/line_2d_editor_plugin.h new file mode 100644 index 0000000000..6e0da7df38 --- /dev/null +++ b/editor/plugins/line_2d_editor_plugin.h @@ -0,0 +1,118 @@ +/*************************************************************************/ +/* line_2d_editor_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 LINE_2D_EDITOR_PLUGIN_H +#define LINE_2D_EDITOR_PLUGIN_H + +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" +#include "scene/2d/path_2d.h" +#include "scene/gui/tool_button.h" +#include "scene/gui/button_group.h" +#include "scene/2d/line_2d.h" + + +class CanvasItemEditor; + +class Line2DEditor : public HBoxContainer { + GDCLASS(Line2DEditor, HBoxContainer) + +public: + bool forward_gui_input(const InputEvent& p_event); + void edit(Node *p_line2d); + Line2DEditor(EditorNode *p_editor); + +protected: + void _node_removed(Node *p_node); + void _notification(int p_what); + + Vector2 mouse_to_local_pos(Vector2 mpos); + + static void _bind_methods(); + +private: + void _mode_selected(int p_mode); + void _canvas_draw(); + void _node_visibility_changed(); + + int get_point_index_at(Vector2 gpos); + Vector2 mouse_to_local_pos(Vector2 gpos, bool alt); + + UndoRedo *undo_redo; + + CanvasItemEditor *canvas_item_editor; + EditorNode *editor; + Panel *panel; + Line2D *node; + + HBoxContainer *base_hb; + Separator *sep; + + enum Mode { + MODE_CREATE = 0, + MODE_EDIT, + MODE_DELETE, + _MODE_COUNT + }; + + Mode mode; + ToolButton* toolbar_buttons[_MODE_COUNT]; + + bool _dragging; + int action_point; + Point2 moving_from; + Point2 moving_screen_from; +}; + +class Line2DEditorPlugin : public EditorPlugin { + GDCLASS( Line2DEditorPlugin, EditorPlugin ) + +public: + virtual bool forward_canvas_gui_input( + const Transform2D& p_canvas_xform, + const InputEvent& p_event) + { + return line2d_editor->forward_gui_input(p_event); + } + + virtual String get_name() const { return "Line2D"; } + 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); + + Line2DEditorPlugin(EditorNode *p_node); + +private: + Line2DEditor *line2d_editor; + EditorNode *editor; + +}; + +#endif // LINE_2D_EDITOR_PLUGIN_H + diff --git a/tools/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 1aababa91b..cdf7c70d39 100644 --- a/tools/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -122,8 +122,8 @@ void MaterialEditor::_button_pressed(Node* p_button) { void MaterialEditor::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&MaterialEditor::_gui_input); - ClassDB::bind_method(_MD("_button_pressed"),&MaterialEditor::_button_pressed); + ClassDB::bind_method(D_METHOD("_gui_input"),&MaterialEditor::_gui_input); + ClassDB::bind_method(D_METHOD("_button_pressed"),&MaterialEditor::_button_pressed); } diff --git a/tools/editor/plugins/material_editor_plugin.h b/editor/plugins/material_editor_plugin.h index 5daae124e0..604e7e61bd 100644 --- a/tools/editor/plugins/material_editor_plugin.h +++ b/editor/plugins/material_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef MATERIAL_EDITOR_PLUGIN_H #define MATERIAL_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/resources/material.h" #include "scene/3d/light.h" #include "scene/3d/mesh_instance.h" diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index 49cb02c9d8..93f417247e 100644 --- a/tools/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -136,8 +136,8 @@ void MeshEditor::_button_pressed(Node* p_button) { void MeshEditor::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&MeshEditor::_gui_input); - ClassDB::bind_method(_MD("_button_pressed"),&MeshEditor::_button_pressed); + ClassDB::bind_method(D_METHOD("_gui_input"),&MeshEditor::_gui_input); + ClassDB::bind_method(D_METHOD("_button_pressed"),&MeshEditor::_button_pressed); } diff --git a/tools/editor/plugins/mesh_editor_plugin.h b/editor/plugins/mesh_editor_plugin.h index 136290ffd4..80504ae445 100644 --- a/tools/editor/plugins/mesh_editor_plugin.h +++ b/editor/plugins/mesh_editor_plugin.h @@ -31,8 +31,8 @@ #if 0 -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/resources/material.h" #include "scene/3d/light.h" #include "scene/3d/mesh_instance.h" diff --git a/tools/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_editor_plugin.cpp index 322e212534..322e212534 100644 --- a/tools/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_editor_plugin.cpp diff --git a/tools/editor/plugins/mesh_instance_editor_plugin.h b/editor/plugins/mesh_instance_editor_plugin.h index 441d4d1d3f..de5be2fbbb 100644 --- a/tools/editor/plugins/mesh_instance_editor_plugin.h +++ b/editor/plugins/mesh_instance_editor_plugin.h @@ -30,8 +30,8 @@ #define MESH_INSTANCE_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/3d/mesh_instance.h" #include "scene/gui/spin_box.h" diff --git a/tools/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp index 6259ddf473..6259ddf473 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.cpp +++ b/editor/plugins/multimesh_editor_plugin.cpp diff --git a/tools/editor/plugins/multimesh_editor_plugin.h b/editor/plugins/multimesh_editor_plugin.h index e322850238..a97b3758a1 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.h +++ b/editor/plugins/multimesh_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef MULTIMESH_EDITOR_PLUGIN_H #define MULTIMESH_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/3d/multimesh_instance.h" #include "scene/gui/spin_box.h" diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp index e70f2be9fa..654afb754e 100644 --- a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "canvas_item_editor_plugin.h" #include "os/file_access.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" void NavigationPolygonEditor::_notification(int p_what) { @@ -312,7 +312,7 @@ bool NavigationPolygonEditor::forward_gui_input(const InputEvent& p_event) { return true; } } - } if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) { + } else if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) { int closest_outline=-1; int closest_idx=-1; @@ -477,10 +477,10 @@ void NavigationPolygonEditor::edit(Node *p_collision_polygon) { void NavigationPolygonEditor::_bind_methods() { - ClassDB::bind_method(_MD("_menu_option"),&NavigationPolygonEditor::_menu_option); - ClassDB::bind_method(_MD("_canvas_draw"),&NavigationPolygonEditor::_canvas_draw); - ClassDB::bind_method(_MD("_node_removed"),&NavigationPolygonEditor::_node_removed); - ClassDB::bind_method(_MD("_create_nav"),&NavigationPolygonEditor::_create_nav); + ClassDB::bind_method(D_METHOD("_menu_option"),&NavigationPolygonEditor::_menu_option); + ClassDB::bind_method(D_METHOD("_canvas_draw"),&NavigationPolygonEditor::_canvas_draw); + ClassDB::bind_method(D_METHOD("_node_removed"),&NavigationPolygonEditor::_node_removed); + ClassDB::bind_method(D_METHOD("_create_nav"),&NavigationPolygonEditor::_create_nav); } diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.h b/editor/plugins/navigation_polygon_editor_plugin.h index 50df4df744..0d5e67e352 100644 --- a/tools/editor/plugins/navigation_polygon_editor_plugin.h +++ b/editor/plugins/navigation_polygon_editor_plugin.h @@ -31,8 +31,8 @@ -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/2d/navigation_polygon.h" #include "scene/gui/tool_button.h" #include "scene/gui/button_group.h" diff --git a/tools/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp index 20b1b9d1ca..1efdbe9e68 100644 --- a/tools/editor/plugins/particles_2d_editor_plugin.cpp +++ b/editor/plugins/particles_2d_editor_plugin.cpp @@ -152,8 +152,8 @@ void Particles2DEditorPlugin::_notification(int p_what) { void Particles2DEditorPlugin::_bind_methods() { - ClassDB::bind_method(_MD("_menu_callback"),&Particles2DEditorPlugin::_menu_callback); - ClassDB::bind_method(_MD("_file_selected"),&Particles2DEditorPlugin::_file_selected); + ClassDB::bind_method(D_METHOD("_menu_callback"),&Particles2DEditorPlugin::_menu_callback); + ClassDB::bind_method(D_METHOD("_file_selected"),&Particles2DEditorPlugin::_file_selected); } diff --git a/tools/editor/plugins/particles_2d_editor_plugin.h b/editor/plugins/particles_2d_editor_plugin.h index c532a5fe73..ea71c739f3 100644 --- a/tools/editor/plugins/particles_2d_editor_plugin.h +++ b/editor/plugins/particles_2d_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef PARTICLES_2D_EDITOR_PLUGIN_H #define PARTICLES_2D_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/2d/collision_polygon_2d.h" #include "scene/gui/box_container.h" diff --git a/tools/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp index fd5ec5b5b9..4ce1f5eb54 100644 --- a/tools/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/particles_editor_plugin.cpp @@ -31,7 +31,7 @@ #include "particles_editor_plugin.h" #include "io/resource_loader.h" #include "servers/visual/particle_system_sw.h" -#include "tools/editor/plugins/spatial_editor_plugin.h" +#include "editor/plugins/spatial_editor_plugin.h" void ParticlesEditor::_node_removed(Node *p_node) { diff --git a/tools/editor/plugins/particles_editor_plugin.h b/editor/plugins/particles_editor_plugin.h index c32fbe5ada..06134ddef2 100644 --- a/tools/editor/plugins/particles_editor_plugin.h +++ b/editor/plugins/particles_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef PARTICLES_EDITOR_PLUGIN_H #define PARTICLES_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/3d/particles.h" #include "scene/gui/spin_box.h" diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index 8e475e56f7..00b026e25b 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "canvas_item_editor_plugin.h" #include "os/file_access.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "os/keyboard.h" void Path2DEditor::_notification(int p_what) { @@ -550,10 +550,10 @@ void Path2DEditor::edit(Node *p_path2d) { void Path2DEditor::_bind_methods() { - //ClassDB::bind_method(_MD("_menu_option"),&Path2DEditor::_menu_option); - ClassDB::bind_method(_MD("_canvas_draw"),&Path2DEditor::_canvas_draw); - ClassDB::bind_method(_MD("_node_visibility_changed"),&Path2DEditor::_node_visibility_changed); - ClassDB::bind_method(_MD("_mode_selected"),&Path2DEditor::_mode_selected); + //ClassDB::bind_method(D_METHOD("_menu_option"),&Path2DEditor::_menu_option); + ClassDB::bind_method(D_METHOD("_canvas_draw"),&Path2DEditor::_canvas_draw); + ClassDB::bind_method(D_METHOD("_node_visibility_changed"),&Path2DEditor::_node_visibility_changed); + ClassDB::bind_method(D_METHOD("_mode_selected"),&Path2DEditor::_mode_selected); } void Path2DEditor::_mode_selected(int p_mode) { diff --git a/tools/editor/plugins/path_2d_editor_plugin.h b/editor/plugins/path_2d_editor_plugin.h index aa940e4edf..89f42d94cc 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.h +++ b/editor/plugins/path_2d_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef PATH_2D_EDITOR_PLUGIN_H #define PATH_2D_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/2d/path_2d.h" #include "scene/gui/tool_button.h" #include "scene/gui/button_group.h" diff --git a/tools/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp index 2e148d6486..a3df39fdaa 100644 --- a/tools/editor/plugins/path_editor_plugin.cpp +++ b/editor/plugins/path_editor_plugin.cpp @@ -517,8 +517,8 @@ void PathEditorPlugin::_notification(int p_what) { void PathEditorPlugin::_bind_methods() { - ClassDB::bind_method(_MD("_mode_changed"),&PathEditorPlugin::_mode_changed); - ClassDB::bind_method(_MD("_close_curve"),&PathEditorPlugin::_close_curve); + ClassDB::bind_method(D_METHOD("_mode_changed"),&PathEditorPlugin::_mode_changed); + ClassDB::bind_method(D_METHOD("_close_curve"),&PathEditorPlugin::_close_curve); } PathEditorPlugin* PathEditorPlugin::singleton=NULL; diff --git a/tools/editor/plugins/path_editor_plugin.h b/editor/plugins/path_editor_plugin.h index 79e978dc1d..fe1c5ad159 100644 --- a/tools/editor/plugins/path_editor_plugin.h +++ b/editor/plugins/path_editor_plugin.h @@ -30,7 +30,7 @@ #define PATH_EDITOR_PLUGIN_H -#include "tools/editor/spatial_editor_gizmos.h" +#include "editor/spatial_editor_gizmos.h" #include "scene/3d/path.h" # if 0 class PathSpatialGizmo : public EditorSpatialGizmo { diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 7958dce75a..3a41b2cb6b 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -30,7 +30,7 @@ #include "canvas_item_editor_plugin.h" #include "os/file_access.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "os/keyboard.h" #include "os/input.h" @@ -385,7 +385,7 @@ bool Polygon2DEditor::forward_gui_input(const InputEvent& p_event) { return true; } } - } if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) { + } else if (mb.button_index==BUTTON_RIGHT && mb.pressed && edited_point==-1) { @@ -775,19 +775,19 @@ void Polygon2DEditor::edit(Node *p_collision_polygon) { void Polygon2DEditor::_bind_methods() { - ClassDB::bind_method(_MD("_menu_option"),&Polygon2DEditor::_menu_option); - ClassDB::bind_method(_MD("_canvas_draw"),&Polygon2DEditor::_canvas_draw); - ClassDB::bind_method(_MD("_uv_mode"),&Polygon2DEditor::_uv_mode); - ClassDB::bind_method(_MD("_uv_draw"),&Polygon2DEditor::_uv_draw); - ClassDB::bind_method(_MD("_uv_input"),&Polygon2DEditor::_uv_input); - ClassDB::bind_method(_MD("_uv_scroll_changed"),&Polygon2DEditor::_uv_scroll_changed); - ClassDB::bind_method(_MD("_node_removed"),&Polygon2DEditor::_node_removed); - ClassDB::bind_method(_MD("_set_use_snap"),&Polygon2DEditor::_set_use_snap); - ClassDB::bind_method(_MD("_set_show_grid"),&Polygon2DEditor::_set_show_grid); - ClassDB::bind_method(_MD("_set_snap_off_x"),&Polygon2DEditor::_set_snap_off_x); - ClassDB::bind_method(_MD("_set_snap_off_y"),&Polygon2DEditor::_set_snap_off_y); - ClassDB::bind_method(_MD("_set_snap_step_x"),&Polygon2DEditor::_set_snap_step_x); - ClassDB::bind_method(_MD("_set_snap_step_y"),&Polygon2DEditor::_set_snap_step_y); + ClassDB::bind_method(D_METHOD("_menu_option"),&Polygon2DEditor::_menu_option); + ClassDB::bind_method(D_METHOD("_canvas_draw"),&Polygon2DEditor::_canvas_draw); + ClassDB::bind_method(D_METHOD("_uv_mode"),&Polygon2DEditor::_uv_mode); + ClassDB::bind_method(D_METHOD("_uv_draw"),&Polygon2DEditor::_uv_draw); + ClassDB::bind_method(D_METHOD("_uv_input"),&Polygon2DEditor::_uv_input); + ClassDB::bind_method(D_METHOD("_uv_scroll_changed"),&Polygon2DEditor::_uv_scroll_changed); + ClassDB::bind_method(D_METHOD("_node_removed"),&Polygon2DEditor::_node_removed); + ClassDB::bind_method(D_METHOD("_set_use_snap"),&Polygon2DEditor::_set_use_snap); + ClassDB::bind_method(D_METHOD("_set_show_grid"),&Polygon2DEditor::_set_show_grid); + ClassDB::bind_method(D_METHOD("_set_snap_off_x"),&Polygon2DEditor::_set_snap_off_x); + ClassDB::bind_method(D_METHOD("_set_snap_off_y"),&Polygon2DEditor::_set_snap_off_y); + ClassDB::bind_method(D_METHOD("_set_snap_step_x"),&Polygon2DEditor::_set_snap_step_x); + ClassDB::bind_method(D_METHOD("_set_snap_step_y"),&Polygon2DEditor::_set_snap_step_y); } diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h index 6011ee1f87..c994867705 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.h +++ b/editor/plugins/polygon_2d_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef POLYGON_2D_EDITOR_PLUGIN_H #define POLYGON_2D_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/2d/polygon_2d.h" #include "scene/gui/tool_button.h" #include "scene/gui/button_group.h" diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index cb139cbe24..e876fa55c6 100644 --- a/tools/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -29,8 +29,8 @@ #include "resource_preloader_editor_plugin.h" #include "io/resource_loader.h" -#include "globals.h" -#include "tools/editor/editor_settings.h" +#include "global_config.h" +#include "editor/editor_settings.h" void ResourcePreloaderEditor::_gui_input(InputEvent p_event) { @@ -380,19 +380,19 @@ void ResourcePreloaderEditor::drop_data_fw(const Point2& p_point,const Variant& void ResourcePreloaderEditor::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&ResourcePreloaderEditor::_gui_input); - ClassDB::bind_method(_MD("_load_pressed"),&ResourcePreloaderEditor::_load_pressed); - ClassDB::bind_method(_MD("_item_edited"),&ResourcePreloaderEditor::_item_edited); - ClassDB::bind_method(_MD("_delete_pressed"),&ResourcePreloaderEditor::_delete_pressed); - ClassDB::bind_method(_MD("_paste_pressed"),&ResourcePreloaderEditor::_paste_pressed); - ClassDB::bind_method(_MD("_delete_confirm_pressed"),&ResourcePreloaderEditor::_delete_confirm_pressed); - ClassDB::bind_method(_MD("_files_load_request"),&ResourcePreloaderEditor::_files_load_request); - ClassDB::bind_method(_MD("_update_library"),&ResourcePreloaderEditor::_update_library); + ClassDB::bind_method(D_METHOD("_gui_input"),&ResourcePreloaderEditor::_gui_input); + ClassDB::bind_method(D_METHOD("_load_pressed"),&ResourcePreloaderEditor::_load_pressed); + ClassDB::bind_method(D_METHOD("_item_edited"),&ResourcePreloaderEditor::_item_edited); + ClassDB::bind_method(D_METHOD("_delete_pressed"),&ResourcePreloaderEditor::_delete_pressed); + ClassDB::bind_method(D_METHOD("_paste_pressed"),&ResourcePreloaderEditor::_paste_pressed); + ClassDB::bind_method(D_METHOD("_delete_confirm_pressed"),&ResourcePreloaderEditor::_delete_confirm_pressed); + ClassDB::bind_method(D_METHOD("_files_load_request"),&ResourcePreloaderEditor::_files_load_request); + ClassDB::bind_method(D_METHOD("_update_library"),&ResourcePreloaderEditor::_update_library); - ClassDB::bind_method(_MD("get_drag_data_fw"), &ResourcePreloaderEditor::get_drag_data_fw); - ClassDB::bind_method(_MD("can_drop_data_fw"), &ResourcePreloaderEditor::can_drop_data_fw); - ClassDB::bind_method(_MD("drop_data_fw"), &ResourcePreloaderEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &ResourcePreloaderEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &ResourcePreloaderEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &ResourcePreloaderEditor::drop_data_fw); } diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.h b/editor/plugins/resource_preloader_editor_plugin.h index 6990301ded..54ccad4341 100644 --- a/tools/editor/plugins/resource_preloader_editor_plugin.h +++ b/editor/plugins/resource_preloader_editor_plugin.h @@ -30,8 +30,8 @@ #define RESOURCE_PRELOADER_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/gui/tree.h" #include "scene/main/resource_preloader.h" #include "scene/gui/file_dialog.h" diff --git a/tools/editor/plugins/rich_text_editor_plugin.cpp b/editor/plugins/rich_text_editor_plugin.cpp index 8629d6ec8f..797ee8e8ea 100644 --- a/tools/editor/plugins/rich_text_editor_plugin.cpp +++ b/editor/plugins/rich_text_editor_plugin.cpp @@ -90,8 +90,8 @@ void RichTextEditor::_menu_option(int p_option) { void RichTextEditor::_bind_methods() { - ClassDB::bind_method(_MD("_menu_option"),&RichTextEditor::_menu_option); - ClassDB::bind_method(_MD("_file_selected"),&RichTextEditor::_file_selected); + ClassDB::bind_method(D_METHOD("_menu_option"),&RichTextEditor::_menu_option); + ClassDB::bind_method(D_METHOD("_file_selected"),&RichTextEditor::_file_selected); } diff --git a/tools/editor/plugins/rich_text_editor_plugin.h b/editor/plugins/rich_text_editor_plugin.h index cf97d7517c..c7f95fb479 100644 --- a/tools/editor/plugins/rich_text_editor_plugin.h +++ b/editor/plugins/rich_text_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef RICH_TEXT_EDITOR_PLUGIN_H #define RICH_TEXT_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/gui/rich_text_label.h" #include "scene/gui/file_dialog.h" diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/editor/plugins/sample_editor_plugin.cpp index c333ba017f..b6b96c946e 100644 --- a/tools/editor/plugins/sample_editor_plugin.cpp +++ b/editor/plugins/sample_editor_plugin.cpp @@ -30,8 +30,8 @@ #if 0 #include "io/resource_loader.h" -#include "globals.h" -#include "tools/editor/editor_settings.h" +#include "global_config.h" +#include "editor/editor_settings.h" @@ -349,9 +349,9 @@ void SampleEditor::edit(Ref<Sample> p_sample) { void SampleEditor::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&SampleEditor::_gui_input); - ClassDB::bind_method(_MD("_play_pressed"),&SampleEditor::_play_pressed); - ClassDB::bind_method(_MD("_stop_pressed"),&SampleEditor::_stop_pressed); + ClassDB::bind_method(D_METHOD("_gui_input"),&SampleEditor::_gui_input); + ClassDB::bind_method(D_METHOD("_play_pressed"),&SampleEditor::_play_pressed); + ClassDB::bind_method(D_METHOD("_stop_pressed"),&SampleEditor::_stop_pressed); } diff --git a/tools/editor/plugins/sample_editor_plugin.h b/editor/plugins/sample_editor_plugin.h index 651cd14a84..dae9cef9f4 100644 --- a/tools/editor/plugins/sample_editor_plugin.h +++ b/editor/plugins/sample_editor_plugin.h @@ -30,8 +30,8 @@ #define SAMPLE_EDITOR_PLUGIN_H #if 0 -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/audio/sample_player.h" #include "scene/resources/sample.h" #include "scene/resources/sample_library.h" diff --git a/tools/editor/plugins/sample_library_editor_plugin.cpp b/editor/plugins/sample_library_editor_plugin.cpp index 116c5d11b6..4ead1d2709 100644 --- a/tools/editor/plugins/sample_library_editor_plugin.cpp +++ b/editor/plugins/sample_library_editor_plugin.cpp @@ -31,8 +31,8 @@ #include "sample_library_editor_plugin.h" #include "io/resource_loader.h" -#include "globals.h" -#include "tools/editor/editor_settings.h" +#include "global_config.h" +#include "editor/editor_settings.h" #include "scene/main/viewport.h" #include "sample_editor_plugin.h" @@ -413,17 +413,17 @@ void SampleLibraryEditor::drop_data_fw(const Point2& p_point,const Variant& p_da void SampleLibraryEditor::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&SampleLibraryEditor::_gui_input); - ClassDB::bind_method(_MD("_load_pressed"),&SampleLibraryEditor::_load_pressed); - ClassDB::bind_method(_MD("_item_edited"),&SampleLibraryEditor::_item_edited); - ClassDB::bind_method(_MD("_delete_pressed"),&SampleLibraryEditor::_delete_pressed); - ClassDB::bind_method(_MD("_file_load_request"),&SampleLibraryEditor::_file_load_request); - ClassDB::bind_method(_MD("_update_library"),&SampleLibraryEditor::_update_library); - ClassDB::bind_method(_MD("_button_pressed"),&SampleLibraryEditor::_button_pressed); - - ClassDB::bind_method(_MD("get_drag_data_fw"), &SampleLibraryEditor::get_drag_data_fw); - ClassDB::bind_method(_MD("can_drop_data_fw"), &SampleLibraryEditor::can_drop_data_fw); - ClassDB::bind_method(_MD("drop_data_fw"), &SampleLibraryEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("_gui_input"),&SampleLibraryEditor::_gui_input); + ClassDB::bind_method(D_METHOD("_load_pressed"),&SampleLibraryEditor::_load_pressed); + ClassDB::bind_method(D_METHOD("_item_edited"),&SampleLibraryEditor::_item_edited); + ClassDB::bind_method(D_METHOD("_delete_pressed"),&SampleLibraryEditor::_delete_pressed); + ClassDB::bind_method(D_METHOD("_file_load_request"),&SampleLibraryEditor::_file_load_request); + ClassDB::bind_method(D_METHOD("_update_library"),&SampleLibraryEditor::_update_library); + ClassDB::bind_method(D_METHOD("_button_pressed"),&SampleLibraryEditor::_button_pressed); + + ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &SampleLibraryEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &SampleLibraryEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &SampleLibraryEditor::drop_data_fw); } diff --git a/tools/editor/plugins/sample_library_editor_plugin.h b/editor/plugins/sample_library_editor_plugin.h index 35028df859..4bbc29b147 100644 --- a/tools/editor/plugins/sample_library_editor_plugin.h +++ b/editor/plugins/sample_library_editor_plugin.h @@ -31,8 +31,8 @@ #if 0 -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/audio/sample_player.h" #include "scene/resources/sample.h" #include "scene/gui/tree.h" diff --git a/tools/editor/plugins/sample_player_editor_plugin.cpp b/editor/plugins/sample_player_editor_plugin.cpp index dd6450bfe7..7e2683dedf 100644 --- a/tools/editor/plugins/sample_player_editor_plugin.cpp +++ b/editor/plugins/sample_player_editor_plugin.cpp @@ -54,8 +54,8 @@ void SamplePlayerEditor::_node_removed(Node *p_node) { void SamplePlayerEditor::_bind_methods() { - ClassDB::bind_method(_MD("_play"),&SamplePlayerEditor::_play); - ClassDB::bind_method(_MD("_stop"),&SamplePlayerEditor::_stop); + ClassDB::bind_method(D_METHOD("_play"),&SamplePlayerEditor::_play); + ClassDB::bind_method(D_METHOD("_stop"),&SamplePlayerEditor::_stop); } diff --git a/tools/editor/plugins/sample_player_editor_plugin.h b/editor/plugins/sample_player_editor_plugin.h index ba1684497c..c1d599540a 100644 --- a/tools/editor/plugins/sample_player_editor_plugin.h +++ b/editor/plugins/sample_player_editor_plugin.h @@ -31,8 +31,8 @@ #if 0 -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/3d/spatial_sample_player.h" #include "scene/gui/option_button.h" #include "scene/audio/sample_player.h" diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 5f97fce4e7..3631d39f9a 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -28,14 +28,14 @@ /*************************************************************************/ #include "script_editor_plugin.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "io/resource_loader.h" #include "io/resource_saver.h" #include "os/keyboard.h" #include "os/os.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/script_editor_debugger.h" -#include "globals.h" +#include "editor/editor_node.h" +#include "editor/script_editor_debugger.h" +#include "global_config.h" #include "os/file_access.h" #include "scene/main/viewport.h" #include "os/keyboard.h" @@ -241,9 +241,9 @@ void ScriptEditorQuickOpen::_notification(int p_what) { void ScriptEditorQuickOpen::_bind_methods() { - ClassDB::bind_method(_MD("_text_changed"),&ScriptEditorQuickOpen::_text_changed); - ClassDB::bind_method(_MD("_confirmed"),&ScriptEditorQuickOpen::_confirmed); - ClassDB::bind_method(_MD("_sbox_input"),&ScriptEditorQuickOpen::_sbox_input); + ClassDB::bind_method(D_METHOD("_text_changed"),&ScriptEditorQuickOpen::_text_changed); + ClassDB::bind_method(D_METHOD("_confirmed"),&ScriptEditorQuickOpen::_confirmed); + ClassDB::bind_method(D_METHOD("_sbox_input"),&ScriptEditorQuickOpen::_sbox_input); ADD_SIGNAL(MethodInfo("goto_line",PropertyInfo(Variant::INT,"line"))); @@ -292,6 +292,10 @@ String ScriptEditor::_get_debug_tooltip(const String&p_text,Node *_se) { void ScriptEditor::_breaked(bool p_breaked,bool p_can_debug) { + if (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) { + return; + } + debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), !(p_breaked && p_can_debug)); debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_STEP), !(p_breaked && p_can_debug) ); debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_BREAK), p_breaked ); diff --git a/tools/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 75099fc5ec..bf5316363c 100644 --- a/tools/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef SCRIPT_EDITOR_PLUGIN_H #define SCRIPT_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/script_create_dialog.h" +#include "editor/editor_plugin.h" +#include "editor/script_create_dialog.h" #include "scene/gui/tab_container.h" #include "scene/gui/text_edit.h" #include "scene/gui/menu_button.h" @@ -38,10 +38,10 @@ #include "scene/gui/tree.h" #include "scene/main/timer.h" #include "script_language.h" -#include "tools/editor/code_editor.h" +#include "editor/code_editor.h" #include "scene/gui/split_container.h" #include "scene/gui/item_list.h" -#include "tools/editor/editor_help.h" +#include "editor/editor_help.h" class ScriptEditorQuickOpen : public ConfirmationDialog { diff --git a/tools/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 9ec6266419..8723a863f0 100644 --- a/tools/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -28,10 +28,10 @@ /*************************************************************************/ #include "script_text_editor.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "os/keyboard.h" -#include "tools/editor/script_editor_debugger.h" -#include "tools/editor/editor_node.h" +#include "editor/script_editor_debugger.h" +#include "editor/editor_node.h" Vector<String> ScriptTextEditor::get_functions() { diff --git a/tools/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h index e30a78340e..e30a78340e 100644 --- a/tools/editor/plugins/script_text_editor.h +++ b/editor/plugins/script_text_editor.h diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 56a8fccb9c..c14d1650fd 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -28,14 +28,14 @@ /*************************************************************************/ #include "shader_editor_plugin.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "spatial_editor_plugin.h" #include "scene/resources/shader_graph.h" #include "io/resource_loader.h" #include "io/resource_saver.h" #include "os/keyboard.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/property_editor.h" +#include "editor/editor_node.h" +#include "editor/property_editor.h" #include "os/os.h" #include "servers/visual/shader_types.h" diff --git a/tools/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h index e94b4d9c25..703913e431 100644 --- a/tools/editor/plugins/shader_editor_plugin.h +++ b/editor/plugins/shader_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef SHADER_EDITOR_PLUGIN_H #define SHADER_EDITOR_PLUGIN_H -#include "tools/editor/code_editor.h" -#include "tools/editor/editor_plugin.h" +#include "editor/code_editor.h" +#include "editor/editor_plugin.h" #include "scene/gui/tab_container.h" #include "scene/gui/text_edit.h" #include "scene/gui/menu_button.h" diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/editor/plugins/shader_graph_editor_plugin.cpp index d86fec11d8..dac63b4a9f 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/editor/plugins/shader_graph_editor_plugin.cpp @@ -296,8 +296,8 @@ Vector<Color> GraphColorRampEdit::get_colors() const{ void GraphColorRampEdit::_bind_methods(){ - ClassDB::bind_method(_MD("_gui_input"),&GraphColorRampEdit::_gui_input); - ClassDB::bind_method(_MD("_color_changed"),&GraphColorRampEdit::_color_changed); + ClassDB::bind_method(D_METHOD("_gui_input"),&GraphColorRampEdit::_gui_input); + ClassDB::bind_method(D_METHOD("_color_changed"),&GraphColorRampEdit::_color_changed); ADD_SIGNAL(MethodInfo("ramp_changed")); } @@ -657,7 +657,7 @@ Vector<Vector2> GraphCurveMapEdit::get_points() const { void GraphCurveMapEdit::_bind_methods(){ - ClassDB::bind_method(_MD("_gui_input"),&GraphCurveMapEdit::_gui_input); + ClassDB::bind_method(D_METHOD("_gui_input"),&GraphCurveMapEdit::_gui_input); ADD_SIGNAL(MethodInfo("curve_changed")); } @@ -2732,9 +2732,9 @@ void ShaderGraphView::_bind_methods() { ClassDB::bind_method("_color_ramp_changed",&ShaderGraphView::_color_ramp_changed); ClassDB::bind_method("_curve_changed",&ShaderGraphView::_curve_changed); - ClassDB::bind_method(_MD("get_drag_data_fw"), &ShaderGraphView::get_drag_data_fw); - ClassDB::bind_method(_MD("can_drop_data_fw"), &ShaderGraphView::can_drop_data_fw); - ClassDB::bind_method(_MD("drop_data_fw"), &ShaderGraphView::drop_data_fw); + ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &ShaderGraphView::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &ShaderGraphView::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &ShaderGraphView::drop_data_fw); ClassDB::bind_method("_sg_updated",&ShaderGraphView::_sg_updated); } diff --git a/tools/editor/plugins/shader_graph_editor_plugin.h b/editor/plugins/shader_graph_editor_plugin.h index 477a45bd1f..5143722242 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.h +++ b/editor/plugins/shader_graph_editor_plugin.h @@ -30,14 +30,14 @@ #define SHADER_GRAPH_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/resources/shader.h" #include "scene/gui/tree.h" #include "scene/gui/button.h" #include "scene/gui/graph_edit.h" #include "scene/gui/popup.h" -#include "tools/editor/property_editor.h" +#include "editor/property_editor.h" #include "scene/resources/shader_graph.h" /** @author Juan Linietsky <reduzio@gmail.com> diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 3ba1a2cbdc..8a7969c71b 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -34,13 +34,13 @@ #include "scene/3d/camera.h" #include "camera_matrix.h" #include "sort.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_node.h" +#include "editor/editor_settings.h" #include "scene/resources/surface_tool.h" -#include "tools/editor/spatial_editor_gizmos.h" -#include "globals.h" -#include "tools/editor/plugins/animation_player_editor_plugin.h" -#include "tools/editor/animation_editor.h" +#include "editor/spatial_editor_gizmos.h" +#include "global_config.h" +#include "editor/plugins/animation_player_editor_plugin.h" +#include "editor/animation_editor.h" #define DISTANCE_DEFAULT 4 @@ -2221,15 +2221,15 @@ Dictionary SpatialEditorViewport::get_state() const { void SpatialEditorViewport::_bind_methods(){ - ClassDB::bind_method(_MD("_draw"),&SpatialEditorViewport::_draw); - ClassDB::bind_method(_MD("_smouseenter"),&SpatialEditorViewport::_smouseenter); - ClassDB::bind_method(_MD("_sinput"),&SpatialEditorViewport::_sinput); - ClassDB::bind_method(_MD("_menu_option"),&SpatialEditorViewport::_menu_option); - ClassDB::bind_method(_MD("_toggle_camera_preview"),&SpatialEditorViewport::_toggle_camera_preview); - ClassDB::bind_method(_MD("_preview_exited_scene"),&SpatialEditorViewport::_preview_exited_scene); - ClassDB::bind_method(_MD("update_transform_gizmo_view"),&SpatialEditorViewport::update_transform_gizmo_view); - ClassDB::bind_method(_MD("_selection_result_pressed"),&SpatialEditorViewport::_selection_result_pressed); - ClassDB::bind_method(_MD("_selection_menu_hide"),&SpatialEditorViewport::_selection_menu_hide); + ClassDB::bind_method(D_METHOD("_draw"),&SpatialEditorViewport::_draw); + ClassDB::bind_method(D_METHOD("_smouseenter"),&SpatialEditorViewport::_smouseenter); + ClassDB::bind_method(D_METHOD("_sinput"),&SpatialEditorViewport::_sinput); + ClassDB::bind_method(D_METHOD("_menu_option"),&SpatialEditorViewport::_menu_option); + ClassDB::bind_method(D_METHOD("_toggle_camera_preview"),&SpatialEditorViewport::_toggle_camera_preview); + ClassDB::bind_method(D_METHOD("_preview_exited_scene"),&SpatialEditorViewport::_preview_exited_scene); + ClassDB::bind_method(D_METHOD("update_transform_gizmo_view"),&SpatialEditorViewport::update_transform_gizmo_view); + ClassDB::bind_method(D_METHOD("_selection_result_pressed"),&SpatialEditorViewport::_selection_result_pressed); + ClassDB::bind_method(D_METHOD("_selection_menu_hide"),&SpatialEditorViewport::_selection_menu_hide); ADD_SIGNAL( MethodInfo("toggle_maximize_view", PropertyInfo(Variant::OBJECT, "viewport")) ); } diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 36f807c11f..44ce4a0281 100644 --- a/tools/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef SPATIAL_EDITOR_PLUGIN_H #define SPATIAL_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/3d/visual_instance.h" #include "scene/3d/immediate_geometry.h" #include "scene/3d/light.h" diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 095b059836..44d6d3c6e1 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -29,8 +29,8 @@ #include "sprite_frames_editor_plugin.h" #include "io/resource_loader.h" -#include "globals.h" -#include "tools/editor/editor_settings.h" +#include "global_config.h" +#include "editor/editor_settings.h" #include "scene/3d/sprite_3d.h" @@ -754,27 +754,27 @@ void SpriteFramesEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat void SpriteFramesEditor::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&SpriteFramesEditor::_gui_input); - ClassDB::bind_method(_MD("_load_pressed"),&SpriteFramesEditor::_load_pressed); - ClassDB::bind_method(_MD("_empty_pressed"),&SpriteFramesEditor::_empty_pressed); - ClassDB::bind_method(_MD("_empty2_pressed"),&SpriteFramesEditor::_empty2_pressed); - ClassDB::bind_method(_MD("_item_edited"),&SpriteFramesEditor::_item_edited); - ClassDB::bind_method(_MD("_delete_pressed"),&SpriteFramesEditor::_delete_pressed); - ClassDB::bind_method(_MD("_paste_pressed"),&SpriteFramesEditor::_paste_pressed); - ClassDB::bind_method(_MD("_delete_confirm_pressed"),&SpriteFramesEditor::_delete_confirm_pressed); - ClassDB::bind_method(_MD("_file_load_request","files","atpos"),&SpriteFramesEditor::_file_load_request,DEFVAL(-1)); - ClassDB::bind_method(_MD("_update_library","skipsel"),&SpriteFramesEditor::_update_library,DEFVAL(false)); - ClassDB::bind_method(_MD("_up_pressed"),&SpriteFramesEditor::_up_pressed); - ClassDB::bind_method(_MD("_down_pressed"),&SpriteFramesEditor::_down_pressed); - ClassDB::bind_method(_MD("_animation_select"),&SpriteFramesEditor::_animation_select); - ClassDB::bind_method(_MD("_animation_name_edited"),&SpriteFramesEditor::_animation_name_edited); - ClassDB::bind_method(_MD("_animation_add"),&SpriteFramesEditor::_animation_add); - ClassDB::bind_method(_MD("_animation_remove"),&SpriteFramesEditor::_animation_remove); - ClassDB::bind_method(_MD("_animation_loop_changed"),&SpriteFramesEditor::_animation_loop_changed); - ClassDB::bind_method(_MD("_animation_fps_changed"),&SpriteFramesEditor::_animation_fps_changed); - ClassDB::bind_method(_MD("get_drag_data_fw"), &SpriteFramesEditor::get_drag_data_fw); - ClassDB::bind_method(_MD("can_drop_data_fw"), &SpriteFramesEditor::can_drop_data_fw); - ClassDB::bind_method(_MD("drop_data_fw"), &SpriteFramesEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("_gui_input"),&SpriteFramesEditor::_gui_input); + ClassDB::bind_method(D_METHOD("_load_pressed"),&SpriteFramesEditor::_load_pressed); + ClassDB::bind_method(D_METHOD("_empty_pressed"),&SpriteFramesEditor::_empty_pressed); + ClassDB::bind_method(D_METHOD("_empty2_pressed"),&SpriteFramesEditor::_empty2_pressed); + ClassDB::bind_method(D_METHOD("_item_edited"),&SpriteFramesEditor::_item_edited); + ClassDB::bind_method(D_METHOD("_delete_pressed"),&SpriteFramesEditor::_delete_pressed); + ClassDB::bind_method(D_METHOD("_paste_pressed"),&SpriteFramesEditor::_paste_pressed); + ClassDB::bind_method(D_METHOD("_delete_confirm_pressed"),&SpriteFramesEditor::_delete_confirm_pressed); + ClassDB::bind_method(D_METHOD("_file_load_request","files","atpos"),&SpriteFramesEditor::_file_load_request,DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("_update_library","skipsel"),&SpriteFramesEditor::_update_library,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("_up_pressed"),&SpriteFramesEditor::_up_pressed); + ClassDB::bind_method(D_METHOD("_down_pressed"),&SpriteFramesEditor::_down_pressed); + ClassDB::bind_method(D_METHOD("_animation_select"),&SpriteFramesEditor::_animation_select); + ClassDB::bind_method(D_METHOD("_animation_name_edited"),&SpriteFramesEditor::_animation_name_edited); + ClassDB::bind_method(D_METHOD("_animation_add"),&SpriteFramesEditor::_animation_add); + ClassDB::bind_method(D_METHOD("_animation_remove"),&SpriteFramesEditor::_animation_remove); + ClassDB::bind_method(D_METHOD("_animation_loop_changed"),&SpriteFramesEditor::_animation_loop_changed); + ClassDB::bind_method(D_METHOD("_animation_fps_changed"),&SpriteFramesEditor::_animation_fps_changed); + ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &SpriteFramesEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &SpriteFramesEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &SpriteFramesEditor::drop_data_fw); } diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h index 36a022b7e4..11f545b443 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.h +++ b/editor/plugins/sprite_frames_editor_plugin.h @@ -30,8 +30,8 @@ #define SPRITE_FRAMES_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/gui/tree.h" #include "scene/2d/animated_sprite.h" #include "scene/gui/file_dialog.h" diff --git a/tools/editor/plugins/stream_editor_plugin.cpp b/editor/plugins/stream_editor_plugin.cpp index 991c29b6db..449f6f610e 100644 --- a/tools/editor/plugins/stream_editor_plugin.cpp +++ b/editor/plugins/stream_editor_plugin.cpp @@ -59,8 +59,8 @@ void StreamEditor::_stop() { void StreamEditor::_bind_methods() { - ClassDB::bind_method(_MD("_play"),&StreamEditor::_play); - ClassDB::bind_method(_MD("_stop"),&StreamEditor::_stop); + ClassDB::bind_method(D_METHOD("_play"),&StreamEditor::_play); + ClassDB::bind_method(D_METHOD("_stop"),&StreamEditor::_stop); } diff --git a/tools/editor/plugins/stream_editor_plugin.h b/editor/plugins/stream_editor_plugin.h index cc853d4661..2ae3b7100e 100644 --- a/tools/editor/plugins/stream_editor_plugin.h +++ b/editor/plugins/stream_editor_plugin.h @@ -30,8 +30,8 @@ #define STREAM_EDITOR_PLUGIN_H #if 0 -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/audio/stream_player.h" /** diff --git a/tools/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp index 396ebd0052..396ebd0052 100644 --- a/tools/editor/plugins/style_box_editor_plugin.cpp +++ b/editor/plugins/style_box_editor_plugin.cpp diff --git a/tools/editor/plugins/style_box_editor_plugin.h b/editor/plugins/style_box_editor_plugin.h index 29e98efd8b..01e636472b 100644 --- a/tools/editor/plugins/style_box_editor_plugin.h +++ b/editor/plugins/style_box_editor_plugin.h @@ -32,7 +32,7 @@ #include "scene/resources/style_box.h" #include "scene/gui/texture_rect.h" #include "scene/gui/option_button.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_node.h" class StyleBoxEditor : public Control { diff --git a/tools/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 82cba7ac0e..af05094e5e 100644 --- a/tools/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -29,8 +29,8 @@ #include "texture_editor_plugin.h" #include "io/resource_loader.h" -#include "globals.h" -#include "tools/editor/editor_settings.h" +#include "global_config.h" +#include "editor/editor_settings.h" void TextureEditor::_gui_input(InputEvent p_event) { @@ -112,7 +112,7 @@ void TextureEditor::edit(Ref<Texture> p_texture) { void TextureEditor::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&TextureEditor::_gui_input); + ClassDB::bind_method(D_METHOD("_gui_input"),&TextureEditor::_gui_input); } diff --git a/tools/editor/plugins/texture_editor_plugin.h b/editor/plugins/texture_editor_plugin.h index 456a5249de..7ad0e918cf 100644 --- a/tools/editor/plugins/texture_editor_plugin.h +++ b/editor/plugins/texture_editor_plugin.h @@ -31,8 +31,8 @@ -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/resources/texture.h" diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 9b0ca0a482..aabf938577 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -353,6 +353,7 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input) undo_redo->add_undo_method(atlas_tex.ptr(),"set_region",rect_prev); } else if(node_patch9){ + // FIXME: Is this intentional? } else if(node_patch9){ undo_redo->add_do_method(node_patch9 ,"set_region_rect",node_patch9->get_region_rect()); undo_redo->add_undo_method(node_patch9,"set_region_rect",rect_prev); @@ -614,21 +615,21 @@ void TextureRegionEditor::_node_removed(Object *p_obj) void TextureRegionEditor::_bind_methods() { - ClassDB::bind_method(_MD("_edit_region"),&TextureRegionEditor::_edit_region); - ClassDB::bind_method(_MD("_region_draw"),&TextureRegionEditor::_region_draw); - ClassDB::bind_method(_MD("_region_input"),&TextureRegionEditor::_region_input); - ClassDB::bind_method(_MD("_scroll_changed"),&TextureRegionEditor::_scroll_changed); - ClassDB::bind_method(_MD("_node_removed"),&TextureRegionEditor::_node_removed); - ClassDB::bind_method(_MD("_set_snap_mode"),&TextureRegionEditor::_set_snap_mode); - ClassDB::bind_method(_MD("_set_snap_off_x"),&TextureRegionEditor::_set_snap_off_x); - ClassDB::bind_method(_MD("_set_snap_off_y"),&TextureRegionEditor::_set_snap_off_y); - ClassDB::bind_method(_MD("_set_snap_step_x"),&TextureRegionEditor::_set_snap_step_x); - ClassDB::bind_method(_MD("_set_snap_step_y"),&TextureRegionEditor::_set_snap_step_y); - ClassDB::bind_method(_MD("_set_snap_sep_x"),&TextureRegionEditor::_set_snap_sep_x); - ClassDB::bind_method(_MD("_set_snap_sep_y"),&TextureRegionEditor::_set_snap_sep_y); - ClassDB::bind_method(_MD("_zoom_in"),&TextureRegionEditor::_zoom_in); - ClassDB::bind_method(_MD("_zoom_reset"),&TextureRegionEditor::_zoom_reset); - ClassDB::bind_method(_MD("_zoom_out"),&TextureRegionEditor::_zoom_out); + ClassDB::bind_method(D_METHOD("_edit_region"),&TextureRegionEditor::_edit_region); + ClassDB::bind_method(D_METHOD("_region_draw"),&TextureRegionEditor::_region_draw); + ClassDB::bind_method(D_METHOD("_region_input"),&TextureRegionEditor::_region_input); + ClassDB::bind_method(D_METHOD("_scroll_changed"),&TextureRegionEditor::_scroll_changed); + ClassDB::bind_method(D_METHOD("_node_removed"),&TextureRegionEditor::_node_removed); + ClassDB::bind_method(D_METHOD("_set_snap_mode"),&TextureRegionEditor::_set_snap_mode); + ClassDB::bind_method(D_METHOD("_set_snap_off_x"),&TextureRegionEditor::_set_snap_off_x); + ClassDB::bind_method(D_METHOD("_set_snap_off_y"),&TextureRegionEditor::_set_snap_off_y); + ClassDB::bind_method(D_METHOD("_set_snap_step_x"),&TextureRegionEditor::_set_snap_step_x); + ClassDB::bind_method(D_METHOD("_set_snap_step_y"),&TextureRegionEditor::_set_snap_step_y); + ClassDB::bind_method(D_METHOD("_set_snap_sep_x"),&TextureRegionEditor::_set_snap_sep_x); + ClassDB::bind_method(D_METHOD("_set_snap_sep_y"),&TextureRegionEditor::_set_snap_sep_y); + ClassDB::bind_method(D_METHOD("_zoom_in"),&TextureRegionEditor::_zoom_in); + ClassDB::bind_method(D_METHOD("_zoom_reset"),&TextureRegionEditor::_zoom_reset); + ClassDB::bind_method(D_METHOD("_zoom_out"),&TextureRegionEditor::_zoom_out); } void TextureRegionEditor::edit(Object *p_obj) diff --git a/tools/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h index da713a53d3..8e88f0b707 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.h +++ b/editor/plugins/texture_region_editor_plugin.h @@ -33,8 +33,8 @@ #define TEXTURE_REGION_EDITOR_PLUGIN_H #include "canvas_item_editor_plugin.h" -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/2d/sprite.h" #include "scene/gui/patch_9_rect.h" #include "scene/resources/style_box.h" diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 4b8fea5a45..4b8fea5a45 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp diff --git a/tools/editor/plugins/theme_editor_plugin.h b/editor/plugins/theme_editor_plugin.h index 9251da8e07..f661da4cd5 100644 --- a/tools/editor/plugins/theme_editor_plugin.h +++ b/editor/plugins/theme_editor_plugin.h @@ -37,7 +37,7 @@ #include "scene/gui/button_group.h" #include "scene/gui/scroll_container.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_node.h" diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 7c232f0c32..fb6d5a786a 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -31,8 +31,8 @@ #include "os/keyboard.h" #include "os/input.h" #include "canvas_item_editor_plugin.h" -#include "tools/editor/editor_settings.h" -#include "tools/editor/editor_scale.h" +#include "editor/editor_settings.h" +#include "editor/editor_scale.h" void TileMapEditor::_notification(int p_what) { @@ -1344,20 +1344,20 @@ void TileMapEditor::_icon_size_changed(float p_value) { void TileMapEditor::_bind_methods() { - ClassDB::bind_method(_MD("_text_entered"),&TileMapEditor::_text_entered); - ClassDB::bind_method(_MD("_text_changed"),&TileMapEditor::_text_changed); - ClassDB::bind_method(_MD("_sbox_input"),&TileMapEditor::_sbox_input); - ClassDB::bind_method(_MD("_menu_option"),&TileMapEditor::_menu_option); - ClassDB::bind_method(_MD("_canvas_draw"),&TileMapEditor::_canvas_draw); - ClassDB::bind_method(_MD("_canvas_mouse_enter"),&TileMapEditor::_canvas_mouse_enter); - ClassDB::bind_method(_MD("_canvas_mouse_exit"),&TileMapEditor::_canvas_mouse_exit); - ClassDB::bind_method(_MD("_tileset_settings_changed"),&TileMapEditor::_tileset_settings_changed); - ClassDB::bind_method(_MD("_update_transform_buttons"),&TileMapEditor::_update_transform_buttons); + ClassDB::bind_method(D_METHOD("_text_entered"),&TileMapEditor::_text_entered); + ClassDB::bind_method(D_METHOD("_text_changed"),&TileMapEditor::_text_changed); + ClassDB::bind_method(D_METHOD("_sbox_input"),&TileMapEditor::_sbox_input); + ClassDB::bind_method(D_METHOD("_menu_option"),&TileMapEditor::_menu_option); + ClassDB::bind_method(D_METHOD("_canvas_draw"),&TileMapEditor::_canvas_draw); + ClassDB::bind_method(D_METHOD("_canvas_mouse_enter"),&TileMapEditor::_canvas_mouse_enter); + ClassDB::bind_method(D_METHOD("_canvas_mouse_exit"),&TileMapEditor::_canvas_mouse_exit); + ClassDB::bind_method(D_METHOD("_tileset_settings_changed"),&TileMapEditor::_tileset_settings_changed); + ClassDB::bind_method(D_METHOD("_update_transform_buttons"),&TileMapEditor::_update_transform_buttons); - ClassDB::bind_method(_MD("_fill_points"),&TileMapEditor::_fill_points); - ClassDB::bind_method(_MD("_erase_points"),&TileMapEditor::_erase_points); + ClassDB::bind_method(D_METHOD("_fill_points"),&TileMapEditor::_fill_points); + ClassDB::bind_method(D_METHOD("_erase_points"),&TileMapEditor::_erase_points); - ClassDB::bind_method(_MD("_icon_size_changed"), &TileMapEditor::_icon_size_changed); + ClassDB::bind_method(D_METHOD("_icon_size_changed"), &TileMapEditor::_icon_size_changed); } TileMapEditor::CellOp TileMapEditor::_get_op_from_cell(const Point2i& p_pos) diff --git a/tools/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h index 08032d9afd..82e2a396d1 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.h +++ b/editor/plugins/tile_map_editor_plugin.h @@ -29,8 +29,8 @@ #ifndef TILE_MAP_EDITOR_PLUGIN_H #define TILE_MAP_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "scene/2d/tile_map.h" #include "scene/gui/line_edit.h" diff --git a/tools/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 3db6c94917..3db6c94917 100644 --- a/tools/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp diff --git a/tools/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h index 7fec7fa162..02a82ebd6b 100644 --- a/tools/editor/plugins/tile_set_editor_plugin.h +++ b/editor/plugins/tile_set_editor_plugin.h @@ -32,8 +32,8 @@ #include "scene/resources/tile_set.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/editor_name_dialog.h" +#include "editor/editor_node.h" +#include "editor/editor_name_dialog.h" class TileSetEditor : public Control { diff --git a/tools/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index 76626c4556..76626c4556 100644 --- a/tools/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp diff --git a/tools/editor/progress_dialog.h b/editor/progress_dialog.h index 60acf825a9..60acf825a9 100644 --- a/tools/editor/progress_dialog.h +++ b/editor/progress_dialog.h diff --git a/editor/project_export.cpp b/editor/project_export.cpp new file mode 100644 index 0000000000..fc6d8793d8 --- /dev/null +++ b/editor/project_export.cpp @@ -0,0 +1,828 @@ +/*************************************************************************/ +/* project_export.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "project_export.h" +#include "os/dir_access.h" +#include "os/file_access.h" +#include "global_config.h" +#include "io/resource_loader.h" +#include "io/resource_saver.h" +#include "os/os.h" +#include "scene/gui/box_container.h" +#include "scene/gui/tab_container.h" +#include "scene/gui/scroll_container.h" +#include "scene/gui/margin_container.h" +#include "editor_data.h" +#include "io/image_loader.h" +#include "compressed_translation.h" +#include "editor_node.h" +#include "io_plugins/editor_texture_import_plugin.h" +#include "editor_settings.h" + +void ProjectExportDialog::_notification(int p_what) { + + switch (p_what) { + case NOTIFICATION_READY: { + delete_preset->set_icon(get_icon("Del","EditorIcons")); + connect("confirmed",this,"_export_pck_zip"); + } break; + case NOTIFICATION_POPUP_HIDE: { + EditorSettings::get_singleton()->set("interface/dialogs/export_bounds", get_rect()); + } break; + } +} + + +void ProjectExportDialog::popup_export() { + + add_preset->get_popup()->clear(); + for(int i=0;i<EditorExport::get_singleton()->get_export_platform_count();i++) { + + Ref<EditorExportPlatform> plat = EditorExport::get_singleton()->get_export_platform(i); + + add_preset->get_popup()->add_icon_item(plat->get_logo(),plat->get_name()); + + } + + _update_presets(); + + // Restore valid window bounds or pop up at default size. + if (EditorSettings::get_singleton()->has("interface/dialogs/export_bounds")) { + popup(EditorSettings::get_singleton()->get("interface/dialogs/export_bounds")); + } else { + popup_centered_ratio(); + } +} + +void ProjectExportDialog::_add_preset(int p_platform) { + + Ref<EditorExportPreset> preset = EditorExport::get_singleton()->get_export_platform(p_platform)->create_preset(); + ERR_FAIL_COND(!preset.is_valid()); + + String name = EditorExport::get_singleton()->get_export_platform(p_platform)->get_name(); + bool make_runnable=true; + int attempt=1; + while(true) { + + bool valid=true; + + for(int i=0;i<EditorExport::get_singleton()->get_export_preset_count();i++) { + Ref<EditorExportPreset> p = EditorExport::get_singleton()->get_export_preset(i); + if (p->get_platform()==preset->get_platform() && p->is_runnable()) { + make_runnable=false; + } + if (p->get_name()==name) { + valid=false; + break; + } + + } + + if (valid) + break; + + attempt++; + name = EditorExport::get_singleton()->get_export_platform(p_platform)->get_name()+" "+itos(attempt); + + } + + preset->set_name(name); + if (make_runnable) + preset->set_runnable(make_runnable); + EditorExport::get_singleton()->add_export_preset(preset); + _update_presets(); + _edit_preset(EditorExport::get_singleton()->get_export_preset_count()-1); + +} + + +void ProjectExportDialog::_update_presets() { + + updating=true; + + Ref<EditorExportPreset> current; + if (presets->get_current()>=0 && presets->get_current()<presets->get_item_count()) + current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + + int current_idx=-1; + presets->clear(); + for(int i=0;i<EditorExport::get_singleton()->get_export_preset_count();i++) { + Ref<EditorExportPreset> preset = EditorExport::get_singleton()->get_export_preset(i); + if (preset==current) { + current_idx=i; + } + + String name = preset->get_name(); + if (preset->is_runnable()) + name+=" ("+TTR("Runnable")+")"; + presets->add_item(name,preset->get_platform()->get_logo()); + } + + if (current_idx!=-1) { + presets->select(current_idx); + //_edit_preset(current_idx); + } + + updating=false; + +} + +void ProjectExportDialog::_edit_preset(int p_index) { + + if (p_index<0 || p_index>=presets->get_item_count()) { + name->set_text(""); + name->set_editable(false); + runnable->set_disabled(true); + parameters->edit(NULL); + delete_preset->set_disabled(true); + sections->hide(); + patches->clear(); + return; + } + + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(p_index); + ERR_FAIL_COND(current.is_null()); + + + updating=true; + + presets->select(p_index); + sections->show(); + + name->set_editable(true); + delete_preset->set_disabled(false); + name->set_text(current->get_name()); + runnable->set_disabled(false); + runnable->set_pressed(current->is_runnable()); + parameters->edit(current.ptr()); + + export_filter->select(current->get_export_filter()); + include_filters->set_text(current->get_include_filter()); + exclude_filters->set_text(current->get_exclude_filter()); + + + patches->clear(); + TreeItem *patch_root = patches->create_item(); + Vector<String> patchlist = current->get_patches(); + for(int i=0;i<patchlist.size();i++) { + TreeItem *patch = patches->create_item(patch_root); + patch->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); + String file = patchlist[i].get_file(); + patch->set_editable(0,true); + patch->set_text(0,file.get_file().replace("*","")); + if (file.ends_with("*")) + patch->set_checked(0,true); + patch->set_tooltip(0,patchlist[i]); + patch->set_metadata(0,i); + patch->add_button(0,get_icon("Del","EditorIcons"),0); + patch->add_button(0,get_icon("folder","FileDialog"),1); + } + + TreeItem *patch_add = patches->create_item(patch_root); + patch_add->set_metadata(0,patchlist.size()); + if (patchlist.size()==0) + patch_add->set_text(0,"Add initial export.."); + else + patch_add->set_text(0,"Add previous patches.."); + + patch_add->add_button(0,get_icon("folder","FileDialog"),1); + + _fill_resource_tree(); + + updating=false; + +} + +void ProjectExportDialog::_patch_button_pressed(Object* p_item,int p_column,int p_id) { + + + TreeItem *ti = (TreeItem*)p_item; + + patch_index=ti->get_metadata(0); + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + ERR_FAIL_COND(current.is_null()); + + if (p_id==0) { + Vector<String> patches = current->get_patches(); + ERR_FAIL_INDEX(patch_index,patches.size()); + patch_erase->set_text(vformat(TTR("Delete patch '"+patches[patch_index].get_file()+"' from list?"))); + patch_erase->popup_centered_minsize(); + } else { + patch_dialog->popup_centered_ratio(); + } +} + +void ProjectExportDialog::_patch_edited() { + + TreeItem *item = patches->get_edited(); + if (!item) + return; + int index = item->get_metadata(0); + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + ERR_FAIL_COND(current.is_null()); + + Vector<String> patches = current->get_patches(); + + ERR_FAIL_INDEX(index,patches.size()); + + String patch = patches[index].replace("*",""); + + if (item->is_checked(0)) { + patch+="*"; + } + + current->set_patch(index,patch); + + + +} + +void ProjectExportDialog::_patch_selected(const String& p_path) { + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + ERR_FAIL_COND(current.is_null()); + + Vector<String> patches = current->get_patches(); + + if (patch_index >=patches.size()) { + + current->add_patch(GlobalConfig::get_singleton()->get_resource_path().path_to(p_path)+"*"); + } else { + String enabled = patches[patch_index].ends_with("*") ? String("*") : String(); + current->set_patch(patch_index,GlobalConfig::get_singleton()->get_resource_path().path_to(p_path)+enabled); + + } + + _edit_preset(presets->get_current()); + +} + +void ProjectExportDialog::_patch_deleted() { + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + ERR_FAIL_COND(current.is_null()); + + Vector<String> patches = current->get_patches(); + if (patch_index <patches.size()) { + + current->remove_patch(patch_index); + _edit_preset(presets->get_current()); + } + +} + +void ProjectExportDialog::_runnable_pressed() { + + if (updating) + return; + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + ERR_FAIL_COND(current.is_null()); + + if (runnable->is_pressed()) { + + for(int i=0;i<EditorExport::get_singleton()->get_export_preset_count();i++) { + Ref<EditorExportPreset> p = EditorExport::get_singleton()->get_export_preset(i); + if (p->get_platform()==current->get_platform()) { + p->set_runnable(current==p); + } + } + } else { + + current->set_runnable(false); + } + + _update_presets(); +} + +void ProjectExportDialog::_name_changed(const String& p_string) { + + if (updating) + return; + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + ERR_FAIL_COND(current.is_null()); + + current->set_name(p_string); + _update_presets(); + + +} + +void ProjectExportDialog::_delete_preset() { + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + if (current.is_null()) + return; + + delete_confirm->set_text(vformat(TTR("Delete preset '%s'?"),current->get_name())); + delete_confirm->popup_centered_minsize(); + +} + +void ProjectExportDialog::_delete_preset_confirm() { + + int idx = presets->get_current(); + parameters->edit(NULL);//to avoid crash + EditorExport::get_singleton()->remove_export_preset(idx); + _update_presets(); + _edit_preset(-1); +} + + +Variant ProjectExportDialog::get_drag_data_fw(const Point2& p_point,Control* p_from) { + + if (p_from==presets) { + int pos = presets->get_item_at_pos(p_point,true); + + if (pos>=0) { + Dictionary d; + d["type"]="export_preset"; + d["preset"]=pos; + + HBoxContainer *drag = memnew( HBoxContainer); + TextureRect *tr = memnew(TextureRect); + tr->set_texture(presets->get_item_icon(pos)); + drag->add_child(tr); + Label *label = memnew( Label ); + label->set_text(presets->get_item_text(pos)); + drag->add_child(label); + + set_drag_preview(drag); + + return d; + + } + } else if (p_from==patches) { + + TreeItem *item = patches->get_item_at_pos(p_point); + + if (item && item->get_cell_mode(0)==TreeItem::CELL_MODE_CHECK) { + + int metadata = item->get_metadata(0); + Dictionary d; + d["type"]="export_patch"; + d["patch"]=metadata; + + Label *label = memnew( Label ); + label->set_text(item->get_text(0)); + set_drag_preview(label); + + return d; + } + + } + + return Variant(); +} + +bool ProjectExportDialog::can_drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from) const{ + + if (p_from==presets) { + Dictionary d = p_data; + if (!d.has("type") || String(d["type"])!="export_preset") + return false; + + + if (presets->get_item_at_pos(p_point,true)<0 && !presets->is_pos_at_end_of_items(p_point)) + return false; + } else if (p_from==patches) { + + Dictionary d = p_data; + if (!d.has("type") || String(d["type"])!="export_patch") + return false; + + patches->set_drop_mode_flags(Tree::DROP_MODE_ON_ITEM); + + TreeItem *item = patches->get_item_at_pos(p_point); + + if (!item) { + + return false; + } + + } + + return true; +} + +void ProjectExportDialog::drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from){ + + if (p_from==presets) { + Dictionary d=p_data; + int from_pos = d["preset"]; + + int to_pos=-1; + + if (presets->get_item_at_pos(p_point,true)>=0) { + to_pos = presets->get_item_at_pos(p_point,true); + } + + if (to_pos==-1 && !presets->is_pos_at_end_of_items(p_point)) + return; + + if (to_pos==from_pos) + return; + else if (to_pos>from_pos) { + to_pos--; + } + + + Ref<EditorExportPreset> preset = EditorExport::get_singleton()->get_export_preset(from_pos); + EditorExport::get_singleton()->remove_export_preset(from_pos); + EditorExport::get_singleton()->add_export_preset(preset,to_pos); + + _update_presets(); + if (to_pos>=0) + _edit_preset(to_pos); + else + _edit_preset(presets->get_item_count()-1); + } else if (p_from==patches) { + + Dictionary d = p_data; + if (!d.has("type") || String(d["type"])!="export_patch") + return; + + int from_pos = d["patch"]; + + TreeItem *item = patches->get_item_at_pos(p_point); + if (!item) + return; + + int to_pos = item->get_cell_mode(0)==TreeItem::CELL_MODE_CHECK ? int(item->get_metadata(0)) : -1; + + if (to_pos==from_pos) + return; + else if (to_pos>from_pos) { + to_pos--; + } + + Ref<EditorExportPreset> preset = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + String patch = preset->get_patch(from_pos); + preset->remove_patch(from_pos); + preset->add_patch(patch,to_pos); + + _edit_preset(presets->get_current()); + + } + +} + +void ProjectExportDialog::_export_type_changed(int p_which) { + + if (updating) + return; + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + if (current.is_null()) + return; + + current->set_export_filter(EditorExportPreset::ExportFilter(p_which)); + updating=true; + _fill_resource_tree(); + updating=false; + +} + +void ProjectExportDialog::_filter_changed(const String& p_filter) { + + if (updating) + return; + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + if (current.is_null()) + return; + + current->set_include_filter(include_filters->get_text()); + current->set_exclude_filter(exclude_filters->get_text()); + + + +} + +void ProjectExportDialog::_fill_resource_tree() { + + include_files->clear(); + include_label->hide(); + include_margin->hide(); + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + if (current.is_null()) + return; + + EditorExportPreset::ExportFilter f = current->get_export_filter(); + + if (f==EditorExportPreset::EXPORT_ALL_RESOURCES) { + return; + } + + include_label->show(); + include_margin->show(); + + TreeItem *root = include_files->create_item(); + + + _fill_tree(EditorFileSystem::get_singleton()->get_filesystem(),root,current,f==EditorExportPreset::EXPORT_SELECTED_SCENES); + +} + + +bool ProjectExportDialog::_fill_tree(EditorFileSystemDirectory *p_dir,TreeItem *p_item,Ref<EditorExportPreset> ¤t,bool p_only_scenes) { + + p_item->set_icon(0,get_icon("folder","FileDialog")); + p_item->set_text(0,p_dir->get_name()+"/"); + + bool used=false; + for(int i=0;i<p_dir->get_subdir_count();i++) { + + TreeItem *subdir = include_files->create_item(p_item); + if (_fill_tree(p_dir->get_subdir(i),subdir,current,p_only_scenes)==false) { + memdelete(subdir); + } else { + used=true; + } + } + + + + for(int i=0;i<p_dir->get_file_count();i++) { + + String type = p_dir->get_file_type(i); + if (p_only_scenes && type!="PackedScene") + continue; + + TreeItem *file = include_files->create_item(p_item); + file->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); + file->set_text(0,p_dir->get_file(i)); + + Ref<Texture> tex; + if (has_icon(type,editor_icons)) { + tex = get_icon(type,editor_icons); + } else { + tex = get_icon("Object",editor_icons); + } + + String path = p_dir->get_file_path(i); + + file->set_icon(0,tex); + file->set_editable(0,true); + file->set_checked(0,current->has_export_file(path)); + file->set_metadata(0,path); + + used=true; + + } + + return used; +} + +void ProjectExportDialog::_tree_changed() { + + if (updating) + return; + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + if (current.is_null()) + return; + + TreeItem *item = include_files->get_edited(); + if (!item) + return; + + String path = item->get_metadata(0); + bool added = item->is_checked(0); + + if (added) { + current->add_export_file(path); + } else { + current->remove_export_file(path); + + } +} + + +void ProjectExportDialog::_export_pck_zip() { + + export_pck_zip->popup_centered_ratio(); +} + +void ProjectExportDialog::_export_pck_zip_selected(const String& p_path) { + + Ref<EditorExportPreset> current = EditorExport::get_singleton()->get_export_preset(presets->get_current()); + ERR_FAIL_COND (current.is_null()); + Ref<EditorExportPlatform> platform = current->get_platform(); + ERR_FAIL_COND( platform.is_null() ); + + if (p_path.ends_with(".zip")) { + platform->save_zip(current,p_path); + } else if (p_path.ends_with(".pck")) { + platform->save_pack(current,p_path); + } +} + + +void ProjectExportDialog::_bind_methods() { + + ClassDB::bind_method("_add_preset",&ProjectExportDialog::_add_preset); + ClassDB::bind_method("_edit_preset",&ProjectExportDialog::_edit_preset); + ClassDB::bind_method("_runnable_pressed",&ProjectExportDialog::_runnable_pressed); + ClassDB::bind_method("_name_changed",&ProjectExportDialog::_name_changed); + ClassDB::bind_method("_delete_preset",&ProjectExportDialog::_delete_preset); + ClassDB::bind_method("_delete_preset_confirm",&ProjectExportDialog::_delete_preset_confirm); + ClassDB::bind_method("get_drag_data_fw",&ProjectExportDialog::get_drag_data_fw); + ClassDB::bind_method("can_drop_data_fw",&ProjectExportDialog::can_drop_data_fw); + ClassDB::bind_method("drop_data_fw",&ProjectExportDialog::drop_data_fw); + ClassDB::bind_method("_export_type_changed",&ProjectExportDialog::_export_type_changed); + ClassDB::bind_method("_filter_changed",&ProjectExportDialog::_filter_changed); + ClassDB::bind_method("_tree_changed",&ProjectExportDialog::_tree_changed); + ClassDB::bind_method("_patch_button_pressed",&ProjectExportDialog::_patch_button_pressed); + ClassDB::bind_method("_patch_selected",&ProjectExportDialog::_patch_selected); + ClassDB::bind_method("_patch_deleted",&ProjectExportDialog::_patch_deleted); + ClassDB::bind_method("_patch_edited",&ProjectExportDialog::_patch_edited); + ClassDB::bind_method("_export_pck_zip",&ProjectExportDialog::_export_pck_zip); + ClassDB::bind_method("_export_pck_zip_selected",&ProjectExportDialog::_export_pck_zip_selected); + + +} +ProjectExportDialog::ProjectExportDialog() { + + set_title(TTR("Export")); + set_resizable(true); + + HBoxContainer *hbox = memnew( HBoxContainer ); + add_child(hbox); + + VBoxContainer *preset_vb = memnew( VBoxContainer ); + preset_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); + hbox->add_child(preset_vb); + + HBoxContainer *preset_hb = memnew( HBoxContainer ); + preset_hb->add_child(memnew(Label(TTR("Presets")))); + preset_hb->add_spacer(); + preset_vb->add_child(preset_hb); + + add_preset = memnew( MenuButton ); + add_preset->set_text(TTR("Add..")); + add_preset->get_popup()->connect("index_pressed",this,"_add_preset"); + preset_hb->add_child(add_preset); + MarginContainer *mc = memnew( MarginContainer ); + preset_vb->add_child(mc); + mc->set_v_size_flags(SIZE_EXPAND_FILL); + presets = memnew( ItemList ); + presets->set_drag_forwarding(this); + mc->add_child(presets); + presets->connect("item_selected",this,"_edit_preset"); + delete_preset = memnew( ToolButton ); + preset_hb->add_child(delete_preset); + delete_preset->connect("pressed",this,"_delete_preset"); + + VBoxContainer *settings_vb = memnew( VBoxContainer ); + settings_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); + hbox->add_child(settings_vb); + + name = memnew(LineEdit); + settings_vb->add_margin_child(TTR("Name:"),name); + name->connect("text_changed",this,"_name_changed"); + runnable = memnew(CheckButton); + runnable->set_text(TTR("Runnable")); + runnable->connect("pressed",this,"_runnable_pressed"); + settings_vb->add_child(runnable); + + sections = memnew (TabContainer ); + settings_vb->add_child(sections); + sections->set_v_size_flags(SIZE_EXPAND_FILL); + + parameters = memnew (PropertyEditor ); + sections->add_child(parameters); + parameters->set_name(TTR("Options")); + parameters->hide_top_label(); + parameters->set_v_size_flags(SIZE_EXPAND_FILL); + parameters->set_hide_script(true); + + VBoxContainer *resources_vb = memnew( VBoxContainer ); + sections->add_child(resources_vb); + resources_vb->set_name(TTR("Resources")); + + export_filter = memnew( OptionButton ); + export_filter->add_item(TTR("Export all resources in the project")); + export_filter->add_item(TTR("Export selected scenes (and dependencies)")); + export_filter->add_item(TTR("Export selected resources (and dependencies)")); + resources_vb->add_margin_child(TTR("Export Mode:"),export_filter); + export_filter->connect("item_selected",this,"_export_type_changed"); + + include_label = memnew( Label ); + include_label->set_text(TTR("Resources to export:")); + resources_vb->add_child(include_label); + include_margin = memnew( MarginContainer ); + include_margin->set_v_size_flags(SIZE_EXPAND_FILL); + resources_vb->add_child(include_margin); + + include_files = memnew(Tree); + include_margin->add_child(include_files); + include_files->connect("item_edited",this,"_tree_changed"); + + include_filters = memnew( LineEdit ); + resources_vb->add_margin_child(TTR("Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"),include_filters); + include_filters->connect("text_changed",this,"_filter_changed"); + + exclude_filters = memnew( LineEdit ); + resources_vb->add_margin_child(TTR("Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"),exclude_filters); + exclude_filters->connect("text_changed",this,"_filter_changed"); + + VBoxContainer *patch_vb = memnew( VBoxContainer ); + sections->add_child(patch_vb); + patch_vb->set_name(TTR("Patches")); + + patches = memnew( Tree ); + patch_vb->add_child(patches); + patches->set_v_size_flags(SIZE_EXPAND_FILL); + patches->set_hide_root(true); + patches->connect("button_pressed",this,"_patch_button_pressed"); + patches->connect("item_edited",this,"_patch_edited"); + patches->set_drag_forwarding(this); + patches->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true); + + HBoxContainer *patches_hb = memnew( HBoxContainer ); + patch_vb->add_child(patches_hb); + patches_hb->add_spacer(); + patch_export = memnew( Button ); + patch_export->set_text(TTR("Make Patch")); + patches_hb->add_child(patch_export); + patches_hb->add_spacer(); + + patch_dialog = memnew( FileDialog ); + patch_dialog->add_filter("*.pck ; Pack File"); + patch_dialog->set_mode(FileDialog::MODE_OPEN_FILE); + patch_dialog->connect("file_selected",this,"_patch_selected"); + add_child(patch_dialog); + + patch_erase = memnew( ConfirmationDialog ); + patch_erase->get_ok()->set_text(TTR("Delete")); + patch_erase->connect("confirmed",this,"_patch_deleted"); + add_child(patch_erase); + + + //disable by default + name->set_editable(false); + runnable->set_disabled(true); + delete_preset->set_disabled(true); + sections->hide(); + parameters->edit(NULL); + + delete_confirm = memnew( ConfirmationDialog ); + add_child(delete_confirm); + delete_confirm->get_ok()->set_text(TTR("Delete")); + delete_confirm->connect("confirmed",this,"_delete_preset_confirm"); + + updating=false; + + get_ok()->set_text("Export PCK/Zip"); + export_button = add_button("Export Project",!OS::get_singleton()->get_swap_ok_cancel(),"export"); + + export_pck_zip = memnew( FileDialog ); + export_pck_zip->add_filter("*.zip ; ZIP File"); + export_pck_zip->add_filter("*.pck ; Godot Game Pack"); + export_pck_zip->set_access(FileDialog::ACCESS_FILESYSTEM); + export_pck_zip->set_mode(FileDialog::MODE_SAVE_FILE); + add_child(export_pck_zip); + export_pck_zip->connect("file_selected",this,"_export_pck_zip_selected"); + + set_hide_on_ok(false); + + + + editor_icons = "EditorIcons"; +} + +ProjectExportDialog::~ProjectExportDialog() { + + +} diff --git a/editor/project_export.h b/editor/project_export.h new file mode 100644 index 0000000000..b58ce2dc9d --- /dev/null +++ b/editor/project_export.h @@ -0,0 +1,142 @@ +/*************************************************************************/ +/* project_export.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 PROJECT_EXPORT_SETTINGS_H +#define PROJECT_EXPORT_SETTINGS_H + +#include "scene/main/timer.h" +#include "scene/gui/control.h" +#include "scene/gui/tree.h" +#include "scene/gui/label.h" +#include "editor/editor_file_dialog.h" +#include "scene/gui/button.h" +#include "scene/gui/file_dialog.h" +#include "scene/gui/dialogs.h" +#include "scene/gui/tab_container.h" +#include "os/dir_access.h" +#include "os/thread.h" +#include "scene/gui/option_button.h" + +#include "scene/gui/slider.h" +#include "editor/editor_file_system.h" +#include "property_editor.h" +#include "editor_export.h" + + +class EditorNode; + +class ProjectExportDialog : public ConfirmationDialog { + GDCLASS( ProjectExportDialog, ConfirmationDialog ); + +private: + + + TabContainer *sections; + + MenuButton *add_preset; + Button *delete_preset; + ItemList *presets; + + LineEdit *name; + PropertyEditor *parameters; + CheckButton *runnable; + + + EditorFileDialog *pck_export; + EditorFileDialog *file_export; + + Button *button_export; + bool updating; + + ConfirmationDialog *delete_confirm; + + OptionButton *export_filter; + LineEdit *include_filters; + LineEdit *exclude_filters; + Tree *include_files; + + Label* include_label; + MarginContainer *include_margin; + + StringName editor_icons; + + Tree *patches; + Button *patch_export; + int patch_index; + FileDialog *patch_dialog; + ConfirmationDialog *patch_erase; + + Button *export_button; + + void _patch_selected(const String& p_path); + void _patch_deleted(); + + void _runnable_pressed(); + void _name_changed(const String& p_string); + void _add_preset(int p_platform); + void _edit_preset(int p_index); + void _delete_preset(); + void _delete_preset_confirm(); + + void _update_presets(); + + void _export_type_changed(int p_which); + void _filter_changed(const String& p_filter); + void _fill_resource_tree(); + bool _fill_tree(EditorFileSystemDirectory *p_dir,TreeItem *p_item,Ref<EditorExportPreset> ¤t,bool p_only_scenes); + void _tree_changed(); + + void _patch_button_pressed(Object* p_item,int p_column,int p_id); + void _patch_edited(); + + + Variant get_drag_data_fw(const Point2& p_point,Control* p_from); + bool can_drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from) const; + void drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from); + + FileDialog *export_pck_zip; + + void _export_pck_zip(); + void _export_pck_zip_selected(const String& p_path); + +protected: + void _notification(int p_what); + static void _bind_methods(); +public: + + void popup_export(); + + ProjectExportDialog(); + ~ProjectExportDialog(); +}; + + + + +#endif // PROJECT_EXPORT_SETTINGS_H + diff --git a/tools/editor/project_manager.cpp b/editor/project_manager.cpp index af73414ab0..34b2d3e82c 100644 --- a/tools/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1200,7 +1200,7 @@ void ProjectManager::_bind_methods() { ClassDB::bind_method("_favorite_pressed",&ProjectManager::_favorite_pressed); ClassDB::bind_method("_install_project",&ProjectManager::_install_project); ClassDB::bind_method("_files_dropped",&ProjectManager::_files_dropped); - ClassDB::bind_method(_MD("_scan_multiple_folders", "files"),&ProjectManager::_scan_multiple_folders); + ClassDB::bind_method(D_METHOD("_scan_multiple_folders", "files"),&ProjectManager::_scan_multiple_folders); } @@ -1483,9 +1483,9 @@ void ProjectListFilter::_notification(int p_what) { void ProjectListFilter::_bind_methods() { - ClassDB::bind_method(_MD("_command"),&ProjectListFilter::_command); - ClassDB::bind_method(_MD("_search_text_changed"), &ProjectListFilter::_search_text_changed); - ClassDB::bind_method(_MD("_filter_option_selected"), &ProjectListFilter::_filter_option_selected); + ClassDB::bind_method(D_METHOD("_command"),&ProjectListFilter::_command); + ClassDB::bind_method(D_METHOD("_search_text_changed"), &ProjectListFilter::_search_text_changed); + ClassDB::bind_method(D_METHOD("_filter_option_selected"), &ProjectListFilter::_filter_option_selected); ADD_SIGNAL( MethodInfo("filter_changed") ); } diff --git a/tools/editor/project_manager.h b/editor/project_manager.h index 1fd8a301ea..cb6c0b7f26 100644 --- a/tools/editor/project_manager.h +++ b/editor/project_manager.h @@ -34,7 +34,7 @@ #include "scene/gui/scroll_container.h" #include "scene/gui/file_dialog.h" #include "scene/gui/tool_button.h" -#include "tools/editor/asset_library_editor_plugin.h" +#include "editor/asset_library_editor_plugin.h" class NewProjectDialog; class ProjectListFilter; diff --git a/tools/editor/project_settings.cpp b/editor/project_settings.cpp index e725786f94..15019b8ca8 100644 --- a/tools/editor/project_settings.cpp +++ b/editor/project_settings.cpp @@ -29,7 +29,7 @@ #include "project_settings.h" #include "scene/gui/tab_container.h" -#include "globals.h" +#include "global_config.h" #include "os/keyboard.h" #include "editor_node.h" #include "scene/gui/margin_container.h" @@ -73,34 +73,38 @@ static const char* _axis_names[JOY_AXIS_MAX*2] = { void ProjectSettings::_notification(int p_what) { - if (p_what==NOTIFICATION_ENTER_TREE) { + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { + globals_editor->edit(GlobalConfig::get_singleton()); - globals_editor->edit(GlobalConfig::get_singleton()); + search_button->set_icon(get_icon("Zoom","EditorIcons")); + clear_button->set_icon(get_icon("Close","EditorIcons")); - 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"),TTR("Key "),InputEvent::KEY);//"Key " - because the word 'key' has already been used as a key animation + popup_add->add_icon_item(get_icon("JoyButton","EditorIcons"),TTR("Joy Button"),InputEvent::JOYPAD_BUTTON); + popup_add->add_icon_item(get_icon("JoyAxis","EditorIcons"),TTR("Joy Axis"),InputEvent::JOYPAD_MOTION); + popup_add->add_icon_item(get_icon("Mouse","EditorIcons"),TTR("Mouse Button"),InputEvent::MOUSE_BUTTON); - translation_list->connect("button_pressed",this,"_translation_delete"); - _update_actions(); - popup_add->add_icon_item(get_icon("Keyboard","EditorIcons"),TTR("Key "),InputEvent::KEY);//"Key " - because the word 'key' has already been used as a key animation - popup_add->add_icon_item(get_icon("JoyButton","EditorIcons"),TTR("Joy Button"),InputEvent::JOYPAD_BUTTON); - popup_add->add_icon_item(get_icon("JoyAxis","EditorIcons"),TTR("Joy Axis"),InputEvent::JOYPAD_MOTION); - popup_add->add_icon_item(get_icon("Mouse","EditorIcons"),TTR("Mouse Button"),InputEvent::MOUSE_BUTTON); + List<String> tfn; + ResourceLoader::get_recognized_extensions_for_type("Translation",&tfn); + for (List<String>::Element *E=tfn.front();E;E=E->next()) { - List<String> tfn; - ResourceLoader::get_recognized_extensions_for_type("Translation",&tfn); - for (List<String>::Element *E=tfn.front();E;E=E->next()) { - - translation_file_open->add_filter("*."+E->get()); - } + translation_file_open->add_filter("*."+E->get()); + } - List<String> rfn; - ResourceLoader::get_recognized_extensions_for_type("Resource",&rfn); - for (List<String>::Element *E=rfn.front();E;E=E->next()) { + List<String> rfn; + ResourceLoader::get_recognized_extensions_for_type("Resource",&rfn); + for (List<String>::Element *E=rfn.front();E;E=E->next()) { - translation_res_file_open->add_filter("*."+E->get()); - translation_res_option_file_open->add_filter("*."+E->get()); - } + translation_res_file_open->add_filter("*."+E->get()); + translation_res_option_file_open->add_filter("*."+E->get()); + } + } break; + case NOTIFICATION_POPUP_HIDE: { + EditorSettings::get_singleton()->set("interface/dialogs/project_settings_bounds", get_rect()); + } break; } } @@ -242,7 +246,7 @@ void ProjectSettings::_device_input_add() { undo_redo->add_undo_method(this,"_settings_changed"); undo_redo->commit_action(); - _show_last_added(ie); + _show_last_added(ie, name); } @@ -279,12 +283,14 @@ void ProjectSettings::_press_a_key_confirm() { undo_redo->add_undo_method(this,"_settings_changed"); undo_redo->commit_action(); - _show_last_added(ie); + _show_last_added(ie, name); } -void ProjectSettings::_show_last_added(const InputEvent& p_event) { +void ProjectSettings::_show_last_added(const InputEvent& p_event, const String &p_name) { TreeItem *r = input_editor->get_root(); + String name = p_name; + name.erase(0,6); if (!r) return; r=r->get_children(); @@ -292,6 +298,10 @@ void ProjectSettings::_show_last_added(const InputEvent& p_event) { return; bool found = false; while(r){ + if (r->get_text(0) != name) { + r=r->get_next(); + continue; + } TreeItem *child = r->get_children(); while(child){ Variant input = child->get_meta("__input"); @@ -377,7 +387,7 @@ void ProjectSettings::_add_item(int p_item){ } break; case InputEvent::JOYPAD_BUTTON: { - device_id->set_value(3); + device_id->set_value(0); device_index_label->set_text(TTR("Joypad Button Index:")); device_index->clear(); @@ -573,8 +583,12 @@ void ProjectSettings::_update_actions() { void ProjectSettings::popup_project_settings() { - //popup_centered(Size2(500,400)); - popup_centered_ratio(); + // Restore valid window bounds or pop up at default size. + if (EditorSettings::get_singleton()->has("interface/dialogs/project_settings_bounds")) { + popup(EditorSettings::get_singleton()->get("interface/dialogs/project_settings_bounds")); + } else { + popup_centered_ratio(); + } globals_editor->update_category_list(); _update_translations(); autoload_settings->update_autoload(); @@ -1175,41 +1189,41 @@ void ProjectSettings::set_plugins_page() { void ProjectSettings::_bind_methods() { - ClassDB::bind_method(_MD("_item_selected"),&ProjectSettings::_item_selected); - ClassDB::bind_method(_MD("_item_add"),&ProjectSettings::_item_add); - ClassDB::bind_method(_MD("_item_adds"),&ProjectSettings::_item_adds); - ClassDB::bind_method(_MD("_item_del"),&ProjectSettings::_item_del); - ClassDB::bind_method(_MD("_item_checked"),&ProjectSettings::_item_checked); - ClassDB::bind_method(_MD("_save"),&ProjectSettings::_save); - ClassDB::bind_method(_MD("_action_add"),&ProjectSettings::_action_add); - ClassDB::bind_method(_MD("_action_adds"),&ProjectSettings::_action_adds); - ClassDB::bind_method(_MD("_action_selected"),&ProjectSettings::_action_selected); - ClassDB::bind_method(_MD("_action_edited"),&ProjectSettings::_action_edited); - ClassDB::bind_method(_MD("_action_button_pressed"),&ProjectSettings::_action_button_pressed); - ClassDB::bind_method(_MD("_update_actions"),&ProjectSettings::_update_actions); - ClassDB::bind_method(_MD("_wait_for_key"),&ProjectSettings::_wait_for_key); - ClassDB::bind_method(_MD("_add_item"),&ProjectSettings::_add_item); - ClassDB::bind_method(_MD("_device_input_add"),&ProjectSettings::_device_input_add); - ClassDB::bind_method(_MD("_press_a_key_confirm"),&ProjectSettings::_press_a_key_confirm); - ClassDB::bind_method(_MD("_settings_prop_edited"),&ProjectSettings::_settings_prop_edited); - ClassDB::bind_method(_MD("_copy_to_platform"),&ProjectSettings::_copy_to_platform); - ClassDB::bind_method(_MD("_update_translations"),&ProjectSettings::_update_translations); - ClassDB::bind_method(_MD("_translation_delete"),&ProjectSettings::_translation_delete); - ClassDB::bind_method(_MD("_settings_changed"),&ProjectSettings::_settings_changed); - ClassDB::bind_method(_MD("_translation_add"),&ProjectSettings::_translation_add); - ClassDB::bind_method(_MD("_translation_file_open"),&ProjectSettings::_translation_file_open); - - ClassDB::bind_method(_MD("_translation_res_add"),&ProjectSettings::_translation_res_add); - ClassDB::bind_method(_MD("_translation_res_file_open"),&ProjectSettings::_translation_res_file_open); - ClassDB::bind_method(_MD("_translation_res_option_add"),&ProjectSettings::_translation_res_option_add); - ClassDB::bind_method(_MD("_translation_res_option_file_open"),&ProjectSettings::_translation_res_option_file_open); - ClassDB::bind_method(_MD("_translation_res_select"),&ProjectSettings::_translation_res_select); - ClassDB::bind_method(_MD("_translation_res_option_changed"),&ProjectSettings::_translation_res_option_changed); - ClassDB::bind_method(_MD("_translation_res_delete"),&ProjectSettings::_translation_res_delete); - ClassDB::bind_method(_MD("_translation_res_option_delete"),&ProjectSettings::_translation_res_option_delete); - - ClassDB::bind_method(_MD("_clear_search_box"),&ProjectSettings::_clear_search_box); - ClassDB::bind_method(_MD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar); + ClassDB::bind_method(D_METHOD("_item_selected"),&ProjectSettings::_item_selected); + ClassDB::bind_method(D_METHOD("_item_add"),&ProjectSettings::_item_add); + ClassDB::bind_method(D_METHOD("_item_adds"),&ProjectSettings::_item_adds); + ClassDB::bind_method(D_METHOD("_item_del"),&ProjectSettings::_item_del); + ClassDB::bind_method(D_METHOD("_item_checked"),&ProjectSettings::_item_checked); + ClassDB::bind_method(D_METHOD("_save"),&ProjectSettings::_save); + ClassDB::bind_method(D_METHOD("_action_add"),&ProjectSettings::_action_add); + ClassDB::bind_method(D_METHOD("_action_adds"),&ProjectSettings::_action_adds); + ClassDB::bind_method(D_METHOD("_action_selected"),&ProjectSettings::_action_selected); + ClassDB::bind_method(D_METHOD("_action_edited"),&ProjectSettings::_action_edited); + ClassDB::bind_method(D_METHOD("_action_button_pressed"),&ProjectSettings::_action_button_pressed); + ClassDB::bind_method(D_METHOD("_update_actions"),&ProjectSettings::_update_actions); + ClassDB::bind_method(D_METHOD("_wait_for_key"),&ProjectSettings::_wait_for_key); + ClassDB::bind_method(D_METHOD("_add_item"),&ProjectSettings::_add_item); + ClassDB::bind_method(D_METHOD("_device_input_add"),&ProjectSettings::_device_input_add); + ClassDB::bind_method(D_METHOD("_press_a_key_confirm"),&ProjectSettings::_press_a_key_confirm); + ClassDB::bind_method(D_METHOD("_settings_prop_edited"),&ProjectSettings::_settings_prop_edited); + ClassDB::bind_method(D_METHOD("_copy_to_platform"),&ProjectSettings::_copy_to_platform); + ClassDB::bind_method(D_METHOD("_update_translations"),&ProjectSettings::_update_translations); + ClassDB::bind_method(D_METHOD("_translation_delete"),&ProjectSettings::_translation_delete); + ClassDB::bind_method(D_METHOD("_settings_changed"),&ProjectSettings::_settings_changed); + ClassDB::bind_method(D_METHOD("_translation_add"),&ProjectSettings::_translation_add); + ClassDB::bind_method(D_METHOD("_translation_file_open"),&ProjectSettings::_translation_file_open); + + ClassDB::bind_method(D_METHOD("_translation_res_add"),&ProjectSettings::_translation_res_add); + ClassDB::bind_method(D_METHOD("_translation_res_file_open"),&ProjectSettings::_translation_res_file_open); + ClassDB::bind_method(D_METHOD("_translation_res_option_add"),&ProjectSettings::_translation_res_option_add); + ClassDB::bind_method(D_METHOD("_translation_res_option_file_open"),&ProjectSettings::_translation_res_option_file_open); + ClassDB::bind_method(D_METHOD("_translation_res_select"),&ProjectSettings::_translation_res_select); + ClassDB::bind_method(D_METHOD("_translation_res_option_changed"),&ProjectSettings::_translation_res_option_changed); + ClassDB::bind_method(D_METHOD("_translation_res_delete"),&ProjectSettings::_translation_res_delete); + ClassDB::bind_method(D_METHOD("_translation_res_option_delete"),&ProjectSettings::_translation_res_option_delete); + + ClassDB::bind_method(D_METHOD("_clear_search_box"),&ProjectSettings::_clear_search_box); + ClassDB::bind_method(D_METHOD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar); } @@ -1218,6 +1232,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { singleton=this; set_title(TTR("Project Settings (godot.cfg)")); + set_resizable(true); undo_redo=&p_data->get_undo_redo(); data=p_data; diff --git a/tools/editor/project_settings.h b/editor/project_settings.h index bb925a5fd9..96ac2e2c11 100644 --- a/tools/editor/project_settings.h +++ b/editor/project_settings.h @@ -111,7 +111,7 @@ class ProjectSettings : public AcceptDialog { void _action_button_pressed(Object* p_obj, int p_column,int p_id); void _wait_for_key(const InputEvent& p_event); void _press_a_key_confirm(); - void _show_last_added(const InputEvent& p_event); + void _show_last_added(const InputEvent& p_event, const String& p_name); void _settings_prop_edited(const String& p_name); void _settings_changed(); diff --git a/tools/editor/property_editor.cpp b/editor/property_editor.cpp index 8e3791eb8d..533a5b156b 100644 --- a/tools/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -31,14 +31,16 @@ #include "scene/gui/label.h" #include "io/resource_loader.h" #include "io/image_loader.h" +#include "os/input.h" +#include "os/keyboard.h" #include "class_db.h" #include "print_string.h" -#include "globals.h" +#include "global_config.h" #include "scene/resources/font.h" #include "pair.h" #include "scene/scene_string_names.h" #include "editor_settings.h" -#include "editor_import_export.h" +#include "editor_export.h" #include "editor_node.h" #include "multi_node_edit.h" #include "array_property_edit.h" @@ -48,7 +50,7 @@ #include "editor_file_system.h" #include "create_dialog.h" #include "property_selector.h" -#include "globals.h" +#include "global_config.h" void CustomPropertyEditor::_notification(int p_what) { @@ -222,6 +224,14 @@ void CustomPropertyEditor::_menu_option(int p_which) { EditorNode::get_singleton()->get_scene_tree_dock()->open_script_dialog(owner->cast_to<Node>()); } break; + case OBJ_MENU_SHOW_IN_FILE_SYSTEM: { + RES r=v; + FileSystemDock *file_system_dock=EditorNode::get_singleton()->get_filesystem_dock(); + file_system_dock->navigate_to_path(r->get_path()); + // Ensure that the FileSystem dock is visible. + TabContainer* tab_container=(TabContainer*)file_system_dock->get_parent_control(); + tab_container->set_current_tab(file_system_dock->get_position_in_parent()); + } break; default: { @@ -272,6 +282,7 @@ Variant CustomPropertyEditor::get_variant() const { return v; } + String CustomPropertyEditor::get_name() const { return name; @@ -283,6 +294,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty updating=true; name=p_name; v=p_variant; + field_names.clear(); hint=p_hint; hint_text=p_hint_text; type_button->hide(); @@ -526,7 +538,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } else if (hint==PROPERTY_HINT_TYPE_STRING) { - + /* FIXME: This is repeated twice, with slightly different behavior! Which one? Check line 644 */ if (!create_dialog) { create_dialog = memnew( CreateDialog ); create_dialog->connect("create",this,"_create_dialog_callback"); @@ -643,6 +655,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } else if (hint==PROPERTY_HINT_TYPE_STRING) { if (!create_dialog) { + /* FIXME: ... and here. See line 529 */ create_dialog = memnew( CreateDialog ); create_dialog->connect("create",this,"_create_dialog_callback"); add_child(create_dialog); @@ -658,22 +671,20 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } break; case Variant::VECTOR2: { - List<String> names; - names.push_back("x"); - names.push_back("y"); - config_value_editors(2,2,10,names); + field_names.push_back("x"); + field_names.push_back("y"); + config_value_editors(2,2,10,field_names); Vector2 vec=v; value_editor[0]->set_text( String::num( vec.x) ); value_editor[1]->set_text( String::num( vec.y) ); } break; case Variant::RECT2: { - List<String> names; - names.push_back("x"); - names.push_back("y"); - names.push_back("w"); - names.push_back("h"); - config_value_editors(4,4,10,names); + field_names.push_back("x"); + field_names.push_back("y"); + field_names.push_back("w"); + field_names.push_back("h"); + config_value_editors(4,4,10,field_names); Rect2 r=v; value_editor[0]->set_text( String::num( r.pos.x) ); value_editor[1]->set_text( String::num( r.pos.y) ); @@ -682,11 +693,10 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } break; case Variant::VECTOR3: { - List<String> names; - names.push_back("x"); - names.push_back("y"); - names.push_back("z"); - config_value_editors(3,3,10,names); + field_names.push_back("x"); + field_names.push_back("y"); + field_names.push_back("z"); + config_value_editors(3,3,10,field_names); Vector3 vec=v; value_editor[0]->set_text( String::num( vec.x) ); value_editor[1]->set_text( String::num( vec.y) ); @@ -694,12 +704,11 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } break; case Variant::PLANE: { - List<String> names; - names.push_back("x"); - names.push_back("y"); - names.push_back("z"); - names.push_back("d"); - config_value_editors(4,4,10,names); + field_names.push_back("x"); + field_names.push_back("y"); + field_names.push_back("z"); + field_names.push_back("d"); + config_value_editors(4,4,10,field_names); Plane plane=v; value_editor[0]->set_text( String::num( plane.normal.x ) ); value_editor[1]->set_text( String::num( plane.normal.y ) ); @@ -709,12 +718,11 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } break; case Variant::QUAT: { - List<String> names; - names.push_back("x"); - names.push_back("y"); - names.push_back("z"); - names.push_back("w"); - config_value_editors(4,4,10,names); + field_names.push_back("x"); + field_names.push_back("y"); + field_names.push_back("z"); + field_names.push_back("w"); + config_value_editors(4,4,10,field_names); Quat q=v; value_editor[0]->set_text( String::num( q.x ) ); value_editor[1]->set_text( String::num( q.y ) ); @@ -724,14 +732,13 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } break; case Variant::RECT3: { - List<String> names; - names.push_back("px"); - names.push_back("py"); - names.push_back("pz"); - names.push_back("sx"); - names.push_back("sy"); - names.push_back("sz"); - config_value_editors(6,3,16,names); + field_names.push_back("px"); + field_names.push_back("py"); + field_names.push_back("pz"); + field_names.push_back("sx"); + field_names.push_back("sy"); + field_names.push_back("sz"); + config_value_editors(6,3,16,field_names); Rect3 aabb=v; value_editor[0]->set_text( String::num( aabb.pos.x ) ); @@ -744,14 +751,13 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } break; case Variant::TRANSFORM2D: { - List<String> names; - names.push_back("xx"); - names.push_back("xy"); - names.push_back("yx"); - names.push_back("yy"); - names.push_back("ox"); - names.push_back("oy"); - config_value_editors(6,2,16,names); + field_names.push_back("xx"); + field_names.push_back("xy"); + field_names.push_back("yx"); + field_names.push_back("yy"); + field_names.push_back("ox"); + field_names.push_back("oy"); + config_value_editors(6,2,16,field_names); Transform2D basis=v; for(int i=0;i<6;i++) { @@ -762,17 +768,16 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } break; case Variant::BASIS: { - List<String> names; - names.push_back("xx"); - names.push_back("xy"); - names.push_back("xz"); - names.push_back("yx"); - names.push_back("yy"); - names.push_back("yz"); - names.push_back("zx"); - names.push_back("zy"); - names.push_back("zz"); - config_value_editors(9,3,16,names); + field_names.push_back("xx"); + field_names.push_back("xy"); + field_names.push_back("xz"); + field_names.push_back("yx"); + field_names.push_back("yy"); + field_names.push_back("yz"); + field_names.push_back("zx"); + field_names.push_back("zy"); + field_names.push_back("zz"); + config_value_editors(9,3,16,field_names); Basis basis=v; for(int i=0;i<9;i++) { @@ -784,20 +789,19 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty case Variant::TRANSFORM: { - List<String> names; - names.push_back("xx"); - names.push_back("xy"); - names.push_back("xz"); - names.push_back("xo"); - names.push_back("yx"); - names.push_back("yy"); - names.push_back("yz"); - names.push_back("yo"); - names.push_back("zx"); - names.push_back("zy"); - names.push_back("zz"); - names.push_back("zo"); - config_value_editors(12,4,16,names); + field_names.push_back("xx"); + field_names.push_back("xy"); + field_names.push_back("xz"); + field_names.push_back("xo"); + field_names.push_back("yx"); + field_names.push_back("yy"); + field_names.push_back("yz"); + field_names.push_back("yo"); + field_names.push_back("zx"); + field_names.push_back("zy"); + field_names.push_back("zz"); + field_names.push_back("zo"); + config_value_editors(12,4,16,field_names); Transform tr=v; for(int i=0;i<9;i++) { @@ -889,7 +893,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty menu->clear(); menu->set_size(Size2(1,1)); - if (p_name=="script/script" && hint_text=="Script" && owner->cast_to<Node>()) { + if (p_name=="script" && hint_text=="Script" && owner->cast_to<Node>()) { menu->add_icon_item(get_icon("Script","EditorIcons"),TTR("New Script"),OBJ_MENU_NEW_SCRIPT); menu->add_separator(); } else if (hint_text!="") { @@ -945,11 +949,15 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty menu->add_icon_item(get_icon("EditResource","EditorIcons"),"Edit",OBJ_MENU_EDIT); menu->add_icon_item(get_icon("Del","EditorIcons"),"Clear",OBJ_MENU_CLEAR); menu->add_icon_item(get_icon("Duplicate","EditorIcons"),"Make Unique",OBJ_MENU_MAKE_UNIQUE); - /*RES r = v; - if (r.is_valid() && r->get_path().is_resource_file() && r->get_import_metadata().is_valid()) { + RES r = v; + if (r.is_valid() && r->get_path().is_resource_file()) { + /*if (r->get_import_metadata().is_valid()) { + menu->add_separator(); + menu->add_icon_item(get_icon("ReloadSmall","EditorIcons"),"Re-Import",OBJ_MENU_REIMPORT); + }*/ menu->add_separator(); - menu->add_icon_item(get_icon("ReloadSmall","EditorIcons"),"Re-Import",OBJ_MENU_REIMPORT); - }*/ + menu->add_item(TTR("Show in File System"),OBJ_MENU_SHOW_IN_FILE_SYSTEM); + } /*if (r.is_valid() && r->get_path().is_resource_file()) { menu->set_item_tooltip(1,r->get_path()); } else if (r.is_valid()) { @@ -1037,6 +1045,14 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty return true; } +////void CustomPropertyEditor::_save_properties_values(List<String> p_names) { +//// +//// field_names=p_names; +//// for (int i=0;i<p_names.size();i++) { +//// field_values.push_back(v.get(p_names[i])); +//// } +////} + void CustomPropertyEditor::_file_selected(String p_file) { switch(type) { @@ -1630,7 +1646,7 @@ void CustomPropertyEditor::_modified(String p_string) { vec.y=value_editor[1]->get_text().to_double(); } v=vec; - emit_signal("variant_changed"); + _emit_changed_whole_or_field(); } break; case Variant::RECT2: { @@ -1648,7 +1664,7 @@ void CustomPropertyEditor::_modified(String p_string) { r2.size.y=value_editor[3]->get_text().to_double(); } v=r2; - emit_signal("variant_changed"); + _emit_changed_whole_or_field(); } break; @@ -1665,7 +1681,7 @@ void CustomPropertyEditor::_modified(String p_string) { vec.z=value_editor[2]->get_text().to_double(); } v=vec; - emit_signal("variant_changed"); + _emit_changed_whole_or_field(); } break; case Variant::PLANE: { @@ -1683,7 +1699,7 @@ void CustomPropertyEditor::_modified(String p_string) { pl.d=value_editor[3]->get_text().to_double(); } v=pl; - emit_signal("variant_changed"); + _emit_changed_whole_or_field(); } break; case Variant::QUAT: { @@ -1701,7 +1717,7 @@ void CustomPropertyEditor::_modified(String p_string) { q.w=value_editor[3]->get_text().to_double(); } v=q; - emit_signal("variant_changed"); + _emit_changed_whole_or_field(); } break; case Variant::RECT3: { @@ -1725,7 +1741,7 @@ void CustomPropertyEditor::_modified(String p_string) { size.z=value_editor[5]->get_text().to_double(); } v=Rect3(pos,size); - emit_signal("variant_changed"); + _emit_changed_whole_or_field(); } break; case Variant::TRANSFORM2D: { @@ -1740,7 +1756,7 @@ void CustomPropertyEditor::_modified(String p_string) { } v=m; - emit_signal("variant_changed"); + _emit_changed_whole_or_field(); } break; case Variant::BASIS: { @@ -1756,7 +1772,7 @@ void CustomPropertyEditor::_modified(String p_string) { } v=m; - emit_signal("variant_changed"); + _emit_changed_whole_or_field(); } break; case Variant::TRANSFORM: { @@ -1784,7 +1800,7 @@ void CustomPropertyEditor::_modified(String p_string) { } v=Transform(basis,origin); - emit_signal("variant_changed"); + _emit_changed_whole_or_field(); } break; @@ -1851,6 +1867,15 @@ void CustomPropertyEditor::_modified(String p_string) { updating=false; } +void CustomPropertyEditor::_emit_changed_whole_or_field() { + + if (!Input::get_singleton()->is_key_pressed(KEY_SHIFT)) { + emit_signal("variant_changed"); + } else { + emit_signal("variant_field_changed",field_names[focused_value_editor]); + } +} + void CustomPropertyEditor::_range_modified(double p_value) { v=p_value; @@ -1872,6 +1897,7 @@ void CustomPropertyEditor::_focus_enter() { case Variant::TRANSFORM: { for (int i=0;i<MAX_VALUE_EDITORS;++i) { if (value_editor[i]->has_focus()) { + focused_value_editor=i; value_editor[i]->select_all(); break; } @@ -1984,6 +2010,7 @@ void CustomPropertyEditor::_bind_methods() { ADD_SIGNAL( MethodInfo("variant_changed") ); + ADD_SIGNAL( MethodInfo("variant_field_changed",PropertyInfo(Variant::STRING,"field")) ); ADD_SIGNAL( MethodInfo("resource_edit_request") ); } CustomPropertyEditor::CustomPropertyEditor() { @@ -2004,6 +2031,7 @@ CustomPropertyEditor::CustomPropertyEditor() { value_editor[i]->connect("focus_entered", this, "_focus_enter"); value_editor[i]->connect("focus_exited", this, "_focus_exit"); } + focused_value_editor=-1; for(int i=0;i<4;i++) { @@ -2372,6 +2400,7 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p p_item->set_range(1, obj->get( p_name ) ); } else { + /* FIXME: Why are both statements equal? */ p_item->set_range(1, obj->get( p_name ) ); } @@ -3141,7 +3170,7 @@ void PropertyEditor::update_tree() { continue; - if (hide_script && p.name=="script/script") + if (hide_script && p.name=="script") continue; String basename=p.name; @@ -3890,7 +3919,7 @@ void PropertyEditor::_item_selected() { } -void PropertyEditor::_edit_set(const String& p_name, const Variant& p_value, bool p_refresh_all) { +void PropertyEditor::_edit_set(const String& p_name, const Variant& p_value, bool p_refresh_all, const String& p_changed_field) { if (autoclear) { TreeItem *item = tree->get_selected(); @@ -3900,7 +3929,7 @@ void PropertyEditor::_edit_set(const String& p_name, const Variant& p_value, boo } } - if (!undo_redo || obj->cast_to<MultiNodeEdit>() || obj->cast_to<ArrayPropertyEdit>()) { //kind of hacky + if (!undo_redo|| obj->cast_to<ArrayPropertyEdit>()) { //kind of hacky obj->set(p_name,p_value); if (p_refresh_all) @@ -3910,7 +3939,11 @@ void PropertyEditor::_edit_set(const String& p_name, const Variant& p_value, boo emit_signal(_prop_edited,p_name); + } else if (obj->cast_to<MultiNodeEdit>()) { + obj->cast_to<MultiNodeEdit>()->set_property_field(p_name,p_value,p_changed_field); + _changed_callbacks(obj,p_name); + emit_signal(_prop_edited,p_name); } else { undo_redo->create_action(TTR("Set")+" "+p_name,UndoRedo::MERGE_ENDS); @@ -4115,10 +4148,19 @@ void PropertyEditor::_custom_editor_edited() { if (!obj) return; - _edit_set(custom_editor->get_name(), custom_editor->get_variant()); } +void PropertyEditor::_custom_editor_edited_field(const String& p_field_name) { + + ERR_FAIL_COND(p_field_name==""); + + if (!obj) + return; + + _edit_set(custom_editor->get_name(), custom_editor->get_variant(), false, p_field_name); +} + void PropertyEditor::_custom_editor_request(bool p_arrow) { TreeItem * item = tree->get_edited(); @@ -4391,6 +4433,7 @@ void PropertyEditor::_bind_methods() { ClassDB::bind_method( "_item_selected",&PropertyEditor::_item_selected); ClassDB::bind_method( "_custom_editor_request",&PropertyEditor::_custom_editor_request); ClassDB::bind_method( "_custom_editor_edited",&PropertyEditor::_custom_editor_edited); + ClassDB::bind_method( "_custom_editor_edited_field",&PropertyEditor::_custom_editor_edited_field,DEFVAL("")); ClassDB::bind_method( "_resource_edit_request",&PropertyEditor::_resource_edit_request); ClassDB::bind_method( "_node_removed",&PropertyEditor::_node_removed); ClassDB::bind_method( "_edit_button",&PropertyEditor::_edit_button); @@ -4403,9 +4446,9 @@ void PropertyEditor::_bind_methods() { ClassDB::bind_method( "refresh",&PropertyEditor::refresh); ClassDB::bind_method( "_draw_transparency",&PropertyEditor::_draw_transparency); - ClassDB::bind_method(_MD("get_drag_data_fw"), &PropertyEditor::get_drag_data_fw); - ClassDB::bind_method(_MD("can_drop_data_fw"), &PropertyEditor::can_drop_data_fw); - ClassDB::bind_method(_MD("drop_data_fw"), &PropertyEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &PropertyEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &PropertyEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &PropertyEditor::drop_data_fw); ADD_SIGNAL( MethodInfo("property_toggled",PropertyInfo( Variant::STRING, "property"),PropertyInfo( Variant::BOOL, "value"))); ADD_SIGNAL( MethodInfo("resource_selected", PropertyInfo( Variant::OBJECT, "res"),PropertyInfo( Variant::STRING, "prop") ) ); @@ -4537,6 +4580,7 @@ PropertyEditor::PropertyEditor() { tree->connect("custom_popup_edited", this,"_custom_editor_request"); tree->connect("button_pressed", this,"_edit_button"); custom_editor->connect("variant_changed", this,"_custom_editor_edited"); + custom_editor->connect("variant_field_changed", this,"_custom_editor_edited_field"); custom_editor->connect("resource_edit_request", this,"_resource_edit_request",make_binds(),CONNECT_DEFERRED); tree->set_hide_folding(true); @@ -4780,7 +4824,7 @@ void SectionedPropertyEditor::update_category_list() { else if ( !(pi.usage&PROPERTY_USAGE_EDITOR) ) continue; - if (pi.name.find(":")!=-1 || pi.name=="script/script" || pi.name=="resource_name" || pi.name=="resource_path") + if (pi.name.find(":")!=-1 || pi.name=="script" || pi.name=="resource_name" || pi.name=="resource_path") continue; int sp = pi.name.find("/"); if (sp==-1) diff --git a/tools/editor/property_editor.h b/editor/property_editor.h index 969340d5a2..c9ae9a85cc 100644 --- a/tools/editor/property_editor.h +++ b/editor/property_editor.h @@ -33,7 +33,7 @@ #include "scene/gui/button.h" #include "scene/gui/check_box.h" #include "scene/gui/label.h" -#include "tools/editor/editor_file_dialog.h" +#include "editor/editor_file_dialog.h" #include "scene/gui/dialogs.h" #include "scene/gui/color_picker.h" #include "scene/gui/menu_button.h" @@ -67,8 +67,8 @@ class CustomPropertyEditor : public Popup { OBJ_MENU_PASTE=5, OBJ_MENU_REIMPORT=6, OBJ_MENU_NEW_SCRIPT=7, + OBJ_MENU_SHOW_IN_FILE_SYSTEM=8, TYPE_BASE_ID=100 - }; enum { @@ -88,9 +88,11 @@ class CustomPropertyEditor : public Popup { String name; Variant::Type type; Variant v; + List<String> field_names; int hint; String hint_text; LineEdit *value_editor[MAX_VALUE_EDITORS]; + int focused_value_editor; Label *value_label[MAX_VALUE_EDITORS]; HScrollBar *scroll[4]; Button *action_buttons[MAX_ACTION_BUTTONS]; @@ -141,6 +143,8 @@ class CustomPropertyEditor : public Popup { void config_value_editors(int p_amount, int p_columns,int p_label_w,const List<String>& p_strings); void config_action_buttons(const List<String>& p_strings); + void _emit_changed_whole_or_field(); + protected: @@ -204,6 +208,7 @@ class PropertyEditor : public Control { void _resource_edit_request(); void _custom_editor_edited(); + void _custom_editor_edited_field(const String& p_field_name); void _custom_editor_request(bool p_arrow); void _item_selected(); @@ -225,7 +230,7 @@ class PropertyEditor : public Control { void _node_removed(Node *p_node); friend class ProjectExportDialog; - void _edit_set(const String& p_name, const Variant& p_value,bool p_refresh_all=false); + void _edit_set(const String& p_name, const Variant& p_value,bool p_refresh_all=false, const String& p_changed_field=""); void _draw_flags(Object *ti,const Rect2& p_rect); bool _might_be_in_instance(); diff --git a/tools/editor/property_selector.cpp b/editor/property_selector.cpp index 3eeec1634d..71ffae4729 100644 --- a/tools/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -587,10 +587,10 @@ void PropertySelector::select_property_from_instance(Object* p_instance, const S void PropertySelector::_bind_methods() { - ClassDB::bind_method(_MD("_text_changed"),&PropertySelector::_text_changed); - ClassDB::bind_method(_MD("_confirmed"),&PropertySelector::_confirmed); - ClassDB::bind_method(_MD("_sbox_input"),&PropertySelector::_sbox_input); - ClassDB::bind_method(_MD("_item_selected"),&PropertySelector::_item_selected); + ClassDB::bind_method(D_METHOD("_text_changed"),&PropertySelector::_text_changed); + ClassDB::bind_method(D_METHOD("_confirmed"),&PropertySelector::_confirmed); + ClassDB::bind_method(D_METHOD("_sbox_input"),&PropertySelector::_sbox_input); + ClassDB::bind_method(D_METHOD("_item_selected"),&PropertySelector::_item_selected); ADD_SIGNAL(MethodInfo("selected",PropertyInfo(Variant::STRING,"name"))); diff --git a/tools/editor/property_selector.h b/editor/property_selector.h index d29183f85e..c2ce996be2 100644 --- a/tools/editor/property_selector.h +++ b/editor/property_selector.h @@ -29,7 +29,7 @@ #ifndef PROPERTYSELECTOR_H #define PROPERTYSELECTOR_H -#include "tools/editor/property_editor.h" +#include "editor/property_editor.h" #include "scene/gui/rich_text_label.h" #include "editor_help.h" diff --git a/tools/editor/pvrtc_compress.cpp b/editor/pvrtc_compress.cpp index b130f6c773..b130f6c773 100644 --- a/tools/editor/pvrtc_compress.cpp +++ b/editor/pvrtc_compress.cpp diff --git a/tools/editor/pvrtc_compress.h b/editor/pvrtc_compress.h index 4ba29026c5..4ba29026c5 100644 --- a/tools/editor/pvrtc_compress.h +++ b/editor/pvrtc_compress.h diff --git a/tools/editor/quick_open.cpp b/editor/quick_open.cpp index 615b42b411..f43189a7bf 100644 --- a/tools/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -252,9 +252,9 @@ StringName EditorQuickOpen::get_base_type() const { void EditorQuickOpen::_bind_methods() { - ClassDB::bind_method(_MD("_text_changed"),&EditorQuickOpen::_text_changed); - ClassDB::bind_method(_MD("_confirmed"),&EditorQuickOpen::_confirmed); - ClassDB::bind_method(_MD("_sbox_input"),&EditorQuickOpen::_sbox_input); + ClassDB::bind_method(D_METHOD("_text_changed"),&EditorQuickOpen::_text_changed); + ClassDB::bind_method(D_METHOD("_confirmed"),&EditorQuickOpen::_confirmed); + ClassDB::bind_method(D_METHOD("_sbox_input"),&EditorQuickOpen::_sbox_input); ADD_SIGNAL(MethodInfo("quick_open")); diff --git a/tools/editor/quick_open.h b/editor/quick_open.h index ef91d910b1..ef91d910b1 100644 --- a/tools/editor/quick_open.h +++ b/editor/quick_open.h diff --git a/tools/editor/register_exporters.h b/editor/register_exporters.h index 30ec522a00..30ec522a00 100644 --- a/tools/editor/register_exporters.h +++ b/editor/register_exporters.h diff --git a/tools/editor/reparent_dialog.cpp b/editor/reparent_dialog.cpp index c5b74d9006..c5b74d9006 100644 --- a/tools/editor/reparent_dialog.cpp +++ b/editor/reparent_dialog.cpp diff --git a/tools/editor/reparent_dialog.h b/editor/reparent_dialog.h index 5e21f84581..200760314c 100644 --- a/tools/editor/reparent_dialog.h +++ b/editor/reparent_dialog.h @@ -33,7 +33,7 @@ #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 "editor/scene_tree_editor.h" #include "scene/gui/line_edit.h" /** @author Juan Linietsky <reduzio@gmail.com> diff --git a/tools/editor/resources_dock.cpp b/editor/resources_dock.cpp index e89262db25..8648361bae 100644 --- a/tools/editor/resources_dock.cpp +++ b/editor/resources_dock.cpp @@ -33,7 +33,7 @@ #include "io/resource_saver.h" #include "editor_settings.h" #include "project_settings.h" -#include "globals.h" +#include "global_config.h" #include "editor_file_system.h" @@ -322,12 +322,12 @@ void ResourcesDock::_create() { void ResourcesDock::_bind_methods() { - ClassDB::bind_method(_MD("_tool_selected"),&ResourcesDock::_tool_selected); - ClassDB::bind_method(_MD("_create"),&ResourcesDock::_create); - ClassDB::bind_method(_MD("_resource_selected"),&ResourcesDock::_resource_selected); - ClassDB::bind_method(_MD("_delete"),&ResourcesDock::_delete); - ClassDB::bind_method(_MD("remove_resource"),&ResourcesDock::remove_resource); - ClassDB::bind_method(_MD("_file_action"),&ResourcesDock::_file_action); + ClassDB::bind_method(D_METHOD("_tool_selected"),&ResourcesDock::_tool_selected); + ClassDB::bind_method(D_METHOD("_create"),&ResourcesDock::_create); + ClassDB::bind_method(D_METHOD("_resource_selected"),&ResourcesDock::_resource_selected); + ClassDB::bind_method(D_METHOD("_delete"),&ResourcesDock::_delete); + ClassDB::bind_method(D_METHOD("remove_resource"),&ResourcesDock::remove_resource); + ClassDB::bind_method(D_METHOD("_file_action"),&ResourcesDock::_file_action); diff --git a/tools/editor/resources_dock.h b/editor/resources_dock.h index e225786583..e225786583 100644 --- a/tools/editor/resources_dock.h +++ b/editor/resources_dock.h diff --git a/tools/editor/run_settings_dialog.cpp b/editor/run_settings_dialog.cpp index 4d69c7ad84..4d69c7ad84 100644 --- a/tools/editor/run_settings_dialog.cpp +++ b/editor/run_settings_dialog.cpp diff --git a/tools/editor/run_settings_dialog.h b/editor/run_settings_dialog.h index 2efc18e43f..2efc18e43f 100644 --- a/tools/editor/run_settings_dialog.h +++ b/editor/run_settings_dialog.h diff --git a/tools/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index ae7a80377d..47eb84ab79 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -29,17 +29,17 @@ #include "scene_tree_dock.h" #include "editor_node.h" -#include "globals.h" +#include "global_config.h" #include "os/keyboard.h" #include "scene/resources/packed_scene.h" #include "editor_settings.h" -#include "tools/editor/plugins/canvas_item_editor_plugin.h" -#include "tools/editor/plugins/spatial_editor_plugin.h" +#include "editor/plugins/canvas_item_editor_plugin.h" +#include "editor/plugins/spatial_editor_plugin.h" #include "script_editor_debugger.h" -#include "tools/editor/plugins/script_editor_plugin.h" +#include "editor/plugins/script_editor_plugin.h" #include "core/io/resource_saver.h" #include "multi_node_edit.h" -#include "tools/editor/plugins/animation_player_editor_plugin.h" +#include "editor/plugins/animation_player_editor_plugin.h" #include "animation_editor.h" #include "scene/main/viewport.h" @@ -403,6 +403,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if(existing.is_valid()) { const RefPtr empty; selected->set_script(empty); + button_create_script->show(); + button_clear_script->hide(); } } break; @@ -1252,6 +1254,8 @@ void SceneTreeDock::_script_created(Ref<Script> p_script) { return; selected->set_script(p_script.get_ref_ptr()); editor->push_item(p_script.operator->()); + button_create_script->hide(); + button_clear_script->show(); } @@ -1882,33 +1886,33 @@ void SceneTreeDock::open_script_dialog(Node* p_for_node) { void SceneTreeDock::_bind_methods() { - ClassDB::bind_method(_MD("_tool_selected"),&SceneTreeDock::_tool_selected,DEFVAL(false)); - ClassDB::bind_method(_MD("_create"),&SceneTreeDock::_create); - //ClassDB::bind_method(_MD("_script_created"),&SceneTreeDock::_script_created); - ClassDB::bind_method(_MD("_node_reparent"),&SceneTreeDock::_node_reparent); - ClassDB::bind_method(_MD("_set_owners"),&SceneTreeDock::_set_owners); - ClassDB::bind_method(_MD("_node_selected"),&SceneTreeDock::_node_selected); - ClassDB::bind_method(_MD("_node_renamed"),&SceneTreeDock::_node_renamed); - ClassDB::bind_method(_MD("_script_created"),&SceneTreeDock::_script_created); - ClassDB::bind_method(_MD("_load_request"),&SceneTreeDock::_load_request); - ClassDB::bind_method(_MD("_script_open_request"),&SceneTreeDock::_script_open_request); - ClassDB::bind_method(_MD("_unhandled_key_input"),&SceneTreeDock::_unhandled_key_input); - ClassDB::bind_method(_MD("_input"),&SceneTreeDock::_input); - ClassDB::bind_method(_MD("_nodes_drag_begin"),&SceneTreeDock::_nodes_drag_begin); - ClassDB::bind_method(_MD("_delete_confirm"),&SceneTreeDock::_delete_confirm); - ClassDB::bind_method(_MD("_node_prerenamed"),&SceneTreeDock::_node_prerenamed); - ClassDB::bind_method(_MD("_import_subscene"),&SceneTreeDock::_import_subscene); - ClassDB::bind_method(_MD("_selection_changed"),&SceneTreeDock::_selection_changed); - ClassDB::bind_method(_MD("_new_scene_from"),&SceneTreeDock::_new_scene_from); - ClassDB::bind_method(_MD("_nodes_dragged"),&SceneTreeDock::_nodes_dragged); - ClassDB::bind_method(_MD("_files_dropped"),&SceneTreeDock::_files_dropped); - ClassDB::bind_method(_MD("_script_dropped"),&SceneTreeDock::_script_dropped); - ClassDB::bind_method(_MD("_tree_rmb"),&SceneTreeDock::_tree_rmb); - ClassDB::bind_method(_MD("_filter_changed"),&SceneTreeDock::_filter_changed); - ClassDB::bind_method(_MD("_focus_node"),&SceneTreeDock::_focus_node); - - - ClassDB::bind_method(_MD("instance"),&SceneTreeDock::instance); + ClassDB::bind_method(D_METHOD("_tool_selected"),&SceneTreeDock::_tool_selected,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("_create"),&SceneTreeDock::_create); + //ClassDB::bind_method(D_METHOD("_script_created"),&SceneTreeDock::_script_created); + ClassDB::bind_method(D_METHOD("_node_reparent"),&SceneTreeDock::_node_reparent); + ClassDB::bind_method(D_METHOD("_set_owners"),&SceneTreeDock::_set_owners); + ClassDB::bind_method(D_METHOD("_node_selected"),&SceneTreeDock::_node_selected); + ClassDB::bind_method(D_METHOD("_node_renamed"),&SceneTreeDock::_node_renamed); + ClassDB::bind_method(D_METHOD("_script_created"),&SceneTreeDock::_script_created); + ClassDB::bind_method(D_METHOD("_load_request"),&SceneTreeDock::_load_request); + ClassDB::bind_method(D_METHOD("_script_open_request"),&SceneTreeDock::_script_open_request); + ClassDB::bind_method(D_METHOD("_unhandled_key_input"),&SceneTreeDock::_unhandled_key_input); + ClassDB::bind_method(D_METHOD("_input"),&SceneTreeDock::_input); + ClassDB::bind_method(D_METHOD("_nodes_drag_begin"),&SceneTreeDock::_nodes_drag_begin); + ClassDB::bind_method(D_METHOD("_delete_confirm"),&SceneTreeDock::_delete_confirm); + ClassDB::bind_method(D_METHOD("_node_prerenamed"),&SceneTreeDock::_node_prerenamed); + ClassDB::bind_method(D_METHOD("_import_subscene"),&SceneTreeDock::_import_subscene); + ClassDB::bind_method(D_METHOD("_selection_changed"),&SceneTreeDock::_selection_changed); + ClassDB::bind_method(D_METHOD("_new_scene_from"),&SceneTreeDock::_new_scene_from); + ClassDB::bind_method(D_METHOD("_nodes_dragged"),&SceneTreeDock::_nodes_dragged); + ClassDB::bind_method(D_METHOD("_files_dropped"),&SceneTreeDock::_files_dropped); + ClassDB::bind_method(D_METHOD("_script_dropped"),&SceneTreeDock::_script_dropped); + ClassDB::bind_method(D_METHOD("_tree_rmb"),&SceneTreeDock::_tree_rmb); + ClassDB::bind_method(D_METHOD("_filter_changed"),&SceneTreeDock::_filter_changed); + ClassDB::bind_method(D_METHOD("_focus_node"),&SceneTreeDock::_focus_node); + + + ClassDB::bind_method(D_METHOD("instance"),&SceneTreeDock::instance); } diff --git a/tools/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index 2ee7ba3d06..2ee7ba3d06 100644 --- a/tools/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h diff --git a/tools/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index dd1fdeb400..fb21747ebb 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -33,7 +33,7 @@ #include "print_string.h" #include "message_queue.h" #include "scene/main/viewport.h" -#include "tools/editor/plugins/canvas_item_editor_plugin.h" +#include "editor/plugins/canvas_item_editor_plugin.h" #include "scene/resources/packed_scene.h" Node *SceneTreeEditor::get_scene_node() { @@ -1124,11 +1124,11 @@ void SceneTreeEditor::_bind_methods() { ClassDB::bind_method("_editor_settings_changed", &SceneTreeEditor::_editor_settings_changed); - ClassDB::bind_method(_MD("get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw); - ClassDB::bind_method(_MD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw); - ClassDB::bind_method(_MD("drop_data_fw"), &SceneTreeEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &SceneTreeEditor::drop_data_fw); - ClassDB::bind_method(_MD("update_tree"), &SceneTreeEditor::update_tree); + ClassDB::bind_method(D_METHOD("update_tree"), &SceneTreeEditor::update_tree); ADD_SIGNAL( MethodInfo("node_selected") ); ADD_SIGNAL( MethodInfo("node_renamed") ); diff --git a/tools/editor/scene_tree_editor.h b/editor/scene_tree_editor.h index 5586f02c00..5586f02c00 100644 --- a/tools/editor/scene_tree_editor.h +++ b/editor/scene_tree_editor.h diff --git a/tools/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index da01cdefe5..dfaa1f645c 100644 --- a/tools/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -29,7 +29,7 @@ #include "script_create_dialog.h" #include "script_language.h" -#include "globals.h" +#include "global_config.h" #include "io/resource_saver.h" #include "os/file_access.h" #include "editor_file_system.h" @@ -128,7 +128,7 @@ void ScriptCreateDialog::_create_new() { Ref<Script> scr = ScriptServer::get_language( language_menu->get_selected() )->get_template(cname,parent_name->get_text()); String selected_language = language_menu->get_item_text(language_menu->get_selected()); - editor_settings->set_last_selected_language(selected_language); + editor_settings->set_project_metadata("script_setup", "last_selected_language", selected_language); if (cname!="") scr->set_name(cname); @@ -380,7 +380,7 @@ ScriptCreateDialog::ScriptCreateDialog() { } editor_settings = EditorSettings::get_singleton(); - String last_selected_language = editor_settings->get_last_selected_language(); + String last_selected_language = editor_settings->get_project_metadata("script_setup", "last_selected_language", ""); if (last_selected_language != "") for (int i = 0; i < language_menu->get_item_count(); i++) if (language_menu->get_item_text(i) == last_selected_language) diff --git a/tools/editor/script_create_dialog.h b/editor/script_create_dialog.h index df16efc73c..ad9616c071 100644 --- a/tools/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -32,8 +32,8 @@ #include "scene/gui/dialogs.h" #include "scene/gui/line_edit.h" #include "scene/gui/option_button.h" -#include "tools/editor/editor_file_dialog.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_file_dialog.h" +#include "editor/editor_settings.h" #include "scene/gui/check_button.h" class ScriptCreateDialog : public ConfirmationDialog { diff --git a/tools/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index d5cca06820..fa33ffe5c7 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -39,7 +39,7 @@ #include "scene/gui/rich_text_label.h" #include "scene/gui/margin_container.h" #include "property_editor.h" -#include "globals.h" +#include "global_config.h" #include "editor_node.h" #include "main/performance.h" #include "editor_profiler.h" @@ -1635,39 +1635,39 @@ void ScriptEditorDebugger::_paused() { void ScriptEditorDebugger::_bind_methods() { - ClassDB::bind_method(_MD("_stack_dump_frame_selected"),&ScriptEditorDebugger::_stack_dump_frame_selected); - ClassDB::bind_method(_MD("debug_next"),&ScriptEditorDebugger::debug_next); - ClassDB::bind_method(_MD("debug_step"),&ScriptEditorDebugger::debug_step); - ClassDB::bind_method(_MD("debug_break"),&ScriptEditorDebugger::debug_break); - ClassDB::bind_method(_MD("debug_continue"),&ScriptEditorDebugger::debug_continue); - ClassDB::bind_method(_MD("_output_clear"),&ScriptEditorDebugger::_output_clear); - ClassDB::bind_method(_MD("_performance_draw"),&ScriptEditorDebugger::_performance_draw); - ClassDB::bind_method(_MD("_performance_select"),&ScriptEditorDebugger::_performance_select); - ClassDB::bind_method(_MD("_scene_tree_request"),&ScriptEditorDebugger::_scene_tree_request); - ClassDB::bind_method(_MD("_video_mem_request"),&ScriptEditorDebugger::_video_mem_request); - ClassDB::bind_method(_MD("_live_edit_set"),&ScriptEditorDebugger::_live_edit_set); - ClassDB::bind_method(_MD("_live_edit_clear"),&ScriptEditorDebugger::_live_edit_clear); - - ClassDB::bind_method(_MD("_error_selected"),&ScriptEditorDebugger::_error_selected); - ClassDB::bind_method(_MD("_error_stack_selected"),&ScriptEditorDebugger::_error_stack_selected); - ClassDB::bind_method(_MD("_profiler_activate"),&ScriptEditorDebugger::_profiler_activate); - ClassDB::bind_method(_MD("_profiler_seeked"),&ScriptEditorDebugger::_profiler_seeked); - - ClassDB::bind_method(_MD("_paused"),&ScriptEditorDebugger::_paused); - - ClassDB::bind_method(_MD("_scene_tree_selected"),&ScriptEditorDebugger::_scene_tree_selected); - ClassDB::bind_method(_MD("_scene_tree_folded"),&ScriptEditorDebugger::_scene_tree_folded); - - - ClassDB::bind_method(_MD("live_debug_create_node"),&ScriptEditorDebugger::live_debug_create_node); - ClassDB::bind_method(_MD("live_debug_instance_node"),&ScriptEditorDebugger::live_debug_instance_node); - ClassDB::bind_method(_MD("live_debug_remove_node"),&ScriptEditorDebugger::live_debug_remove_node); - ClassDB::bind_method(_MD("live_debug_remove_and_keep_node"),&ScriptEditorDebugger::live_debug_remove_and_keep_node); - ClassDB::bind_method(_MD("live_debug_restore_node"),&ScriptEditorDebugger::live_debug_restore_node); - ClassDB::bind_method(_MD("live_debug_duplicate_node"),&ScriptEditorDebugger::live_debug_duplicate_node); - ClassDB::bind_method(_MD("live_debug_reparent_node"),&ScriptEditorDebugger::live_debug_reparent_node); - ClassDB::bind_method(_MD("_scene_tree_property_select_object"),&ScriptEditorDebugger::_scene_tree_property_select_object); - ClassDB::bind_method(_MD("_scene_tree_property_value_edited"),&ScriptEditorDebugger::_scene_tree_property_value_edited); + ClassDB::bind_method(D_METHOD("_stack_dump_frame_selected"),&ScriptEditorDebugger::_stack_dump_frame_selected); + ClassDB::bind_method(D_METHOD("debug_next"),&ScriptEditorDebugger::debug_next); + ClassDB::bind_method(D_METHOD("debug_step"),&ScriptEditorDebugger::debug_step); + ClassDB::bind_method(D_METHOD("debug_break"),&ScriptEditorDebugger::debug_break); + ClassDB::bind_method(D_METHOD("debug_continue"),&ScriptEditorDebugger::debug_continue); + ClassDB::bind_method(D_METHOD("_output_clear"),&ScriptEditorDebugger::_output_clear); + ClassDB::bind_method(D_METHOD("_performance_draw"),&ScriptEditorDebugger::_performance_draw); + ClassDB::bind_method(D_METHOD("_performance_select"),&ScriptEditorDebugger::_performance_select); + ClassDB::bind_method(D_METHOD("_scene_tree_request"),&ScriptEditorDebugger::_scene_tree_request); + ClassDB::bind_method(D_METHOD("_video_mem_request"),&ScriptEditorDebugger::_video_mem_request); + ClassDB::bind_method(D_METHOD("_live_edit_set"),&ScriptEditorDebugger::_live_edit_set); + ClassDB::bind_method(D_METHOD("_live_edit_clear"),&ScriptEditorDebugger::_live_edit_clear); + + ClassDB::bind_method(D_METHOD("_error_selected"),&ScriptEditorDebugger::_error_selected); + ClassDB::bind_method(D_METHOD("_error_stack_selected"),&ScriptEditorDebugger::_error_stack_selected); + ClassDB::bind_method(D_METHOD("_profiler_activate"),&ScriptEditorDebugger::_profiler_activate); + ClassDB::bind_method(D_METHOD("_profiler_seeked"),&ScriptEditorDebugger::_profiler_seeked); + + ClassDB::bind_method(D_METHOD("_paused"),&ScriptEditorDebugger::_paused); + + ClassDB::bind_method(D_METHOD("_scene_tree_selected"),&ScriptEditorDebugger::_scene_tree_selected); + ClassDB::bind_method(D_METHOD("_scene_tree_folded"),&ScriptEditorDebugger::_scene_tree_folded); + + + ClassDB::bind_method(D_METHOD("live_debug_create_node"),&ScriptEditorDebugger::live_debug_create_node); + ClassDB::bind_method(D_METHOD("live_debug_instance_node"),&ScriptEditorDebugger::live_debug_instance_node); + ClassDB::bind_method(D_METHOD("live_debug_remove_node"),&ScriptEditorDebugger::live_debug_remove_node); + ClassDB::bind_method(D_METHOD("live_debug_remove_and_keep_node"),&ScriptEditorDebugger::live_debug_remove_and_keep_node); + ClassDB::bind_method(D_METHOD("live_debug_restore_node"),&ScriptEditorDebugger::live_debug_restore_node); + ClassDB::bind_method(D_METHOD("live_debug_duplicate_node"),&ScriptEditorDebugger::live_debug_duplicate_node); + ClassDB::bind_method(D_METHOD("live_debug_reparent_node"),&ScriptEditorDebugger::live_debug_reparent_node); + ClassDB::bind_method(D_METHOD("_scene_tree_property_select_object"),&ScriptEditorDebugger::_scene_tree_property_select_object); + ClassDB::bind_method(D_METHOD("_scene_tree_property_value_edited"),&ScriptEditorDebugger::_scene_tree_property_value_edited); ADD_SIGNAL(MethodInfo("goto_script_line")); ADD_SIGNAL(MethodInfo("breaked",PropertyInfo(Variant::BOOL,"reallydid"),PropertyInfo(Variant::BOOL,"can_debug"))); diff --git a/tools/editor/script_editor_debugger.h b/editor/script_editor_debugger.h index a02934bbaf..a02934bbaf 100644 --- a/tools/editor/script_editor_debugger.h +++ b/editor/script_editor_debugger.h diff --git a/tools/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index 31cbcee5ae..7d8d6ffcec 100644 --- a/tools/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -30,7 +30,7 @@ #include "editor_settings.h" #include "scene/gui/margin_container.h" -#include "globals.h" +#include "global_config.h" #include "editor_file_system.h" #include "editor_node.h" #include "os/keyboard.h" @@ -93,10 +93,14 @@ void EditorSettingsDialog::popup_edit_settings() { search_box->grab_focus(); _update_shortcuts(); - popup_centered_ratio(0.7); -} - + // Restore valid window bounds or pop up at default size. + if (EditorSettings::get_singleton()->has("interface/dialogs/editor_settings_bounds")) { + popup(EditorSettings::get_singleton()->get("interface/dialogs/editor_settings_bounds")); + } else { + popup_centered_ratio(0.7); + } +} void EditorSettingsDialog::_clear_search_box() { @@ -121,10 +125,14 @@ void EditorSettingsDialog::_filter_shortcuts(const String& p_filter) { void EditorSettingsDialog::_notification(int p_what) { - if (p_what==NOTIFICATION_ENTER_TREE) { - - clear_button->set_icon(get_icon("Close","EditorIcons")); - shortcut_clear_button->set_icon(get_icon("Close","EditorIcons")); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { + clear_button->set_icon(get_icon("Close", "EditorIcons")); + shortcut_clear_button->set_icon(get_icon("Close", "EditorIcons")); + } break; + case NOTIFICATION_POPUP_HIDE: { + EditorSettings::get_singleton()->set("interface/dialogs/editor_settings_bounds", get_rect()); + } break; } } @@ -289,22 +297,23 @@ void EditorSettingsDialog::_press_a_key_confirm() { void EditorSettingsDialog::_bind_methods() { - ClassDB::bind_method(_MD("_settings_save"),&EditorSettingsDialog::_settings_save); - ClassDB::bind_method(_MD("_settings_changed"),&EditorSettingsDialog::_settings_changed); - ClassDB::bind_method(_MD("_settings_property_edited"),&EditorSettingsDialog::_settings_property_edited); - ClassDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box); - ClassDB::bind_method(_MD("_clear_shortcut_search_box"),&EditorSettingsDialog::_clear_shortcut_search_box); - ClassDB::bind_method(_MD("_shortcut_button_pressed"),&EditorSettingsDialog::_shortcut_button_pressed); - ClassDB::bind_method(_MD("_filter_shortcuts"),&EditorSettingsDialog::_filter_shortcuts); - ClassDB::bind_method(_MD("_update_shortcuts"),&EditorSettingsDialog::_update_shortcuts); - ClassDB::bind_method(_MD("_press_a_key_confirm"),&EditorSettingsDialog::_press_a_key_confirm); - ClassDB::bind_method(_MD("_wait_for_key"),&EditorSettingsDialog::_wait_for_key); + ClassDB::bind_method(D_METHOD("_settings_save"),&EditorSettingsDialog::_settings_save); + ClassDB::bind_method(D_METHOD("_settings_changed"),&EditorSettingsDialog::_settings_changed); + ClassDB::bind_method(D_METHOD("_settings_property_edited"),&EditorSettingsDialog::_settings_property_edited); + ClassDB::bind_method(D_METHOD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box); + ClassDB::bind_method(D_METHOD("_clear_shortcut_search_box"),&EditorSettingsDialog::_clear_shortcut_search_box); + ClassDB::bind_method(D_METHOD("_shortcut_button_pressed"),&EditorSettingsDialog::_shortcut_button_pressed); + ClassDB::bind_method(D_METHOD("_filter_shortcuts"),&EditorSettingsDialog::_filter_shortcuts); + ClassDB::bind_method(D_METHOD("_update_shortcuts"),&EditorSettingsDialog::_update_shortcuts); + ClassDB::bind_method(D_METHOD("_press_a_key_confirm"),&EditorSettingsDialog::_press_a_key_confirm); + ClassDB::bind_method(D_METHOD("_wait_for_key"),&EditorSettingsDialog::_wait_for_key); } EditorSettingsDialog::EditorSettingsDialog() { set_title(TTR("Editor Settings")); + set_resizable(true); tabs = memnew( TabContainer ); add_child(tabs); diff --git a/tools/editor/settings_config_dialog.h b/editor/settings_config_dialog.h index 17a05c27d3..17a05c27d3 100644 --- a/tools/editor/settings_config_dialog.h +++ b/editor/settings_config_dialog.h diff --git a/tools/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 3ed101cdd6..825db5356b 100644 --- a/tools/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -618,14 +618,14 @@ void EditorSpatialGizmo::free(){ void EditorSpatialGizmo::_bind_methods() { - ClassDB::bind_method(_MD("add_lines","lines","material:Material","billboard"),&EditorSpatialGizmo::add_lines,DEFVAL(false)); - ClassDB::bind_method(_MD("add_mesh","mesh:Mesh","billboard","skeleton"),&EditorSpatialGizmo::add_mesh,DEFVAL(false),DEFVAL(RID())); - ClassDB::bind_method(_MD("add_collision_segments","segments"),&EditorSpatialGizmo::add_collision_segments); - ClassDB::bind_method(_MD("add_collision_triangles","triangles:TriangleMesh"),&EditorSpatialGizmo::add_collision_triangles); - ClassDB::bind_method(_MD("add_unscaled_billboard","material:Material","default_scale"),&EditorSpatialGizmo::add_unscaled_billboard,DEFVAL(1)); - ClassDB::bind_method(_MD("add_handles","handles","billboard","secondary"),&EditorSpatialGizmo::add_handles,DEFVAL(false),DEFVAL(false)); - ClassDB::bind_method(_MD("set_spatial_node","node:Spatial"),&EditorSpatialGizmo::_set_spatial_node); - ClassDB::bind_method(_MD("clear"),&EditorSpatialGizmo::clear); + ClassDB::bind_method(D_METHOD("add_lines","lines","material:Material","billboard"),&EditorSpatialGizmo::add_lines,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("add_mesh","mesh:Mesh","billboard","skeleton"),&EditorSpatialGizmo::add_mesh,DEFVAL(false),DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("add_collision_segments","segments"),&EditorSpatialGizmo::add_collision_segments); + ClassDB::bind_method(D_METHOD("add_collision_triangles","triangles:TriangleMesh"),&EditorSpatialGizmo::add_collision_triangles); + ClassDB::bind_method(D_METHOD("add_unscaled_billboard","material:Material","default_scale"),&EditorSpatialGizmo::add_unscaled_billboard,DEFVAL(1)); + ClassDB::bind_method(D_METHOD("add_handles","handles","billboard","secondary"),&EditorSpatialGizmo::add_handles,DEFVAL(false),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("set_spatial_node","node:Spatial"),&EditorSpatialGizmo::_set_spatial_node); + ClassDB::bind_method(D_METHOD("clear"),&EditorSpatialGizmo::clear); BIND_VMETHOD( MethodInfo("redraw")); BIND_VMETHOD( MethodInfo(Variant::STRING,"get_handle_name",PropertyInfo(Variant::INT,"index"))); diff --git a/tools/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h index 8a63d4f81e..c44a987144 100644 --- a/tools/editor/spatial_editor_gizmos.h +++ b/editor/spatial_editor_gizmos.h @@ -30,7 +30,7 @@ #define SPATIAL_EDITOR_GIZMOS_H -#include "tools/editor/plugins/spatial_editor_plugin.h" +#include "editor/plugins/spatial_editor_plugin.h" #include "scene/3d/light.h" #include "scene/3d/listener.h" #include "scene/3d/camera.h" diff --git a/tools/editor/translations/Makefile b/editor/translations/Makefile index bea20e877d..4f5d9f165f 100644 --- a/tools/editor/translations/Makefile +++ b/editor/translations/Makefile @@ -1,13 +1,13 @@ # Makefile providing various facilities to manage translations -TEMPLATE = tools.pot +TEMPLATE = editor.pot POFILES = $(wildcard *.po) LANGS = $(POFILES:%.po=%) all: update merge update: - @cd ../..; python2 tools/translations/extract.py + @cd ../..; python2 editor/translations/extract.py merge: @for po in $(POFILES); do \ diff --git a/tools/editor/translations/README.md b/editor/translations/README.md index 351bc9e2d1..351bc9e2d1 100644 --- a/tools/editor/translations/README.md +++ b/editor/translations/README.md diff --git a/tools/editor/translations/ar.po b/editor/translations/ar.po index 539b94ab62..539b94ab62 100644 --- a/tools/editor/translations/ar.po +++ b/editor/translations/ar.po diff --git a/tools/editor/translations/bg.po b/editor/translations/bg.po index fe711e1b30..fe711e1b30 100644 --- a/tools/editor/translations/bg.po +++ b/editor/translations/bg.po diff --git a/tools/editor/translations/bn.po b/editor/translations/bn.po index 0b1993caa0..0b1993caa0 100644 --- a/tools/editor/translations/bn.po +++ b/editor/translations/bn.po diff --git a/tools/editor/translations/ca.po b/editor/translations/ca.po index c45cad964b..c45cad964b 100644 --- a/tools/editor/translations/ca.po +++ b/editor/translations/ca.po diff --git a/tools/editor/translations/cs.po b/editor/translations/cs.po index 3dc52fa536..3dc52fa536 100644 --- a/tools/editor/translations/cs.po +++ b/editor/translations/cs.po diff --git a/tools/editor/translations/da.po b/editor/translations/da.po index 6148d0b82d..6148d0b82d 100644 --- a/tools/editor/translations/da.po +++ b/editor/translations/da.po diff --git a/tools/editor/translations/de.po b/editor/translations/de.po index 0545ea2f21..0545ea2f21 100644 --- a/tools/editor/translations/de.po +++ b/editor/translations/de.po diff --git a/tools/editor/translations/de_CH.po b/editor/translations/de_CH.po index 0420d3fc97..0420d3fc97 100644 --- a/tools/editor/translations/de_CH.po +++ b/editor/translations/de_CH.po diff --git a/tools/editor/translations/tools.pot b/editor/translations/editor.pot index 8e54d88989..8e54d88989 100644 --- a/tools/editor/translations/tools.pot +++ b/editor/translations/editor.pot diff --git a/tools/editor/translations/es.po b/editor/translations/es.po index a1108822fa..a1108822fa 100644 --- a/tools/editor/translations/es.po +++ b/editor/translations/es.po diff --git a/tools/editor/translations/es_AR.po b/editor/translations/es_AR.po index d921254859..d921254859 100644 --- a/tools/editor/translations/es_AR.po +++ b/editor/translations/es_AR.po diff --git a/tools/editor/translations/extract.py b/editor/translations/extract.py index 1192c19011..616fec17a0 100755 --- a/tools/editor/translations/extract.py +++ b/editor/translations/extract.py @@ -17,7 +17,7 @@ for arg in sys.argv[1:]: os.sys.exit("Non supported argument '" + arg + "'. Aborting.") -if (not os.path.exists("tools")): +if (not os.path.exists("editor")): os.sys.exit("ERROR: This script should be started from the root of the git repo.") @@ -51,7 +51,7 @@ msgstr "" "Content-Transfer-Encoding: 8-bit\\n" """ -print("Updating the tools.pot template...") +print("Updating the editor.pot template...") for fname in matches: @@ -102,20 +102,20 @@ for fname in matches: f.close() -f = open("tools.pot", "wb") +f = open("editor.pot", "wb") f.write(main_po) f.close() if (os.name == "posix"): print("Wrapping template at 79 characters for compatibility with Weblate.") - os.system("msgmerge -w79 tools.pot tools.pot > tools.pot.wrap") - shutil.move("tools.pot.wrap", "tools.pot") + os.system("msgmerge -w79 editor.pot editor.pot > editor.pot.wrap") + shutil.move("editor.pot.wrap", "editor.pot") -shutil.move("tools.pot", "tools/translations/tools.pot") +shutil.move("editor.pot", "editor/translations/editor.pot") # TODO: Make that in a portable way, if we care; if not, kudos to Unix users if (os.name == "posix"): - added = subprocess.check_output("git diff tools/translations/tools.pot | grep \+msgid | wc -l", shell=True) - removed = subprocess.check_output("git diff tools/translations/tools.pot | grep \\\-msgid | wc -l", shell=True) + added = subprocess.check_output("git diff editor/translations/editor.pot | grep \+msgid | wc -l", shell=True) + removed = subprocess.check_output("git diff editor/translations/editor.pot | grep \\\-msgid | wc -l", shell=True) print("\n# Template changes compared to the staged status:") print("# Additions: %s msgids.\n# Deletions: %s msgids." % (int(added), int(removed))) diff --git a/tools/editor/translations/fa.po b/editor/translations/fa.po index 41a686ba52..41a686ba52 100644 --- a/tools/editor/translations/fa.po +++ b/editor/translations/fa.po diff --git a/tools/editor/translations/fr.po b/editor/translations/fr.po index 2c4f7144fe..2c4f7144fe 100644 --- a/tools/editor/translations/fr.po +++ b/editor/translations/fr.po diff --git a/tools/editor/translations/hu.po b/editor/translations/hu.po index 335ab25c6a..335ab25c6a 100644 --- a/tools/editor/translations/hu.po +++ b/editor/translations/hu.po diff --git a/tools/editor/translations/id.po b/editor/translations/id.po index 30bd357a21..30bd357a21 100644 --- a/tools/editor/translations/id.po +++ b/editor/translations/id.po diff --git a/tools/editor/translations/it.po b/editor/translations/it.po index 8fefe67677..8fefe67677 100644 --- a/tools/editor/translations/it.po +++ b/editor/translations/it.po diff --git a/tools/editor/translations/ja.po b/editor/translations/ja.po index ea314db101..ea314db101 100644 --- a/tools/editor/translations/ja.po +++ b/editor/translations/ja.po diff --git a/tools/editor/translations/ko.po b/editor/translations/ko.po index a0ecb70bf5..a0ecb70bf5 100644 --- a/tools/editor/translations/ko.po +++ b/editor/translations/ko.po diff --git a/tools/editor/translations/nb.po b/editor/translations/nb.po index cbd2a09951..cbd2a09951 100644 --- a/tools/editor/translations/nb.po +++ b/editor/translations/nb.po diff --git a/tools/editor/translations/pl.po b/editor/translations/pl.po index 50afecad1b..50afecad1b 100644 --- a/tools/editor/translations/pl.po +++ b/editor/translations/pl.po diff --git a/tools/editor/translations/pr.po b/editor/translations/pr.po index 8ea2967a22..8ea2967a22 100644 --- a/tools/editor/translations/pr.po +++ b/editor/translations/pr.po diff --git a/tools/editor/translations/pt_BR.po b/editor/translations/pt_BR.po index 9ab81786b1..9ab81786b1 100644 --- a/tools/editor/translations/pt_BR.po +++ b/editor/translations/pt_BR.po diff --git a/tools/editor/translations/pt_PT.po b/editor/translations/pt_PT.po index da9d971347..da9d971347 100644 --- a/tools/editor/translations/pt_PT.po +++ b/editor/translations/pt_PT.po diff --git a/tools/editor/translations/ru.po b/editor/translations/ru.po index 0595a675b3..0595a675b3 100644 --- a/tools/editor/translations/ru.po +++ b/editor/translations/ru.po diff --git a/tools/editor/translations/sk.po b/editor/translations/sk.po index 6aa2e16664..6aa2e16664 100644 --- a/tools/editor/translations/sk.po +++ b/editor/translations/sk.po diff --git a/tools/editor/translations/sl.po b/editor/translations/sl.po index 4934be97d7..4934be97d7 100644 --- a/tools/editor/translations/sl.po +++ b/editor/translations/sl.po diff --git a/tools/editor/translations/tr.po b/editor/translations/tr.po index 5c0b6ebca8..5c0b6ebca8 100644 --- a/tools/editor/translations/tr.po +++ b/editor/translations/tr.po diff --git a/tools/editor/translations/ur_PK.po b/editor/translations/ur_PK.po index b898301d0c..b898301d0c 100644 --- a/tools/editor/translations/ur_PK.po +++ b/editor/translations/ur_PK.po diff --git a/tools/editor/translations/zh_CN.po b/editor/translations/zh_CN.po index 47c77f6170..47c77f6170 100644 --- a/tools/editor/translations/zh_CN.po +++ b/editor/translations/zh_CN.po diff --git a/tools/editor/translations/zh_HK.po b/editor/translations/zh_HK.po index b0bb11d527..b0bb11d527 100644 --- a/tools/editor/translations/zh_HK.po +++ b/editor/translations/zh_HK.po diff --git a/tools/editor/translations/zh_TW.po b/editor/translations/zh_TW.po index 3e9b61ec0f..3e9b61ec0f 100644 --- a/tools/editor/translations/zh_TW.po +++ b/editor/translations/zh_TW.po diff --git a/main/input_default.cpp b/main/input_default.cpp index 0561f2bb34..a9f643c785 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -1214,6 +1214,15 @@ int InputDefault::get_joy_button_index_from_string(String p_button) { ERR_FAIL_V(-1); } +int InputDefault::get_unused_joy_id() { + for (int i=0;i<JOYPADS_MAX;i++) { + if (!joy_names.has(i) || !joy_names[i].connected) { + return i; + } + } + return -1; +} + String InputDefault::get_joy_axis_string(int p_axis) { ERR_FAIL_INDEX_V(p_axis, JOY_AXIS_MAX, ""); return _axes[p_axis]; diff --git a/main/input_default.h b/main/input_default.h index 3e41c494c1..78bc0f4355 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -134,6 +134,11 @@ public: HAT_LEFT, HAT_MAX, }; + + enum { + JOYPADS_MAX = 16, + }; + struct JoyAxis { int min; float value; @@ -243,6 +248,8 @@ public: virtual int get_joy_axis_index_from_string(String p_axis); virtual int get_joy_button_index_from_string(String p_button); + int get_unused_joy_id(); + bool is_joy_mapped(int p_device); String get_joy_guid_remapped(int p_device) const; void set_fallback_mapping(String p_guid); diff --git a/main/main.cpp b/main/main.cpp index 21a839a25f..32aea6a4a5 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "main.h" #include "os/os.h" -#include "globals.h" +#include "global_config.h" #include "splash.h" #include "core/register_core_types.h" #include "scene/register_scene_types.h" @@ -54,9 +54,9 @@ #include "scene/main/viewport.h" #ifdef TOOLS_ENABLED -#include "tools/editor/doc/doc_data.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/project_manager.h" +#include "editor/doc/doc_data.h" +#include "editor/editor_node.h" +#include "editor/project_manager.h" #endif #include "io/file_access_network.h" @@ -1063,6 +1063,7 @@ bool Main::start() { bool editor=false; String doc_tool; + List<String> removal_docs; bool doc_base=true; String game_path; String script; @@ -1093,6 +1094,8 @@ bool Main::start() { bool parsed_pair=true; if (args[i]=="-doctool") { doc_tool=args[i+1]; + for(int j=i+2; j<args.size();j++) + removal_docs.push_back(args[j]); } else if (args[i]=="-script" || args[i]=="-s") { script=args[i+1]; } else if (args[i]=="-level" || args[i]=="-l") { @@ -1141,6 +1144,14 @@ bool Main::start() { } + for(List<String>::Element* E= removal_docs.front(); E; E=E->next()) { + DocData rmdoc; + if (rmdoc.load(E->get()) == OK) { + print_line(String("Removing classes in ") + E->get()); + doc.remove_from(rmdoc); + } + } + doc.save(doc_tool); return false; diff --git a/main/performance.cpp b/main/performance.cpp index 50ca594f8e..bc5d8c33c4 100644 --- a/main/performance.cpp +++ b/main/performance.cpp @@ -40,7 +40,7 @@ Performance *Performance::singleton=NULL; void Performance::_bind_methods() { - ClassDB::bind_method(_MD("get_monitor","monitor"),&Performance::get_monitor); + ClassDB::bind_method(D_METHOD("get_monitor","monitor"),&Performance::get_monitor); BIND_CONSTANT( TIME_FPS ); BIND_CONSTANT( TIME_PROCESS ); diff --git a/main/tests/test_containers.cpp b/main/tests/test_containers.cpp index 2711d107e4..8926066fe6 100644 --- a/main/tests/test_containers.cpp +++ b/main/tests/test_containers.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,6 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "test_containers.h" + #include "dvector.h" #include "set.h" #include "print_string.h" diff --git a/main/tests/test_containers.h b/main/tests/test_containers.h index 72d5c0ff7a..bbc132f1c2 100644 --- a/main/tests/test_containers.h +++ b/main/tests/test_containers.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 7fdfef5f3c..e9ac238f2a 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_gdscript.h b/main/tests/test_gdscript.h index 225654e2a8..7541e7b20f 100644 --- a/main/tests/test_gdscript.h +++ b/main/tests/test_gdscript.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_gui.cpp b/main/tests/test_gui.cpp index 899bdc37b9..6833558f07 100644 --- a/main/tests/test_gui.cpp +++ b/main/tests/test_gui.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_gui.h b/main/tests/test_gui.h index 5526320b0c..d053770bdd 100644 --- a/main/tests/test_gui.h +++ b/main/tests/test_gui.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_image.cpp b/main/tests/test_image.cpp index bf9851cf01..dbe0111367 100644 --- a/main/tests/test_image.cpp +++ b/main/tests/test_image.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,10 +27,12 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "test_image.h" + #include "os/main_loop.h" #include "math_funcs.h" #include "print_string.h" #include "io/image_loader.h" + namespace TestImage { diff --git a/main/tests/test_image.h b/main/tests/test_image.h index 09b33e799e..51ce6d5cc7 100644 --- a/main/tests/test_image.h +++ b/main/tests/test_image.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_io.cpp b/main/tests/test_io.cpp index 42664e73cd..af4742afa7 100644 --- a/main/tests/test_io.cpp +++ b/main/tests/test_io.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ #include "io/resource_loader.h" #include "io/resource_saver.h" #include "os/dir_access.h" -#include "core/globals.h" +#include "core/global_config.h" #include "io/file_access_memory.h" diff --git a/main/tests/test_io.h b/main/tests/test_io.h index c839590ab9..bb6a4a4474 100644 --- a/main/tests/test_io.h +++ b/main/tests/test_io.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_main.cpp b/main/tests/test_main.cpp index 763616dd46..27f7c2d025 100644 --- a/main/tests/test_main.cpp +++ b/main/tests/test_main.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_main.h b/main/tests/test_main.h index c8d571a7dd..4d9419a4f6 100644 --- a/main/tests/test_main.h +++ b/main/tests/test_main.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_math.cpp b/main/tests/test_math.cpp index 89513b81d9..43164bb2e6 100644 --- a/main/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,6 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "test_math.h" + #include "ustring.h" #include "print_string.h" #include "transform.h" @@ -144,11 +145,11 @@ class GetClassAndNamespace { error_str="Unterminated comment"; error=true; return TK_ERROR; - } if (code[idx]=='*' &&code[idx+1]=='/') { + } else if (code[idx]=='*' &&code[idx+1]=='/') { idx+=2; break; - } if (code[idx]=='\n') { + } else if (code[idx]=='\n') { line++; } diff --git a/main/tests/test_math.h b/main/tests/test_math.h index 492c3a1837..1ca8a8c12a 100644 --- a/main/tests/test_math.h +++ b/main/tests/test_math.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_physics.cpp b/main/tests/test_physics.cpp index 95ce540b16..fe0fad9bc8 100644 --- a/main/tests/test_physics.cpp +++ b/main/tests/test_physics.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_physics.h b/main/tests/test_physics.h index 5b6a54f2d4..68693fd931 100644 --- a/main/tests/test_physics.h +++ b/main/tests/test_physics.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_physics_2d.cpp b/main/tests/test_physics_2d.cpp index 76d1afd2ac..4321a356f5 100644 --- a/main/tests/test_physics_2d.cpp +++ b/main/tests/test_physics_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,6 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "test_physics_2d.h" + #include "servers/visual_server.h" #include "servers/physics_2d_server.h" #include "os/main_loop.h" @@ -356,8 +357,8 @@ protected: static void _bind_methods() { - ClassDB::bind_method(_MD("_body_moved"),&TestPhysics2DMainLoop::_body_moved); - ClassDB::bind_method(_MD("_ray_query_callback"),&TestPhysics2DMainLoop::_ray_query_callback); + ClassDB::bind_method(D_METHOD("_body_moved"),&TestPhysics2DMainLoop::_body_moved); + ClassDB::bind_method(D_METHOD("_ray_query_callback"),&TestPhysics2DMainLoop::_ray_query_callback); } diff --git a/main/tests/test_physics_2d.h b/main/tests/test_physics_2d.h index e2eb1f4023..dee18edfe0 100644 --- a/main/tests/test_physics_2d.h +++ b/main/tests/test_physics_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_render.cpp b/main/tests/test_render.cpp index 7380c1ff6a..512c48b116 100644 --- a/main/tests/test_render.cpp +++ b/main/tests/test_render.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,6 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "test_render.h" + #include "servers/visual_server.h" #include "os/main_loop.h" #include "math_funcs.h" diff --git a/main/tests/test_render.h b/main/tests/test_render.h index 6993e75b9f..b6f6d81881 100644 --- a/main/tests/test_render.h +++ b/main/tests/test_render.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp index 1a677bcbe2..64c3853065 100644 --- a/main/tests/test_shader_lang.cpp +++ b/main/tests/test_shader_lang.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_shader_lang.h b/main/tests/test_shader_lang.h index f129fb224a..aae047ce10 100644 --- a/main/tests/test_shader_lang.h +++ b/main/tests/test_shader_lang.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_sound.cpp b/main/tests/test_sound.cpp index 6b0cf0a324..095ce001ba 100644 --- a/main/tests/test_sound.cpp +++ b/main/tests/test_sound.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_sound.h b/main/tests/test_sound.h index 91b87a2261..167751bd1d 100644 --- a/main/tests/test_sound.h +++ b/main/tests/test_sound.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* 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/tests/test_string.cpp b/main/tests/test_string.cpp index a4a8ceb072..ca7fdedcb8 100644 --- a/main/tests/test_string.cpp +++ b/main/tests/test_string.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -835,7 +835,6 @@ bool test_28() { bool test_29() { - bool error = false; bool state = true; bool success = false; diff --git a/main/tests/test_string.h b/main/tests/test_string.h index 7b3cd9a019..12df7f126f 100644 --- a/main/tests/test_string.h +++ b/main/tests/test_string.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/misc/dist/appimage/AppRun b/misc/dist/appimage/AppRun new file mode 100755 index 0000000000..db3398a92a --- /dev/null +++ b/misc/dist/appimage/AppRun @@ -0,0 +1,3 @@ +#!/bin/sh +HERE="$(dirname "$(readlink -f "${0}")")" +"${HERE}"/godot $@ diff --git a/misc/dist/appimage/godot.desktop b/misc/dist/appimage/godot.desktop new file mode 100644 index 0000000000..545c491256 --- /dev/null +++ b/misc/dist/appimage/godot.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Godot Engine +GenericName=Libre game engine +Comment=Multi-platform 2D and 3D game engine with a feature rich editor +Exec=godot -pm +Icon=godot +Terminal=false +Type=Application +Categories=Development;IDE; diff --git a/misc/dist/appimage/godot.png b/misc/dist/appimage/godot.png Binary files differnew file mode 100644 index 0000000000..e334f5fa78 --- /dev/null +++ b/misc/dist/appimage/godot.png diff --git a/modules/cscript/godot_c.cpp b/modules/cscript/godot_c.cpp index d5c1b53dfe..85ee28d6d2 100644 --- a/modules/cscript/godot_c.cpp +++ b/modules/cscript/godot_c.cpp @@ -1,2 +1,30 @@ +/*************************************************************************/ +/* godot_c.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "godot_c.h" diff --git a/modules/cscript/godot_c.h b/modules/cscript/godot_c.h index 3bf86d1aeb..97a63a439f 100644 --- a/modules/cscript/godot_c.h +++ b/modules/cscript/godot_c.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* godot_c.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 GODOT_C_H #define GODOT_C_H diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 5295183c35..600cae991e 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -114,7 +114,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String& p_original_path, uint32_t width = f->get_32(); uint32_t height = f->get_32(); uint32_t pitch = f->get_32(); - uint32_t depth = f->get_32(); + /* uint32_t depth = */ f->get_32(); uint32_t mipmaps = f->get_32(); //skip 11 @@ -130,7 +130,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String& p_original_path, } - uint32_t format_size = f->get_32(); + /* uint32_t format_size = */ f->get_32(); uint32_t format_flags = f->get_32(); uint32_t format_fourcc = f->get_32(); uint32_t format_rgb_bits = f->get_32(); @@ -139,9 +139,9 @@ RES ResourceFormatDDS::load(const String &p_path, const String& p_original_path, uint32_t format_blue_mask = f->get_32(); uint32_t format_alpha_mask = f->get_32(); - uint32_t caps_1 = f->get_32(); - uint32_t caps_2 = f->get_32(); - uint32_t caps_ddsx = f->get_32(); + /* uint32_t caps_1 = */ f->get_32(); + /* uint32_t caps_2 = */ f->get_32(); + /* uint32_t caps_ddsx = */ f->get_32(); //reserved skip f->get_32(); diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index d10634e9ea..af555b7eb6 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -645,12 +645,12 @@ void NetworkedMultiplayerENet::enet_compressor_destroy(void * context){ void NetworkedMultiplayerENet::_bind_methods() { - ClassDB::bind_method(_MD("create_server","port","max_clients","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_server,DEFVAL(32),DEFVAL(0),DEFVAL(0)); - ClassDB::bind_method(_MD("create_client","ip","port","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_client,DEFVAL(0),DEFVAL(0)); - ClassDB::bind_method(_MD("close_connection"),&NetworkedMultiplayerENet::close_connection); - ClassDB::bind_method(_MD("set_compression_mode","mode"),&NetworkedMultiplayerENet::set_compression_mode); - ClassDB::bind_method(_MD("get_compression_mode"),&NetworkedMultiplayerENet::get_compression_mode); - ClassDB::bind_method(_MD("set_bind_ip", "ip"),&NetworkedMultiplayerENet::set_bind_ip); + ClassDB::bind_method(D_METHOD("create_server","port","max_clients","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_server,DEFVAL(32),DEFVAL(0),DEFVAL(0)); + ClassDB::bind_method(D_METHOD("create_client","ip","port","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_client,DEFVAL(0),DEFVAL(0)); + ClassDB::bind_method(D_METHOD("close_connection"),&NetworkedMultiplayerENet::close_connection); + ClassDB::bind_method(D_METHOD("set_compression_mode","mode"),&NetworkedMultiplayerENet::set_compression_mode); + ClassDB::bind_method(D_METHOD("get_compression_mode"),&NetworkedMultiplayerENet::get_compression_mode); + ClassDB::bind_method(D_METHOD("set_bind_ip", "ip"),&NetworkedMultiplayerENet::set_bind_ip); BIND_CONSTANT( COMPRESS_NONE ); BIND_CONSTANT( COMPRESS_RANGE_CODER ); diff --git a/modules/etc1/texture_loader_pkm.cpp b/modules/etc1/texture_loader_pkm.cpp index e720e1fb4c..b00e71c485 100644 --- a/modules/etc1/texture_loader_pkm.cpp +++ b/modules/etc1/texture_loader_pkm.cpp @@ -1,4 +1,33 @@ +/*************************************************************************/ +/* texture_loader_pkm.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "texture_loader_pkm.h" + #include "os/file_access.h" #include <string.h> diff --git a/modules/etc1/texture_loader_pkm.h b/modules/etc1/texture_loader_pkm.h index 5788716d9f..9be7b051d3 100644 --- a/modules/etc1/texture_loader_pkm.h +++ b/modules/etc1/texture_loader_pkm.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* texture_loader_pkm.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 TEXTURE_LOADER_PKM_H #define TEXTURE_LOADER_PKM_H diff --git a/modules/gdscript/gd_compiler.h b/modules/gdscript/gd_compiler.h index dd211a852c..eb6079e8e0 100644 --- a/modules/gdscript/gd_compiler.h +++ b/modules/gdscript/gd_compiler.h @@ -93,7 +93,7 @@ class GDCompiler { //int get_identifier_pos(const StringName& p_dentifier) const; - HashMap<Variant,int,VariantHasher> constant_map; + HashMap<Variant,int,VariantHasher,VariantComparator> constant_map; Map<StringName,int> name_map; int get_name_map_pos(const StringName& p_identifier) { diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index 114a25feeb..9dd41847d7 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "gd_script.h" #include "gd_compiler.h" -#include "globals.h" +#include "global_config.h" #include "os/file_access.h" void GDScriptLanguage::get_comment_delimiters(List<String> *p_delimiters) const { @@ -323,6 +323,16 @@ void GDScriptLanguage::get_public_constants(List<Pair<String,Variant> > *p_const pi.first="PI"; pi.second=Math_PI; p_constants->push_back(pi); + + Pair<String, Variant> infinity; + infinity.first = "INF"; + infinity.second = Math_INF; + p_constants->push_back(infinity); + + Pair<String, Variant> nan; + nan.first = "NAN"; + nan.second = Math_NAN; + p_constants->push_back(nan); } String GDScriptLanguage::make_function(const String& p_class,const String& p_name,const PoolStringArray& p_args) const { @@ -2645,6 +2655,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol switch(p.get_completion_type()) { + case GDParser::COMPLETION_GET_NODE: case GDParser::COMPLETION_NONE: { } break; case GDParser::COMPLETION_BUILT_IN_TYPE_CONSTANT: { diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index 51e2c1e2be..519fb1cd8c 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -1,4 +1,33 @@ +/*************************************************************************/ +/* gd_function.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "gd_function.h" + #include "gd_script.h" #include "os/os.h" #include "gd_functions.h" @@ -171,7 +200,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a if (p_state) { //use existing (supplied) state (yielded) stack=(Variant*)p_state->stack.ptr(); - call_args=(Variant**)&p_state->stack[sizeof(Variant)*p_state->stack_size]; + call_args=(Variant**)stack + sizeof(Variant)*p_state->stack_size; line=p_state->line; ip=p_state->ip; alloca_size=p_state->stack.size(); @@ -725,7 +754,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a err.argument-=1; } } - } if (methodstr=="free") { + } else if (methodstr=="free") { if (err.error==Variant::CallError::CALL_ERROR_INVALID_METHOD) { @@ -1490,8 +1519,8 @@ Variant GDFunctionState::resume(const Variant& p_arg) { void GDFunctionState::_bind_methods() { - ClassDB::bind_method(_MD("resume:Variant","arg"),&GDFunctionState::resume,DEFVAL(Variant())); - ClassDB::bind_method(_MD("is_valid"),&GDFunctionState::is_valid); + ClassDB::bind_method(D_METHOD("resume:Variant","arg"),&GDFunctionState::resume,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("is_valid"),&GDFunctionState::is_valid); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&GDFunctionState::_signal_callback,MethodInfo("_signal_callback")); } diff --git a/modules/gdscript/gd_function.h b/modules/gdscript/gd_function.h index e5262e8ad7..aff6341601 100644 --- a/modules/gdscript/gd_function.h +++ b/modules/gdscript/gd_function.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* gd_function.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 GD_FUNCTION_H #define GD_FUNCTION_H diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 34c39c8024..5147ccd63f 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -375,6 +375,22 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_ constant->value=Math_PI; tokenizer->advance(); expr=constant; + } + else if (tokenizer->get_token() == GDTokenizer::TK_CONST_INF) { + + //constant defined by tokenizer + ConstantNode *constant = alloc_node<ConstantNode>(); + constant->value = Math_INF; + tokenizer->advance(); + expr = constant; + } + else if (tokenizer->get_token() == GDTokenizer::TK_CONST_NAN) { + + //constant defined by tokenizer + ConstantNode *constant = alloc_node<ConstantNode>(); + constant->value = Math_NAN; + tokenizer->advance(); + expr = constant; } else if (tokenizer->get_token()==GDTokenizer::TK_PR_PRELOAD) { //constant defined by tokenizer @@ -386,21 +402,42 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_ tokenizer->advance(); String path; + bool found_constant = false; bool valid = false; + ConstantNode *cn; + Node *subexpr = _parse_and_reduce_expression(p_parent, p_static); if (subexpr) { if (subexpr->type == Node::TYPE_CONSTANT) { - ConstantNode *cn = static_cast<ConstantNode*>(subexpr); - if (cn->value.get_type() == Variant::STRING) { - valid = true; - path = (String) cn->value; + cn = static_cast<ConstantNode*>(subexpr); + found_constant = true; + } + if (subexpr->type == Node::TYPE_IDENTIFIER) { + IdentifierNode *in = static_cast<IdentifierNode*>(subexpr); + Vector<ClassNode::Constant> ce = current_class->constant_expressions; + + // Try to find the constant expression by the identifier + for(int i=0; i < ce.size(); ++i){ + if(ce[i].identifier == in->name) { + if(ce[i].expression->type == Node::TYPE_CONSTANT) { + cn = static_cast<ConstantNode*>(ce[i].expression); + found_constant = true; + } + } } } + + if (found_constant && cn->value.get_type() == Variant::STRING) { + valid = true; + path = (String) cn->value; + } } + if (!valid) { _set_error("expected string constant as 'preload' argument."); return NULL; } + if (!path.is_abs_path() && base_path!="") path=base_path+"/"+path; path = path.replace("///","//").simplify_path(); @@ -2577,7 +2614,7 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { Vector<Node*> args; Vector<double> constants; - bool constant=true; + bool constant=false; for(int i=1;i<op->arguments.size();i++) { args.push_back(op->arguments[i]); @@ -2585,13 +2622,14 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) { ConstantNode *c = static_cast<ConstantNode*>(op->arguments[i]); if (c->value.get_type()==Variant::REAL || c->value.get_type()==Variant::INT) { constants.push_back(c->value); - } else { - constant=false; + constant=true; } + } else { + constant=false; } } - if (args.size()>0 || args.size()<4) { + if (args.size()>0 && args.size()<4) { if (constant) { diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 89df7e962a..4e72bc39a4 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "gd_script.h" -#include "globals.h" +#include "global_config.h" #include "global_constants.h" #include "gd_compiler.h" #include "os/file_access.h" @@ -63,7 +63,7 @@ bool GDNativeClass::_get(const StringName& p_name,Variant &r_ret) const { void GDNativeClass::_bind_methods() { - ClassDB::bind_method(_MD("new"),&GDNativeClass::_new); + ClassDB::bind_method(D_METHOD("new"),&GDNativeClass::_new); } @@ -789,7 +789,7 @@ void GDScript::_bind_methods() { ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"new",&GDScript::_new,MethodInfo(Variant::OBJECT,"new")); - ClassDB::bind_method(_MD("get_as_byte_code"),&GDScript::get_as_byte_code); + ClassDB::bind_method(D_METHOD("get_as_byte_code"),&GDScript::get_as_byte_code); } @@ -1517,6 +1517,8 @@ void GDScriptLanguage::init() { } _add_global(StaticCString::create("PI"),Math_PI); + _add_global(StaticCString::create("INF"),Math_INF); + _add_global(StaticCString::create("NAN"),Math_NAN); //populate native classes @@ -1909,6 +1911,8 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const { "bool", "null", "PI", + "INF", + "NAN", "self", "true", // functions diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp index 5be2a2beae..54b9624e8e 100644 --- a/modules/gdscript/gd_tokenizer.cpp +++ b/modules/gdscript/gd_tokenizer.cpp @@ -120,6 +120,8 @@ const char* GDTokenizer::token_names[TK_MAX]={ "'\\n'", "PI", "_", +"INF", +"NAN", "Error", "EOF", "Cursor"}; @@ -901,6 +903,8 @@ void GDTokenizerText::_advance() { {TK_SELF,"self"}, {TK_CONST_PI,"PI"}, {TK_WILDCARD,"_"}, + {TK_CONST_INF,"INF"}, + {TK_CONST_NAN,"NAN"}, {TK_ERROR,NULL} }; @@ -1169,7 +1173,7 @@ Vector<uint8_t> GDTokenizerBuffer::parse_code_string(const String& p_code) { Map<StringName,int> identifier_map; - HashMap<Variant,int,VariantHasher> constant_map; + HashMap<Variant,int,VariantHasher,VariantComparator> constant_map; Map<uint32_t,int> line_map; Vector<uint32_t> token_array; diff --git a/modules/gdscript/gd_tokenizer.h b/modules/gdscript/gd_tokenizer.h index 5d955ff1ae..1e9eda7947 100644 --- a/modules/gdscript/gd_tokenizer.h +++ b/modules/gdscript/gd_tokenizer.h @@ -128,6 +128,8 @@ public: TK_NEWLINE, TK_CONST_PI, TK_WILDCARD, + TK_CONST_INF, + TK_CONST_NAN, 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 db47ee43ce..d1d69c6709 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -41,10 +41,10 @@ ResourceFormatSaverGDScript *resource_saver_gd=NULL; #if 0 #ifdef TOOLS_ENABLED -#include "tools/editor/editor_import_export.h" +#include "editor/editor_import_export.h" #include "gd_tokenizer.h" -#include "tools/editor/editor_node.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_node.h" +#include "editor/editor_settings.h" class EditorExportGDScript : public EditorExportPlugin { diff --git a/modules/gridmap/config.py b/modules/gridmap/config.py index 1ab13c4aeb..5698a37295 100644 --- a/modules/gridmap/config.py +++ b/modules/gridmap/config.py @@ -1,8 +1,7 @@ def can_build(platform): - # FIXME: Disabled temporary for gles3 implementation - return False + return True def configure(env): diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 2dd7e951ab..d4fb174bfe 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -31,7 +31,7 @@ #include "scene/resources/surface_tool.h" #include "message_queue.h" #include "scene/3d/light.h" -#include "scene/3d/baked_light_instance.h" + #include "io/marshalls.h" #include "scene/scene_string_names.h" #include "os/os.h" @@ -41,25 +41,21 @@ bool GridMap::_set(const StringName& p_name, const Variant& p_value) { String name=p_name; - if (name=="theme/theme") { + if (name=="theme") { set_theme(p_value); - } else if (name=="cell/size") { + } else if (name=="cell_size") { set_cell_size(p_value); - } else if (name=="cell/octant_size") { + } else if (name=="cell_octant_size") { set_octant_size(p_value); - } else if (name=="cell/center_x") { + } else if (name=="cell_center_x") { set_center_x(p_value); - } else if (name=="cell/center_y") { + } else if (name=="cell_center_y") { set_center_y(p_value); - } else if (name=="cell/center_z") { + } else if (name=="cell_center_z") { set_center_z(p_value); - } else if (name=="cell/scale") { + } else if (name=="cell_scale") { set_cell_scale(p_value); - } else if (name=="lighting/bake") { - set_use_baked_light(p_value); - } else if (name=="theme/bake") { - set_bake(p_value); /* } else if (name=="cells") { PoolVector<int> cells = p_value; int amount=cells.size(); @@ -81,9 +77,6 @@ bool GridMap::_set(const StringName& p_name, const Variant& p_value) { Dictionary d = p_value; - Dictionary baked; - if (d.has("baked")) - baked=d["baked"]; if (d.has("cells")) { PoolVector<int> cells = d["cells"]; @@ -101,33 +94,7 @@ bool GridMap::_set(const StringName& p_name, const Variant& p_value) { } } - baked_lock=baked.size()!=0; _recreate_octant_data(); - baked_lock=false; - if (!baked.empty()) { - List<Variant> kl; - baked.get_key_list(&kl); - for (List<Variant>::Element *E=kl.front();E;E=E->next()) { - - Plane ikv = E->get(); - Ref<Mesh> b=baked[ikv]; - ERR_CONTINUE(!b.is_valid()); - OctantKey ok; - ok.x=ikv.normal.x; - ok.y=ikv.normal.y; - ok.z=ikv.normal.z; - ok.area=ikv.d; - - ERR_CONTINUE(!octant_map.has(ok)); - - Octant &g = *octant_map[ok]; - - g.baked=b; - g.bake_instance=VS::get_singleton()->instance_create(); - VS::get_singleton()->instance_set_base(g.bake_instance,g.baked->get_rid()); - VS::get_singleton()->instance_geometry_set_baked_light(g.bake_instance,baked_light_instance?baked_light_instance->get_baked_light_instance():RID()); - } - } } else if (name.begins_with("areas/")) { @@ -161,24 +128,20 @@ bool GridMap::_get(const StringName& p_name,Variant &r_ret) const { String name=p_name; - if (name=="theme/theme") { + if (name=="theme") { r_ret= get_theme(); - } else if (name=="cell/size") { + } else if (name=="cell_size") { r_ret= get_cell_size(); - } else if (name=="cell/octant_size") { + } else if (name=="cell_octant_size") { r_ret= get_octant_size(); - } else if (name=="cell/center_x") { + } else if (name=="cell_center_x") { r_ret= get_center_x(); - } else if (name=="cell/center_y") { + } else if (name=="cell_center_y") { r_ret= get_center_y(); - } else if (name=="cell/center_z") { + } else if (name=="cell_center_z") { r_ret= get_center_z(); - } else if (name=="cell/scale") { + } else if (name=="cell_scale") { r_ret= cell_scale; - } else if (name=="lighting/bake") { - r_ret=is_using_baked_light(); - } else if (name=="theme/bake") { - r_ret= bake; } else if (name=="data") { Dictionary d; @@ -197,23 +160,8 @@ bool GridMap::_get(const StringName& p_name,Variant &r_ret) const { d["cells"]=cells; - Dictionary baked; - for(Map<OctantKey,Octant*>::Element *E=octant_map.front();E;E=E->next()) { - - Octant &g=*E->get(); - - if (g.baked.is_valid()) { - - baked[Plane(E->key().x,E->key().y,E->key().z,E->key().area)]=g.baked; - } - } - - if (baked.size()) { - d["baked"]=baked; - } - r_ret= d; } else if (name.begins_with("areas/")) { int which = name.get_slicec('/',1).to_int(); @@ -237,15 +185,14 @@ bool GridMap::_get(const StringName& p_name,Variant &r_ret) const { void GridMap::_get_property_list( List<PropertyInfo> *p_list) const { - p_list->push_back( PropertyInfo( Variant::OBJECT, "theme/theme", PROPERTY_HINT_RESOURCE_TYPE, "MeshLibrary")); - p_list->push_back( PropertyInfo( Variant::BOOL, "theme/bake")); - p_list->push_back( PropertyInfo( Variant::BOOL, "lighting/bake")); - p_list->push_back( PropertyInfo( Variant::REAL, "cell/size",PROPERTY_HINT_RANGE,"0.01,16384,0.01") ); - p_list->push_back( PropertyInfo( Variant::INT, "cell/octant_size",PROPERTY_HINT_RANGE,"1,1024,1") ); - p_list->push_back( PropertyInfo( Variant::BOOL, "cell/center_x") ); - p_list->push_back( PropertyInfo( Variant::BOOL, "cell/center_y") ); - p_list->push_back( PropertyInfo( Variant::BOOL, "cell/center_z") ); - p_list->push_back( PropertyInfo( Variant::REAL, "cell/scale") ); + p_list->push_back( PropertyInfo( Variant::OBJECT, "theme", PROPERTY_HINT_RESOURCE_TYPE, "MeshLibrary")); + p_list->push_back( PropertyInfo( Variant::NIL, "Cell", PROPERTY_HINT_NONE,"cell_",PROPERTY_USAGE_GROUP)); + p_list->push_back( PropertyInfo( Variant::REAL, "cell_size",PROPERTY_HINT_RANGE,"0.01,16384,0.01") ); + p_list->push_back( PropertyInfo( Variant::INT, "cell_octant_size",PROPERTY_HINT_RANGE,"1,1024,1") ); + p_list->push_back( PropertyInfo( Variant::BOOL, "cell_center_x") ); + p_list->push_back( PropertyInfo( Variant::BOOL, "cell_center_y") ); + p_list->push_back( PropertyInfo( Variant::BOOL, "cell_center_z") ); + p_list->push_back( PropertyInfo( Variant::REAL, "cell_scale") ); p_list->push_back( PropertyInfo( Variant::DICTIONARY, "data", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_STORAGE) ); @@ -380,17 +327,6 @@ void GridMap::set_cell_item(int p_x,int p_y,int p_z, int p_item,int p_rot){ g.items.erase(prev_item); } - - if (g.items.empty() || !baked_lock) { - //unbake just in case - if (g.baked.is_valid()) { - VS::get_singleton()->free(g.bake_instance); - g.bake_instance=RID(); - g.baked=Ref<Mesh>(); - } - - - } if (g.items.empty()) { PhysicsServer::get_singleton()->free(g.static_body); @@ -454,24 +390,12 @@ void GridMap::set_cell_item(int p_x,int p_y,int p_z, int p_item,int p_rot){ ii.navmesh=theme->get_item_navmesh(p_item); } ii.multimesh = Ref<MultiMesh>( memnew( MultiMesh ) ); + ii.multimesh->set_color_format(MultiMesh::COLOR_NONE); + ii.multimesh->set_transform_format(MultiMesh::TRANSFORM_3D); ii.multimesh->set_mesh(ii.mesh); ii.multimesh_instance = VS::get_singleton()->instance_create(); VS::get_singleton()->instance_set_base(ii.multimesh_instance,ii.multimesh->get_rid()); - VS::get_singleton()->instance_geometry_set_baked_light(ii.multimesh_instance,baked_light_instance?baked_light_instance->get_baked_light_instance():RID()); - - if (!baked_lock) { - //unbake just in case - if (g.bake_instance.is_valid()) - VS::get_singleton()->free(g.bake_instance); - g.baked=Ref<Mesh>(); - if (is_inside_world()) { - VS::get_singleton()->instance_set_scenario(ii.multimesh_instance,get_world()->get_scenario()); - if (ok.area) { - VS::get_singleton()->instance_set_room( ii.multimesh_instance,area_map[ok.area]->instance); - } - } - } g.items[p_item]=ii; } @@ -585,27 +509,14 @@ void GridMap::_octant_enter_world(const OctantKey &p_key) { VS::get_singleton()->instance_set_room(g.collision_debug_instance,area_map[p_key.area]->instance); } } - if (g.baked.is_valid()) { + for(Map<int,Octant::ItemInstances>::Element *E=g.items.front();E;E=E->next()) { - Transform xf = get_global_transform(); - xf.translate(_octant_get_offset(p_key)); + VS::get_singleton()->instance_set_scenario(E->get().multimesh_instance,get_world()->get_scenario()); + VS::get_singleton()->instance_set_transform(E->get().multimesh_instance,get_global_transform()); + //print_line("INSTANCEPOS: "+get_global_transform()); - VS::get_singleton()->instance_set_transform(g.bake_instance,xf); - VS::get_singleton()->instance_set_scenario(g.bake_instance,get_world()->get_scenario()); if (area_map.has(p_key.area)) { - VS::get_singleton()->instance_set_room(g.bake_instance,area_map[p_key.area]->instance); - - } - } else { - for(Map<int,Octant::ItemInstances>::Element *E=g.items.front();E;E=E->next()) { - - VS::get_singleton()->instance_set_scenario(E->get().multimesh_instance,get_world()->get_scenario()); - VS::get_singleton()->instance_set_transform(E->get().multimesh_instance,get_global_transform()); - //print_line("INSTANCEPOS: "+get_global_transform()); - - if (area_map.has(p_key.area)) { - VS::get_singleton()->instance_set_room(E->get().multimesh_instance,area_map[p_key.area]->instance); - } + VS::get_singleton()->instance_set_room(E->get().multimesh_instance,area_map[p_key.area]->instance); } } } @@ -621,17 +532,10 @@ void GridMap::_octant_transform(const OctantKey &p_key) { VS::get_singleton()->instance_set_transform(g.collision_debug_instance,get_global_transform()); } - if (g.baked.is_valid()) { - - Transform xf = get_global_transform(); - xf.origin+=_octant_get_offset(p_key); - VS::get_singleton()->instance_set_transform(g.bake_instance,xf); - } else { - for(Map<int,Octant::ItemInstances>::Element *E=g.items.front();E;E=E->next()) { + for(Map<int,Octant::ItemInstances>::Element *E=g.items.front();E;E=E->next()) { - VS::get_singleton()->instance_set_transform(E->get().multimesh_instance,get_global_transform()); - //print_line("UPDATEPOS: "+get_global_transform()); - } + VS::get_singleton()->instance_set_transform(E->get().multimesh_instance,get_global_transform()); + //print_line("UPDATEPOS: "+get_global_transform()); } } @@ -711,7 +615,7 @@ void GridMap::_octant_update(const OctantKey &p_key) { ii.multimesh->set_instance_transform(idx,xform); //ii.multimesh->set_instance_transform(idx,Transform() ); - ii.multimesh->set_instance_color(idx,Color(1,1,1,1)); + //ii.multimesh->set_instance_color(idx,Color(1,1,1,1)); //print_line("MMINST: "+xform); @@ -748,7 +652,7 @@ void GridMap::_octant_update(const OctantKey &p_key) { idx++; } - ii.multimesh->set_aabb(aabb); + //ii.multimesh->set_aabb(aabb); } @@ -760,7 +664,7 @@ void GridMap::_octant_update(const OctantKey &p_key) { arr.resize(VS::ARRAY_MAX); arr[VS::ARRAY_VERTEX]=col_debug; - VS::get_singleton()->mesh_add_surface(g.collision_debug,VS::PRIMITIVE_LINES,arr); + VS::get_singleton()->mesh_add_surface_from_arrays(g.collision_debug,VS::PRIMITIVE_LINES,arr); SceneTree *st=SceneTree::get_singleton(); if (st) { VS::get_singleton()->mesh_surface_set_material( g.collision_debug, 0,st->get_debug_collision_material()->get_rid() ); @@ -780,13 +684,6 @@ void GridMap::_octant_exit_world(const OctantKey &p_key) { PhysicsServer::get_singleton()->body_set_space(g.static_body,RID()); - if (g.baked.is_valid()) { - - VS::get_singleton()->instance_set_room(g.bake_instance,RID()); - VS::get_singleton()->instance_set_scenario(g.bake_instance,RID()); - - } - if (g.collision_debug_instance.is_valid()) { VS::get_singleton()->instance_set_room(g.collision_debug_instance,RID()); @@ -802,194 +699,6 @@ void GridMap::_octant_exit_world(const OctantKey &p_key) { } -void GridMap::_octant_clear_baked(const OctantKey &p_key) { - - - ERR_FAIL_COND(!octant_map.has(p_key)); - Octant&g = *octant_map[p_key]; - - if (!g.baked.is_valid()) - return; - - VS::get_singleton()->free(g.bake_instance); - g.bake_instance=RID(); - g.baked=Ref<Mesh>(); - - if (is_inside_tree()) - _octant_enter_world(p_key); - g.dirty=true; - _queue_dirty_map(); -} - -void GridMap::_octant_bake(const OctantKey &p_key, const Ref<TriangleMesh>& p_tmesh,const Vector<BakeLight> &p_lights,List<Vector3> *p_prebake) { - - - ERR_FAIL_COND(!octant_map.has(p_key)); - Octant&g = *octant_map[p_key]; - - Ref<TriangleMesh> tm=p_tmesh; - if (!p_prebake && is_inside_world()) - _octant_exit_world(p_key); - - Map< Ref<Material>, Ref<SurfaceTool> > surfaces; - Vector3 ofs(cell_size*0.5*int(center_x),cell_size*0.5*int(center_y),cell_size*0.5*int(center_z)); - Vector3 octant_ofs=_octant_get_offset(p_key); - - for(Map<int,Octant::ItemInstances>::Element *E=g.items.front();E;E=E->next()) { - - Octant::ItemInstances &ii=E->get(); - - if (ii.mesh.is_null()) - continue; - - for(Set<IndexKey>::Element *F=ii.cells.front();F;F=F->next()) { - - IndexKey ik=F->get(); - Map<IndexKey,Cell>::Element *C=cell_map.find(ik); - ERR_CONTINUE(!C); - Vector3 cellpos = Vector3(ik.x,ik.y,ik.z ); - - Transform xform; - xform.basis.set_orthogonal_index(C->get().rot); - xform.set_origin( cellpos*cell_size+ofs); - if (!p_prebake) - xform.origin-=octant_ofs; - - - for(int i=0;i<ii.mesh->get_surface_count();i++) { - - if (p_prebake) { - - if (ii.mesh->surface_get_primitive_type(i)!=Mesh::PRIMITIVE_TRIANGLES) - continue; - Array a = ii.mesh->surface_get_arrays(i); - PoolVector<Vector3> av=a[VS::ARRAY_VERTEX]; - int avs = av.size(); - PoolVector<Vector3>::Read vr = av.read(); - - PoolVector<int> ai=a[VS::ARRAY_INDEX]; - int ais=ai.size(); - if (ais) { - - PoolVector<int>::Read ir=ai.read(); - for(int j=0;j<ais;j++) { - - p_prebake->push_back(xform.xform(vr[ir[j]])); - //print_line("V SET: "+xform.xform(vr[ir[j]])); - } - - } else { - - for(int j=0;j<avs;j++) { - - p_prebake->push_back(xform.xform(vr[j])); - } - } - - } else { - - Ref<Material> m = ii.mesh->surface_get_material(i); - - Map< Ref<Material>, Ref<SurfaceTool> >::Element *S=surfaces.find(m); - - if (!S) { - - S=surfaces.insert(m,Ref<SurfaceTool>( memnew( SurfaceTool ))); - } - - Ref<SurfaceTool> st = S->get(); - List<SurfaceTool::Vertex>::Element *V=st->get_vertex_array().back(); - st->append_from(ii.mesh,i,xform); - st->set_material(m); - - - if (tm.is_valid()) { - - if (V) - V=V->next(); - else - V=st->get_vertex_array().front(); - int lc = p_lights.size(); - const BakeLight* bl = p_lights.ptr(); - float ofs = cell_size*0.02; - - - for(;V;V=V->next()) { - - SurfaceTool::Vertex &v=V->get(); - - Vector3 vertex = v.vertex + octant_ofs; - //print_line("V GET: "+vertex); - Vector3 normal = tm->get_area_normal( Rect3( Vector3(-ofs,-ofs,-ofs)+vertex,Vector3(ofs,ofs,ofs)*2.0)); - if (normal==Vector3()) { - print_line("couldn't find for vertex: "+vertex); - } - ERR_CONTINUE( normal== Vector3()); - - float max_l=1.0; - float max_dist=1.0; - - if (lc) { - - for(int j=0;j<lc;j++) { - const BakeLight &l=bl[j]; - switch(l.type) { - case VS::LIGHT_DIRECTIONAL: { - - Vector3 ray_from=vertex + normal *ofs; - Vector3 ray_to=l.dir*5000; - Vector3 n; - Vector3 p; - if (tm->intersect_segment(ray_from,ray_to,p,n)) { - - float dist = 1.0-l.param[VS::LIGHT_PARAM_SHADOW_DARKENING]; - if (dist<=max_dist) { - max_dist=dist; - max_l=1.0-dist; - } - } - } break; - } - - } - } - - v.color=Color(max_l,max_l,max_l,1.0); - - } - - st->add_to_format(VS::ARRAY_FORMAT_COLOR); - if (m.is_valid()) { - Ref<FixedSpatialMaterial> fm = m; - if (fm.is_valid()) - fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true); - } - } - } - } - } - } - - if (p_prebake) - return; - - g.baked = Ref<Mesh>( memnew( Mesh )); - - for(Map< Ref<Material>, Ref<SurfaceTool> >::Element *E=surfaces.front();E;E=E->next()) { - - Ref<SurfaceTool> st = E->get(); - st->commit(g.baked); - } - - g.bake_instance = VS::get_singleton()->instance_create(); - VS::get_singleton()->instance_set_base(g.bake_instance,g.baked->get_rid()); - - if (is_inside_world()) - _octant_enter_world(p_key); - - g.dirty=true; - _queue_dirty_map(); -} void GridMap::_notification(int p_what) { @@ -1011,10 +720,6 @@ void GridMap::_notification(int p_what) { last_transform=get_global_transform(); - if (use_baked_light) { - - _find_baked_light(); - } } break; case NOTIFICATION_TRANSFORM_CHANGED: { @@ -1036,15 +741,6 @@ void GridMap::_notification(int p_what) { _octant_exit_world(E->key()); } - if (use_baked_light) { - - if (baked_light_instance) { - baked_light_instance->disconnect(SceneStringNames::get_singleton()->baked_light_changed,this,SceneStringNames::get_singleton()->_baked_light_changed); - baked_light_instance=NULL; - } - _baked_light_changed(); - - } //_queue_dirty_map(MAP_DIRTY_INSTANCES|MAP_DIRTY_TRANSFORMS); //_update_dirty_map_callback(); @@ -1122,9 +818,6 @@ void GridMap::_clear_internal(bool p_keep_areas) { VS::get_singleton()->free(F->get().multimesh_instance); } - //unbake just in case - if (E->get()->bake_instance.is_valid()) - VS::get_singleton()->free(E->get()->bake_instance); if (E->get()->collision_debug.is_valid()) VS::get_singleton()->free(E->get()->collision_debug); @@ -1185,60 +878,48 @@ void GridMap::_update_dirty_map_callback() { void GridMap::_bind_methods() { - ClassDB::bind_method(_MD("set_theme","theme:MeshLibrary"),&GridMap::set_theme); - ClassDB::bind_method(_MD("get_theme:MeshLibrary"),&GridMap::get_theme); - - ClassDB::bind_method(_MD("set_bake","enable"),&GridMap::set_bake); - ClassDB::bind_method(_MD("is_baking_enabled"),&GridMap::is_baking_enabled); - - ClassDB::bind_method(_MD("set_cell_size","size"),&GridMap::set_cell_size); - ClassDB::bind_method(_MD("get_cell_size"),&GridMap::get_cell_size); - - ClassDB::bind_method(_MD("set_octant_size","size"),&GridMap::set_octant_size); - ClassDB::bind_method(_MD("get_octant_size"),&GridMap::get_octant_size); - - ClassDB::bind_method(_MD("set_cell_item","x","y","z","item","orientation"),&GridMap::set_cell_item,DEFVAL(0)); - ClassDB::bind_method(_MD("get_cell_item","x","y","z"),&GridMap::get_cell_item); - ClassDB::bind_method(_MD("get_cell_item_orientation","x","y","z"),&GridMap::get_cell_item_orientation); - - //ClassDB::bind_method(_MD("_recreate_octants"),&GridMap::_recreate_octants); - ClassDB::bind_method(_MD("_update_dirty_map_callback"),&GridMap::_update_dirty_map_callback); - ClassDB::bind_method(_MD("resource_changed","resource"),&GridMap::resource_changed); + ClassDB::bind_method(D_METHOD("set_theme","theme:MeshLibrary"),&GridMap::set_theme); + ClassDB::bind_method(D_METHOD("get_theme:MeshLibrary"),&GridMap::get_theme); - ClassDB::bind_method(_MD("set_center_x","enable"),&GridMap::set_center_x); - ClassDB::bind_method(_MD("get_center_x"),&GridMap::get_center_x); - ClassDB::bind_method(_MD("set_center_y","enable"),&GridMap::set_center_y); - ClassDB::bind_method(_MD("get_center_y"),&GridMap::get_center_y); - ClassDB::bind_method(_MD("set_center_z","enable"),&GridMap::set_center_z); - ClassDB::bind_method(_MD("get_center_z"),&GridMap::get_center_z); + ClassDB::bind_method(D_METHOD("set_cell_size","size"),&GridMap::set_cell_size); + ClassDB::bind_method(D_METHOD("get_cell_size"),&GridMap::get_cell_size); - ClassDB::bind_method(_MD("set_clip","enabled","clipabove","floor","axis"),&GridMap::set_clip,DEFVAL(true),DEFVAL(0),DEFVAL(Vector3::AXIS_X)); + ClassDB::bind_method(D_METHOD("set_octant_size","size"),&GridMap::set_octant_size); + ClassDB::bind_method(D_METHOD("get_octant_size"),&GridMap::get_octant_size); - ClassDB::bind_method(_MD("create_area","id","area"),&GridMap::create_area); - ClassDB::bind_method(_MD("area_get_bounds","area","bounds"),&GridMap::area_get_bounds); - ClassDB::bind_method(_MD("area_set_exterior_portal","area","enable"),&GridMap::area_set_exterior_portal); - ClassDB::bind_method(_MD("area_set_name","area","name"),&GridMap::area_set_name); - ClassDB::bind_method(_MD("area_get_name","area"),&GridMap::area_get_name); - ClassDB::bind_method(_MD("area_is_exterior_portal","area"),&GridMap::area_is_exterior_portal); - ClassDB::bind_method(_MD("area_set_portal_disable_distance","area","distance"),&GridMap::area_set_portal_disable_distance); - ClassDB::bind_method(_MD("area_get_portal_disable_distance","area"),&GridMap::area_get_portal_disable_distance); - ClassDB::bind_method(_MD("area_set_portal_disable_color","area","color"),&GridMap::area_set_portal_disable_color); - ClassDB::bind_method(_MD("area_get_portal_disable_color","area"),&GridMap::area_get_portal_disable_color); - ClassDB::bind_method(_MD("erase_area","area"),&GridMap::erase_area); - ClassDB::bind_method(_MD("get_unused_area_id","area"),&GridMap::get_unused_area_id); - ClassDB::bind_method(_MD("bake_geometry"),&GridMap::bake_geometry); + ClassDB::bind_method(D_METHOD("set_cell_item","x","y","z","item","orientation"),&GridMap::set_cell_item,DEFVAL(0)); + ClassDB::bind_method(D_METHOD("get_cell_item","x","y","z"),&GridMap::get_cell_item); + ClassDB::bind_method(D_METHOD("get_cell_item_orientation","x","y","z"),&GridMap::get_cell_item_orientation); - ClassDB::bind_method(_MD("_baked_light_changed"),&GridMap::_baked_light_changed); - ClassDB::bind_method(_MD("set_use_baked_light","use"),&GridMap::set_use_baked_light); - ClassDB::bind_method(_MD("is_using_baked_light","use"),&GridMap::is_using_baked_light); + //ClassDB::bind_method(D_METHOD("_recreate_octants"),&GridMap::_recreate_octants); + ClassDB::bind_method(D_METHOD("_update_dirty_map_callback"),&GridMap::_update_dirty_map_callback); + ClassDB::bind_method(D_METHOD("resource_changed","resource"),&GridMap::resource_changed); - ClassDB::bind_method(_MD("_get_baked_light_meshes"),&GridMap::_get_baked_light_meshes); + ClassDB::bind_method(D_METHOD("set_center_x","enable"),&GridMap::set_center_x); + ClassDB::bind_method(D_METHOD("get_center_x"),&GridMap::get_center_x); + ClassDB::bind_method(D_METHOD("set_center_y","enable"),&GridMap::set_center_y); + ClassDB::bind_method(D_METHOD("get_center_y"),&GridMap::get_center_y); + ClassDB::bind_method(D_METHOD("set_center_z","enable"),&GridMap::set_center_z); + ClassDB::bind_method(D_METHOD("get_center_z"),&GridMap::get_center_z); + ClassDB::bind_method(D_METHOD("set_clip","enabled","clipabove","floor","axis"),&GridMap::set_clip,DEFVAL(true),DEFVAL(0),DEFVAL(Vector3::AXIS_X)); + ClassDB::bind_method(D_METHOD("create_area","id","area"),&GridMap::create_area); + ClassDB::bind_method(D_METHOD("area_get_bounds","area","bounds"),&GridMap::area_get_bounds); + ClassDB::bind_method(D_METHOD("area_set_exterior_portal","area","enable"),&GridMap::area_set_exterior_portal); + ClassDB::bind_method(D_METHOD("area_set_name","area","name"),&GridMap::area_set_name); + ClassDB::bind_method(D_METHOD("area_get_name","area"),&GridMap::area_get_name); + ClassDB::bind_method(D_METHOD("area_is_exterior_portal","area"),&GridMap::area_is_exterior_portal); + ClassDB::bind_method(D_METHOD("area_set_portal_disable_distance","area","distance"),&GridMap::area_set_portal_disable_distance); + ClassDB::bind_method(D_METHOD("area_get_portal_disable_distance","area"),&GridMap::area_get_portal_disable_distance); + ClassDB::bind_method(D_METHOD("area_set_portal_disable_color","area","color"),&GridMap::area_set_portal_disable_color); + ClassDB::bind_method(D_METHOD("area_get_portal_disable_color","area"),&GridMap::area_get_portal_disable_color); + ClassDB::bind_method(D_METHOD("erase_area","area"),&GridMap::erase_area); + ClassDB::bind_method(D_METHOD("get_unused_area_id","area"),&GridMap::get_unused_area_id); - ClassDB::set_method_flags("GridMap","bake_geometry",METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(D_METHOD("clear"),&GridMap::clear); - ClassDB::bind_method(_MD("clear"),&GridMap::clear); + ClassDB::bind_method(D_METHOD("get_meshes"),&GridMap::get_meshes); BIND_CONSTANT( INVALID_CELL_ITEM ); @@ -1622,23 +1303,6 @@ int GridMap::get_unused_area_id() const { return area_map.back()->key()+1; } - -void GridMap::set_bake(bool p_bake) { - - bake=p_bake; - if (bake==false) { - for(Map<OctantKey,Octant*>::Element *E=octant_map.front();E;E=E->next()) { - - _octant_clear_baked(E->key()); - } - } -} - -bool GridMap::is_baking_enabled() const { - - return bake; -} - void GridMap::set_cell_scale(float p_scale) { cell_scale=p_scale; @@ -1652,100 +1316,8 @@ float GridMap::get_cell_scale() const{ -void GridMap::bake_geometry() { - - //used to compute vertex occlusion - Ref<TriangleMesh> tmesh; - Vector<BakeLight> lights; - - if (true) { - - List<Vector3> vertices; - - for(Map<OctantKey,Octant*>::Element *E=octant_map.front();E;E=E->next()) { - _octant_bake(E->key(),tmesh,lights,&vertices); - - } - - PoolVector<Vector3> vv; - vv.fill_with(vertices); - //print_line("TOTAL VERTICES: "+itos(vv.size())); - tmesh = Ref<TriangleMesh>( memnew( TriangleMesh )); - tmesh->create(vv); - - for(int i=0;i<get_child_count();i++) { - - if (get_child(i)->cast_to<Light>()) { - Light *l = get_child(i)->cast_to<Light>(); - BakeLight bl; - for(int i=0;i<Light::PARAM_MAX;i++) { - bl.param[i]=l->get_parameter(Light::Parameter(i)); - } - Transform t=l->get_global_transform(); - bl.pos=t.origin; - bl.dir=t.basis.get_axis(2); - bl.type=l->get_light_type(); - lights.push_back(bl); - - } - } - } - - int idx=0; - for(Map<OctantKey,Octant*>::Element *E=octant_map.front();E;E=E->next()) { - if (E->get()->baked.is_valid()) - _octant_clear_baked(E->key()); - - _octant_bake(E->key(),tmesh,lights); - print_line("baking "+itos(idx)+"/"+itos(octant_map.size())); - idx++; - } - -} - -void GridMap::_baked_light_changed() { - - /* - if (!baked_light_instance) - VS::get_singleton()->instance_geometry_set_baked_light(get_instance(),RID()); - else - VS::get_singleton()->instance_geometry_set_baked_light(get_instance(),baked_light_instance->get_baked_light_instance()); - */ - for(Map<OctantKey,Octant*>::Element *E=octant_map.front();E;E=E->next()) { - - for(Map<int,Octant::ItemInstances>::Element *F=E->get()->items.front();F;F=F->next()) { - - VS::get_singleton()->instance_geometry_set_baked_light(F->get().multimesh_instance,baked_light_instance?baked_light_instance->get_baked_light_instance():RID()); - } - - } - -} - -void GridMap::_find_baked_light() { - - Node *n=get_parent(); - while(n) { - - BakedLightInstance *bl=n->cast_to<BakedLightInstance>(); - if (bl) { - - baked_light_instance=bl; - baked_light_instance->connect(SceneStringNames::get_singleton()->baked_light_changed,this,SceneStringNames::get_singleton()->_baked_light_changed); - _baked_light_changed(); - - return; - } - - n=n->get_parent(); - } - - _baked_light_changed(); -} - - -Array GridMap::_get_baked_light_meshes() { +Array GridMap::get_meshes() { if (theme.is_null()) return Array(); @@ -1783,31 +1355,6 @@ Array GridMap::_get_baked_light_meshes() { return meshes; } -void GridMap::set_use_baked_light(bool p_use) { - - if (use_baked_light==p_use) - return; - - use_baked_light=p_use; - - if (is_inside_world()) { - if (!p_use) { - if (baked_light_instance) { - baked_light_instance->disconnect(SceneStringNames::get_singleton()->baked_light_changed,this,SceneStringNames::get_singleton()->_baked_light_changed); - baked_light_instance=NULL; - } - _baked_light_changed(); - } else { - _find_baked_light(); - } - } - -} - -bool GridMap::is_using_baked_light() const{ - - return use_baked_light; -} @@ -1825,12 +1372,8 @@ GridMap::GridMap() { clip_floor=0; clip_axis=Vector3::AXIS_Z; clip_above=true; - baked_lock=false; - bake=false; cell_scale=1.0; - baked_light_instance=NULL; - use_baked_light=false; navigation = NULL; set_notify_transform(true); diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h index 04d140cdc6..5d4133383b 100644 --- a/modules/gridmap/grid_map.h +++ b/modules/gridmap/grid_map.h @@ -103,8 +103,6 @@ class GridMap : public Spatial { Ref<NavigationMesh> navmesh; }; - Ref<Mesh> baked; - RID bake_instance; RID collision_debug; RID collision_debug_instance; @@ -140,14 +138,12 @@ class GridMap : public Spatial { float cell_size; int octant_size; bool center_x,center_y,center_z; - bool bake; float cell_scale; Navigation *navigation; bool clip; bool clip_above; int clip_floor; - bool baked_lock; Vector3::Axis clip_axis; @@ -205,9 +201,7 @@ class GridMap : public Spatial { void _octant_exit_world(const OctantKey &p_key); void _octant_update(const OctantKey &p_key); void _octant_transform(const OctantKey &p_key); - void _octant_clear_baked(const OctantKey &p_key); void _octant_clear_navmesh(const GridMap::OctantKey&); - void _octant_bake(const OctantKey &p_key,const Ref<TriangleMesh>& p_tmesh=RES(),const Vector<BakeLight> &p_lights=Vector<BakeLight>(),List<Vector3> *r_prebake=NULL); bool awaiting_update; void _queue_dirty_map(); @@ -221,14 +215,6 @@ class GridMap : public Spatial { void _clear_internal(bool p_keep_areas=false); - BakedLightInstance *baked_light_instance; - bool use_baked_light; - void _find_baked_light(); - void _baked_light_changed(); - - - Array _get_baked_light_meshes(); - protected: bool _set(const StringName& p_name, const Variant& p_value); @@ -285,13 +271,11 @@ public: void set_cell_scale(float p_scale); float get_cell_scale() const; - void set_bake(bool p_bake); - bool is_baking_enabled() const; - void bake_geometry(); - void set_use_baked_light(bool p_use); - bool is_using_baked_light() const; + Array get_meshes(); + + void clear(); GridMap(); diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 0d57ffa394..a5d2f84c68 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -27,9 +27,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "grid_map_editor_plugin.h" -#include "tools/editor/plugins/spatial_editor_plugin.h" +#include "editor/plugins/spatial_editor_plugin.h" #include "scene/3d/camera.h" -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #include "os/keyboard.h" #include "geometry.h" @@ -249,7 +249,7 @@ void GridMapEditor::_update_cursor_transform() { if (cursor_instance.is_valid()) { VisualServer::get_singleton()->instance_set_transform(cursor_instance,cursor_transform); - VisualServer::get_singleton()->instance_geometry_set_flag(cursor_instance,VS::INSTANCE_FLAG_VISIBLE,cursor_visible); + VisualServer::get_singleton()->instance_set_visible(cursor_instance,cursor_visible); } } @@ -852,11 +852,11 @@ void GridMapEditor::edit(GridMap *p_gridmap) { if (!node) { set_process(false); for(int i=0;i<3;i++) { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,false); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],false); } - VisualServer::get_singleton()->instance_geometry_set_flag(cursor_instance, VS::INSTANCE_FLAG_VISIBLE,false); + VisualServer::get_singleton()->instance_set_visible(cursor_instance,false); _clear_areas(); @@ -884,13 +884,11 @@ void GridMapEditor::edit(GridMap *p_gridmap) { { //update grids - indicator_mat = VisualServer::get_singleton()->fixed_material_create(); - VisualServer::get_singleton()->material_set_flag( indicator_mat, VisualServer::MATERIAL_FLAG_UNSHADED, true ); - VisualServer::get_singleton()->material_set_flag( indicator_mat, VisualServer::MATERIAL_FLAG_ONTOP, false ); - - VisualServer::get_singleton()->fixed_material_set_param(indicator_mat,VisualServer::FIXED_MATERIAL_PARAM_DIFFUSE,Color(0.8,0.5,0.1)); - VisualServer::get_singleton()->fixed_material_set_flag( indicator_mat, VisualServer::FIXED_MATERIAL_FLAG_USE_ALPHA, true ); - VisualServer::get_singleton()->fixed_material_set_flag( indicator_mat, VisualServer::FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY, true ); + indicator_mat.instance(); + indicator_mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); + indicator_mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true); + indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true); + indicator_mat->set_albedo(Color(0.8,0.5,0.1)); Vector<Vector3> grid_points[3]; @@ -937,8 +935,8 @@ void GridMapEditor::edit(GridMap *p_gridmap) { d.resize(VS::ARRAY_MAX); d[VS::ARRAY_VERTEX]=grid_points[i]; d[VS::ARRAY_COLOR]=grid_colors[i]; - VisualServer::get_singleton()->mesh_add_surface(grid[i],VisualServer::PRIMITIVE_LINES,d); - VisualServer::get_singleton()->mesh_surface_set_material(grid[i],0,indicator_mat); + VisualServer::get_singleton()->mesh_add_surface_from_arrays(grid[i],VisualServer::PRIMITIVE_LINES,d); + VisualServer::get_singleton()->mesh_surface_set_material(grid[i],0,indicator_mat->get_rid()); } @@ -976,7 +974,7 @@ void GridMapEditor::update_grid() { for(int i=0;i<3;i++) { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,i==edit_axis); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],i==edit_axis); } @@ -1103,7 +1101,7 @@ void GridMapEditor::_update_areas_display() { if (!node) { return; } - +#if 0 _clear_areas(); List<int> areas; node->get_area_list(&areas); @@ -1118,6 +1116,8 @@ void GridMapEditor::_update_areas_display() { color=Color(1,1,1,0.2); else color.set_hsv(Math::fmod(area*0.37,1),Math::fmod(area*0.75,1),1.0,0.2); + + RID material = VisualServer::get_singleton()->fixed_material_create(); VisualServer::get_singleton()->fixed_material_set_param( material, VS::FIXED_MATERIAL_PARAM_DIFFUSE,color ); VisualServer::get_singleton()->fixed_material_set_param( material, VS::FIXED_MATERIAL_PARAM_EMISSION,0.5 ); @@ -1149,7 +1149,7 @@ void GridMapEditor::_update_areas_display() { this->areas.push_back(ad); } - +#endif } void GridMapEditor::_edit_mode_changed(int p_what) { @@ -1189,7 +1189,7 @@ void GridMapEditor::_bind_methods() { ClassDB::bind_method("_area_selected",&GridMapEditor::_area_selected); ClassDB::bind_method("_floor_changed",&GridMapEditor::_floor_changed); - ClassDB::bind_method(_MD("_set_display_mode","mode"), &GridMapEditor::_set_display_mode); + ClassDB::bind_method(D_METHOD("_set_display_mode","mode"), &GridMapEditor::_set_display_mode); } @@ -1295,7 +1295,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { hb->add_child(mode_list); mode_list->connect("pressed", this, "_set_display_mode", varray(DISPLAY_LIST)); - EDITOR_DEF("editors/grid_map/preview_size",64) + EDITOR_DEF("editors/grid_map/preview_size",64); display_mode = DISPLAY_THUMBNAIL; selected_area=-1; @@ -1387,52 +1387,36 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { Array d; d.resize(VS::ARRAY_MAX); - inner_mat = VisualServer::get_singleton()->fixed_material_create(); - VisualServer::get_singleton()->fixed_material_set_param(inner_mat,VS::FIXED_MATERIAL_PARAM_DIFFUSE,Color(0.7,0.7,1.0,0.3)); - VisualServer::get_singleton()->material_set_flag(inner_mat,VS::MATERIAL_FLAG_ONTOP,true); - VisualServer::get_singleton()->material_set_flag(inner_mat,VS::MATERIAL_FLAG_UNSHADED,true); - VisualServer::get_singleton()->fixed_material_set_flag( inner_mat, VisualServer::FIXED_MATERIAL_FLAG_USE_ALPHA, true ); + inner_mat.instance(); + inner_mat->set_albedo(Color(0.7,0.7,1.0,0.3)); + inner_mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true); + inner_mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); + inner_mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT,true); d[VS::ARRAY_VERTEX]=triangles; - VisualServer::get_singleton()->mesh_add_surface(selection_mesh,VS::PRIMITIVE_TRIANGLES,d); - VisualServer::get_singleton()->mesh_surface_set_material(selection_mesh,0,inner_mat); + VisualServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh,VS::PRIMITIVE_TRIANGLES,d); + VisualServer::get_singleton()->mesh_surface_set_material(selection_mesh,0,inner_mat->get_rid()); - outer_mat = VisualServer::get_singleton()->fixed_material_create(); - VisualServer::get_singleton()->fixed_material_set_param(outer_mat,VS::FIXED_MATERIAL_PARAM_DIFFUSE,Color(0.7,0.7,1.0,0.8)); - VisualServer::get_singleton()->material_set_line_width(outer_mat,3.0); - VisualServer::get_singleton()->material_set_flag(outer_mat,VS::MATERIAL_FLAG_ONTOP,true); - VisualServer::get_singleton()->material_set_flag(outer_mat,VS::MATERIAL_FLAG_UNSHADED,true); - VisualServer::get_singleton()->fixed_material_set_flag( outer_mat, VisualServer::FIXED_MATERIAL_FLAG_USE_ALPHA, true ); + outer_mat.instance(); + outer_mat->set_albedo(Color(0.7,0.7,1.0,0.3)); + outer_mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true); + outer_mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); + outer_mat->set_line_width(3.0); + outer_mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT,true); d[VS::ARRAY_VERTEX]=lines; - VisualServer::get_singleton()->mesh_add_surface(selection_mesh,VS::PRIMITIVE_LINES,d); - VisualServer::get_singleton()->mesh_surface_set_material(selection_mesh,1,outer_mat); - - - inner_mat_dup = VisualServer::get_singleton()->fixed_material_create(); - VisualServer::get_singleton()->fixed_material_set_param(inner_mat_dup,VS::FIXED_MATERIAL_PARAM_DIFFUSE,Color(1.0,0.7,0.7,0.3)); - VisualServer::get_singleton()->material_set_flag(inner_mat_dup,VS::MATERIAL_FLAG_ONTOP,true); - VisualServer::get_singleton()->material_set_flag(inner_mat_dup,VS::MATERIAL_FLAG_UNSHADED,true); - VisualServer::get_singleton()->fixed_material_set_flag( inner_mat_dup, VisualServer::FIXED_MATERIAL_FLAG_USE_ALPHA, true ); - + VisualServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh,VS::PRIMITIVE_LINES,d); + VisualServer::get_singleton()->mesh_surface_set_material(selection_mesh,1,outer_mat->get_rid()); d[VS::ARRAY_VERTEX]=triangles; - VisualServer::get_singleton()->mesh_add_surface(duplicate_mesh,VS::PRIMITIVE_TRIANGLES,d); - VisualServer::get_singleton()->mesh_surface_set_material(duplicate_mesh,0,inner_mat_dup); - - outer_mat_dup = VisualServer::get_singleton()->fixed_material_create(); - VisualServer::get_singleton()->fixed_material_set_param(outer_mat_dup,VS::FIXED_MATERIAL_PARAM_DIFFUSE,Color(1.0,0.7,0.7,0.8)); - VisualServer::get_singleton()->material_set_line_width(outer_mat_dup,3.0); - VisualServer::get_singleton()->material_set_flag(outer_mat_dup,VS::MATERIAL_FLAG_ONTOP,true); - VisualServer::get_singleton()->material_set_flag(outer_mat_dup,VS::MATERIAL_FLAG_UNSHADED,true); - VisualServer::get_singleton()->fixed_material_set_flag( outer_mat_dup, VisualServer::FIXED_MATERIAL_FLAG_USE_ALPHA, true ); - + VisualServer::get_singleton()->mesh_add_surface_from_arrays(duplicate_mesh,VS::PRIMITIVE_TRIANGLES,d); + VisualServer::get_singleton()->mesh_surface_set_material(duplicate_mesh,0,inner_mat->get_rid()); d[VS::ARRAY_VERTEX]=lines; - VisualServer::get_singleton()->mesh_add_surface(duplicate_mesh,VS::PRIMITIVE_LINES,d); - VisualServer::get_singleton()->mesh_surface_set_material(duplicate_mesh,1,outer_mat_dup); + VisualServer::get_singleton()->mesh_add_surface_from_arrays(duplicate_mesh,VS::PRIMITIVE_LINES,d); + VisualServer::get_singleton()->mesh_surface_set_material(duplicate_mesh,1,outer_mat->get_rid()); } @@ -1452,14 +1436,10 @@ GridMapEditor::~GridMapEditor() { VisualServer::get_singleton()->free(grid[i]); if (grid_instance[i].is_valid()) VisualServer::get_singleton()->free(grid_instance[i]); - if (cursor_instance) + if (cursor_instance.is_valid()) VisualServer::get_singleton()->free(cursor_instance); } - VisualServer::get_singleton()->free(inner_mat); - VisualServer::get_singleton()->free(outer_mat); - VisualServer::get_singleton()->free(inner_mat_dup); - VisualServer::get_singleton()->free(outer_mat_dup); VisualServer::get_singleton()->free(selection_mesh); if (selection_instance.is_valid()) diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index 2c0ff99dc6..07ac34cd4e 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -29,10 +29,10 @@ #ifndef GRID_MAP_EDITOR_PLUGIN_H #define GRID_MAP_EDITOR_PLUGIN_H -#include "tools/editor/editor_plugin.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_plugin.h" +#include "editor/editor_node.h" #include "grid_map.h" -#include "tools/editor/pane_drag.h" +#include "editor/pane_drag.h" /** @author Juan Linietsky <reduzio@gmail.com> */ @@ -112,12 +112,9 @@ class GridMapEditor : public VBoxContainer { RID duplicate_mesh; RID duplicate_instance; - RID indicator_mat; - - RID inner_mat; - RID outer_mat; - RID inner_mat_dup; - RID outer_mat_dup; + Ref<FixedSpatialMaterial> indicator_mat; + Ref<FixedSpatialMaterial> inner_mat; + Ref<FixedSpatialMaterial> outer_mat; bool updating; diff --git a/modules/openssl/stream_peer_openssl.h b/modules/openssl/stream_peer_openssl.h index 3d6875698c..84ae03fe07 100644 --- a/modules/openssl/stream_peer_openssl.h +++ b/modules/openssl/stream_peer_openssl.h @@ -31,7 +31,7 @@ #include <stdio.h> // If you don't know what this is for stop reading now. #include "io/stream_peer_ssl.h" -#include "globals.h" +#include "global_config.h" #include "os/file_access.h" #include "curl_hostcheck.h" diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index e67040b5a3..3d1dd048a8 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -321,7 +321,7 @@ struct RegExNodeClass : public RegExNode { case Type_lower: return ('a' <= c && c <= 'z'); case Type_print: - return (0x1F < c && c < 0x1F); + return (0x20 < c && c < 0x7f); case Type_punct: return (REGEX_NODE_PUNCT.find(c) >= 0); case Type_space: @@ -1481,27 +1481,27 @@ RegEx::~RegEx() { void RegExMatch::_bind_methods() { - ClassDB::bind_method(_MD("expand","template"),&RegExMatch::expand); - ClassDB::bind_method(_MD("get_group_count"),&RegExMatch::get_group_count); - ClassDB::bind_method(_MD("get_group_array"),&RegExMatch::get_group_array); - ClassDB::bind_method(_MD("get_names"),&RegExMatch::get_names); - ClassDB::bind_method(_MD("get_name_dict"),&RegExMatch::get_name_dict); - ClassDB::bind_method(_MD("get_string","name"),&RegExMatch::get_string, DEFVAL(0)); - ClassDB::bind_method(_MD("get_start","name"),&RegExMatch::get_start, DEFVAL(0)); - ClassDB::bind_method(_MD("get_end","name"),&RegExMatch::get_end, DEFVAL(0)); + ClassDB::bind_method(D_METHOD("expand","template"),&RegExMatch::expand); + ClassDB::bind_method(D_METHOD("get_group_count"),&RegExMatch::get_group_count); + ClassDB::bind_method(D_METHOD("get_group_array"),&RegExMatch::get_group_array); + ClassDB::bind_method(D_METHOD("get_names"),&RegExMatch::get_names); + ClassDB::bind_method(D_METHOD("get_name_dict"),&RegExMatch::get_name_dict); + ClassDB::bind_method(D_METHOD("get_string","name"),&RegExMatch::get_string, DEFVAL(0)); + ClassDB::bind_method(D_METHOD("get_start","name"),&RegExMatch::get_start, DEFVAL(0)); + ClassDB::bind_method(D_METHOD("get_end","name"),&RegExMatch::get_end, DEFVAL(0)); } void RegEx::_bind_methods() { - ClassDB::bind_method(_MD("clear"),&RegEx::clear); - ClassDB::bind_method(_MD("compile","pattern"),&RegEx::compile); - ClassDB::bind_method(_MD("search","text","start","end"),&RegEx::search, DEFVAL(0), DEFVAL(-1)); - ClassDB::bind_method(_MD("sub","text","replacement","all","start","end"),&RegEx::sub, DEFVAL(false), DEFVAL(0), DEFVAL(-1)); - ClassDB::bind_method(_MD("is_valid"),&RegEx::is_valid); - ClassDB::bind_method(_MD("get_pattern"),&RegEx::get_pattern); - ClassDB::bind_method(_MD("get_group_count"),&RegEx::get_group_count); - ClassDB::bind_method(_MD("get_names"),&RegEx::get_names); + ClassDB::bind_method(D_METHOD("clear"),&RegEx::clear); + ClassDB::bind_method(D_METHOD("compile","pattern"),&RegEx::compile); + ClassDB::bind_method(D_METHOD("search","text","start","end"),&RegEx::search, DEFVAL(0), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("sub","text","replacement","all","start","end"),&RegEx::sub, DEFVAL(false), DEFVAL(0), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("is_valid"),&RegEx::is_valid); + ClassDB::bind_method(D_METHOD("get_pattern"),&RegEx::get_pattern); + ClassDB::bind_method(D_METHOD("get_group_count"),&RegEx::get_group_count); + ClassDB::bind_method(D_METHOD("get_names"),&RegEx::get_names); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "pattern"), _SCS("compile"), _SCS("get_pattern")); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "pattern"), "compile", "get_pattern"); } diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 4b4c57fbdd..d3d7ab2307 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -1,5 +1,33 @@ - +/*************************************************************************/ +/* audio_stream_ogg_vorbis.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_stream_ogg_vorbis.h" + #include "thirdparty/stb_vorbis/stb_vorbis.c" #include "os/file_access.h" @@ -205,14 +233,14 @@ bool AudioStreamOGGVorbis::has_loop() const { void AudioStreamOGGVorbis::_bind_methods() { - ClassDB::bind_method(_MD("set_data","data"),&AudioStreamOGGVorbis::set_data); - ClassDB::bind_method(_MD("get_data"),&AudioStreamOGGVorbis::get_data); + ClassDB::bind_method(D_METHOD("set_data","data"),&AudioStreamOGGVorbis::set_data); + ClassDB::bind_method(D_METHOD("get_data"),&AudioStreamOGGVorbis::get_data); - ClassDB::bind_method(_MD("set_loop","enable"),&AudioStreamOGGVorbis::set_loop); - ClassDB::bind_method(_MD("has_loop"),&AudioStreamOGGVorbis::has_loop); + ClassDB::bind_method(D_METHOD("set_loop","enable"),&AudioStreamOGGVorbis::set_loop); + ClassDB::bind_method(D_METHOD("has_loop"),&AudioStreamOGGVorbis::has_loop); - ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_data"),_SCS("get_data")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"loop",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_loop"),_SCS("has_loop")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_data","get_data"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"loop",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_loop","has_loop"); } diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.h b/modules/stb_vorbis/audio_stream_ogg_vorbis.h index 21ce23740c..2313fc4ae3 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.h +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_stream_ogg_vorbis.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIO_STREAM_STB_VORBIS_H #define AUDIO_STREAM_STB_VORBIS_H diff --git a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp index 6f90c8587b..03495652d4 100644 --- a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp +++ b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* resource_importer_ogg_vorbis.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "resource_importer_ogg_vorbis.h" #include "io/resource_saver.h" diff --git a/modules/stb_vorbis/resource_importer_ogg_vorbis.h b/modules/stb_vorbis/resource_importer_ogg_vorbis.h index 8a3b2d8ec6..15fc2cd2f3 100644 --- a/modules/stb_vorbis/resource_importer_ogg_vorbis.h +++ b/modules/stb_vorbis/resource_importer_ogg_vorbis.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* resource_importer_ogg_vorbis.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 RESOURCEIMPORTEROGGVORBIS_H #define RESOURCEIMPORTEROGGVORBIS_H diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index 9d2dfc7f56..2a7b2707bf 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "video_stream_theora.h" -#include "globals.h" +#include "global_config.h" #include "os/os.h" #include "yuv2rgb.h" diff --git a/modules/theora/yuv2rgb.h b/modules/theora/yuv2rgb.h index 3b81607a65..a9bef76da8 100644 --- a/modules/theora/yuv2rgb.h +++ b/modules/theora/yuv2rgb.h @@ -1,3 +1,6 @@ +/* Thirdparty code presumably from http://wss.co.uk/pinknoise/yuv2rgb/ */ +/* FIXME: Move to thirdparty dir */ + #ifndef YUV2RGB_H #define YUV2RGB_H diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index e1e180432a..9f742591d5 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -1,8 +1,37 @@ +/*************************************************************************/ +/* visual_script.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_script.h" + #include "visual_script_nodes.h" #include "scene/main/node.h" #include "os/os.h" -#include "globals.h" +#include "global_config.h" @@ -104,13 +133,13 @@ Array VisualScriptNode::_get_default_input_values() const { void VisualScriptNode::_bind_methods() { - ClassDB::bind_method(_MD("get_visual_script:VisualScript"),&VisualScriptNode::get_visual_script); - ClassDB::bind_method(_MD("set_default_input_value","port_idx","value:Variant"),&VisualScriptNode::set_default_input_value); - ClassDB::bind_method(_MD("get_default_input_value:Variant","port_idx"),&VisualScriptNode::get_default_input_value); - ClassDB::bind_method(_MD("_set_default_input_values","values"),&VisualScriptNode::_set_default_input_values); - ClassDB::bind_method(_MD("_get_default_input_values"),&VisualScriptNode::_get_default_input_values); + ClassDB::bind_method(D_METHOD("get_visual_script:VisualScript"),&VisualScriptNode::get_visual_script); + ClassDB::bind_method(D_METHOD("set_default_input_value","port_idx","value:Variant"),&VisualScriptNode::set_default_input_value); + ClassDB::bind_method(D_METHOD("get_default_input_value:Variant","port_idx"),&VisualScriptNode::get_default_input_value); + ClassDB::bind_method(D_METHOD("_set_default_input_values","values"),&VisualScriptNode::_set_default_input_values); + ClassDB::bind_method(D_METHOD("_get_default_input_values"),&VisualScriptNode::_get_default_input_values); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"_default_input_values",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_default_input_values"),_SCS("_get_default_input_values")); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"_default_input_values",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_default_input_values","_get_default_input_values"); ADD_SIGNAL(MethodInfo("ports_changed")); } @@ -1317,65 +1346,65 @@ void VisualScript::_bind_methods() { - ClassDB::bind_method(_MD("_node_ports_changed"),&VisualScript::_node_ports_changed); + ClassDB::bind_method(D_METHOD("_node_ports_changed"),&VisualScript::_node_ports_changed); - ClassDB::bind_method(_MD("add_function","name"),&VisualScript::add_function); - ClassDB::bind_method(_MD("has_function","name"),&VisualScript::has_function); - ClassDB::bind_method(_MD("remove_function","name"),&VisualScript::remove_function); - ClassDB::bind_method(_MD("rename_function","name","new_name"),&VisualScript::rename_function); - ClassDB::bind_method(_MD("set_function_scroll","ofs"),&VisualScript::set_function_scroll); - ClassDB::bind_method(_MD("get_function_scroll"),&VisualScript::get_function_scroll); + ClassDB::bind_method(D_METHOD("add_function","name"),&VisualScript::add_function); + ClassDB::bind_method(D_METHOD("has_function","name"),&VisualScript::has_function); + ClassDB::bind_method(D_METHOD("remove_function","name"),&VisualScript::remove_function); + ClassDB::bind_method(D_METHOD("rename_function","name","new_name"),&VisualScript::rename_function); + ClassDB::bind_method(D_METHOD("set_function_scroll","ofs"),&VisualScript::set_function_scroll); + ClassDB::bind_method(D_METHOD("get_function_scroll"),&VisualScript::get_function_scroll); - ClassDB::bind_method(_MD("add_node","func","id","node","pos"),&VisualScript::add_node,DEFVAL(Point2())); - ClassDB::bind_method(_MD("remove_node","func","id"),&VisualScript::remove_node); - ClassDB::bind_method(_MD("get_function_node_id","name"),&VisualScript::get_function_node_id); + ClassDB::bind_method(D_METHOD("add_node","func","id","node","pos"),&VisualScript::add_node,DEFVAL(Point2())); + ClassDB::bind_method(D_METHOD("remove_node","func","id"),&VisualScript::remove_node); + ClassDB::bind_method(D_METHOD("get_function_node_id","name"),&VisualScript::get_function_node_id); - ClassDB::bind_method(_MD("get_node","func","id"),&VisualScript::get_node); - ClassDB::bind_method(_MD("has_node","func","id"),&VisualScript::has_node); - ClassDB::bind_method(_MD("set_node_pos","func","id","pos"),&VisualScript::set_node_pos); - ClassDB::bind_method(_MD("get_node_pos","func","id"),&VisualScript::get_node_pos); + ClassDB::bind_method(D_METHOD("get_node","func","id"),&VisualScript::get_node); + ClassDB::bind_method(D_METHOD("has_node","func","id"),&VisualScript::has_node); + ClassDB::bind_method(D_METHOD("set_node_pos","func","id","pos"),&VisualScript::set_node_pos); + ClassDB::bind_method(D_METHOD("get_node_pos","func","id"),&VisualScript::get_node_pos); - ClassDB::bind_method(_MD("sequence_connect","func","from_node","from_output","to_node"),&VisualScript::sequence_connect); - ClassDB::bind_method(_MD("sequence_disconnect","func","from_node","from_output","to_node"),&VisualScript::sequence_disconnect); - ClassDB::bind_method(_MD("has_sequence_connection","func","from_node","from_output","to_node"),&VisualScript::has_sequence_connection); + ClassDB::bind_method(D_METHOD("sequence_connect","func","from_node","from_output","to_node"),&VisualScript::sequence_connect); + ClassDB::bind_method(D_METHOD("sequence_disconnect","func","from_node","from_output","to_node"),&VisualScript::sequence_disconnect); + ClassDB::bind_method(D_METHOD("has_sequence_connection","func","from_node","from_output","to_node"),&VisualScript::has_sequence_connection); - ClassDB::bind_method(_MD("data_connect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_connect); - ClassDB::bind_method(_MD("data_disconnect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_disconnect); - ClassDB::bind_method(_MD("has_data_connection","func","from_node","from_port","to_node","to_port"),&VisualScript::has_data_connection); + ClassDB::bind_method(D_METHOD("data_connect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_connect); + ClassDB::bind_method(D_METHOD("data_disconnect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_disconnect); + ClassDB::bind_method(D_METHOD("has_data_connection","func","from_node","from_port","to_node","to_port"),&VisualScript::has_data_connection); - ClassDB::bind_method(_MD("add_variable","name","default_value","export"),&VisualScript::add_variable,DEFVAL(Variant()),DEFVAL(false)); - ClassDB::bind_method(_MD("has_variable","name"),&VisualScript::has_variable); - ClassDB::bind_method(_MD("remove_variable","name"),&VisualScript::remove_variable); - ClassDB::bind_method(_MD("set_variable_default_value","name","value"),&VisualScript::set_variable_default_value); - ClassDB::bind_method(_MD("get_variable_default_value","name"),&VisualScript::get_variable_default_value); - ClassDB::bind_method(_MD("set_variable_info","name","value"),&VisualScript::_set_variable_info); - ClassDB::bind_method(_MD("get_variable_info","name"),&VisualScript::_get_variable_info); - ClassDB::bind_method(_MD("set_variable_export","name","enable"),&VisualScript::set_variable_export); - ClassDB::bind_method(_MD("get_variable_export","name"),&VisualScript::get_variable_export); - ClassDB::bind_method(_MD("rename_variable","name","new_name"),&VisualScript::rename_variable); + ClassDB::bind_method(D_METHOD("add_variable","name","default_value","export"),&VisualScript::add_variable,DEFVAL(Variant()),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("has_variable","name"),&VisualScript::has_variable); + ClassDB::bind_method(D_METHOD("remove_variable","name"),&VisualScript::remove_variable); + ClassDB::bind_method(D_METHOD("set_variable_default_value","name","value"),&VisualScript::set_variable_default_value); + ClassDB::bind_method(D_METHOD("get_variable_default_value","name"),&VisualScript::get_variable_default_value); + ClassDB::bind_method(D_METHOD("set_variable_info","name","value"),&VisualScript::_set_variable_info); + ClassDB::bind_method(D_METHOD("get_variable_info","name"),&VisualScript::_get_variable_info); + ClassDB::bind_method(D_METHOD("set_variable_export","name","enable"),&VisualScript::set_variable_export); + ClassDB::bind_method(D_METHOD("get_variable_export","name"),&VisualScript::get_variable_export); + ClassDB::bind_method(D_METHOD("rename_variable","name","new_name"),&VisualScript::rename_variable); - ClassDB::bind_method(_MD("add_custom_signal","name"),&VisualScript::add_custom_signal); - ClassDB::bind_method(_MD("has_custom_signal","name"),&VisualScript::has_custom_signal); - ClassDB::bind_method(_MD("custom_signal_add_argument","name","type","argname","index"),&VisualScript::custom_signal_add_argument,DEFVAL(-1)); - ClassDB::bind_method(_MD("custom_signal_set_argument_type","name","argidx","type"),&VisualScript::custom_signal_set_argument_type); - ClassDB::bind_method(_MD("custom_signal_get_argument_type","name","argidx"),&VisualScript::custom_signal_get_argument_type); - ClassDB::bind_method(_MD("custom_signal_set_argument_name","name","argidx","argname"),&VisualScript::custom_signal_set_argument_name); - ClassDB::bind_method(_MD("custom_signal_get_argument_name","name","argidx"),&VisualScript::custom_signal_get_argument_name); - ClassDB::bind_method(_MD("custom_signal_remove_argument","argidx"),&VisualScript::custom_signal_remove_argument); - ClassDB::bind_method(_MD("custom_signal_get_argument_count","name"),&VisualScript::custom_signal_get_argument_count); - ClassDB::bind_method(_MD("custom_signal_swap_argument","name","argidx","withidx"),&VisualScript::custom_signal_swap_argument); - ClassDB::bind_method(_MD("remove_custom_signal","name"),&VisualScript::remove_custom_signal); - ClassDB::bind_method(_MD("rename_custom_signal","name","new_name"),&VisualScript::rename_custom_signal); + ClassDB::bind_method(D_METHOD("add_custom_signal","name"),&VisualScript::add_custom_signal); + ClassDB::bind_method(D_METHOD("has_custom_signal","name"),&VisualScript::has_custom_signal); + ClassDB::bind_method(D_METHOD("custom_signal_add_argument","name","type","argname","index"),&VisualScript::custom_signal_add_argument,DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("custom_signal_set_argument_type","name","argidx","type"),&VisualScript::custom_signal_set_argument_type); + ClassDB::bind_method(D_METHOD("custom_signal_get_argument_type","name","argidx"),&VisualScript::custom_signal_get_argument_type); + ClassDB::bind_method(D_METHOD("custom_signal_set_argument_name","name","argidx","argname"),&VisualScript::custom_signal_set_argument_name); + ClassDB::bind_method(D_METHOD("custom_signal_get_argument_name","name","argidx"),&VisualScript::custom_signal_get_argument_name); + ClassDB::bind_method(D_METHOD("custom_signal_remove_argument","argidx"),&VisualScript::custom_signal_remove_argument); + ClassDB::bind_method(D_METHOD("custom_signal_get_argument_count","name"),&VisualScript::custom_signal_get_argument_count); + ClassDB::bind_method(D_METHOD("custom_signal_swap_argument","name","argidx","withidx"),&VisualScript::custom_signal_swap_argument); + ClassDB::bind_method(D_METHOD("remove_custom_signal","name"),&VisualScript::remove_custom_signal); + ClassDB::bind_method(D_METHOD("rename_custom_signal","name","new_name"),&VisualScript::rename_custom_signal); - //ClassDB::bind_method(_MD("set_variable_info","name","info"),&VScript::set_variable_info); - //ClassDB::bind_method(_MD("get_variable_info","name"),&VScript::set_variable_info); + //ClassDB::bind_method(D_METHOD("set_variable_info","name","info"),&VScript::set_variable_info); + //ClassDB::bind_method(D_METHOD("get_variable_info","name"),&VScript::set_variable_info); - ClassDB::bind_method(_MD("set_instance_base_type","type"),&VisualScript::set_instance_base_type); + ClassDB::bind_method(D_METHOD("set_instance_base_type","type"),&VisualScript::set_instance_base_type); - ClassDB::bind_method(_MD("_set_data","data"),&VisualScript::_set_data); - ClassDB::bind_method(_MD("_get_data"),&VisualScript::_get_data); + ClassDB::bind_method(D_METHOD("_set_data","data"),&VisualScript::_set_data); + ClassDB::bind_method(D_METHOD("_get_data"),&VisualScript::_get_data); - ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_data"),_SCS("_get_data")); + ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_data","_get_data"); ADD_SIGNAL(MethodInfo("node_ports_changed",PropertyInfo(Variant::STRING,"function"),PropertyInfo(Variant::INT,"id"))); } @@ -2436,9 +2465,9 @@ Variant VisualScriptFunctionState::resume(Array p_args) { void VisualScriptFunctionState::_bind_methods() { - ClassDB::bind_method(_MD("connect_to_signal","obj","signals","args"),&VisualScriptFunctionState::connect_to_signal); - ClassDB::bind_method(_MD("resume:Array","args"),&VisualScriptFunctionState::resume,DEFVAL(Variant())); - ClassDB::bind_method(_MD("is_valid"),&VisualScriptFunctionState::is_valid); + ClassDB::bind_method(D_METHOD("connect_to_signal","obj","signals","args"),&VisualScriptFunctionState::connect_to_signal); + ClassDB::bind_method(D_METHOD("resume:Array","args"),&VisualScriptFunctionState::resume,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("is_valid"),&VisualScriptFunctionState::is_valid); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&VisualScriptFunctionState::_signal_callback,MethodInfo("_signal_callback")); } diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index acd1c3a670..ef73a89048 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_script.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VSCRIPT_H #define VSCRIPT_H diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index a0f23a511f..e83cd3e614 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -1,4 +1,33 @@ +/*************************************************************************/ +/* visual_script_builtin_funcs.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_script_builtin_funcs.h" + #include "math_funcs.h" #include "class_db.h" #include "reference.h" @@ -329,7 +358,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const case LOGIC_CLAMP: { if (p_idx==0) return PropertyInfo(Variant::REAL,"a"); - else if (p_idx==0) + else if (p_idx==0) // FIXME: is it ok to test p_idx == 0 twice? return PropertyInfo(Variant::REAL,"min"); else return PropertyInfo(Variant::REAL,"max"); @@ -1166,8 +1195,8 @@ VisualScriptNodeInstance* VisualScriptBuiltinFunc::instance(VisualScriptInstance void VisualScriptBuiltinFunc::_bind_methods() { - ClassDB::bind_method(_MD("set_func","which"),&VisualScriptBuiltinFunc::set_func); - ClassDB::bind_method(_MD("get_func"),&VisualScriptBuiltinFunc::get_func); + ClassDB::bind_method(D_METHOD("set_func","which"),&VisualScriptBuiltinFunc::set_func); + ClassDB::bind_method(D_METHOD("get_func"),&VisualScriptBuiltinFunc::get_func); String cc; @@ -1177,7 +1206,7 @@ void VisualScriptBuiltinFunc::_bind_methods() { cc+=","; cc+=func_name[i]; } - ADD_PROPERTY(PropertyInfo(Variant::INT,"function",PROPERTY_HINT_ENUM,cc),_SCS("set_func"),_SCS("get_func")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"function",PROPERTY_HINT_ENUM,cc),"set_func","get_func"); } VisualScriptBuiltinFunc::VisualScriptBuiltinFunc() { diff --git a/modules/visual_script/visual_script_builtin_funcs.h b/modules/visual_script/visual_script_builtin_funcs.h index a285517c7e..75bea4b1b5 100644 --- a/modules/visual_script/visual_script_builtin_funcs.h +++ b/modules/visual_script/visual_script_builtin_funcs.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_script_builtin_funcs.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUAL_SCRIPT_BUILTIN_FUNCS_H #define VISUAL_SCRIPT_BUILTIN_FUNCS_H diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index eadc9a8892..7dd7059c31 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -1,11 +1,40 @@ +/*************************************************************************/ +/* visual_script_editor.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_script_editor.h" -#include "tools/editor/editor_node.h" + +#include "editor/editor_node.h" #include "visual_script_nodes.h" #include "visual_script_flow_control.h" #include "visual_script_func_nodes.h" #include "visual_script_expression.h" #include "os/input.h" -#include "tools/editor/editor_resource_preview.h" +#include "editor/editor_resource_preview.h" #include "os/keyboard.h" #ifdef TOOLS_ENABLED diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 1dc62b3e69..cdaef8d0ce 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -1,12 +1,40 @@ -#ifndef VisualSCRIPT_EDITOR_H -#define VisualSCRIPT_EDITOR_H - -#include "tools/editor/plugins/script_editor_plugin.h" +/*************************************************************************/ +/* visual_script_editor.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUALSCRIPT_EDITOR_H +#define VISUALSCRIPT_EDITOR_H + +#include "editor/plugins/script_editor_plugin.h" #include "visual_script.h" -#include "tools/editor/property_editor.h" +#include "editor/property_editor.h" #include "scene/gui/graph_edit.h" -#include "tools/editor/create_dialog.h" -#include "tools/editor/property_selector.h" +#include "editor/create_dialog.h" +#include "editor/property_selector.h" class VisualScriptEditorSignalEdit; class VisualScriptEditorVariableEdit; @@ -241,4 +269,4 @@ public: }; #endif -#endif // VisualSCRIPT_EDITOR_H +#endif // VISUALSCRIPT_EDITOR_H diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index cc3b5f2174..3d15e696ef 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_script_expression.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_script_expression.h" @@ -558,6 +586,12 @@ Error VisualScriptExpression::_get_token(Token& r_token) { } else if (id=="PI") { r_token.type=TK_CONSTANT; r_token.value=Math_PI; + } else if (id == "INF") { + r_token.type = TK_CONSTANT; + r_token.value = Math_INF; + } else if (id == "NAN") { + r_token.type = TK_CONSTANT; + r_token.value = Math_NAN; } else if (id=="not") { r_token.type=TK_OP_NOT; } else if (id=="or") { diff --git a/modules/visual_script/visual_script_expression.h b/modules/visual_script/visual_script_expression.h index a67656a4b1..5bd960f60c 100644 --- a/modules/visual_script/visual_script_expression.h +++ b/modules/visual_script/visual_script_expression.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_script_expression.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUALSCRIPTEXPRESSION_H #define VISUALSCRIPTEXPRESSION_H diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp index 0e526f8a42..8aff96b70c 100644 --- a/modules/visual_script/visual_script_flow_control.cpp +++ b/modules/visual_script/visual_script_flow_control.cpp @@ -1,6 +1,35 @@ +/*************************************************************************/ +/* visual_script_flow_control.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_script_flow_control.h" + #include "os/keyboard.h" -#include "globals.h" +#include "global_config.h" ////////////////////////////////////////// @@ -81,18 +110,18 @@ bool VisualScriptReturn::is_return_value_enabled() const { void VisualScriptReturn::_bind_methods() { - ClassDB::bind_method(_MD("set_return_type","type"),&VisualScriptReturn::set_return_type); - ClassDB::bind_method(_MD("get_return_type"),&VisualScriptReturn::get_return_type); - ClassDB::bind_method(_MD("set_enable_return_value","enable"),&VisualScriptReturn::set_enable_return_value); - ClassDB::bind_method(_MD("is_return_value_enabled"),&VisualScriptReturn::is_return_value_enabled); + ClassDB::bind_method(D_METHOD("set_return_type","type"),&VisualScriptReturn::set_return_type); + ClassDB::bind_method(D_METHOD("get_return_type"),&VisualScriptReturn::get_return_type); + ClassDB::bind_method(D_METHOD("set_enable_return_value","enable"),&VisualScriptReturn::set_enable_return_value); + ClassDB::bind_method(D_METHOD("is_return_value_enabled"),&VisualScriptReturn::is_return_value_enabled); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { argt+=","+Variant::get_type_name(Variant::Type(i)); } - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"return_value/enabled"),_SCS("set_enable_return_value"),_SCS("is_return_value_enabled")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"return_value/type",PROPERTY_HINT_ENUM,argt),_SCS("set_return_type"),_SCS("get_return_type")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"return_value/enabled"),"set_enable_return_value","is_return_value_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"return_value/type",PROPERTY_HINT_ENUM,argt),"set_return_type","get_return_type"); } @@ -544,10 +573,10 @@ int VisualScriptSequence::get_steps() const { void VisualScriptSequence::_bind_methods() { - ClassDB::bind_method(_MD("set_steps","steps"),&VisualScriptSequence::set_steps); - ClassDB::bind_method(_MD("get_steps"),&VisualScriptSequence::get_steps); + ClassDB::bind_method(D_METHOD("set_steps","steps"),&VisualScriptSequence::set_steps); + ClassDB::bind_method(D_METHOD("get_steps"),&VisualScriptSequence::get_steps); - ADD_PROPERTY(PropertyInfo(Variant::INT,"steps",PROPERTY_HINT_RANGE,"1,64,1"),_SCS("set_steps"),_SCS("get_steps")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"steps",PROPERTY_HINT_RANGE,"1,64,1"),"set_steps","get_steps"); } @@ -1893,11 +1922,11 @@ VisualScriptNodeInstance* VisualScriptTypeCast::instance(VisualScriptInstance* p void VisualScriptTypeCast::_bind_methods() { - ClassDB::bind_method(_MD("set_base_type","type"),&VisualScriptTypeCast::set_base_type); - ClassDB::bind_method(_MD("get_base_type"),&VisualScriptTypeCast::get_base_type); + ClassDB::bind_method(D_METHOD("set_base_type","type"),&VisualScriptTypeCast::set_base_type); + ClassDB::bind_method(D_METHOD("get_base_type"),&VisualScriptTypeCast::get_base_type); - ClassDB::bind_method(_MD("set_base_script","path"),&VisualScriptTypeCast::set_base_script); - ClassDB::bind_method(_MD("get_base_script"),&VisualScriptTypeCast::get_base_script); + ClassDB::bind_method(D_METHOD("set_base_script","path"),&VisualScriptTypeCast::set_base_script); + ClassDB::bind_method(D_METHOD("get_base_script"),&VisualScriptTypeCast::get_base_script); List<String> script_extensions; @@ -1912,8 +1941,8 @@ void VisualScriptTypeCast::_bind_methods() { script_ext_hint+="*."+E->get(); } - ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_script",PROPERTY_HINT_FILE,script_ext_hint),_SCS("set_base_script"),_SCS("get_base_script")); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),"set_base_type","get_base_type"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_script",PROPERTY_HINT_FILE,script_ext_hint),"set_base_script","get_base_script"); } diff --git a/modules/visual_script/visual_script_flow_control.h b/modules/visual_script/visual_script_flow_control.h index 26e981cb1e..8406bb5a5b 100644 --- a/modules/visual_script/visual_script_flow_control.h +++ b/modules/visual_script/visual_script_flow_control.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_script_flow_control.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUAL_SCRIPT_FLOW_CONTROL_H #define VISUAL_SCRIPT_FLOW_CONTROL_H diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index a8d78b9298..c9ed49ee5c 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -1,10 +1,39 @@ +/*************************************************************************/ +/* visual_script_func_nodes.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_script_func_nodes.h" + #include "scene/main/scene_main_loop.h" #include "os/os.h" #include "scene/main/node.h" #include "visual_script_nodes.h" #include "io/resource_loader.h" -#include "globals.h" +#include "global_config.h" ////////////////////////////////////////// ////////////////CALL////////////////////// @@ -687,38 +716,38 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo& property) const void VisualScriptFunctionCall::_bind_methods() { - ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptFunctionCall::set_base_type); - ClassDB::bind_method(_MD("get_base_type"),&VisualScriptFunctionCall::get_base_type); + ClassDB::bind_method(D_METHOD("set_base_type","base_type"),&VisualScriptFunctionCall::set_base_type); + ClassDB::bind_method(D_METHOD("get_base_type"),&VisualScriptFunctionCall::get_base_type); - ClassDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptFunctionCall::set_base_script); - ClassDB::bind_method(_MD("get_base_script"),&VisualScriptFunctionCall::get_base_script); + ClassDB::bind_method(D_METHOD("set_base_script","base_script"),&VisualScriptFunctionCall::set_base_script); + ClassDB::bind_method(D_METHOD("get_base_script"),&VisualScriptFunctionCall::get_base_script); - ClassDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptFunctionCall::set_basic_type); - ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptFunctionCall::get_basic_type); + ClassDB::bind_method(D_METHOD("set_basic_type","basic_type"),&VisualScriptFunctionCall::set_basic_type); + ClassDB::bind_method(D_METHOD("get_basic_type"),&VisualScriptFunctionCall::get_basic_type); - ClassDB::bind_method(_MD("set_singleton","singleton"),&VisualScriptFunctionCall::set_singleton); - ClassDB::bind_method(_MD("get_singleton"),&VisualScriptFunctionCall::get_singleton); + ClassDB::bind_method(D_METHOD("set_singleton","singleton"),&VisualScriptFunctionCall::set_singleton); + ClassDB::bind_method(D_METHOD("get_singleton"),&VisualScriptFunctionCall::get_singleton); - ClassDB::bind_method(_MD("set_function","function"),&VisualScriptFunctionCall::set_function); - ClassDB::bind_method(_MD("get_function"),&VisualScriptFunctionCall::get_function); + ClassDB::bind_method(D_METHOD("set_function","function"),&VisualScriptFunctionCall::set_function); + ClassDB::bind_method(D_METHOD("get_function"),&VisualScriptFunctionCall::get_function); - ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptFunctionCall::set_call_mode); - ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptFunctionCall::get_call_mode); + ClassDB::bind_method(D_METHOD("set_call_mode","mode"),&VisualScriptFunctionCall::set_call_mode); + ClassDB::bind_method(D_METHOD("get_call_mode"),&VisualScriptFunctionCall::get_call_mode); - ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptFunctionCall::set_base_path); - ClassDB::bind_method(_MD("get_base_path"),&VisualScriptFunctionCall::get_base_path); + ClassDB::bind_method(D_METHOD("set_base_path","base_path"),&VisualScriptFunctionCall::set_base_path); + ClassDB::bind_method(D_METHOD("get_base_path"),&VisualScriptFunctionCall::get_base_path); - ClassDB::bind_method(_MD("set_use_default_args","amount"),&VisualScriptFunctionCall::set_use_default_args); - ClassDB::bind_method(_MD("get_use_default_args"),&VisualScriptFunctionCall::get_use_default_args); + ClassDB::bind_method(D_METHOD("set_use_default_args","amount"),&VisualScriptFunctionCall::set_use_default_args); + ClassDB::bind_method(D_METHOD("get_use_default_args"),&VisualScriptFunctionCall::get_use_default_args); - ClassDB::bind_method(_MD("_set_argument_cache","argument_cache"),&VisualScriptFunctionCall::_set_argument_cache); - ClassDB::bind_method(_MD("_get_argument_cache"),&VisualScriptFunctionCall::_get_argument_cache); + ClassDB::bind_method(D_METHOD("_set_argument_cache","argument_cache"),&VisualScriptFunctionCall::_set_argument_cache); + ClassDB::bind_method(D_METHOD("_get_argument_cache"),&VisualScriptFunctionCall::_get_argument_cache); - ClassDB::bind_method(_MD("set_rpc_call_mode","mode"),&VisualScriptFunctionCall::set_rpc_call_mode); - ClassDB::bind_method(_MD("get_rpc_call_mode"),&VisualScriptFunctionCall::get_rpc_call_mode); + ClassDB::bind_method(D_METHOD("set_rpc_call_mode","mode"),&VisualScriptFunctionCall::set_rpc_call_mode); + ClassDB::bind_method(D_METHOD("get_rpc_call_mode"),&VisualScriptFunctionCall::get_rpc_call_mode); - ClassDB::bind_method(_MD("set_validate","enable"),&VisualScriptFunctionCall::set_validate); - ClassDB::bind_method(_MD("get_validate"),&VisualScriptFunctionCall::get_validate); + ClassDB::bind_method(D_METHOD("set_validate","enable"),&VisualScriptFunctionCall::set_validate); + ClassDB::bind_method(D_METHOD("get_validate"),&VisualScriptFunctionCall::get_validate); String bt; for(int i=0;i<Variant::VARIANT_MAX;i++) { @@ -743,17 +772,17 @@ void VisualScriptFunctionCall::_bind_methods() { - ADD_PROPERTY(PropertyInfo(Variant::INT,"function/call_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance,Basic Type,Singleton"),_SCS("set_call_mode"),_SCS("get_call_mode")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/base_script",PROPERTY_HINT_FILE,script_ext_hint),_SCS("set_base_script"),_SCS("get_base_script")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/singleton"),_SCS("set_singleton"),_SCS("get_singleton")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"function/basic_type",PROPERTY_HINT_ENUM,bt),_SCS("set_basic_type"),_SCS("get_basic_type")); - ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"function/node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),_SCS("set_base_path"),_SCS("get_base_path")); - ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"function/argument_cache",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_argument_cache"),_SCS("_get_argument_cache")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/function"),_SCS("set_function"),_SCS("get_function")); //when set, if loaded properly, will override argument count. - ADD_PROPERTY(PropertyInfo(Variant::INT,"function/use_default_args"),_SCS("set_use_default_args"),_SCS("get_use_default_args")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"function/validate"),_SCS("set_validate"),_SCS("get_validate")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"rpc/call_mode",PROPERTY_HINT_ENUM,"Disabled,Reliable,Unreliable,ReliableToID,UnreliableToID"),_SCS("set_rpc_call_mode"),_SCS("get_rpc_call_mode")); //when set, if loaded properly, will override argument count. + ADD_PROPERTY(PropertyInfo(Variant::INT,"function/call_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance,Basic Type,Singleton"),"set_call_mode","get_call_mode"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),"set_base_type","get_base_type"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/base_script",PROPERTY_HINT_FILE,script_ext_hint),"set_base_script","get_base_script"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/singleton"),"set_singleton","get_singleton"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"function/basic_type",PROPERTY_HINT_ENUM,bt),"set_basic_type","get_basic_type"); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"function/node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),"set_base_path","get_base_path"); + ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"function/argument_cache",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_argument_cache","_get_argument_cache"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"function/function"),"set_function","get_function"); //when set, if loaded properly, will override argument count. + ADD_PROPERTY(PropertyInfo(Variant::INT,"function/use_default_args"),"set_use_default_args","get_use_default_args"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"function/validate"),"set_validate","get_validate"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"rpc/call_mode",PROPERTY_HINT_ENUM,"Disabled,Reliable,Unreliable,ReliableToID,UnreliableToID"),"set_rpc_call_mode","get_rpc_call_mode"); //when set, if loaded properly, will override argument count. BIND_CONSTANT( CALL_MODE_SELF ); BIND_CONSTANT( CALL_MODE_NODE_PATH); @@ -1453,29 +1482,29 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo& property) const { void VisualScriptPropertySet::_bind_methods() { - ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptPropertySet::set_base_type); - ClassDB::bind_method(_MD("get_base_type"),&VisualScriptPropertySet::get_base_type); + ClassDB::bind_method(D_METHOD("set_base_type","base_type"),&VisualScriptPropertySet::set_base_type); + ClassDB::bind_method(D_METHOD("get_base_type"),&VisualScriptPropertySet::get_base_type); - ClassDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptPropertySet::set_base_script); - ClassDB::bind_method(_MD("get_base_script"),&VisualScriptPropertySet::get_base_script); + ClassDB::bind_method(D_METHOD("set_base_script","base_script"),&VisualScriptPropertySet::set_base_script); + ClassDB::bind_method(D_METHOD("get_base_script"),&VisualScriptPropertySet::get_base_script); - ClassDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptPropertySet::set_basic_type); - ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptPropertySet::get_basic_type); + ClassDB::bind_method(D_METHOD("set_basic_type","basic_type"),&VisualScriptPropertySet::set_basic_type); + ClassDB::bind_method(D_METHOD("get_basic_type"),&VisualScriptPropertySet::get_basic_type); - ClassDB::bind_method(_MD("_set_type_cache","type_cache"),&VisualScriptPropertySet::_set_type_cache); - ClassDB::bind_method(_MD("_get_type_cache"),&VisualScriptPropertySet::_get_type_cache); + ClassDB::bind_method(D_METHOD("_set_type_cache","type_cache"),&VisualScriptPropertySet::_set_type_cache); + ClassDB::bind_method(D_METHOD("_get_type_cache"),&VisualScriptPropertySet::_get_type_cache); - ClassDB::bind_method(_MD("set_event_type","event_type"),&VisualScriptPropertySet::set_event_type); - ClassDB::bind_method(_MD("get_event_type"),&VisualScriptPropertySet::get_event_type); + ClassDB::bind_method(D_METHOD("set_event_type","event_type"),&VisualScriptPropertySet::set_event_type); + ClassDB::bind_method(D_METHOD("get_event_type"),&VisualScriptPropertySet::get_event_type); - ClassDB::bind_method(_MD("set_property","property"),&VisualScriptPropertySet::set_property); - ClassDB::bind_method(_MD("get_property"),&VisualScriptPropertySet::get_property); + ClassDB::bind_method(D_METHOD("set_property","property"),&VisualScriptPropertySet::set_property); + ClassDB::bind_method(D_METHOD("get_property"),&VisualScriptPropertySet::get_property); - ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptPropertySet::set_call_mode); - ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptPropertySet::get_call_mode); + ClassDB::bind_method(D_METHOD("set_call_mode","mode"),&VisualScriptPropertySet::set_call_mode); + ClassDB::bind_method(D_METHOD("get_call_mode"),&VisualScriptPropertySet::get_call_mode); - ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptPropertySet::set_base_path); - ClassDB::bind_method(_MD("get_base_path"),&VisualScriptPropertySet::get_base_path); + ClassDB::bind_method(D_METHOD("set_base_path","base_path"),&VisualScriptPropertySet::set_base_path); + ClassDB::bind_method(D_METHOD("get_base_path"),&VisualScriptPropertySet::get_base_path); @@ -1507,14 +1536,14 @@ void VisualScriptPropertySet::_bind_methods() { script_ext_hint+="*."+E->get(); } - ADD_PROPERTY(PropertyInfo(Variant::INT,"property/set_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance,Basic Type"),_SCS("set_call_mode"),_SCS("get_call_mode")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_script",PROPERTY_HINT_FILE,script_ext_hint),_SCS("set_base_script"),_SCS("get_base_script")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"property/type_cache",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_type_cache"),_SCS("_get_type_cache")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"property/basic_type",PROPERTY_HINT_ENUM,bt),_SCS("set_basic_type"),_SCS("get_basic_type")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"property/event_type",PROPERTY_HINT_ENUM,et),_SCS("set_event_type"),_SCS("get_event_type")); - ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"property/node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),_SCS("set_base_path"),_SCS("get_base_path")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/property"),_SCS("set_property"),_SCS("get_property")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"property/set_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance,Basic Type"),"set_call_mode","get_call_mode"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),"set_base_type","get_base_type"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_script",PROPERTY_HINT_FILE,script_ext_hint),"set_base_script","get_base_script"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"property/type_cache",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_type_cache","_get_type_cache"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"property/basic_type",PROPERTY_HINT_ENUM,bt),"set_basic_type","get_basic_type"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"property/event_type",PROPERTY_HINT_ENUM,et),"set_event_type","get_event_type"); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"property/node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),"set_base_path","get_base_path"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/property"),"set_property","get_property"); BIND_CONSTANT( CALL_MODE_SELF ); BIND_CONSTANT( CALL_MODE_NODE_PATH); @@ -2117,30 +2146,30 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo& property) const { void VisualScriptPropertyGet::_bind_methods() { - ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptPropertyGet::set_base_type); - ClassDB::bind_method(_MD("get_base_type"),&VisualScriptPropertyGet::get_base_type); + ClassDB::bind_method(D_METHOD("set_base_type","base_type"),&VisualScriptPropertyGet::set_base_type); + ClassDB::bind_method(D_METHOD("get_base_type"),&VisualScriptPropertyGet::get_base_type); - ClassDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptPropertyGet::set_base_script); - ClassDB::bind_method(_MD("get_base_script"),&VisualScriptPropertyGet::get_base_script); + ClassDB::bind_method(D_METHOD("set_base_script","base_script"),&VisualScriptPropertyGet::set_base_script); + ClassDB::bind_method(D_METHOD("get_base_script"),&VisualScriptPropertyGet::get_base_script); - ClassDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptPropertyGet::set_basic_type); - ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptPropertyGet::get_basic_type); + ClassDB::bind_method(D_METHOD("set_basic_type","basic_type"),&VisualScriptPropertyGet::set_basic_type); + ClassDB::bind_method(D_METHOD("get_basic_type"),&VisualScriptPropertyGet::get_basic_type); - ClassDB::bind_method(_MD("_set_type_cache","type_cache"),&VisualScriptPropertyGet::_set_type_cache); - ClassDB::bind_method(_MD("_get_type_cache"),&VisualScriptPropertyGet::_get_type_cache); + ClassDB::bind_method(D_METHOD("_set_type_cache","type_cache"),&VisualScriptPropertyGet::_set_type_cache); + ClassDB::bind_method(D_METHOD("_get_type_cache"),&VisualScriptPropertyGet::_get_type_cache); - ClassDB::bind_method(_MD("set_event_type","event_type"),&VisualScriptPropertyGet::set_event_type); - ClassDB::bind_method(_MD("get_event_type"),&VisualScriptPropertyGet::get_event_type); + ClassDB::bind_method(D_METHOD("set_event_type","event_type"),&VisualScriptPropertyGet::set_event_type); + ClassDB::bind_method(D_METHOD("get_event_type"),&VisualScriptPropertyGet::get_event_type); - ClassDB::bind_method(_MD("set_property","property"),&VisualScriptPropertyGet::set_property); - ClassDB::bind_method(_MD("get_property"),&VisualScriptPropertyGet::get_property); + ClassDB::bind_method(D_METHOD("set_property","property"),&VisualScriptPropertyGet::set_property); + ClassDB::bind_method(D_METHOD("get_property"),&VisualScriptPropertyGet::get_property); - ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptPropertyGet::set_call_mode); - ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptPropertyGet::get_call_mode); + ClassDB::bind_method(D_METHOD("set_call_mode","mode"),&VisualScriptPropertyGet::set_call_mode); + ClassDB::bind_method(D_METHOD("get_call_mode"),&VisualScriptPropertyGet::get_call_mode); - ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptPropertyGet::set_base_path); - ClassDB::bind_method(_MD("get_base_path"),&VisualScriptPropertyGet::get_base_path); + ClassDB::bind_method(D_METHOD("set_base_path","base_path"),&VisualScriptPropertyGet::set_base_path); + ClassDB::bind_method(D_METHOD("get_base_path"),&VisualScriptPropertyGet::get_base_path); String bt; for(int i=0;i<Variant::VARIANT_MAX;i++) { @@ -2170,14 +2199,14 @@ void VisualScriptPropertyGet::_bind_methods() { script_ext_hint+="."+E->get(); } - ADD_PROPERTY(PropertyInfo(Variant::INT,"property/set_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance,Basic Type"),_SCS("set_call_mode"),_SCS("get_call_mode")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_script",PROPERTY_HINT_FILE,script_ext_hint),_SCS("set_base_script"),_SCS("get_base_script")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"property/type_cache",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_type_cache"),_SCS("_get_type_cache")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"property/basic_type",PROPERTY_HINT_ENUM,bt),_SCS("set_basic_type"),_SCS("get_basic_type")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"property/event_type",PROPERTY_HINT_ENUM,et),_SCS("set_event_type"),_SCS("get_event_type")); - ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"property/node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),_SCS("set_base_path"),_SCS("get_base_path")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/property"),_SCS("set_property"),_SCS("get_property")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"property/set_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance,Basic Type"),"set_call_mode","get_call_mode"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),"set_base_type","get_base_type"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/base_script",PROPERTY_HINT_FILE,script_ext_hint),"set_base_script","get_base_script"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"property/type_cache",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_type_cache","_get_type_cache"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"property/basic_type",PROPERTY_HINT_ENUM,bt),"set_basic_type","get_basic_type"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"property/event_type",PROPERTY_HINT_ENUM,et),"set_event_type","get_event_type"); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"property/node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),"set_base_path","get_base_path"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"property/property"),"set_property","get_property"); BIND_CONSTANT( CALL_MODE_SELF ); BIND_CONSTANT( CALL_MODE_NODE_PATH); @@ -2420,11 +2449,11 @@ void VisualScriptEmitSignal::_validate_property(PropertyInfo& property) const { void VisualScriptEmitSignal::_bind_methods() { - ClassDB::bind_method(_MD("set_signal","name"),&VisualScriptEmitSignal::set_signal); - ClassDB::bind_method(_MD("get_signal"),&VisualScriptEmitSignal::get_signal); + ClassDB::bind_method(D_METHOD("set_signal","name"),&VisualScriptEmitSignal::set_signal); + ClassDB::bind_method(D_METHOD("get_signal"),&VisualScriptEmitSignal::get_signal); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"signal/signal"),_SCS("set_signal"),_SCS("get_signal")); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"signal/signal"),"set_signal","get_signal"); } diff --git a/modules/visual_script/visual_script_func_nodes.h b/modules/visual_script/visual_script_func_nodes.h index 7d33549e21..7c1d4511cb 100644 --- a/modules/visual_script/visual_script_func_nodes.h +++ b/modules/visual_script/visual_script_func_nodes.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_script_func_nodes.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUAL_SCRIPT_FUNC_NODES_H #define VISUAL_SCRIPT_FUNC_NODES_H diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index ce33b2e5ae..824dfe88a9 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -1,6 +1,35 @@ +/*************************************************************************/ +/* visual_script_nodes.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_script_nodes.h" + #include "global_constants.h" -#include "globals.h" +#include "global_config.h" #include "scene/main/scene_main_loop.h" #include "os/os.h" #include "scene/main/node.h" @@ -539,11 +568,11 @@ Variant::Type VisualScriptOperator::get_typed() const { void VisualScriptOperator::_bind_methods() { - ClassDB::bind_method(_MD("set_operator","op"),&VisualScriptOperator::set_operator); - ClassDB::bind_method(_MD("get_operator"),&VisualScriptOperator::get_operator); + ClassDB::bind_method(D_METHOD("set_operator","op"),&VisualScriptOperator::set_operator); + ClassDB::bind_method(D_METHOD("get_operator"),&VisualScriptOperator::get_operator); - ClassDB::bind_method(_MD("set_typed","type"),&VisualScriptOperator::set_typed); - ClassDB::bind_method(_MD("get_typed"),&VisualScriptOperator::get_typed); + ClassDB::bind_method(D_METHOD("set_typed","type"),&VisualScriptOperator::set_typed); + ClassDB::bind_method(D_METHOD("get_typed"),&VisualScriptOperator::get_typed); String types; for(int i=0;i<Variant::OP_MAX;i++) { @@ -557,8 +586,8 @@ void VisualScriptOperator::_bind_methods() { argt+=","+Variant::get_type_name(Variant::Type(i)); } - ADD_PROPERTY(PropertyInfo(Variant::INT,"operator_value/type",PROPERTY_HINT_ENUM,types),_SCS("set_operator"),_SCS("get_operator")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"typed_value/typed",PROPERTY_HINT_ENUM,argt),_SCS("set_typed"),_SCS("get_typed")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"operator_value/type",PROPERTY_HINT_ENUM,types),"set_operator","get_operator"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"typed_value/typed",PROPERTY_HINT_ENUM,argt),"set_typed","get_typed"); } @@ -717,11 +746,11 @@ void VisualScriptVariableGet::_validate_property(PropertyInfo& property) const { void VisualScriptVariableGet::_bind_methods() { - ClassDB::bind_method(_MD("set_variable","name"),&VisualScriptVariableGet::set_variable); - ClassDB::bind_method(_MD("get_variable"),&VisualScriptVariableGet::get_variable); + ClassDB::bind_method(D_METHOD("set_variable","name"),&VisualScriptVariableGet::set_variable); + ClassDB::bind_method(D_METHOD("get_variable"),&VisualScriptVariableGet::get_variable); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"variable/name"),_SCS("set_variable"),_SCS("get_variable")); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"variable/name"),"set_variable","get_variable"); } @@ -853,11 +882,11 @@ void VisualScriptVariableSet::_validate_property(PropertyInfo& property) const { void VisualScriptVariableSet::_bind_methods() { - ClassDB::bind_method(_MD("set_variable","name"),&VisualScriptVariableSet::set_variable); - ClassDB::bind_method(_MD("get_variable"),&VisualScriptVariableSet::get_variable); + ClassDB::bind_method(D_METHOD("set_variable","name"),&VisualScriptVariableSet::set_variable); + ClassDB::bind_method(D_METHOD("get_variable"),&VisualScriptVariableSet::get_variable); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"variable/name"),_SCS("set_variable"),_SCS("get_variable")); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"variable/name"),"set_variable","get_variable"); } @@ -995,11 +1024,11 @@ void VisualScriptConstant::_validate_property(PropertyInfo& property) const { void VisualScriptConstant::_bind_methods() { - ClassDB::bind_method(_MD("set_constant_type","type"),&VisualScriptConstant::set_constant_type); - ClassDB::bind_method(_MD("get_constant_type"),&VisualScriptConstant::get_constant_type); + ClassDB::bind_method(D_METHOD("set_constant_type","type"),&VisualScriptConstant::set_constant_type); + ClassDB::bind_method(D_METHOD("get_constant_type"),&VisualScriptConstant::get_constant_type); - ClassDB::bind_method(_MD("set_constant_value","value"),&VisualScriptConstant::set_constant_value); - ClassDB::bind_method(_MD("get_constant_value"),&VisualScriptConstant::get_constant_value); + ClassDB::bind_method(D_METHOD("set_constant_value","value"),&VisualScriptConstant::set_constant_value); + ClassDB::bind_method(D_METHOD("get_constant_value"),&VisualScriptConstant::get_constant_value); String argt="Null"; for(int i=1;i<Variant::VARIANT_MAX;i++) { @@ -1007,8 +1036,8 @@ void VisualScriptConstant::_bind_methods() { } - ADD_PROPERTY(PropertyInfo(Variant::INT,"constant/type",PROPERTY_HINT_ENUM,argt),_SCS("set_constant_type"),_SCS("get_constant_type")); - ADD_PROPERTY(PropertyInfo(Variant::NIL,"constant/value"),_SCS("set_constant_value"),_SCS("get_constant_value")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"constant/type",PROPERTY_HINT_ENUM,argt),"set_constant_type","get_constant_type"); + ADD_PROPERTY(PropertyInfo(Variant::NIL,"constant/value"),"set_constant_value","get_constant_value"); } @@ -1123,11 +1152,11 @@ Ref<Resource> VisualScriptPreload::get_preload() const{ void VisualScriptPreload::_bind_methods() { - ClassDB::bind_method(_MD("set_preload","resource"),&VisualScriptPreload::set_preload); - ClassDB::bind_method(_MD("get_preload"),&VisualScriptPreload::get_preload); + ClassDB::bind_method(D_METHOD("set_preload","resource"),&VisualScriptPreload::set_preload); + ClassDB::bind_method(D_METHOD("get_preload"),&VisualScriptPreload::get_preload); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"resource",PROPERTY_HINT_RESOURCE_TYPE,"Resource"),_SCS("set_preload"),_SCS("get_preload")); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"resource",PROPERTY_HINT_RESOURCE_TYPE,"Resource"),"set_preload","get_preload"); } @@ -1425,8 +1454,8 @@ VisualScriptNodeInstance* VisualScriptGlobalConstant::instance(VisualScriptInsta void VisualScriptGlobalConstant::_bind_methods() { - ClassDB::bind_method(_MD("set_global_constant","index"),&VisualScriptGlobalConstant::set_global_constant); - ClassDB::bind_method(_MD("get_global_constant"),&VisualScriptGlobalConstant::get_global_constant); + ClassDB::bind_method(D_METHOD("set_global_constant","index"),&VisualScriptGlobalConstant::set_global_constant); + ClassDB::bind_method(D_METHOD("get_global_constant"),&VisualScriptGlobalConstant::get_global_constant); String cc; @@ -1436,7 +1465,7 @@ void VisualScriptGlobalConstant::_bind_methods() { cc+=","; cc+=GlobalConstants::get_global_constant_name(i); } - ADD_PROPERTY(PropertyInfo(Variant::INT,"constant",PROPERTY_HINT_ENUM,cc),_SCS("set_global_constant"),_SCS("get_global_constant")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"constant",PROPERTY_HINT_ENUM,cc),"set_global_constant","get_global_constant"); } VisualScriptGlobalConstant::VisualScriptGlobalConstant() { @@ -1563,14 +1592,14 @@ void VisualScriptClassConstant::_validate_property(PropertyInfo& property) const void VisualScriptClassConstant::_bind_methods() { - ClassDB::bind_method(_MD("set_class_constant","name"),&VisualScriptClassConstant::set_class_constant); - ClassDB::bind_method(_MD("get_class_constant"),&VisualScriptClassConstant::get_class_constant); + ClassDB::bind_method(D_METHOD("set_class_constant","name"),&VisualScriptClassConstant::set_class_constant); + ClassDB::bind_method(D_METHOD("get_class_constant"),&VisualScriptClassConstant::get_class_constant); - ClassDB::bind_method(_MD("set_base_type","name"),&VisualScriptClassConstant::set_base_type); - ClassDB::bind_method(_MD("get_base_type"),&VisualScriptClassConstant::get_base_type); + ClassDB::bind_method(D_METHOD("set_base_type","name"),&VisualScriptClassConstant::set_base_type); + ClassDB::bind_method(D_METHOD("get_base_type"),&VisualScriptClassConstant::get_base_type); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"constant",PROPERTY_HINT_ENUM,""),_SCS("set_class_constant"),_SCS("get_class_constant")); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"base_type",PROPERTY_HINT_TYPE_STRING,"Object"),"set_base_type","get_base_type"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"constant",PROPERTY_HINT_ENUM,""),"set_class_constant","get_class_constant"); } VisualScriptClassConstant::VisualScriptClassConstant() { @@ -1703,11 +1732,11 @@ void VisualScriptBasicTypeConstant::_validate_property(PropertyInfo& property) c void VisualScriptBasicTypeConstant::_bind_methods() { - ClassDB::bind_method(_MD("set_basic_type","name"),&VisualScriptBasicTypeConstant::set_basic_type); - ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptBasicTypeConstant::get_basic_type); + ClassDB::bind_method(D_METHOD("set_basic_type","name"),&VisualScriptBasicTypeConstant::set_basic_type); + ClassDB::bind_method(D_METHOD("get_basic_type"),&VisualScriptBasicTypeConstant::get_basic_type); - ClassDB::bind_method(_MD("set_basic_type_constant","name"),&VisualScriptBasicTypeConstant::set_basic_type_constant); - ClassDB::bind_method(_MD("get_basic_type_constant"),&VisualScriptBasicTypeConstant::get_basic_type_constant); + ClassDB::bind_method(D_METHOD("set_basic_type_constant","name"),&VisualScriptBasicTypeConstant::set_basic_type_constant); + ClassDB::bind_method(D_METHOD("get_basic_type_constant"),&VisualScriptBasicTypeConstant::get_basic_type_constant); String argt="Null"; @@ -1715,8 +1744,8 @@ void VisualScriptBasicTypeConstant::_bind_methods() { argt+=","+Variant::get_type_name(Variant::Type(i)); } - ADD_PROPERTY(PropertyInfo(Variant::INT,"basic_type",PROPERTY_HINT_ENUM,argt),_SCS("set_basic_type"),_SCS("get_basic_type")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"constant",PROPERTY_HINT_ENUM,""),_SCS("set_basic_type_constant"),_SCS("get_basic_type_constant")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"basic_type",PROPERTY_HINT_ENUM,argt),"set_basic_type","get_basic_type"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"constant",PROPERTY_HINT_ENUM,""),"set_basic_type_constant","get_basic_type_constant"); } VisualScriptBasicTypeConstant::VisualScriptBasicTypeConstant() { @@ -1738,6 +1767,8 @@ const char* VisualScriptMathConstant::const_name[MATH_CONSTANT_MAX]={ "PI/2", "E", "Sqrt2", + "INF", + "NAN" }; double VisualScriptMathConstant::const_value[MATH_CONSTANT_MAX]={ @@ -1746,7 +1777,9 @@ double VisualScriptMathConstant::const_value[MATH_CONSTANT_MAX]={ Math_PI*2, Math_PI*0.5, 2.71828182845904523536, - Math::sqrt(2.0) + Math::sqrt(2.0), + Math_INF, + Math_NAN }; @@ -1831,8 +1864,8 @@ VisualScriptNodeInstance* VisualScriptMathConstant::instance(VisualScriptInstanc void VisualScriptMathConstant::_bind_methods() { - ClassDB::bind_method(_MD("set_math_constant","which"),&VisualScriptMathConstant::set_math_constant); - ClassDB::bind_method(_MD("get_math_constant"),&VisualScriptMathConstant::get_math_constant); + ClassDB::bind_method(D_METHOD("set_math_constant","which"),&VisualScriptMathConstant::set_math_constant); + ClassDB::bind_method(D_METHOD("get_math_constant"),&VisualScriptMathConstant::get_math_constant); String cc; @@ -1842,7 +1875,7 @@ void VisualScriptMathConstant::_bind_methods() { cc+=","; cc+=const_name[i]; } - ADD_PROPERTY(PropertyInfo(Variant::INT,"constant",PROPERTY_HINT_ENUM,cc),_SCS("set_math_constant"),_SCS("get_math_constant")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"constant",PROPERTY_HINT_ENUM,cc),"set_math_constant","get_math_constant"); } VisualScriptMathConstant::VisualScriptMathConstant() { @@ -1953,8 +1986,8 @@ VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output void VisualScriptEngineSingleton::_bind_methods() { - ClassDB::bind_method(_MD("set_singleton","name"),&VisualScriptEngineSingleton::set_singleton); - ClassDB::bind_method(_MD("get_singleton"),&VisualScriptEngineSingleton::get_singleton); + ClassDB::bind_method(D_METHOD("set_singleton","name"),&VisualScriptEngineSingleton::set_singleton); + ClassDB::bind_method(D_METHOD("get_singleton"),&VisualScriptEngineSingleton::get_singleton); String cc; @@ -1971,7 +2004,7 @@ void VisualScriptEngineSingleton::_bind_methods() { cc+=E->get().name; } - ADD_PROPERTY(PropertyInfo(Variant::STRING,"constant",PROPERTY_HINT_ENUM,cc),_SCS("set_singleton"),_SCS("get_singleton")); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"constant",PROPERTY_HINT_ENUM,cc),"set_singleton","get_singleton"); } VisualScriptEngineSingleton::VisualScriptEngineSingleton() { @@ -2190,10 +2223,10 @@ void VisualScriptSceneNode::_validate_property(PropertyInfo& property) const { void VisualScriptSceneNode::_bind_methods() { - ClassDB::bind_method(_MD("set_node_path","path"),&VisualScriptSceneNode::set_node_path); - ClassDB::bind_method(_MD("get_node_path"),&VisualScriptSceneNode::get_node_path); + ClassDB::bind_method(D_METHOD("set_node_path","path"),&VisualScriptSceneNode::set_node_path); + ClassDB::bind_method(D_METHOD("get_node_path"),&VisualScriptSceneNode::get_node_path); - ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),_SCS("set_node_path"),_SCS("get_node_path")); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),"set_node_path","get_node_path"); } VisualScriptSceneNode::VisualScriptSceneNode() { @@ -2401,10 +2434,10 @@ VisualScriptNodeInstance* VisualScriptResourcePath::instance(VisualScriptInstanc void VisualScriptResourcePath::_bind_methods() { - ClassDB::bind_method(_MD("set_resource_path","path"),&VisualScriptResourcePath::set_resource_path); - ClassDB::bind_method(_MD("get_resource_path"),&VisualScriptResourcePath::get_resource_path); + ClassDB::bind_method(D_METHOD("set_resource_path","path"),&VisualScriptResourcePath::set_resource_path); + ClassDB::bind_method(D_METHOD("get_resource_path"),&VisualScriptResourcePath::get_resource_path); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"path",PROPERTY_HINT_FILE),_SCS("set_resource_path"),_SCS("get_resource_path")); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"path",PROPERTY_HINT_FILE),"set_resource_path","get_resource_path"); } VisualScriptResourcePath::VisualScriptResourcePath() { @@ -3001,18 +3034,18 @@ VisualScriptNodeInstance* VisualScriptComment::instance(VisualScriptInstance* p_ void VisualScriptComment::_bind_methods() { - ClassDB::bind_method(_MD("set_title","title"),&VisualScriptComment::set_title); - ClassDB::bind_method(_MD("get_title"),&VisualScriptComment::get_title); + ClassDB::bind_method(D_METHOD("set_title","title"),&VisualScriptComment::set_title); + ClassDB::bind_method(D_METHOD("get_title"),&VisualScriptComment::get_title); - ClassDB::bind_method(_MD("set_description","description"),&VisualScriptComment::set_description); - ClassDB::bind_method(_MD("get_description"),&VisualScriptComment::get_description); + ClassDB::bind_method(D_METHOD("set_description","description"),&VisualScriptComment::set_description); + ClassDB::bind_method(D_METHOD("get_description"),&VisualScriptComment::get_description); - ClassDB::bind_method(_MD("set_size","size"),&VisualScriptComment::set_size); - ClassDB::bind_method(_MD("get_size"),&VisualScriptComment::get_size); + ClassDB::bind_method(D_METHOD("set_size","size"),&VisualScriptComment::set_size); + ClassDB::bind_method(D_METHOD("get_size"),&VisualScriptComment::get_size); - ADD_PROPERTY( PropertyInfo(Variant::STRING,"title"),_SCS("set_title"),_SCS("get_title")); - ADD_PROPERTY( PropertyInfo(Variant::STRING,"description",PROPERTY_HINT_MULTILINE_TEXT),_SCS("set_description"),_SCS("get_description")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"size"),_SCS("set_size"),_SCS("get_size")); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"title"),"set_title","get_title"); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"description",PROPERTY_HINT_MULTILINE_TEXT),"set_description","get_description"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"size"),"set_size","get_size"); } @@ -3140,14 +3173,14 @@ VisualScriptNodeInstance* VisualScriptConstructor::instance(VisualScriptInstance void VisualScriptConstructor::_bind_methods() { - ClassDB::bind_method(_MD("set_constructor_type","type"),&VisualScriptConstructor::set_constructor_type); - ClassDB::bind_method(_MD("get_constructor_type"),&VisualScriptConstructor::get_constructor_type); + ClassDB::bind_method(D_METHOD("set_constructor_type","type"),&VisualScriptConstructor::set_constructor_type); + ClassDB::bind_method(D_METHOD("get_constructor_type"),&VisualScriptConstructor::get_constructor_type); - ClassDB::bind_method(_MD("set_constructor","constructor"),&VisualScriptConstructor::set_constructor); - ClassDB::bind_method(_MD("get_constructor"),&VisualScriptConstructor::get_constructor); + ClassDB::bind_method(D_METHOD("set_constructor","constructor"),&VisualScriptConstructor::set_constructor); + ClassDB::bind_method(D_METHOD("get_constructor"),&VisualScriptConstructor::get_constructor); - ADD_PROPERTY( PropertyInfo(Variant::INT,"type",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_constructor_type"),_SCS("get_constructor_type")); - ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"constructor",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_constructor"),_SCS("get_constructor")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"type",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_constructor_type","get_constructor_type"); + ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"constructor",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_constructor","get_constructor"); } @@ -3283,19 +3316,19 @@ VisualScriptNodeInstance* VisualScriptLocalVar::instance(VisualScriptInstance* p void VisualScriptLocalVar::_bind_methods() { - ClassDB::bind_method(_MD("set_var_name","name"),&VisualScriptLocalVar::set_var_name); - ClassDB::bind_method(_MD("get_var_name"),&VisualScriptLocalVar::get_var_name); + ClassDB::bind_method(D_METHOD("set_var_name","name"),&VisualScriptLocalVar::set_var_name); + ClassDB::bind_method(D_METHOD("get_var_name"),&VisualScriptLocalVar::get_var_name); - ClassDB::bind_method(_MD("set_var_type","type"),&VisualScriptLocalVar::set_var_type); - ClassDB::bind_method(_MD("get_var_type"),&VisualScriptLocalVar::get_var_type); + ClassDB::bind_method(D_METHOD("set_var_type","type"),&VisualScriptLocalVar::set_var_type); + ClassDB::bind_method(D_METHOD("get_var_type"),&VisualScriptLocalVar::get_var_type); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { argt+=","+Variant::get_type_name(Variant::Type(i)); } - ADD_PROPERTY( PropertyInfo(Variant::STRING,"variable/name"),_SCS("set_var_name"),_SCS("get_var_name")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"variable/type",PROPERTY_HINT_ENUM,argt),_SCS("set_var_type"),_SCS("get_var_type")); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"variable/name"),"set_var_name","get_var_name"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"variable/type",PROPERTY_HINT_ENUM,argt),"set_var_type","get_var_type"); } @@ -3420,19 +3453,19 @@ VisualScriptNodeInstance* VisualScriptLocalVarSet::instance(VisualScriptInstance void VisualScriptLocalVarSet::_bind_methods() { - ClassDB::bind_method(_MD("set_var_name","name"),&VisualScriptLocalVarSet::set_var_name); - ClassDB::bind_method(_MD("get_var_name"),&VisualScriptLocalVarSet::get_var_name); + ClassDB::bind_method(D_METHOD("set_var_name","name"),&VisualScriptLocalVarSet::set_var_name); + ClassDB::bind_method(D_METHOD("get_var_name"),&VisualScriptLocalVarSet::get_var_name); - ClassDB::bind_method(_MD("set_var_type","type"),&VisualScriptLocalVarSet::set_var_type); - ClassDB::bind_method(_MD("get_var_type"),&VisualScriptLocalVarSet::get_var_type); + ClassDB::bind_method(D_METHOD("set_var_type","type"),&VisualScriptLocalVarSet::set_var_type); + ClassDB::bind_method(D_METHOD("get_var_type"),&VisualScriptLocalVarSet::get_var_type); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { argt+=","+Variant::get_type_name(Variant::Type(i)); } - ADD_PROPERTY( PropertyInfo(Variant::STRING,"variable/name"),_SCS("set_var_name"),_SCS("get_var_name")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"variable/type",PROPERTY_HINT_ENUM,argt),_SCS("set_var_type"),_SCS("get_var_type")); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"variable/name"),"set_var_name","get_var_name"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"variable/type",PROPERTY_HINT_ENUM,argt),"set_var_type","get_var_type"); } @@ -3630,14 +3663,14 @@ void VisualScriptInputAction::_validate_property(PropertyInfo& property) const { void VisualScriptInputAction::_bind_methods() { - ClassDB::bind_method(_MD("set_action_name","name"),&VisualScriptInputAction::set_action_name); - ClassDB::bind_method(_MD("get_action_name"),&VisualScriptInputAction::get_action_name); + ClassDB::bind_method(D_METHOD("set_action_name","name"),&VisualScriptInputAction::set_action_name); + ClassDB::bind_method(D_METHOD("get_action_name"),&VisualScriptInputAction::get_action_name); - ClassDB::bind_method(_MD("set_action_mode","mode"),&VisualScriptInputAction::set_action_mode); - ClassDB::bind_method(_MD("get_action_mode"),&VisualScriptInputAction::get_action_mode); + ClassDB::bind_method(D_METHOD("set_action_mode","mode"),&VisualScriptInputAction::set_action_mode); + ClassDB::bind_method(D_METHOD("get_action_mode"),&VisualScriptInputAction::get_action_mode); - ADD_PROPERTY( PropertyInfo(Variant::STRING,"action"),_SCS("set_action_name"),_SCS("get_action_name")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Pressed,Released,JustPressed,JustReleased"),_SCS("set_action_mode"),_SCS("get_action_mode")); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"action"),"set_action_name","get_action_name"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Pressed,Released,JustPressed,JustReleased"),"set_action_mode","get_action_mode"); } @@ -3834,14 +3867,14 @@ void VisualScriptDeconstruct::_validate_property(PropertyInfo& property) const { void VisualScriptDeconstruct::_bind_methods() { - ClassDB::bind_method(_MD("set_deconstruct_type","type"),&VisualScriptDeconstruct::set_deconstruct_type); - ClassDB::bind_method(_MD("get_deconstruct_type"),&VisualScriptDeconstruct::get_deconstruct_type); + ClassDB::bind_method(D_METHOD("set_deconstruct_type","type"),&VisualScriptDeconstruct::set_deconstruct_type); + ClassDB::bind_method(D_METHOD("get_deconstruct_type"),&VisualScriptDeconstruct::get_deconstruct_type); - ClassDB::bind_method(_MD("set_deconstruct_input_type","input_type"),&VisualScriptDeconstruct::set_deconstruct_input_type); - ClassDB::bind_method(_MD("get_deconstruct_input_type"),&VisualScriptDeconstruct::get_deconstruct_input_type); + ClassDB::bind_method(D_METHOD("set_deconstruct_input_type","input_type"),&VisualScriptDeconstruct::set_deconstruct_input_type); + ClassDB::bind_method(D_METHOD("get_deconstruct_input_type"),&VisualScriptDeconstruct::get_deconstruct_input_type); - ClassDB::bind_method(_MD("_set_elem_cache","_cache"),&VisualScriptDeconstruct::_set_elem_cache); - ClassDB::bind_method(_MD("_get_elem_cache"),&VisualScriptDeconstruct::_get_elem_cache); + ClassDB::bind_method(D_METHOD("_set_elem_cache","_cache"),&VisualScriptDeconstruct::_set_elem_cache); + ClassDB::bind_method(D_METHOD("_get_elem_cache"),&VisualScriptDeconstruct::_get_elem_cache); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { @@ -3850,9 +3883,9 @@ void VisualScriptDeconstruct::_bind_methods() { String iet="None,Key,MouseMotion,MouseButton,JoypadMotion,JoypadButton,ScreenTouch,ScreenDrag,Action"; - ADD_PROPERTY( PropertyInfo(Variant::INT,"type",PROPERTY_HINT_ENUM,argt),_SCS("set_deconstruct_type"),_SCS("get_deconstruct_type")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"input_type",PROPERTY_HINT_ENUM,iet),_SCS("set_deconstruct_input_type"),_SCS("get_deconstruct_input_type")); - ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"elem_cache",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_elem_cache"),_SCS("_get_elem_cache")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"type",PROPERTY_HINT_ENUM,argt),"set_deconstruct_type","get_deconstruct_type"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"input_type",PROPERTY_HINT_ENUM,iet),"set_deconstruct_input_type","get_deconstruct_input_type"); + ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"elem_cache",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_elem_cache","_get_elem_cache"); } diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h index 7a06fbf5e8..2e7fb0536c 100644 --- a/modules/visual_script/visual_script_nodes.h +++ b/modules/visual_script/visual_script_nodes.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_script_nodes.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUAL_SCRIPT_NODES_H #define VISUAL_SCRIPT_NODES_H @@ -467,7 +495,9 @@ public: MATH_CONSTANT_HALF_PI, MATH_CONSTANT_E, MATH_CONSTANT_SQRT2, - MATH_CONSTANT_MAX, + MATH_CONSTANT_INF, + MATH_CONSTANT_NAN, + MATH_CONSTANT_MAX }; private: diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp index 8b251e667c..35335fd9bc 100644 --- a/modules/visual_script/visual_script_yield_nodes.cpp +++ b/modules/visual_script/visual_script_yield_nodes.cpp @@ -1,4 +1,33 @@ +/*************************************************************************/ +/* visual_script_yield_nodes.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_script_yield_nodes.h" + #include "scene/main/scene_main_loop.h" #include "os/os.h" #include "scene/main/node.h" @@ -157,14 +186,14 @@ void VisualScriptYield::_validate_property(PropertyInfo& property) const { void VisualScriptYield::_bind_methods() { - ClassDB::bind_method(_MD("set_yield_mode","mode"),&VisualScriptYield::set_yield_mode); - ClassDB::bind_method(_MD("get_yield_mode"),&VisualScriptYield::get_yield_mode); + ClassDB::bind_method(D_METHOD("set_yield_mode","mode"),&VisualScriptYield::set_yield_mode); + ClassDB::bind_method(D_METHOD("get_yield_mode"),&VisualScriptYield::get_yield_mode); - ClassDB::bind_method(_MD("set_wait_time","sec"),&VisualScriptYield::set_wait_time); - ClassDB::bind_method(_MD("get_wait_time"),&VisualScriptYield::get_wait_time); + ClassDB::bind_method(D_METHOD("set_wait_time","sec"),&VisualScriptYield::set_wait_time); + ClassDB::bind_method(D_METHOD("get_wait_time"),&VisualScriptYield::get_wait_time); - ADD_PROPERTY(PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Frame,FixedFrame,Time",PROPERTY_USAGE_NOEDITOR),_SCS("set_yield_mode"),_SCS("get_yield_mode")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"wait_time"),_SCS("set_wait_time"),_SCS("get_wait_time")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Frame,FixedFrame,Time",PROPERTY_USAGE_NOEDITOR),"set_yield_mode","get_yield_mode"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"wait_time"),"set_wait_time","get_wait_time"); BIND_CONSTANT( YIELD_FRAME ); @@ -468,17 +497,17 @@ void VisualScriptYieldSignal::_validate_property(PropertyInfo& property) const { void VisualScriptYieldSignal::_bind_methods() { - ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptYieldSignal::set_base_type); - ClassDB::bind_method(_MD("get_base_type"),&VisualScriptYieldSignal::get_base_type); + ClassDB::bind_method(D_METHOD("set_base_type","base_type"),&VisualScriptYieldSignal::set_base_type); + ClassDB::bind_method(D_METHOD("get_base_type"),&VisualScriptYieldSignal::get_base_type); - ClassDB::bind_method(_MD("set_signal","signal"),&VisualScriptYieldSignal::set_signal); - ClassDB::bind_method(_MD("get_signal"),&VisualScriptYieldSignal::get_signal); + ClassDB::bind_method(D_METHOD("set_signal","signal"),&VisualScriptYieldSignal::set_signal); + ClassDB::bind_method(D_METHOD("get_signal"),&VisualScriptYieldSignal::get_signal); - ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptYieldSignal::set_call_mode); - ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptYieldSignal::get_call_mode); + ClassDB::bind_method(D_METHOD("set_call_mode","mode"),&VisualScriptYieldSignal::set_call_mode); + ClassDB::bind_method(D_METHOD("get_call_mode"),&VisualScriptYieldSignal::get_call_mode); - ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptYieldSignal::set_base_path); - ClassDB::bind_method(_MD("get_base_path"),&VisualScriptYieldSignal::get_base_path); + ClassDB::bind_method(D_METHOD("set_base_path","base_path"),&VisualScriptYieldSignal::set_base_path); + ClassDB::bind_method(D_METHOD("get_base_path"),&VisualScriptYieldSignal::get_base_path); @@ -490,10 +519,10 @@ void VisualScriptYieldSignal::_bind_methods() { bt+=Variant::get_type_name(Variant::Type(i)); } - ADD_PROPERTY(PropertyInfo(Variant::INT,"signal/call_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance"),_SCS("set_call_mode"),_SCS("get_call_mode")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"signal/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type")); - ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"signal/node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),_SCS("set_base_path"),_SCS("get_base_path")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"signal/signal"),_SCS("set_signal"),_SCS("get_signal")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"signal/call_mode",PROPERTY_HINT_ENUM,"Self,Node Path,Instance"),"set_call_mode","get_call_mode"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"signal/base_type",PROPERTY_HINT_TYPE_STRING,"Object"),"set_base_type","get_base_type"); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"signal/node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),"set_base_path","get_base_path"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"signal/signal"),"set_signal","get_signal"); BIND_CONSTANT( CALL_MODE_SELF ); diff --git a/modules/visual_script/visual_script_yield_nodes.h b/modules/visual_script/visual_script_yield_nodes.h index 210d6ec995..80ac879aad 100644 --- a/modules/visual_script/visual_script_yield_nodes.h +++ b/modules/visual_script/visual_script_yield_nodes.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_script_yield_nodes.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUAL_SCRIPT_YIELD_NODES_H #define VISUAL_SCRIPT_YIELD_NODES_H diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index bdd97f1df7..d4995ad798 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -35,7 +35,7 @@ #include "../theora/yuv2rgb.h" #include "os/file_access.h" -#include "globals.h" +#include "global_config.h" #include <string.h> diff --git a/modules/webp/SCsub b/modules/webp/SCsub index 92f34c4da1..aa3486a2c5 100644 --- a/modules/webp/SCsub +++ b/modules/webp/SCsub @@ -9,108 +9,118 @@ env_webp = env_modules.Clone() if (env['builtin_libwebp'] != 'no'): thirdparty_dir = "#thirdparty/libwebp/" thirdparty_sources = [ - "enc/webpenc.c", - "enc/near_lossless.c", - "enc/frame.c", - "enc/alpha.c", - "enc/picture_csp.c", - "enc/vp8l.c", - "enc/picture_psnr.c", - "enc/delta_palettization.c", - "enc/syntax.c", - "enc/backward_references.c", - "enc/token.c", - "enc/analysis.c", - "enc/iterator.c", - "enc/picture_tools.c", - "enc/picture_rescale.c", - "enc/config.c", - "enc/tree.c", - "enc/cost.c", - "enc/picture.c", - "enc/quant.c", - "enc/filter.c", - "enc/histogram.c", - "utils/rescaler.c", - "utils/filters.c", - "utils/quant_levels_dec.c", - "utils/huffman.c", - "utils/thread.c", - "utils/quant_levels.c", - "utils/bit_writer.c", - "utils/bit_reader.c", - "utils/random.c", - "utils/utils.c", - "utils/huffman_encode.c", - "utils/color_cache.c", - "mux/muxinternal.c", - "mux/muxread.c", - "mux/anim_encode.c", - "mux/muxedit.c", - "dec/webp.c", - "dec/frame.c", - "dec/alpha.c", - "dec/vp8l.c", - "dec/io.c", - "dec/vp8.c", - "dec/idec.c", - "dec/tree.c", - "dec/buffer.c", - "dec/quant.c", - "demux/demux.c", + "dec/alpha_dec.c", + "dec/buffer_dec.c", + "dec/frame_dec.c", + "dec/idec_dec.c", + "dec/io_dec.c", + "dec/quant_dec.c", + "dec/tree_dec.c", + "dec/vp8_dec.c", + "dec/vp8l_dec.c", + "dec/webp_dec.c", "demux/anim_decode.c", - "dsp/yuv.c", - "dsp/filters_sse2.c", - "dsp/dec_sse41.c", - "dsp/rescaler.c", - "dsp/lossless_sse2.c", - "dsp/alpha_processing_sse41.c", - "dsp/alpha_processing_sse2.c", - "dsp/filters.c", - "dsp/upsampling_mips_dsp_r2.c", - "dsp/dec_neon.c", - "dsp/enc_neon.c", - "dsp/lossless_enc_mips32.c", - "dsp/lossless_enc_sse2.c", - "dsp/upsampling.c", - "dsp/lossless_enc_neon.c", + "demux/demux.c", "dsp/alpha_processing.c", + "dsp/alpha_processing_mips_dsp_r2.c", + "dsp/alpha_processing_neon.c", + "dsp/alpha_processing_sse2.c", + "dsp/alpha_processing_sse41.c", + "dsp/argb.c", + "dsp/argb_mips_dsp_r2.c", + "dsp/argb_sse2.c", + "dsp/cost.c", + "dsp/cost_mips32.c", + "dsp/cost_mips_dsp_r2.c", "dsp/cost_sse2.c", + "dsp/cpu.c", + "dsp/dec.c", + "dsp/dec_clip_tables.c", "dsp/dec_mips32.c", + "dsp/dec_mips_dsp_r2.c", + "dsp/dec_msa.c", + "dsp/dec_neon.c", + "dsp/dec_sse2.c", + "dsp/dec_sse41.c", "dsp/enc_avx2.c", - "dsp/rescaler_mips32.c", "dsp/enc.c", - "dsp/lossless_enc_sse41.c", - "dsp/cost_mips32.c", - "dsp/lossless_mips_dsp_r2.c", - "dsp/filters_mips_dsp_r2.c", - "dsp/upsampling_neon.c", - "dsp/alpha_processing_mips_dsp_r2.c", + "dsp/enc_mips32.c", "dsp/enc_mips_dsp_r2.c", - "dsp/lossless.c", - "dsp/yuv_mips_dsp_r2.c", - "dsp/cost_mips_dsp_r2.c", - "dsp/argb.c", - "dsp/dec_sse2.c", - "dsp/rescaler_sse2.c", + "dsp/enc_msa.c", + "dsp/enc_neon.c", + "dsp/enc_sse2.c", "dsp/enc_sse41.c", - "dsp/argb_mips_dsp_r2.c", + "dsp/filters.c", + "dsp/filters_mips_dsp_r2.c", + "dsp/filters_msa.c", + "dsp/filters_neon.c", + "dsp/filters_sse2.c", + "dsp/lossless.c", + "dsp/lossless_enc.c", + "dsp/lossless_enc_mips32.c", "dsp/lossless_enc_mips_dsp_r2.c", - "dsp/dec_clip_tables.c", - "dsp/yuv_mips32.c", - "dsp/cpu.c", - "dsp/dec.c", - "dsp/argb_sse2.c", + "dsp/lossless_enc_msa.c", + "dsp/lossless_enc_neon.c", + "dsp/lossless_enc_sse2.c", + "dsp/lossless_enc_sse41.c", + "dsp/lossless_mips_dsp_r2.c", + "dsp/lossless_msa.c", "dsp/lossless_neon.c", - "dsp/lossless_enc.c", - "dsp/enc_mips32.c", - "dsp/cost.c", + "dsp/lossless_sse2.c", + "dsp/rescaler.c", + "dsp/rescaler_mips32.c", "dsp/rescaler_mips_dsp_r2.c", - "dsp/dec_mips_dsp_r2.c", + "dsp/rescaler_msa.c", "dsp/rescaler_neon.c", - "dsp/yuv_sse2.c", - "dsp/enc_sse2.c", + "dsp/rescaler_sse2.c", + "dsp/upsampling.c", + "dsp/upsampling_mips_dsp_r2.c", + "dsp/upsampling_msa.c", + "dsp/upsampling_neon.c", "dsp/upsampling_sse2.c", + "dsp/yuv.c", + "dsp/yuv_mips32.c", + "dsp/yuv_mips_dsp_r2.c", + "dsp/yuv_sse2.c", + "enc/alpha_enc.c", + "enc/analysis_enc.c", + "enc/backward_references_enc.c", + "enc/config_enc.c", + "enc/cost_enc.c", + "enc/delta_palettization_enc.c", + "enc/filter_enc.c", + "enc/frame_enc.c", + "enc/histogram_enc.c", + "enc/iterator_enc.c", + "enc/near_lossless_enc.c", + "enc/picture_csp_enc.c", + "enc/picture_enc.c", + "enc/picture_psnr_enc.c", + "enc/picture_rescale_enc.c", + "enc/picture_tools_enc.c", + "enc/predictor_enc.c", + "enc/quant_enc.c", + "enc/syntax_enc.c", + "enc/token_enc.c", + "enc/tree_enc.c", + "enc/vp8l_enc.c", + "enc/webp_enc.c", + "mux/anim_encode.c", + "mux/muxedit.c", + "mux/muxinternal.c", + "mux/muxread.c", + "utils/bit_reader_utils.c", + "utils/bit_writer_utils.c", + "utils/color_cache_utils.c", + "utils/filters_utils.c", + "utils/huffman_encode_utils.c", + "utils/huffman_utils.c", + "utils/quant_levels_dec_utils.c", + "utils/quant_levels_utils.c", + "utils/random_utils.c", + "utils/rescaler_utils.c", + "utils/thread_utils.c", + "utils/utils.c", ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] diff --git a/platform/android/SCsub b/platform/android/SCsub index 146f7c25a3..86f8c40f83 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -20,6 +20,7 @@ android_files = [ 'java_glue.cpp', 'cpu-features.c', 'java_class_wrapper.cpp' + 'power_android.cpp' ] # env.Depends('#core/math/vector3.h', 'vector3_psp.h') diff --git a/platform/android/audio_driver_jandroid.cpp b/platform/android/audio_driver_jandroid.cpp index e0e89e6344..415223c1da 100644 --- a/platform/android/audio_driver_jandroid.cpp +++ b/platform/android/audio_driver_jandroid.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "audio_driver_jandroid.h" -#include "globals.h" +#include "global_config.h" #include "os/os.h" #include "thread_jandroid.h" diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 8e1fda74ed..3fc822860d 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -28,12 +28,12 @@ /*************************************************************************/ #include "version.h" #include "export.h" -#include "tools/editor/editor_settings.h" -#include "tools/editor/editor_import_export.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_settings.h" +#include "editor/editor_export.h" +#include "editor/editor_node.h" #include "io/zip_io.h" #include "io/marshalls.h" -#include "globals.h" +#include "global_config.h" #include "os/file_access.h" #include "os/os.h" #include "platform/android/logo.h" @@ -1892,9 +1892,11 @@ EditorExportPlatformAndroid::~EditorExportPlatformAndroid() { memdelete(device_thread); } +#endif void register_android_exporter() { +#if 0 String exe_ext=OS::get_singleton()->get_name()=="Windows"?"exe":""; EDITOR_DEF("export/android/adb",""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"android/adb",PROPERTY_HINT_GLOBAL_FILE,exe_ext)); @@ -1913,6 +1915,6 @@ void register_android_exporter() { Ref<EditorExportPlatformAndroid> exporter = Ref<EditorExportPlatformAndroid>( memnew(EditorExportPlatformAndroid) ); EditorImportExport::get_singleton()->add_export_platform(exporter); - -} #endif +} + diff --git a/platform/android/globals/global_defaults.cpp b/platform/android/globals/global_defaults.cpp index bbf9bd5b0b..01daac9260 100644 --- a/platform/android/globals/global_defaults.cpp +++ b/platform/android/globals/global_defaults.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "global_defaults.h" -#include "globals.h" +#include "global_config.h" void register_android_global_defaults() { diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp index 3c7f7f5854..83d5a413c0 100644 --- a/platform/android/godot_android.cpp +++ b/platform/android/godot_android.cpp @@ -43,7 +43,7 @@ #include <unistd.h> #include <stdlib.h> #include "os_android.h" -#include "globals.h" +#include "global_config.h" #include "main/main.h" #define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "godot", __VA_ARGS__)) #define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "godot", __VA_ARGS__)) diff --git a/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java b/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java index 80cded6fb5..3c8207fae1 100644 --- a/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java +++ b/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java @@ -49,7 +49,6 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene // =========================================================== private final GodotView mView; private final GodotEditText mEdit; - private String mText; private String mOriginText; // =========================================================== @@ -81,52 +80,28 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene @Override public void afterTextChanged(final Editable s) { - if (this.isFullScreenEdit()) { - return; - } - //if (BuildConfig.DEBUG) { - //Log.d(TAG, "afterTextChanged: " + s); - //} - int nModified = s.length() - this.mText.length(); - if (nModified > 0) { - final String insertText = s.subSequence(this.mText.length(), s.length()).toString(); - for(int i = 0; i < insertText.length(); i++) { - int ch = insertText.codePointAt(i); - GodotLib.key(0, ch, true); - GodotLib.key(0, ch, false); - } - /* - if (BuildConfig.DEBUG) { - Log.d(TAG, "insertText(" + insertText + ")"); - } - */ - } else { - for (; nModified < 0; ++nModified) { - GodotLib.key(KeyEvent.KEYCODE_DEL, 0, true); - GodotLib.key(KeyEvent.KEYCODE_DEL, 0, false); - /* - if (BuildConfig.DEBUG) { - Log.d(TAG, "deleteBackward"); - } - */ - } - } - this.mText = s.toString(); } @Override public void beforeTextChanged(final CharSequence pCharSequence, final int start, final int count, final int after) { - /* - if (BuildConfig.DEBUG) { - Log.d(TAG, "beforeTextChanged(" + pCharSequence + ")start: " + start + ",count: " + count + ",after: " + after); + //Log.d(TAG, "beforeTextChanged(" + pCharSequence + ")start: " + start + ",count: " + count + ",after: " + after); + + for (int i=0;i<count;i++){ + GodotLib.key(KeyEvent.KEYCODE_DEL, 0, true); + GodotLib.key(KeyEvent.KEYCODE_DEL, 0, false); } - */ - this.mText = pCharSequence.toString(); } @Override public void onTextChanged(final CharSequence pCharSequence, final int start, final int before, final int count) { + //Log.d(TAG, "onTextChanged(" + pCharSequence + ")start: " + start + ",count: " + count + ",before: " + before); + + for (int i=start;i<start+count;i++){ + int ch = pCharSequence.charAt(i); + GodotLib.key(0, ch, true); + GodotLib.key(0, ch, false); + } } diff --git a/platform/android/java_class_wrapper.cpp b/platform/android/java_class_wrapper.cpp index 9acda005f1..2923ef6a91 100644 --- a/platform/android/java_class_wrapper.cpp +++ b/platform/android/java_class_wrapper.cpp @@ -562,7 +562,7 @@ JavaObject::~JavaObject(){ void JavaClassWrapper::_bind_methods() { - ClassDB::bind_method(_MD("wrap:JavaClass","name"),&JavaClassWrapper::wrap); + ClassDB::bind_method(D_METHOD("wrap:JavaClass","name"),&JavaClassWrapper::wrap); } diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index dfbb437344..41558cf86a 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -36,7 +36,7 @@ #include "file_access_android.h" #include "dir_access_jandroid.h" #include "audio_driver_jandroid.h" -#include "globals.h" +#include "global_config.h" #include "thread_jandroid.h" #include "core/os/keyboard.h" #include "java_class_wrapper.h" diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 1095689a5b..a10f27424c 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -36,7 +36,7 @@ #include "servers/visual/visual_server_wrap_mt.h" #include "main/main.h" #include "file_access_android.h" -#include "core/globals.h" +#include "core/global_config.h" #ifdef ANDROID_NATIVE_ACTIVITY #include "file_access_android.h" @@ -159,6 +159,8 @@ void OS_Android::initialize(const VideoMode& p_desired,int p_video_driver,int p_ input = memnew( InputDefault ); input->set_fallback_mapping("Default Android Gamepad"); + + power_manager = memnew( power_android ); } void OS_Android::set_main_loop( MainLoop * p_main_loop ) { diff --git a/platform/android/os_android.h b/platform/android/os_android.h index bf1db57ba5..ead3969744 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -32,6 +32,7 @@ #include "os/input.h" #include "drivers/unix/os_unix.h" #include "os/main_loop.h" +#include "power_android.h" #include "servers/physics/physics_server_sw.h" #include "servers/audio_server.h" #include "servers/physics_2d/physics_2d_server_sw.h" @@ -142,6 +143,8 @@ private: SetKeepScreenOnFunc set_keep_screen_on_func; AlertFunc alert_func; + power_android *power_manager; + public: // functions used by main to initialize/deintialize the OS diff --git a/platform/android/power_android.cpp b/platform/android/power_android.cpp new file mode 100644 index 0000000000..dc3a4ec90c --- /dev/null +++ b/platform/android/power_android.cpp @@ -0,0 +1,238 @@ +/*************************************************************************/ +/* power_android.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "core/error_macros.h" + +#include "power_android.h" + +static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder) { + if (refholder->m_env) { + JNIEnv* env = refholder->m_env; + (*env)->PopLocalFrame(env, NULL); + --s_active; + } +} + +static struct LocalReferenceHolder LocalReferenceHolder_Setup(const char *func) +{ + struct LocalReferenceHolder refholder; + refholder.m_env = NULL; + refholder.m_func = func; + return refholder; +} + +static bool LocalReferenceHolder_Init(struct LocalReferenceHolder *refholder, JNIEnv *env) +{ + const int capacity = 16; + if ((*env)->PushLocalFrame(env, capacity) < 0) { + return false; + } + ++s_active; + refholder->m_env = env; + return true; +} + + +static SDL_bool LocalReferenceHolder_IsActive(void) +{ + return s_active > 0; +} + +ANativeWindow* Android_JNI_GetNativeWindow(void) +{ + ANativeWindow* anw; + jobject s; + JNIEnv *env = Android_JNI_GetEnv(); + + s = (*env)->CallStaticObjectMethod(env, mActivityClass, midGetNativeSurface); + anw = ANativeWindow_fromSurface(env, s); + (*env)->DeleteLocalRef(env, s); + + return anw; +} + + +/* + * CODE CHUNK IMPORTED FROM SDL 2.0 + * returns 0 on success or -1 on error (others undefined then) + * returns truthy or falsy value in plugged, charged and battery + * returns the value in seconds and percent or -1 if not available + */ +int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent) +{ + env = Android_JNI_GetEnv(); + refs = LocalReferenceHolder_Setup(__FUNCTION__); + + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); + return -1; + } + mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext", "()Landroid/content/Context;"); + context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid); + action = (*env)->NewStringUTF(env, "android.intent.action.BATTERY_CHANGED"); + cls = (*env)->FindClass(env, "android/content/IntentFilter"); + mid = (*env)->GetMethodID(env, cls, "<init>", "(Ljava/lang/String;)V"); + filter = (*env)->NewObject(env, cls, mid, action); + (*env)->DeleteLocalRef(env, action); + mid = (*env)->GetMethodID(env, mActivityClass, "registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;"); + intent = (*env)->CallObjectMethod(env, context, mid, NULL, filter); + (*env)->DeleteLocalRef(env, filter); + cls = (*env)->GetObjectClass(env, intent); + imid = (*env)->GetMethodID(env, cls, "getIntExtra", "(Ljava/lang/String;I)I"); + // Watch out for C89 scoping rules because of the macro +#define GET_INT_EXTRA(var, key) \ + int var; \ + iname = (*env)->NewStringUTF(env, key); \ + var = (*env)->CallIntMethod(env, intent, imid, iname, -1); \ + (*env)->DeleteLocalRef(env, iname); + bmid = (*env)->GetMethodID(env, cls, "getBooleanExtra", "(Ljava/lang/String;Z)Z"); + // Watch out for C89 scoping rules because of the macro +#define GET_BOOL_EXTRA(var, key) \ + int var; \ + bname = (*env)->NewStringUTF(env, key); \ + var = (*env)->CallBooleanMethod(env, intent, bmid, bname, JNI_FALSE); \ + (*env)->DeleteLocalRef(env, bname); + if (plugged) { + // Watch out for C89 scoping rules because of the macro + GET_INT_EXTRA(plug, "plugged") // == BatteryManager.EXTRA_PLUGGED (API 5) + if (plug == -1) { + LocalReferenceHolder_Cleanup(&refs); + return -1; + } + // 1 == BatteryManager.BATTERY_PLUGGED_AC + // 2 == BatteryManager.BATTERY_PLUGGED_USB + *plugged = (0 < plug) ? 1 : 0; + } + if (charged) { + // Watch out for C89 scoping rules because of the macro + GET_INT_EXTRA(status, "status") // == BatteryManager.EXTRA_STATUS (API 5) + if (status == -1) { + LocalReferenceHolder_Cleanup(&refs); + return -1; + } + // 5 == BatteryManager.BATTERY_STATUS_FULL + *charged = (status == 5) ? 1 : 0; + } + if (battery) { + GET_BOOL_EXTRA(present, "present") // == BatteryManager.EXTRA_PRESENT (API 5) + *battery = present ? 1 : 0; + } + if (seconds) { + *seconds = -1; // not possible + } + if (percent) { + int level; + int scale; + // Watch out for C89 scoping rules because of the macro + { + GET_INT_EXTRA(level_temp, "level") // == BatteryManager.EXTRA_LEVEL (API 5) + level = level_temp; + } + // Watch out for C89 scoping rules because of the macro + { + GET_INT_EXTRA(scale_temp, "scale") // == BatteryManager.EXTRA_SCALE (API 5) + scale = scale_temp; + } + if ((level == -1) || (scale == -1)) { + LocalReferenceHolder_Cleanup(&refs); + return -1; + } + *percent = level * 100 / scale; + } + (*env)->DeleteLocalRef(env, intent); + LocalReferenceHolder_Cleanup(&refs); + + return 0; +} + + +bool power_android::GetPowerInfo_Android() { + int battery; + int plugged; + int charged; + + if (Android_JNI_GetPowerInfo(&plugged, &charged, &battery, &this->nsecs_left, &this->percent_left) != -1) { + if (plugged) { + if (charged) { + this->power_state = POWERSTATE_CHARGED; + } else if (battery) { + this->power_state = POWERSTATE_CHARGING; + } else { + this->power_state = POWERSTATE_NO_BATTERY; + this->nsecs_left = -1; + this->percent_left = -1; + } + } else { + this->power_state = POWERSTATE_ON_BATTERY; + } + } else { + this->power_state = POWERSTATE_UNKNOWN; + this->nsecs_left = -1; + this->percent_left = -1; + } + + return true; +} + +PowerState power_android::get_power_state() { + if (GetPowerInfo_Android()) { + return power_state; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN"); + return POWERSTATE_UNKNOWN; + } +} + +int power_android::get_power_seconds_left() { + if (GetPowerInfo_Android()) { + return nsecs_left; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to -1"); + return -1; + } +} + +int power_android::get_power_percent_left() { + if (GetPowerInfo_Android()) { + return percent_left; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to -1"); + return -1; + } +} + +power_android::power_android() : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) { + +} + +power_android::~power_android() { +} diff --git a/platform/android/power_android.h b/platform/android/power_android.h new file mode 100644 index 0000000000..c59bdf3888 --- /dev/null +++ b/platform/android/power_android.h @@ -0,0 +1,82 @@ +/*************************************************************************/ +/* power_android.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 PLATFORM_ANDROID_POWER_ANDROID_H_ +#define PLATFORM_ANDROID_POWER_ANDROID_H_ + +#include "os/power.h" +#include <android/native_window_jni.h> + +class power_android { + +struct LocalReferenceHolder +{ + JNIEnv *m_env; + const char *m_func; +}; + +private: + static struct LocalReferenceHolder refs; + static JNIEnv* env; + static jmethodID mid; + static jobject context; + static jstring action; + static jclass cls; + static jobject filter; + static jobject intent; + static jstring iname; + static jmethodID imid; + static jstring bname; + static jmethodID bmid; + + + int nsecs_left; + int percent_left; + PowerState power_state; + + bool GetPowerInfo_Android(); + bool UpdatePowerInfo(); + +public: + + static int s_active; + + + power_android(); + virtual ~power_android(); + static bool LocalReferenceHolder_Init(struct LocalReferenceHolder *refholder, JNIEnv *env); + static struct LocalReferenceHolder LocalReferenceHolder_Setup(const char *func); + static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder); + + PowerState get_power_state(); + int get_power_seconds_left(); + int get_power_percent_left(); +}; + +#endif /* PLATFORM_ANDROID_POWER_ANDROID_H_ */ diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp index 3e6dadb094..cf8e2fcc0a 100644 --- a/platform/bb10/export/export.cpp +++ b/platform/bb10/export/export.cpp @@ -28,12 +28,12 @@ /*************************************************************************/ #include "version.h" #include "export.h" -#include "tools/editor/editor_settings.h" -#include "tools/editor/editor_import_export.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_settings.h" +#include "editor/editor_export.h" +#include "editor/editor_node.h" #include "io/zip_io.h" #include "io/marshalls.h" -#include "globals.h" +#include "global_config.h" #include "os/file_access.h" #include "os/os.h" #include "platform/bb10/logo.h" @@ -803,9 +803,9 @@ EditorExportPlatformBB10::~EditorExportPlatformBB10() { memdelete(device_thread); } - +#endif void register_bb10_exporter() { - +#if 0 EDITOR_DEF("export/blackberry/host_tools",""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"export/blackberry/host_tools",PROPERTY_HINT_GLOBAL_DIR)); EDITOR_DEF("export/blackberry/debug_token",""); @@ -824,7 +824,7 @@ void register_bb10_exporter() { Ref<EditorExportPlatformBB10> exporter = Ref<EditorExportPlatformBB10>( memnew(EditorExportPlatformBB10) ); EditorImportExport::get_singleton()->add_export_platform(exporter); - +#endif } -#endif + diff --git a/platform/bb10/os_bb10.cpp b/platform/bb10/os_bb10.cpp index c51f1c6092..bf7bfb6909 100644 --- a/platform/bb10/os_bb10.cpp +++ b/platform/bb10/os_bb10.cpp @@ -31,7 +31,7 @@ #include "drivers/gles2/rasterizer_gles2.h" #include "servers/visual/visual_server_raster.h" #include "core/os/dir_access.h" -#include "core/globals.h" +#include "core/global_config.h" #include "main/main.h" #include "bbutil.h" #include "core/os/keyboard.h" @@ -146,6 +146,8 @@ void OSBB10::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi physics_2d_server->init(); input = memnew( InputDefault ); + + power_manager = memnew( PowerBB10 ); #ifdef PAYMENT_SERVICE_ENABLED payment_service = memnew(PaymentService); @@ -587,6 +589,18 @@ Size2 OSBB10::get_window_size() const { return Vector2(default_videomode.width, default_videomode.height); } +PowerState OSBB10::get_power_state() { + return power_manager->get_power_state(); +} + +int OSBB10::get_power_seconds_left() { + return power_manager->get_power_seconds_left(); +} + +int OSBB10::get_power_percent_left() { + return power_manager->get_power_percent_left(); +} + OSBB10::OSBB10() { main_loop=NULL; diff --git a/platform/bb10/os_bb10.h b/platform/bb10/os_bb10.h index 9cf2091d49..678b8c9fc2 100644 --- a/platform/bb10/os_bb10.h +++ b/platform/bb10/os_bb10.h @@ -39,6 +39,7 @@ #include "servers/visual/rasterizer.h" #include "audio_driver_bb10.h" #include "payment_service.h" +#include "power_bb10.h" #include <screen/screen.h> #include <sys/platform.h> @@ -58,6 +59,7 @@ class OSBB10 : public OS_Unix { PhysicsServer *physics_server; Physics2DServer *physics_2d_server; AudioDriverBB10* audio_driver; + PowerBB10 *power_manager; #ifdef PAYMENT_SERVICE_ENABLED PaymentService* payment_service; @@ -142,6 +144,10 @@ public: void run(); + virtual PowerState get_power_state(); + virtual int get_power_seconds_left(); + virtual int get_power_percent_left(); + OSBB10(); ~OSBB10(); diff --git a/platform/bb10/payment_service.cpp b/platform/bb10/payment_service.cpp index 3138dc2c1d..131c9712a5 100644 --- a/platform/bb10/payment_service.cpp +++ b/platform/bb10/payment_service.cpp @@ -38,11 +38,11 @@ extern char* launch_dir_ptr; void PaymentService::_bind_methods() { - ClassDB::bind_method(_MD("request_product_info"),&PaymentService::request_product_info); - ClassDB::bind_method(_MD("purchase"),&PaymentService::purchase); + ClassDB::bind_method(D_METHOD("request_product_info"),&PaymentService::request_product_info); + ClassDB::bind_method(D_METHOD("purchase"),&PaymentService::purchase); - ClassDB::bind_method(_MD("get_pending_event_count"),&PaymentService::get_pending_event_count); - ClassDB::bind_method(_MD("pop_pending_event"),&PaymentService::pop_pending_event); + ClassDB::bind_method(D_METHOD("get_pending_event_count"),&PaymentService::get_pending_event_count); + ClassDB::bind_method(D_METHOD("pop_pending_event"),&PaymentService::pop_pending_event); }; Error PaymentService::request_product_info(Variant p_params) { diff --git a/platform/bb10/power_bb10.cpp b/platform/bb10/power_bb10.cpp new file mode 100644 index 0000000000..5cd84d6246 --- /dev/null +++ b/platform/bb10/power_bb10.cpp @@ -0,0 +1,76 @@ +/*************************************************************************/ +/* power_bb10.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "power_bb10.h" + +#include "core/error_macros.h" + + +bool PowerBB10::UpdatePowerInfo() { + + return false; +} + +PowerState PowerBB10::get_power_state() { + if (UpdatePowerInfo()) { + return power_state; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN"); + return POWERSTATE_UNKNOWN; + } +} + +int PowerBB10::get_power_seconds_left() { + if (UpdatePowerInfo()) { + return nsecs_left; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to -1"); + return -1; + } +} + +int PowerBB10::get_power_percent_left() { + if (UpdatePowerInfo()) { + return percent_left; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to -1"); + return -1; + } +} + +PowerBB10::PowerBB10() : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) { + +} + +PowerBB10::~PowerBB10() { +} + diff --git a/platform/bb10/power_bb10.h b/platform/bb10/power_bb10.h new file mode 100644 index 0000000000..0e6eb53d03 --- /dev/null +++ b/platform/bb10/power_bb10.h @@ -0,0 +1,49 @@ +/*************************************************************************/ +/* power_bb10.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 PLATFORM_BB10_POWER_BB10_H_ +#define PLATFORM_BB10_POWER_BB10_H_ + +class PowerBB10 { +private: + int nsecs_left; + int percent_left; + PowerState power_state; + + bool UpdatePowerInfo(); +public: + PowerBB10(); + virtual ~PowerBB10(); + + PowerState get_power_state(); + int get_power_seconds_left(); + int get_power_percent_left(); +}; + +#endif /* PLATFORM_BB10_POWER_BB10_H_ */ diff --git a/platform/haiku/audio_driver_media_kit.cpp b/platform/haiku/audio_driver_media_kit.cpp index c6afe7a261..bd485214c8 100644 --- a/platform/haiku/audio_driver_media_kit.cpp +++ b/platform/haiku/audio_driver_media_kit.cpp @@ -30,7 +30,7 @@ #ifdef MEDIA_KIT_ENABLED -#include "globals.h" +#include "global_config.h" int32_t* AudioDriverMediaKit::samples_in = NULL; diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index 9f218aeff4..b9b95ddacd 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -143,6 +143,8 @@ void OS_Haiku::initialize(const VideoMode& p_desired, int p_video_driver, int p_ if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) { ERR_PRINT("Initializing audio failed."); } + + power_manager = memnew( PowerHaiku ); } void OS_Haiku::finalize() { diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h index 531c7a56c3..2c84e95ac3 100644 --- a/platform/haiku/os_haiku.h +++ b/platform/haiku/os_haiku.h @@ -40,6 +40,7 @@ #include "context_gl_haiku.h" #include "haiku_application.h" #include "haiku_direct_window.h" +#include "power_haiku.h" class OS_Haiku : public OS_Unix { @@ -53,6 +54,7 @@ private: VideoMode current_video_mode; PhysicsServer* physics_server; Physics2DServer* physics_2d_server; + PowerHaiku* power_manager; #ifdef MEDIA_KIT_ENABLED AudioDriverMediaKit driver_media_kit; @@ -114,6 +116,10 @@ public: virtual VideoMode get_video_mode(int p_screen=0) const; virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen=0) const; virtual String get_executable_path() const; + + virtual PowerState get_power_state(); + virtual int get_power_seconds_left(); + virtual int get_power_percent_left(); }; #endif diff --git a/platform/haiku/power_haiku.cpp b/platform/haiku/power_haiku.cpp new file mode 100644 index 0000000000..6a54c7b360 --- /dev/null +++ b/platform/haiku/power_haiku.cpp @@ -0,0 +1,74 @@ +/*************************************************************************/ +/* power_haiku.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "core/error_macros.h" + +#include "power_haiku.h" + +bool PowerHaiku::UpdatePowerInfo() { + + return false; +} + +PowerState PowerHaiku::get_power_state() { + if (UpdatePowerInfo()) { + return power_state; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN"); + return POWERSTATE_UNKNOWN; + } +} + +int PowerX11::get_power_seconds_left() { + if (UpdatePowerInfo()) { + return nsecs_left; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to -1"); + return -1; + } +} + +int PowerX11::get_power_percent_left() { + if (UpdatePowerInfo()) { + return percent_left; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to -1"); + return -1; + } +} + +PowerHaiku::PowerHaiku() : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) { + +} + +PowerHaiku::~PowerHaiku() { +} diff --git a/platform/haiku/power_haiku.h b/platform/haiku/power_haiku.h new file mode 100644 index 0000000000..b46cfa3454 --- /dev/null +++ b/platform/haiku/power_haiku.h @@ -0,0 +1,49 @@ +/*************************************************************************/ +/* power_haiku.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 PLATFORM_HAIKU_POWER_HAIKU_H_ +#define PLATFORM_HAIKU_POWER_HAIKU_H_ + +class PowerHaiku { +private: + int nsecs_left; + int percent_left; + PowerState power_state; + + bool UpdatePowerInfo(); +public: + PowerHaiku(); + virtual ~PowerHaiku(); + + PowerState get_power_state(); + int get_power_seconds_left(); + int get_power_percent_left(); +}; + +#endif /* PLATFORM_HAIKU_POWER_HAIKU_H_ */ diff --git a/platform/iphone/Appirater.h b/platform/iphone/Appirater.h deleted file mode 100644 index 96dd30e7c7..0000000000 --- a/platform/iphone/Appirater.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - This file is part of Appirater. - - Copyright (c) 2010, Arash Payan - All rights reserved. - - 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. - */ -/* - * Appirater.h - * appirater - * - * Created by Arash Payan on 9/5/09. - * http://arashpayan.com - * Copyright 2010 Arash Payan. All rights reserved. - */ - -#import <Foundation/Foundation.h> -#import <UIKit/UIKit.h> - -extern NSString *const kAppiraterFirstUseDate; -extern NSString *const kAppiraterUseCount; -extern NSString *const kAppiraterSignificantEventCount; -extern NSString *const kAppiraterCurrentVersion; -extern NSString *const kAppiraterRatedCurrentVersion; -extern NSString *const kAppiraterDeclinedToRate; - -/* - Place your Apple generated software id here. - */ -#define APPIRATER_APP_ID 301377083 - -/* - Your app's name. - */ -#define APPIRATER_APP_NAME [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey] - -/* - This is the message your users will see once they've passed the day+launches - threshold. - */ -#define APPIRATER_MESSAGE [NSString stringWithFormat:@"If you enjoy using %@, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!", APPIRATER_APP_NAME] - -/* - This is the title of the message alert that users will see. - */ -#define APPIRATER_MESSAGE_TITLE [NSString stringWithFormat:@"Rate %@", APPIRATER_APP_NAME] - -/* - The text of the button that rejects reviewing the app. - */ -#define APPIRATER_CANCEL_BUTTON @"No, Thanks" - -/* - Text of button that will send user to app review page. - */ -#define APPIRATER_RATE_BUTTON [NSString stringWithFormat:@"Rate %@", APPIRATER_APP_NAME] - -/* - Text for button to remind the user to review later. - */ -#define APPIRATER_RATE_LATER @"Remind me later" - -/* - Users will need to have the same version of your app installed for this many - days before they will be prompted to rate it. - */ -#define APPIRATER_DAYS_UNTIL_PROMPT 30 // double - -/* - An example of a 'use' would be if the user launched the app. Bringing the app - into the foreground (on devices that support it) would also be considered - a 'use'. You tell Appirater about these events using the two methods: - [Appirater appLaunched:] - [Appirater appEnteredForeground:] - - Users need to 'use' the same version of the app this many times before - before they will be prompted to rate it. - */ -#define APPIRATER_USES_UNTIL_PROMPT 20 // integer - -/* - A significant event can be anything you want to be in your app. In a - telephone app, a significant event might be placing or receiving a call. - In a game, it might be beating a level or a boss. This is just another - layer of filtering that can be used to make sure that only the most - loyal of your users are being prompted to rate you on the app store. - If you leave this at a value of -1, then this won't be a criteria - used for rating. To tell Appirater that the user has performed - a significant event, call the method: - [Appirater userDidSignificantEvent:]; - */ -#define APPIRATER_SIG_EVENTS_UNTIL_PROMPT -1 // integer - -/* - Once the rating alert is presented to the user, they might select - 'Remind me later'. This value specifies how long (in days) Appirater - will wait before reminding them. - */ -#define APPIRATER_TIME_BEFORE_REMINDING 1 // double - -/* - 'YES' will show the Appirater alert everytime. Useful for testing how your message - looks and making sure the link to your app's review page works. - */ -#define APPIRATER_DEBUG NO - -@interface Appirater : NSObject <UIAlertViewDelegate> { - - UIAlertView *ratingAlert; -} - -@property(nonatomic, retain) UIAlertView *ratingAlert; - -/* - DEPRECATED: While still functional, it's better to use - appLaunched:(BOOL)canPromptForRating instead. - - Calls [Appirater appLaunched:YES]. See appLaunched: for details of functionality. - */ -+ (void)appLaunched:(int)p_app_id; - -/* - Tells Appirater that the app has launched, and on devices that do NOT - support multitasking, the 'uses' count will be incremented. You should - call this method at the end of your application delegate's - application:didFinishLaunchingWithOptions: method. - - If the app has been used enough to be rated (and enough significant events), - you can suppress the rating alert - by passing NO for canPromptForRating. The rating alert will simply be postponed - until it is called again with YES for canPromptForRating. The rating alert - can also be triggered by appEnteredForeground: and userDidSignificantEvent: - (as long as you pass YES for canPromptForRating in those methods). - */ -+ (void)appLaunched:(BOOL)canPromptForRating app_id:(int)p_app_id; - -/* - Tells Appirater that the app was brought to the foreground on multitasking - devices. You should call this method from the application delegate's - applicationWillEnterForeground: method. - - If the app has been used enough to be rated (and enough significant events), - you can suppress the rating alert - by passing NO for canPromptForRating. The rating alert will simply be postponed - until it is called again with YES for canPromptForRating. The rating alert - can also be triggered by appLaunched: and userDidSignificantEvent: - (as long as you pass YES for canPromptForRating in those methods). - */ -+ (void)appEnteredForeground:(BOOL)canPromptForRating; - -/* - Tells Appirater that the user performed a significant event. A significant - event is whatever you want it to be. If you're app is used to make VoIP - calls, then you might want to call this method whenever the user places - a call. If it's a game, you might want to call this whenever the user - beats a level boss. - - If the user has performed enough significant events and used the app enough, - you can suppress the rating alert by passing NO for canPromptForRating. The - rating alert will simply be postponed until it is called again with YES for - canPromptForRating. The rating alert can also be triggered by appLaunched: - and appEnteredForeground: (as long as you pass YES for canPromptForRating - in those methods). - */ -+ (void)userDidSignificantEvent:(BOOL)canPromptForRating; - -/* - Tells Appirater to open the App Store page where the user can specify a - rating for the app. Also records the fact that this has happened, so the - user won't be prompted again to rate the app. - - The only case where you should call this directly is if your app has an - explicit "Rate this app" command somewhere. In all other cases, don't worry - about calling this -- instead, just call the other functions listed above, - and let Appirater handle the bookkeeping of deciding when to ask the user - whether to rate the app. - */ -+ (void)rateApp; - -@end diff --git a/platform/iphone/Appirater.m b/platform/iphone/Appirater.m deleted file mode 100644 index 951b892032..0000000000 --- a/platform/iphone/Appirater.m +++ /dev/null @@ -1,732 +0,0 @@ -/* - This file is part of Appirater. - - Copyright (c) 2012, Arash Payan - All rights reserved. - - 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. - */ -/* - * Appirater.m - * appirater - * - * Created by Arash Payan on 9/5/09. - * http://arashpayan.com - * Copyright 2012 Arash Payan. All rights reserved. - */ - -#import "Appirater.h" -#import <SystemConfiguration/SCNetworkReachability.h> -#include <netinet/in.h> - -#if ! __has_feature(objc_arc) -#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). -#endif - -NSString *const kAppiraterFirstUseDate = @"kAppiraterFirstUseDate"; -NSString *const kAppiraterUseCount = @"kAppiraterUseCount"; -NSString *const kAppiraterSignificantEventCount = @"kAppiraterSignificantEventCount"; -NSString *const kAppiraterCurrentVersion = @"kAppiraterCurrentVersion"; -NSString *const kAppiraterRatedCurrentVersion = @"kAppiraterRatedCurrentVersion"; -NSString *const kAppiraterDeclinedToRate = @"kAppiraterDeclinedToRate"; -NSString *const kAppiraterReminderRequestDate = @"kAppiraterReminderRequestDate"; - -NSString *templateReviewURL = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID"; -NSString *templateReviewURLiOS7 = @"itms-apps://itunes.apple.com/app/idAPP_ID"; -NSString *templateReviewURLiOS8 = @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=APP_ID&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software"; - -static NSString *_appId; -static double _daysUntilPrompt = 30; -static NSInteger _usesUntilPrompt = 20; -static NSInteger _significantEventsUntilPrompt = -1; -static double _timeBeforeReminding = 1; -static BOOL _debug = NO; -#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 - static id<AppiraterDelegate> _delegate; -#else - __weak static id<AppiraterDelegate> _delegate; -#endif -static BOOL _usesAnimation = TRUE; -static UIStatusBarStyle _statusBarStyle; -static BOOL _modalOpen = false; -static BOOL _alwaysUseMainBundle = NO; - -@interface Appirater () -@property (nonatomic, copy) NSString *alertTitle; -@property (nonatomic, copy) NSString *alertMessage; -@property (nonatomic, copy) NSString *alertCancelTitle; -@property (nonatomic, copy) NSString *alertRateTitle; -@property (nonatomic, copy) NSString *alertRateLaterTitle; -- (BOOL)connectedToNetwork; -+ (Appirater*)sharedInstance; -- (void)showPromptWithChecks:(BOOL)withChecks - displayRateLaterButton:(BOOL)displayRateLaterButton; -- (void)showRatingAlert:(BOOL)displayRateLaterButton; -- (void)showRatingAlert; -- (BOOL)ratingAlertIsAppropriate; -- (BOOL)ratingConditionsHaveBeenMet; -- (void)incrementUseCount; -- (void)hideRatingAlert; -@end - -@implementation Appirater - -@synthesize ratingAlert; - -+ (void) setAppId:(NSString *)appId { - _appId = appId; -} - -+ (void) setDaysUntilPrompt:(double)value { - _daysUntilPrompt = value; -} - -+ (void) setUsesUntilPrompt:(NSInteger)value { - _usesUntilPrompt = value; -} - -+ (void) setSignificantEventsUntilPrompt:(NSInteger)value { - _significantEventsUntilPrompt = value; -} - -+ (void) setTimeBeforeReminding:(double)value { - _timeBeforeReminding = value; -} - -+ (void) setCustomAlertTitle:(NSString *)title -{ - [self sharedInstance].alertTitle = title; -} - -+ (void) setCustomAlertMessage:(NSString *)message -{ - [self sharedInstance].alertMessage = message; -} - -+ (void) setCustomAlertCancelButtonTitle:(NSString *)cancelTitle -{ - [self sharedInstance].alertCancelTitle = cancelTitle; -} - -+ (void) setCustomAlertRateButtonTitle:(NSString *)rateTitle -{ - [self sharedInstance].alertRateTitle = rateTitle; -} - -+ (void) setCustomAlertRateLaterButtonTitle:(NSString *)rateLaterTitle -{ - [self sharedInstance].alertRateLaterTitle = rateLaterTitle; -} - -+ (void) setDebug:(BOOL)debug { - _debug = debug; -} -+ (void)setDelegate:(id<AppiraterDelegate>)delegate{ - _delegate = delegate; -} -+ (void)setUsesAnimation:(BOOL)animation { - _usesAnimation = animation; -} -+ (void)setOpenInAppStore:(BOOL)openInAppStore { - [Appirater sharedInstance].openInAppStore = openInAppStore; -} -+ (void)setStatusBarStyle:(UIStatusBarStyle)style { - _statusBarStyle = style; -} -+ (void)setModalOpen:(BOOL)open { - _modalOpen = open; -} -+ (void)setAlwaysUseMainBundle:(BOOL)alwaysUseMainBundle { - _alwaysUseMainBundle = alwaysUseMainBundle; -} - -+ (NSBundle *)bundle -{ - NSBundle *bundle; - - if (_alwaysUseMainBundle) { - bundle = [NSBundle mainBundle]; - } else { - NSURL *appiraterBundleURL = [[NSBundle mainBundle] URLForResource:@"Appirater" withExtension:@"bundle"]; - - if (appiraterBundleURL) { - // Appirater.bundle will likely only exist when used via CocoaPods - bundle = [NSBundle bundleWithURL:appiraterBundleURL]; - } else { - bundle = [NSBundle mainBundle]; - } - } - - return bundle; -} - -- (NSString *)alertTitle -{ - return _alertTitle ? _alertTitle : APPIRATER_MESSAGE_TITLE; -} - -- (NSString *)alertMessage -{ - return _alertMessage ? _alertMessage : APPIRATER_MESSAGE; -} - -- (NSString *)alertCancelTitle -{ - return _alertCancelTitle ? _alertCancelTitle : APPIRATER_CANCEL_BUTTON; -} - -- (NSString *)alertRateTitle -{ - return _alertRateTitle ? _alertRateTitle : APPIRATER_RATE_BUTTON; -} - -- (NSString *)alertRateLaterTitle -{ - return _alertRateLaterTitle ? _alertRateLaterTitle : APPIRATER_RATE_LATER; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (id)init { - self = [super init]; - if (self) { - if ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0) { - self.openInAppStore = YES; - } else { - self.openInAppStore = NO; - } - } - - return self; -} - -- (BOOL)connectedToNetwork { - // Create zero addy - struct sockaddr_in zeroAddress; - bzero(&zeroAddress, sizeof(zeroAddress)); - zeroAddress.sin_len = sizeof(zeroAddress); - zeroAddress.sin_family = AF_INET; - - // Recover reachability flags - SCNetworkReachabilityRef defaultRouteReachability = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&zeroAddress); - SCNetworkReachabilityFlags flags; - - Boolean didRetrieveFlags = SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags); - CFRelease(defaultRouteReachability); - - if (!didRetrieveFlags) - { - NSLog(@"Error. Could not recover network reachability flags"); - return NO; - } - - BOOL isReachable = flags & kSCNetworkFlagsReachable; - BOOL needsConnection = flags & kSCNetworkFlagsConnectionRequired; - BOOL nonWiFi = flags & kSCNetworkReachabilityFlagsTransientConnection; - - NSURL *testURL = [NSURL URLWithString:@"http://www.apple.com/"]; - NSURLRequest *testRequest = [NSURLRequest requestWithURL:testURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0]; - NSURLConnection *testConnection = [[NSURLConnection alloc] initWithRequest:testRequest delegate:self]; - - return ((isReachable && !needsConnection) || nonWiFi) ? (testConnection ? YES : NO) : NO; -} - -+ (Appirater*)sharedInstance { - static Appirater *appirater = nil; - if (appirater == nil) - { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - appirater = [[Appirater alloc] init]; - appirater.delegate = _delegate; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillResignActive) name: - UIApplicationWillResignActiveNotification object:nil]; - }); - } - - return appirater; -} - -- (void)showRatingAlert:(BOOL)displayRateLaterButton { - UIAlertView *alertView = nil; - id <AppiraterDelegate> delegate = _delegate; - - if(delegate && [delegate respondsToSelector:@selector(appiraterShouldDisplayAlert:)] && ![delegate appiraterShouldDisplayAlert:self]) { - return; - } - - if (displayRateLaterButton) { - alertView = [[UIAlertView alloc] initWithTitle:self.alertTitle - message:self.alertMessage - delegate:self - cancelButtonTitle:self.alertCancelTitle - otherButtonTitles:self.alertRateTitle, self.alertRateLaterTitle, nil]; - } else { - alertView = [[UIAlertView alloc] initWithTitle:self.alertTitle - message:self.alertMessage - delegate:self - cancelButtonTitle:self.alertCancelTitle - otherButtonTitles:self.alertRateTitle, nil]; - } - - self.ratingAlert = alertView; - [alertView show]; - - if (delegate && [delegate respondsToSelector:@selector(appiraterDidDisplayAlert:)]) { - [delegate appiraterDidDisplayAlert:self]; - } -} - -- (void)showRatingAlert -{ - [self showRatingAlert:true]; -} - -// is this an ok time to show the alert? (regardless of whether the rating conditions have been met) -// -// things checked here: -// * connectivity with network -// * whether user has rated before -// * whether user has declined to rate -// * whether rating alert is currently showing visibly -// things NOT checked here: -// * time since first launch -// * number of uses of app -// * number of significant events -// * time since last reminder -- (BOOL)ratingAlertIsAppropriate { - return ([self connectedToNetwork] - && ![self userHasDeclinedToRate] - && !self.ratingAlert.visible - && ![self userHasRatedCurrentVersion]); -} - -// have the rating conditions been met/earned? (regardless of whether this would be a moment when it's appropriate to show a new rating alert) -// -// things checked here: -// * time since first launch -// * number of uses of app -// * number of significant events -// * time since last reminder -// things NOT checked here: -// * connectivity with network -// * whether user has rated before -// * whether user has declined to rate -// * whether rating alert is currently showing visibly -- (BOOL)ratingConditionsHaveBeenMet { - if (_debug) - return YES; - - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - - NSDate *dateOfFirstLaunch = [NSDate dateWithTimeIntervalSince1970:[userDefaults doubleForKey:kAppiraterFirstUseDate]]; - NSTimeInterval timeSinceFirstLaunch = [[NSDate date] timeIntervalSinceDate:dateOfFirstLaunch]; - NSTimeInterval timeUntilRate = 60 * 60 * 24 * _daysUntilPrompt; - if (timeSinceFirstLaunch < timeUntilRate) - return NO; - - // check if the app has been used enough - NSInteger useCount = [userDefaults integerForKey:kAppiraterUseCount]; - if (useCount < _usesUntilPrompt) - return NO; - - // check if the user has done enough significant events - NSInteger sigEventCount = [userDefaults integerForKey:kAppiraterSignificantEventCount]; - if (sigEventCount < _significantEventsUntilPrompt) - return NO; - - // if the user wanted to be reminded later, has enough time passed? - NSDate *reminderRequestDate = [NSDate dateWithTimeIntervalSince1970:[userDefaults doubleForKey:kAppiraterReminderRequestDate]]; - NSTimeInterval timeSinceReminderRequest = [[NSDate date] timeIntervalSinceDate:reminderRequestDate]; - NSTimeInterval timeUntilReminder = 60 * 60 * 24 * _timeBeforeReminding; - if (timeSinceReminderRequest < timeUntilReminder) - return NO; - - return YES; -} - -- (void)incrementUseCount { - // get the app's version - NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey]; - - // get the version number that we've been tracking - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - NSString *trackingVersion = [userDefaults stringForKey:kAppiraterCurrentVersion]; - if (trackingVersion == nil) - { - trackingVersion = version; - [userDefaults setObject:version forKey:kAppiraterCurrentVersion]; - } - - if (_debug) - NSLog(@"APPIRATER Tracking version: %@", trackingVersion); - - if ([trackingVersion isEqualToString:version]) - { - // check if the first use date has been set. if not, set it. - NSTimeInterval timeInterval = [userDefaults doubleForKey:kAppiraterFirstUseDate]; - if (timeInterval == 0) - { - timeInterval = [[NSDate date] timeIntervalSince1970]; - [userDefaults setDouble:timeInterval forKey:kAppiraterFirstUseDate]; - } - - // increment the use count - NSInteger useCount = [userDefaults integerForKey:kAppiraterUseCount]; - useCount++; - [userDefaults setInteger:useCount forKey:kAppiraterUseCount]; - if (_debug) - NSLog(@"APPIRATER Use count: %@", @(useCount)); - } - else - { - // it's a new version of the app, so restart tracking - [userDefaults setObject:version forKey:kAppiraterCurrentVersion]; - [userDefaults setDouble:[[NSDate date] timeIntervalSince1970] forKey:kAppiraterFirstUseDate]; - [userDefaults setInteger:1 forKey:kAppiraterUseCount]; - [userDefaults setInteger:0 forKey:kAppiraterSignificantEventCount]; - [userDefaults setBool:NO forKey:kAppiraterRatedCurrentVersion]; - [userDefaults setBool:NO forKey:kAppiraterDeclinedToRate]; - [userDefaults setDouble:0 forKey:kAppiraterReminderRequestDate]; - } - - [userDefaults synchronize]; -} - -- (void)incrementSignificantEventCount { - // get the app's version - NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey]; - - // get the version number that we've been tracking - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - NSString *trackingVersion = [userDefaults stringForKey:kAppiraterCurrentVersion]; - if (trackingVersion == nil) - { - trackingVersion = version; - [userDefaults setObject:version forKey:kAppiraterCurrentVersion]; - } - - if (_debug) - NSLog(@"APPIRATER Tracking version: %@", trackingVersion); - - if ([trackingVersion isEqualToString:version]) - { - // check if the first use date has been set. if not, set it. - NSTimeInterval timeInterval = [userDefaults doubleForKey:kAppiraterFirstUseDate]; - if (timeInterval == 0) - { - timeInterval = [[NSDate date] timeIntervalSince1970]; - [userDefaults setDouble:timeInterval forKey:kAppiraterFirstUseDate]; - } - - // increment the significant event count - NSInteger sigEventCount = [userDefaults integerForKey:kAppiraterSignificantEventCount]; - sigEventCount++; - [userDefaults setInteger:sigEventCount forKey:kAppiraterSignificantEventCount]; - if (_debug) - NSLog(@"APPIRATER Significant event count: %@", @(sigEventCount)); - } - else - { - // it's a new version of the app, so restart tracking - [userDefaults setObject:version forKey:kAppiraterCurrentVersion]; - [userDefaults setDouble:0 forKey:kAppiraterFirstUseDate]; - [userDefaults setInteger:0 forKey:kAppiraterUseCount]; - [userDefaults setInteger:1 forKey:kAppiraterSignificantEventCount]; - [userDefaults setBool:NO forKey:kAppiraterRatedCurrentVersion]; - [userDefaults setBool:NO forKey:kAppiraterDeclinedToRate]; - [userDefaults setDouble:0 forKey:kAppiraterReminderRequestDate]; - } - - [userDefaults synchronize]; -} - -- (void)incrementAndRate:(BOOL)canPromptForRating { - [self incrementUseCount]; - - if (canPromptForRating && - [self ratingConditionsHaveBeenMet] && - [self ratingAlertIsAppropriate]) - { - dispatch_async(dispatch_get_main_queue(), - ^{ - [self showRatingAlert]; - }); - } -} - -- (void)incrementSignificantEventAndRate:(BOOL)canPromptForRating { - [self incrementSignificantEventCount]; - - if (canPromptForRating && - [self ratingConditionsHaveBeenMet] && - [self ratingAlertIsAppropriate]) - { - dispatch_async(dispatch_get_main_queue(), - ^{ - [self showRatingAlert]; - }); - } -} - -- (BOOL)userHasDeclinedToRate { - return [[NSUserDefaults standardUserDefaults] boolForKey:kAppiraterDeclinedToRate]; -} - -- (BOOL)userHasRatedCurrentVersion { - return [[NSUserDefaults standardUserDefaults] boolForKey:kAppiraterRatedCurrentVersion]; -} - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-implementations" -+ (void)appLaunched { - [Appirater appLaunched:YES]; -} -#pragma GCC diagnostic pop - -+ (void)appLaunched:(BOOL)canPromptForRating { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), - ^{ - Appirater *a = [Appirater sharedInstance]; - if (_debug) { - dispatch_async(dispatch_get_main_queue(), - ^{ - [a showRatingAlert]; - }); - } else { - [a incrementAndRate:canPromptForRating]; - } - }); -} - -- (void)hideRatingAlert { - if (self.ratingAlert.visible) { - if (_debug) - NSLog(@"APPIRATER Hiding Alert"); - [self.ratingAlert dismissWithClickedButtonIndex:-1 animated:NO]; - } -} - -+ (void)appWillResignActive { - if (_debug) - NSLog(@"APPIRATER appWillResignActive"); - [[Appirater sharedInstance] hideRatingAlert]; -} - -+ (void)appEnteredForeground:(BOOL)canPromptForRating { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), - ^{ - [[Appirater sharedInstance] incrementAndRate:canPromptForRating]; - }); -} - -+ (void)userDidSignificantEvent:(BOOL)canPromptForRating { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), - ^{ - [[Appirater sharedInstance] incrementSignificantEventAndRate:canPromptForRating]; - }); -} - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-implementations" -+ (void)showPrompt { - [Appirater tryToShowPrompt]; -} -#pragma GCC diagnostic pop - -+ (void)tryToShowPrompt { - [[Appirater sharedInstance] showPromptWithChecks:true - displayRateLaterButton:true]; -} - -+ (void)forceShowPrompt:(BOOL)displayRateLaterButton { - [[Appirater sharedInstance] showPromptWithChecks:false - displayRateLaterButton:displayRateLaterButton]; -} - -- (void)showPromptWithChecks:(BOOL)withChecks - displayRateLaterButton:(BOOL)displayRateLaterButton { - if (withChecks == NO || [self ratingAlertIsAppropriate]) { - [self showRatingAlert:displayRateLaterButton]; - } -} - -+ (id)getRootViewController { - UIWindow *window = [[UIApplication sharedApplication] keyWindow]; - if (window.windowLevel != UIWindowLevelNormal) { - NSArray *windows = [[UIApplication sharedApplication] windows]; - for(window in windows) { - if (window.windowLevel == UIWindowLevelNormal) { - break; - } - } - } - - return [Appirater iterateSubViewsForViewController:window]; // iOS 8+ deep traverse -} - -+ (id)iterateSubViewsForViewController:(UIView *) parentView { - for (UIView *subView in [parentView subviews]) { - UIResponder *responder = [subView nextResponder]; - if([responder isKindOfClass:[UIViewController class]]) { - return [self topMostViewController: (UIViewController *) responder]; - } - id found = [Appirater iterateSubViewsForViewController:subView]; - if( nil != found) { - return found; - } - } - return nil; -} - -+ (UIViewController *) topMostViewController: (UIViewController *) controller { - BOOL isPresenting = NO; - do { - // this path is called only on iOS 6+, so -presentedViewController is fine here. - UIViewController *presented = [controller presentedViewController]; - isPresenting = presented != nil; - if(presented != nil) { - controller = presented; - } - - } while (isPresenting); - - return controller; -} - -+ (void)rateApp { - - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - [userDefaults setBool:YES forKey:kAppiraterRatedCurrentVersion]; - [userDefaults synchronize]; - - //Use the in-app StoreKit view if available (iOS 6) and imported. This works in the simulator. - if (![Appirater sharedInstance].openInAppStore && NSStringFromClass([SKStoreProductViewController class]) != nil) { - - SKStoreProductViewController *storeViewController = [[SKStoreProductViewController alloc] init]; - NSNumber *appId = [NSNumber numberWithInteger:_appId.integerValue]; - [storeViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier:appId} completionBlock:nil]; - storeViewController.delegate = self.sharedInstance; - - id <AppiraterDelegate> delegate = self.sharedInstance.delegate; - if ([delegate respondsToSelector:@selector(appiraterWillPresentModalView:animated:)]) { - [delegate appiraterWillPresentModalView:self.sharedInstance animated:_usesAnimation]; - } - [[self getRootViewController] presentViewController:storeViewController animated:_usesAnimation completion:^{ - [self setModalOpen:YES]; - //Temporarily use a black status bar to match the StoreKit view. - [self setStatusBarStyle:[UIApplication sharedApplication].statusBarStyle]; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 - [[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent animated:_usesAnimation]; -#endif - }]; - - //Use the standard openUrl method if StoreKit is unavailable. - } else { - - #if TARGET_IPHONE_SIMULATOR - NSLog(@"APPIRATER NOTE: iTunes App Store is not supported on the iOS simulator. Unable to open App Store page."); - #else - NSString *reviewURL = [templateReviewURL stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%@", _appId]]; - - // iOS 7 needs a different templateReviewURL @see https://github.com/arashpayan/appirater/issues/131 - // Fixes condition @see https://github.com/arashpayan/appirater/issues/205 - if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 && [[[UIDevice currentDevice] systemVersion] floatValue] < 8.0) { - reviewURL = [templateReviewURLiOS7 stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%@", _appId]]; - } - // iOS 8 needs a different templateReviewURL also @see https://github.com/arashpayan/appirater/issues/182 - else if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) - { - reviewURL = [templateReviewURLiOS8 stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%@", _appId]]; - } - - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:reviewURL]]; - #endif - } -} - -- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - - id <AppiraterDelegate> delegate = _delegate; - - switch (buttonIndex) { - case 0: - { - // they don't want to rate it - [userDefaults setBool:YES forKey:kAppiraterDeclinedToRate]; - [userDefaults synchronize]; - if(delegate && [delegate respondsToSelector:@selector(appiraterDidDeclineToRate:)]){ - [delegate appiraterDidDeclineToRate:self]; - } - break; - } - case 1: - { - // they want to rate it - [Appirater rateApp]; - if(delegate&& [delegate respondsToSelector:@selector(appiraterDidOptToRate:)]){ - [delegate appiraterDidOptToRate:self]; - } - break; - } - case 2: - // remind them later - [userDefaults setDouble:[[NSDate date] timeIntervalSince1970] forKey:kAppiraterReminderRequestDate]; - [userDefaults synchronize]; - if(delegate && [delegate respondsToSelector:@selector(appiraterDidOptToRemindLater:)]){ - [delegate appiraterDidOptToRemindLater:self]; - } - break; - default: - break; - } -} - -//Delegate call from the StoreKit view. -- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController { - [Appirater closeModal]; -} - -//Close the in-app rating (StoreKit) view and restore the previous status bar style. -+ (void)closeModal { - if (_modalOpen) { - [[UIApplication sharedApplication]setStatusBarStyle:_statusBarStyle animated:_usesAnimation]; - BOOL usedAnimation = _usesAnimation; - [self setModalOpen:NO]; - - // get the top most controller (= the StoreKit Controller) and dismiss it - UIViewController *presentingController = [UIApplication sharedApplication].keyWindow.rootViewController; - presentingController = [self topMostViewController: presentingController]; - [presentingController dismissViewControllerAnimated:_usesAnimation completion:^{ - id <AppiraterDelegate> delegate = self.sharedInstance.delegate; - if ([delegate respondsToSelector:@selector(appiraterDidDismissModalView:animated:)]) { - [delegate appiraterDidDismissModalView:(Appirater *)self animated:usedAnimation]; - } - }]; - [self.class setStatusBarStyle:(UIStatusBarStyle)nil]; - } -} - -@end diff --git a/platform/iphone/AppiraterDelegate.h b/platform/iphone/AppiraterDelegate.h deleted file mode 100644 index cbe0cfad5b..0000000000 --- a/platform/iphone/AppiraterDelegate.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// AppiraterDelegate.h -// Banana Stand -// -// Created by Robert Haining on 9/25/12. -// Copyright (c) 2012 News.me. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@class Appirater; - -@protocol AppiraterDelegate <NSObject> - -@optional --(BOOL)appiraterShouldDisplayAlert:(Appirater *)appirater; --(void)appiraterDidDisplayAlert:(Appirater *)appirater; --(void)appiraterDidDeclineToRate:(Appirater *)appirater; --(void)appiraterDidOptToRate:(Appirater *)appirater; --(void)appiraterDidOptToRemindLater:(Appirater *)appirater; --(void)appiraterWillPresentModalView:(Appirater *)appirater animated:(BOOL)animated; --(void)appiraterDidDismissModalView:(Appirater *)appirater animated:(BOOL)animated; -@end diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub index 38f789259c..5d3267cff3 100644 --- a/platform/iphone/SCsub +++ b/platform/iphone/SCsub @@ -15,7 +15,6 @@ iphone_lib = [ 'game_center.mm', 'in_app_store.mm', 'icloud.mm', - #'Appirater.m', 'ios.mm', ] @@ -30,10 +29,6 @@ if env['ios_gles22_override'] == "yes": env_ios.Append(CPPFLAGS=['-DGLES2_OVERRIDE']) -# if env['ios_appirater'] == "yes": -# env_ios.Append(CPPFLAGS=['-DAPPIRATER_ENABLED']) - - obj = env_ios.Object('godot_iphone.cpp') prog = None diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 740f1d7edc..00bb4b9fad 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -30,7 +30,7 @@ #import "gl_view.h" #include "os_iphone.h" -#include "core/globals.h" +#include "core/global_config.h" #include "main/main.h" #ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED @@ -52,10 +52,6 @@ #define kRenderingFrequency 60 #define kAccelerometerFrequency 100.0 // Hz -#ifdef APPIRATER_ENABLED -#import "Appirater.h" -#endif - Error _shell_open(String); void _set_keep_screen_on(bool p_enabled); @@ -188,11 +184,6 @@ static int frame_count = 0; Main::start(); ++frame_count; - #ifdef APPIRATER_ENABLED - int aid = GlobalConfig::get_singleton()->get("ios/app_id"); - [Appirater appLaunched:YES app_id:aid]; - #endif - }; break; // no fallthrough default: { diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 20fa45d708..fa6082a5a7 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -30,7 +30,6 @@ def get_opts(): ('store_kit', 'Support for in-app store', 'yes'), ('icloud', 'Support for iCloud', 'yes'), ('ios_gles22_override', 'Force GLES2.0 on iOS', 'yes'), - ('ios_appirater', 'Enable Appirater', 'no'), ('ios_exceptions', 'Use exceptions when compiling on playbook', 'yes'), ('ios_triple', 'Triple for ios toolchain', ''), ('ios_sim', 'Build simulator binary', 'no'), diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm index de6ea73c20..4cfa64ae4b 100644 --- a/platform/iphone/game_center.mm +++ b/platform/iphone/game_center.mm @@ -48,18 +48,18 @@ extern "C" { GameCenter* GameCenter::instance = NULL; void GameCenter::_bind_methods() { - ClassDB::bind_method(_MD("connect"),&GameCenter::connect); - ClassDB::bind_method(_MD("is_connected"),&GameCenter::is_connected); - - ClassDB::bind_method(_MD("post_score"),&GameCenter::post_score); - ClassDB::bind_method(_MD("award_achievement"),&GameCenter::award_achievement); - ClassDB::bind_method(_MD("reset_achievements"),&GameCenter::reset_achievements); - ClassDB::bind_method(_MD("request_achievements"),&GameCenter::request_achievements); - ClassDB::bind_method(_MD("request_achievement_descriptions"),&GameCenter::request_achievement_descriptions); - ClassDB::bind_method(_MD("show_game_center"),&GameCenter::show_game_center); - - ClassDB::bind_method(_MD("get_pending_event_count"),&GameCenter::get_pending_event_count); - ClassDB::bind_method(_MD("pop_pending_event"),&GameCenter::pop_pending_event); + ClassDB::bind_method(D_METHOD("connect"),&GameCenter::connect); + ClassDB::bind_method(D_METHOD("is_connected"),&GameCenter::is_connected); + + ClassDB::bind_method(D_METHOD("post_score"),&GameCenter::post_score); + ClassDB::bind_method(D_METHOD("award_achievement"),&GameCenter::award_achievement); + ClassDB::bind_method(D_METHOD("reset_achievements"),&GameCenter::reset_achievements); + ClassDB::bind_method(D_METHOD("request_achievements"),&GameCenter::request_achievements); + ClassDB::bind_method(D_METHOD("request_achievement_descriptions"),&GameCenter::request_achievement_descriptions); + ClassDB::bind_method(D_METHOD("show_game_center"),&GameCenter::show_game_center); + + ClassDB::bind_method(D_METHOD("get_pending_event_count"),&GameCenter::get_pending_event_count); + ClassDB::bind_method(D_METHOD("pop_pending_event"),&GameCenter::pop_pending_event); }; diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index a3af8f4aa8..adc76a622e 100755 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -31,7 +31,7 @@ #import <OpenGLES/EAGLDrawable.h> #include "os_iphone.h" #include "core/os/keyboard.h" -#include "core/globals.h" +#include "core/global_config.h" #include "servers/audio_server.h" #import "gl_view.h" diff --git a/platform/iphone/globals/global_defaults.cpp b/platform/iphone/globals/global_defaults.cpp index 76b5c9aa01..bf716c36f0 100755 --- a/platform/iphone/globals/global_defaults.cpp +++ b/platform/iphone/globals/global_defaults.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "global_defaults.h" -#include "globals.h" +#include "global_config.h" void register_iphone_global_defaults() { diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm index 0d1825dd6b..a9b23baaeb 100644 --- a/platform/iphone/icloud.mm +++ b/platform/iphone/icloud.mm @@ -44,14 +44,14 @@ extern "C" { ICloud* ICloud::instance = NULL; void ICloud::_bind_methods() { - ClassDB::bind_method(_MD("remove_key"),&ICloud::remove_key); - ClassDB::bind_method(_MD("set_key_values"),&ICloud::set_key_values); - ClassDB::bind_method(_MD("get_key_value"),&ICloud::get_key_value); - ClassDB::bind_method(_MD("synchronize_key_values"),&ICloud::synchronize_key_values); - ClassDB::bind_method(_MD("get_all_key_values"),&ICloud::get_all_key_values); - - ClassDB::bind_method(_MD("get_pending_event_count"),&ICloud::get_pending_event_count); - ClassDB::bind_method(_MD("pop_pending_event"),&ICloud::pop_pending_event); + ClassDB::bind_method(D_METHOD("remove_key"),&ICloud::remove_key); + ClassDB::bind_method(D_METHOD("set_key_values"),&ICloud::set_key_values); + ClassDB::bind_method(D_METHOD("get_key_value"),&ICloud::get_key_value); + ClassDB::bind_method(D_METHOD("synchronize_key_values"),&ICloud::synchronize_key_values); + ClassDB::bind_method(D_METHOD("get_all_key_values"),&ICloud::get_all_key_values); + + ClassDB::bind_method(D_METHOD("get_pending_event_count"),&ICloud::get_pending_event_count); + ClassDB::bind_method(D_METHOD("pop_pending_event"),&ICloud::pop_pending_event); }; int ICloud::get_pending_event_count() { diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm index 050498c125..b63d7b42ab 100644 --- a/platform/iphone/in_app_store.mm +++ b/platform/iphone/in_app_store.mm @@ -66,13 +66,13 @@ NSMutableDictionary* pending_transactions = [NSMutableDictionary dictionary]; InAppStore* InAppStore::instance = NULL; void InAppStore::_bind_methods() { - ClassDB::bind_method(_MD("request_product_info"),&InAppStore::request_product_info); - ClassDB::bind_method(_MD("purchase"),&InAppStore::purchase); + ClassDB::bind_method(D_METHOD("request_product_info"),&InAppStore::request_product_info); + ClassDB::bind_method(D_METHOD("purchase"),&InAppStore::purchase); - ClassDB::bind_method(_MD("get_pending_event_count"),&InAppStore::get_pending_event_count); - ClassDB::bind_method(_MD("pop_pending_event"),&InAppStore::pop_pending_event); - ClassDB::bind_method(_MD("finish_transaction"),&InAppStore::finish_transaction); - ClassDB::bind_method(_MD("set_auto_finish_transaction"),&InAppStore::set_auto_finish_transaction); + ClassDB::bind_method(D_METHOD("get_pending_event_count"),&InAppStore::get_pending_event_count); + ClassDB::bind_method(D_METHOD("pop_pending_event"),&InAppStore::pop_pending_event); + ClassDB::bind_method(D_METHOD("finish_transaction"),&InAppStore::finish_transaction); + ClassDB::bind_method(D_METHOD("set_auto_finish_transaction"),&InAppStore::set_auto_finish_transaction); }; @interface ProductsDelegate : NSObject<SKProductsRequestDelegate> { diff --git a/platform/iphone/ios.mm b/platform/iphone/ios.mm index a068d4aa31..4aca85dafc 100644 --- a/platform/iphone/ios.mm +++ b/platform/iphone/ios.mm @@ -32,7 +32,7 @@ void iOS::_bind_methods() { - ClassDB::bind_method(_MD("get_rate_url","app_id"),&iOS::get_rate_url); + ClassDB::bind_method(D_METHOD("get_rate_url","app_id"),&iOS::get_rate_url); }; String iOS::get_rate_url(int p_app_id) const { diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index e34dbae017..816e456838 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -40,7 +40,7 @@ #include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/io/file_access_pack.h" -#include "core/globals.h" +#include "core/global_config.h" #include "sem_iphone.h" diff --git a/platform/iphone/power_iphone.cpp b/platform/iphone/power_iphone.cpp new file mode 100644 index 0000000000..db555f30c2 --- /dev/null +++ b/platform/iphone/power_iphone.cpp @@ -0,0 +1,71 @@ +/*************************************************************************/ +/* power_iphone.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "power_iphone.h" + +bool PowerState::UpdatePowerInfo() { + return false; +} + + +PowerState PowerIphone::get_power_state() { + if (UpdatePowerInfo()) { + return power_state; + } + else { + return POWERSTATE_UNKNOWN; + } +} + +int PowerIphone::get_power_seconds_left() { + if (UpdatePowerInfo()) { + return nsecs_left; + } + else { + return -1; + } +} + +int PowerIphone::get_power_percent_left() { + if (UpdatePowerInfo()) { + return percent_left; + } + else { + return -1; + } +} + +PowerIphone::PowerIphone() : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) { + // TODO Auto-generated constructor stub + +} + +PowerIphone::~PowerIphone() { + // TODO Auto-generated destructor stub +} diff --git a/platform/iphone/power_iphone.h b/platform/iphone/power_iphone.h new file mode 100644 index 0000000000..8890c33e74 --- /dev/null +++ b/platform/iphone/power_iphone.h @@ -0,0 +1,50 @@ +/*************************************************************************/ +/* power_iphone.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 PLATFORM_IPHONE_POWER_IPHONE_H_ +#define PLATFORM_IPHONE_POWER_IPHONE_H_ + +class PowerIphone { +private: + int nsecs_left; + int percent_left; + PowerState power_state; + + bool UpdatePowerInfo(); + +public: + PowerIphone(); + virtual ~PowerIphone(); + + PowerState get_power_state(); + int get_power_seconds_left(); + int get_power_percent_left(); +}; + +#endif /* PLATFORM_IPHONE_POWER_IPHONE_H_ */ diff --git a/platform/iphone/rasterizer_iphone.cpp b/platform/iphone/rasterizer_iphone.cpp index ee0457cfb1..b8f3dd0d05 100644 --- a/platform/iphone/rasterizer_iphone.cpp +++ b/platform/iphone/rasterizer_iphone.cpp @@ -30,7 +30,7 @@ #include "rasterizer_iphone.h" #include "os/os.h" -#include "globals.h" +#include "global_config.h" #include <stdio.h> _FORCE_INLINE_ static void _gl_load_transform(const Transform& tr) { diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub index a20c0f7a70..bd7b0c304d 100644 --- a/platform/javascript/SCsub +++ b/platform/javascript/SCsub @@ -2,6 +2,9 @@ Import('env') +env.Tool('textfile') +env.Tool('zip') + javascript_files = [ "os_javascript.cpp", "audio_driver_javascript.cpp", @@ -21,18 +24,26 @@ for x in javascript_files: env.Append(LINKFLAGS=["-s", "EXPORTED_FUNCTIONS=\"['_main','_audio_server_mix_function','_main_after_fs_sync']\""]) env.Append(LINKFLAGS=["--shell-file", '"platform/javascript/godot_shell.html"']) -build = env.Program('#bin/godot', javascript_objects, PROGSUFFIX=env["PROGSUFFIX"] + ".html") -Depends(build, "godot_shell.html") - -def make_html_shell(target, source, env): - html_path = target[0].rstr() - assert html_path[:4] == 'bin/' - assert html_path[-5:] == '.html' - basename = html_path[4:-5] - with open(html_path, 'r+') as html_file: - fixed_html = html_file.read().replace('.html.mem', '.mem').replace(basename, '$GODOT_BASE') - html_file.seek(0) - html_file.truncate() - html_file.write(fixed_html) - -env.AddPostAction(build, Action(make_html_shell, "Creating HTML shell file")) +html_file = env.Program('#bin/godot', javascript_objects, PROGSUFFIX=env["PROGSUFFIX"] + ".html")[0] +Depends(html_file, "godot_shell.html") +basename = "godot" + env["PROGSUFFIX"] # output file name without file extension + +# Emscripten hardcodes file names, so replace common base name with +# placeholder while leaving extension; also change `.html.mem` to just `.mem` +fixup_html = env.Substfile(html_file, SUBST_DICT=[(basename, '$$GODOT_BASE'), ('.html.mem', '.mem')], SUBSTFILESUFFIX='.fixup.html') + +zip_dir = env.Dir('#bin/.javascript_zip') +zip_files = [] +js_file = env.SideEffect(html_file.File(basename+'.js'), html_file) +zip_files.append(env.InstallAs( + [zip_dir.File('godot.html'), zip_dir.File('godot.js'), zip_dir.File('godotfs.js')], + [fixup_html, js_file, '#misc/dist/html_fs/godotfs.js'])) + +if env['wasm'] == 'yes': + wasm_file = env.SideEffect(html_file.File(basename+'.wasm'), html_file) + zip_files.append(env.InstallAs(zip_dir.File('godot.wasm'), wasm_file)) +else: + asmjs_files = env.SideEffect([html_file.File(basename+'.asm.js'), html_file.File(basename+'.html.mem')], html_file) + zip_files.append(env.InstallAs([zip_dir.File('godot.asm.js'), zip_dir.File('godot.mem')], asmjs_files)) + +Zip('#bin/godot', zip_files, ZIPSUFFIX=env['PROGSUFFIX']+env['ZIPSUFFIX'], ZIPROOT=zip_dir) diff --git a/platform/javascript/audio_server_javascript.cpp b/platform/javascript/audio_server_javascript.cpp index d5940fb102..bb238ede0c 100644 --- a/platform/javascript/audio_server_javascript.cpp +++ b/platform/javascript/audio_server_javascript.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "audio_server_javascript.h" - +#if 0 #include "emscripten.h" AudioMixer *AudioServerJavascript::get_mixer() { @@ -847,3 +847,4 @@ AudioServerJavascript::AudioServerJavascript() { stream_volume_scale=1.0; } +#endif diff --git a/platform/javascript/audio_server_javascript.h b/platform/javascript/audio_server_javascript.h index f8c8774e4c..2f48e7e79e 100644 --- a/platform/javascript/audio_server_javascript.h +++ b/platform/javascript/audio_server_javascript.h @@ -28,7 +28,7 @@ /*************************************************************************/ #ifndef AUDIO_SERVER_JAVASCRIPT_H #define AUDIO_SERVER_JAVASCRIPT_H - +#if 0 #include "servers/audio_server.h" class AudioServerJavascript : public AudioServer { @@ -223,3 +223,4 @@ public: }; #endif // AUDIO_SERVER_JAVASCRIPT_H +#endif diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index a701823b2e..799b550899 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -12,8 +12,6 @@ def get_name(): def can_build(): - - import os return os.environ.has_key("EMSCRIPTEN_ROOT") @@ -35,31 +33,41 @@ def get_flags(): ] +def create(env): + # remove Windows' .exe suffix + return env.Clone(PROGSUFFIX='') + + +def escape_sources_backslashes(target, source, env, for_signature): + return [path.replace('\\','\\\\') for path in env.GetBuildPath(source)] + +def escape_target_backslashes(target, source, env, for_signature): + return env.GetBuildPath(target[0]).replace('\\','\\\\') + + def configure(env): env['ENV'] = os.environ - env.use_windows_spawn_fix('javascript') env.Append(CPPPATH=['#platform/javascript']) - em_path = os.environ["EMSCRIPTEN_ROOT"] - - env['ENV']['PATH'] = em_path + ":" + env['ENV']['PATH'] - env['CC'] = em_path + '/emcc' - env['CXX'] = em_path + '/emcc' - #env['AR'] = em_path+"/emar" - env['AR'] = em_path + "/emcc" - env['ARFLAGS'] = "-o" + env.PrependENVPath('PATH', os.environ['EMSCRIPTEN_ROOT']) + env['CC'] = 'emcc' + env['CXX'] = 'em++' + env['LINK'] = 'emcc' + env['RANLIB'] = 'emranlib' + # Emscripten's ar has issues with duplicate file names, so use cc + env['AR'] = 'emcc' + env['ARFLAGS'] = '-o' + if (os.name == 'nt'): + # use TempFileMunge on Windows since some commands get too long for + # cmd.exe even with spawn_fix + # need to escape backslashes for this + env['ESCAPED_SOURCES'] = escape_sources_backslashes + env['ESCAPED_TARGET'] = escape_target_backslashes + env['ARCOM'] = '${TEMPFILE("%s")}' % env['ARCOM'].replace('$SOURCES', '$ESCAPED_SOURCES').replace('$TARGET', '$ESCAPED_TARGET') -# env['RANLIB'] = em_path+"/emranlib" - env['RANLIB'] = em_path + "/emcc" env['OBJSUFFIX'] = '.bc' env['LIBSUFFIX'] = '.bc' - env['CCCOM'] = "$CC -o $TARGET $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES" - env['CXXCOM'] = "$CC -o $TARGET $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES" - -# env.Append(LIBS=['c','m','stdc++','log','GLESv1_CM','GLESv2']) - -# env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack ") if (env["target"] == "release"): env.Append(CCFLAGS=['-O2']) @@ -78,7 +86,6 @@ def configure(env): env.Append(CPPFLAGS=["-fno-exceptions", '-DNO_SAFE_CAST', '-fno-rtti']) env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DNO_FCNTL', '-DMPC_FIXED_POINT', '-DTYPED_METHOD_BIND', '-DNO_THREADS']) env.Append(CPPFLAGS=['-DGLES3_ENABLED']) - env.Append(CPPFLAGS=['-DGLES_NO_CLIENT_ARRAYS']) if env['wasm'] == 'yes': env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) @@ -88,7 +95,7 @@ def configure(env): # what is set during compilation, check TOTAL_MEMORY in Emscripten's # src/settings.js for the default. env.Append(LINKFLAGS=['-s', 'ALLOW_MEMORY_GROWTH=1']) - env["PROGSUFFIX"] += ".webassembly" + env.extra_suffix = '.webassembly' + env.extra_suffix else: env.Append(CPPFLAGS=['-s', 'ASM_JS=1']) env.Append(LINKFLAGS=['-s', 'ASM_JS=1']) @@ -101,7 +108,4 @@ def configure(env): env.Append(LINKFLAGS=['-s', 'USE_WEBGL2=1']) # env.Append(LINKFLAGS=['-g4']) - # print "CCCOM is:", env.subst('$CCCOM') - # print "P: ", env['p'], " Platofrm: ", env['platform'] - import methods diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index e487383ef4..b9ef63fe2f 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -28,12 +28,12 @@ /*************************************************************************/ #include "version.h" #include "export.h" -#include "tools/editor/editor_settings.h" -#include "tools/editor/editor_import_export.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_settings.h" +#include "editor/editor_export.h" +#include "editor/editor_node.h" #include "io/zip_io.h" #include "io/marshalls.h" -#include "globals.h" +#include "global_config.h" #include "os/file_access.h" #include "os/os.h" #include "platform/javascript/logo.h" @@ -417,14 +417,14 @@ EditorExportPlatformJavaScript::~EditorExportPlatformJavaScript() { } - +#endif void register_javascript_exporter() { - Ref<EditorExportPlatformJavaScript> exporter = Ref<EditorExportPlatformJavaScript>( memnew(EditorExportPlatformJavaScript) ); - EditorImportExport::get_singleton()->add_export_platform(exporter); + //Ref<EditorExportPlatformJavaScript> exporter = Ref<EditorExportPlatformJavaScript>( memnew(EditorExportPlatformJavaScript) ); + //EditorImportExport::get_singleton()->add_export_platform(exporter); } -#endif + diff --git a/platform/javascript/javascript_eval.cpp b/platform/javascript/javascript_eval.cpp index 72b7ab06cd..d84c8bf040 100644 --- a/platform/javascript/javascript_eval.cpp +++ b/platform/javascript/javascript_eval.cpp @@ -156,7 +156,7 @@ Variant JavaScript::eval(const String& p_code, bool p_use_global_exec_context) { void JavaScript::_bind_methods() { - ClassDB::bind_method(_MD("eval", "code", "use_global_execution_context"), &JavaScript::eval, false); + ClassDB::bind_method(D_METHOD("eval", "code", "use_global_execution_context"), &JavaScript::eval, false); } JavaScript::JavaScript() { diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp index 94320d53c1..076f93f0df 100644 --- a/platform/javascript/javascript_main.cpp +++ b/platform/javascript/javascript_main.cpp @@ -151,16 +151,15 @@ int main(int argc, char *argv[]) { /* Initialize the window */ - printf("let it go!\n"); + printf("let it go dude!\n"); glutInit(&argc, argv); os = new OS_JavaScript(_gfx_init,NULL,NULL); #if 0 char *args[]={"-test","gui","-v",NULL}; Error err = Main::setup("apk",3,args); #else - //char *args[]={"-v",NULL};// - //Error err = Main::setup("",1,args); - Error err = Main::setup("",0,NULL); + char *args[]={"-main_pack","data.pck",NULL}; //pass location of main pack manually, because it wont get an executable name + Error err = Main::setup("",2,args); #endif ResourceLoader::set_abort_on_missing_resources(false); //ease up compatibility diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index b8c3dea3b4..d570d64acf 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -34,7 +34,7 @@ #include "drivers/unix/dir_access_unix.h" #include "servers/visual/visual_server_raster.h" #include "main/main.h" -#include "core/globals.h" +#include "core/global_config.h" #include "dom_keys.h" #include <stdlib.h> @@ -259,6 +259,8 @@ void OS_JavaScript::initialize(const VideoMode& p_desired,int p_video_driver,int physics_2d_server->init(); input = memnew( InputDefault ); + + power_manager = memnew( PowerJavascript ); #define EM_CHECK(ev) if (result!=EMSCRIPTEN_RESULT_SUCCESS)\ ERR_PRINTS("Error while setting " #ev " callback: Code " + itos(result)) @@ -282,6 +284,8 @@ void OS_JavaScript::initialize(const VideoMode& p_desired,int p_video_driver,int javascript_eval = memnew(JavaScript); GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("JavaScript", javascript_eval)); #endif + + visual_server->init(); } void OS_JavaScript::set_main_loop( MainLoop * p_main_loop ) { @@ -851,8 +855,19 @@ String OS_JavaScript::get_joy_guid(int p_device) const { return input->get_joy_guid_remapped(p_device); } -OS_JavaScript::OS_JavaScript(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, GetDataDirFunc p_get_data_dir_func) { +PowerState OS_JavaScript::get_power_state() { + return power_manager->get_power_state(); +} + +int OS_JavaScript::get_power_seconds_left() { + return power_manager->get_power_seconds_left(); +} + +int OS_JavaScript::get_power_percent_left() { + return power_manager->get_power_percent_left(); +} +OS_JavaScript::OS_JavaScript(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, GetDataDirFunc p_get_data_dir_func) { gfx_init_func=p_gfx_init_func; gfx_init_ud=p_gfx_init_ud; last_button_mask=0; diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index 582f128ce8..5f6051bedb 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -32,6 +32,7 @@ #include "os/input.h" #include "drivers/unix/os_unix.h" #include "os/main_loop.h" +#include "power_javascript.h" #include "servers/physics/physics_server_sw.h" #include "servers/audio_server.h" #include "servers/physics_2d/physics_2d_server_sw.h" @@ -81,6 +82,8 @@ private: GetDataDirFunc get_data_dir_func; + PowerJavascript *power_manager; + #ifdef JAVASCRIPT_EVAL_ENABLED JavaScript* javascript_eval; #endif @@ -174,6 +177,10 @@ public: virtual bool is_joy_known(int p_device); virtual String get_joy_guid(int p_device) const; bool joy_connection_changed(int p_type, const EmscriptenGamepadEvent *p_event); + + virtual PowerState get_power_state(); + virtual int get_power_seconds_left(); + virtual int get_power_percent_left(); OS_JavaScript(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, GetDataDirFunc p_get_data_dir_func); ~OS_JavaScript(); diff --git a/platform/javascript/power_javascript.cpp b/platform/javascript/power_javascript.cpp new file mode 100644 index 0000000000..9d2d0364aa --- /dev/null +++ b/platform/javascript/power_javascript.cpp @@ -0,0 +1,76 @@ +/*************************************************************************/ +/* power_javascript.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "core/error_macros.h" +#include "power_javascript.h" + + +bool PowerJavascript::UpdatePowerInfo() { + // TODO Javascript implementation + return false; +} + +PowerState PowerJavascript::get_power_state() { + if (UpdatePowerInfo()) { + return power_state; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN"); + return POWERSTATE_UNKNOWN; + } +} + +int PowerJavascript::get_power_seconds_left() { + if (UpdatePowerInfo()) { + return nsecs_left; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to -1"); + return -1; + } +} + +int PowerJavascript::get_power_percent_left() { + if (UpdatePowerInfo()) { + return percent_left; + } + else { + WARN_PRINT("Power management is not implemented on this platform, defaulting to -1"); + return -1; + } +} + + +PowerJavascript::PowerJavascript() : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) { + +} + +PowerJavascript::~PowerJavascript() { +} diff --git a/platform/javascript/power_javascript.h b/platform/javascript/power_javascript.h new file mode 100644 index 0000000000..bdef2be7e1 --- /dev/null +++ b/platform/javascript/power_javascript.h @@ -0,0 +1,51 @@ +/*************************************************************************/ +/* power_javascript.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 PLATFORM_JAVASCRIPT_POWER_JAVASCRIPT_H_ +#define PLATFORM_JAVASCRIPT_POWER_JAVASCRIPT_H_ + +class PowerJavascript { +private: + int nsecs_left; + int percent_left; + PowerState power_state; + + bool UpdatePowerInfo(); + +public: + PowerJavascript(); + virtual ~PowerJavascript(); + + PowerState get_power_state(); + int get_power_seconds_left(); + int get_power_percent_left(); +}; + +#endif /* PLATFORM_JAVASCRIPT_POWER_JAVASCRIPT_H_ */ diff --git a/platform/osx/SCsub b/platform/osx/SCsub index 00f23687cf..1427c2e00d 100644 --- a/platform/osx/SCsub +++ b/platform/osx/SCsub @@ -10,6 +10,7 @@ files = [ # 'context_gl_osx.cpp', 'dir_access_osx.mm', 'joypad_osx.cpp', + 'power_osx.cpp', ] env.Program('#bin/godot', files) diff --git a/platform/osx/detect.py b/platform/osx/detect.py index ccd86177ab..b59dfe1afb 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -100,3 +100,4 @@ def configure(env): #env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } ) env["x86_libtheora_opt_gcc"] = True + diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 3a97827c16..4af2aaca63 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -28,13 +28,13 @@ /*************************************************************************/ #include "version.h" #include "export.h" -#include "tools/editor/editor_settings.h" -#include "tools/editor/editor_import_export.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_settings.h" +#include "editor/editor_export.h" +#include "editor/editor_node.h" #include "io/zip_io.h" #include "io/marshalls.h" #include "io/resource_saver.h" -#include "globals.h" +#include "global_config.h" #include "os/file_access.h" #include "os/os.h" #include "platform/osx/logo.h" @@ -536,14 +536,14 @@ EditorExportPlatformOSX::~EditorExportPlatformOSX() { } - +#endif void register_osx_exporter() { - +#if 0 Ref<EditorExportPlatformOSX> exporter = Ref<EditorExportPlatformOSX>( memnew(EditorExportPlatformOSX) ); EditorImportExport::get_singleton()->add_export_platform(exporter); - +#endif } -#endif + diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp index 5d25017aa6..98bcc8dc73 100644 --- a/platform/osx/joypad_osx.cpp +++ b/platform/osx/joypad_osx.cpp @@ -275,7 +275,6 @@ void JoypadOSX::_device_removed(int p_id) { input->joy_connection_changed(p_id, false, ""); device_list[device].free(); device_list.remove(device); - attached_devices[p_id] = false; } static String _hex_str(uint8_t p_byte) { @@ -307,7 +306,7 @@ bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad* p_joy) { } name = c_name; - int id = get_free_joy_id(); + int id = input->get_unused_joy_id(); ERR_FAIL_COND_V(id == -1, false); p_joy->id = id; int vendor = 0; @@ -510,16 +509,6 @@ void JoypadOSX::joypad_vibration_stop(int p_id, uint64_t p_timestamp) { FFEffectStop(joy->ff_object); } -int JoypadOSX::get_free_joy_id() { - for (int i = 0; i < JOYPADS_MAX; i++) { - if (!attached_devices[i]) { - attached_devices[i] = true; - return i; - } - } - return -1; -} - int JoypadOSX::get_joy_index(int p_id) const { for (int i = 0; i < device_list.size(); i++) { if (device_list[i].id == p_id) return i; @@ -582,10 +571,6 @@ JoypadOSX::JoypadOSX() self = this; input = (InputDefault*)Input::get_singleton(); - for (int i = 0; i < JOYPADS_MAX; i++) { - attached_devices[i] = false; - } - int okay = 1; const void *vals[] = { (void *) create_match_dictionary(kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick, &okay), diff --git a/platform/osx/joypad_osx.h b/platform/osx/joypad_osx.h index aafd82880d..71a0335316 100644 --- a/platform/osx/joypad_osx.h +++ b/platform/osx/joypad_osx.h @@ -95,14 +95,11 @@ private: InputDefault *input; IOHIDManagerRef hid_manager; - bool attached_devices[JOYPADS_MAX]; Vector<joypad> device_list; bool have_device(IOHIDDeviceRef p_device) const; bool configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy); - - int get_free_joy_id(); int get_joy_index(int p_id) const; void poll_joypads() const; diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index d8c35472f2..9941774b40 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -32,6 +32,7 @@ #include "os/input.h" #include "joypad_osx.h" +#include "power_osx.h" #include "drivers/unix/os_unix.h" #include "main/input_default.h" #include "servers/visual_server.h" @@ -107,6 +108,8 @@ public: Size2 window_size; int current_screen; Rect2 restore_rect; + + power_osx *power_manager; float _mouse_scale(float p_scale) { if (display_scale>1.0) @@ -200,6 +203,10 @@ public: virtual bool is_window_maximized() const; virtual void request_attention(); virtual String get_joy_guid(int p_device) const; + + virtual PowerState get_power_state(); + virtual int get_power_seconds_left(); + virtual int get_power_percent_left(); void run(); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 854ccacbf1..0699978caf 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1119,6 +1119,8 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi input = memnew( InputDefault ); joypad_osx = memnew( JoypadOSX ); + power_manager = memnew( power_osx ); + _ensure_data_dir(); NSArray *screenArray = [NSScreen screens]; @@ -1758,14 +1760,28 @@ OS::MouseMode OS_OSX::get_mouse_mode() const { return mouse_mode; } + String OS_OSX::get_joy_guid(int p_device) const { return input->get_joy_guid_remapped(p_device); } +PowerState OS_OSX::get_power_state() { + return power_manager->get_power_state(); +} + +int OS_OSX::get_power_seconds_left() { + return power_manager->get_power_seconds_left(); +} + +int OS_OSX::get_power_percent_left() { + return power_manager->get_power_percent_left(); +} + OS_OSX* OS_OSX::singleton=NULL; OS_OSX::OS_OSX() { - + + mouse_mode=OS::MOUSE_MODE_VISIBLE; main_loop=NULL; singleton=this; autoreleasePool = [[NSAutoreleasePool alloc] init]; diff --git a/platform/osx/power_osx.cpp b/platform/osx/power_osx.cpp new file mode 100644 index 0000000000..5c8f067f24 --- /dev/null +++ b/platform/osx/power_osx.cpp @@ -0,0 +1,233 @@ +/*************************************************************************/ +/* power_osx.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "power_osx.h" + +#include <CoreFoundation/CoreFoundation.h> +#include <IOKit/ps/IOPowerSources.h> +#include <IOKit/ps/IOPSKeys.h> + +// CODE CHUNK IMPORTED FROM SDL 2.0 + +/* CoreFoundation is so verbose... */ +#define STRMATCH(a,b) (CFStringCompare(a, b, 0) == kCFCompareEqualTo) +#define GETVAL(k,v) \ + CFDictionaryGetValueIfPresent(dict, CFSTR(k), (const void **) v) + +/* Note that AC power sources also include a laptop battery it is charging. */ +void power_osx::checkps(CFDictionaryRef dict, bool * have_ac, bool * have_battery, bool * charging) +{ + CFStringRef strval; /* don't CFRelease() this. */ + CFBooleanRef bval; + CFNumberRef numval; + bool charge = false; + bool choose = false; + bool is_ac = false; + int secs = -1; + int maxpct = -1; + int pct = -1; + + if ((GETVAL(kIOPSIsPresentKey, &bval)) && (bval == kCFBooleanFalse)) { + return; /* nothing to see here. */ + } + + if (!GETVAL(kIOPSPowerSourceStateKey, &strval)) { + return; + } + + if (STRMATCH(strval, CFSTR(kIOPSACPowerValue))) { + is_ac = *have_ac = true; + } else if (!STRMATCH(strval, CFSTR(kIOPSBatteryPowerValue))) { + return; /* not a battery? */ + } + + if ((GETVAL(kIOPSIsChargingKey, &bval)) && (bval == kCFBooleanTrue)) { + charge = true; + } + + if (GETVAL(kIOPSMaxCapacityKey, &numval)) { + SInt32 val = -1; + CFNumberGetValue(numval, kCFNumberSInt32Type, &val); + if (val > 0) { + *have_battery = true; + maxpct = (int) val; + } + } + + if (GETVAL(kIOPSMaxCapacityKey, &numval)) { + SInt32 val = -1; + CFNumberGetValue(numval, kCFNumberSInt32Type, &val); + if (val > 0) { + *have_battery = true; + maxpct = (int) val; + } + } + + if (GETVAL(kIOPSTimeToEmptyKey, &numval)) { + SInt32 val = -1; + CFNumberGetValue(numval, kCFNumberSInt32Type, &val); + + /* Mac OS X reports 0 minutes until empty if you're plugged in. :( */ + if ((val == 0) && (is_ac)) { + val = -1; /* !!! FIXME: calc from timeToFull and capacity? */ + } + + secs = (int) val; + if (secs > 0) { + secs *= 60; /* value is in minutes, so convert to seconds. */ + } + } + + if (GETVAL(kIOPSCurrentCapacityKey, &numval)) { + SInt32 val = -1; + CFNumberGetValue(numval, kCFNumberSInt32Type, &val); + pct = (int) val; + } + + if ((pct > 0) && (maxpct > 0)) { + pct = (int) ((((double) pct) / ((double) maxpct)) * 100.0); + } + + if (pct > 100) { + pct = 100; + } + + /* + * We pick the battery that claims to have the most minutes left. + * (failing a report of minutes, we'll take the highest percent.) + */ + if ((secs < 0) && (nsecs_left < 0)) { + if ((pct < 0) && (percent_left < 0)) { + choose = true; /* at least we know there's a battery. */ + } + if (pct > percent_left) { + choose = true; + } + } else if (secs > nsecs_left) { + choose = true; + } + + if (choose) { + nsecs_left = secs; + percent_left = pct; + *charging = charge; + } +} + +#undef GETVAL +#undef STRMATCH + +// CODE CHUNK IMPORTED FROM SDL 2.0 +bool power_osx::GetPowerInfo_MacOSX() +{ + CFTypeRef blob = IOPSCopyPowerSourcesInfo(); + + nsecs_left = -1; + percent_left = -1; + power_state = POWERSTATE_UNKNOWN; + + if (blob != NULL) { + CFArrayRef list = IOPSCopyPowerSourcesList(blob); + if (list != NULL) { + /* don't CFRelease() the list items, or dictionaries! */ + bool have_ac = false; + bool have_battery = false; + bool charging = false; + const CFIndex total = CFArrayGetCount(list); + CFIndex i; + for (i = 0; i < total; i++) { + CFTypeRef ps = (CFTypeRef) CFArrayGetValueAtIndex(list, i); + CFDictionaryRef dict = IOPSGetPowerSourceDescription(blob, ps); + if (dict != NULL) { + checkps(dict, &have_ac, &have_battery, &charging); + } + } + + if (!have_battery) { + power_state = POWERSTATE_NO_BATTERY; + } else if (charging) { + power_state = POWERSTATE_CHARGING; + } else if (have_ac) { + power_state = POWERSTATE_CHARGED; + } else { + power_state = POWERSTATE_ON_BATTERY; + } + + CFRelease(list); + } + CFRelease(blob); + } + + return true; /* always the definitive answer on Mac OS X. */ +} + + + +bool power_osx::UpdatePowerInfo() { + if (GetPowerInfo_MacOSX()) { + return true; + } + return false; +} + + +PowerState power_osx::get_power_state() { + if (UpdatePowerInfo()) { + return power_state; + } + else { + return POWERSTATE_UNKNOWN; + } +} + +int power_osx::get_power_seconds_left() { + if (UpdatePowerInfo()) { + return nsecs_left; + } + else { + return -1; + } +} + +int power_osx::get_power_percent_left() { + if (UpdatePowerInfo()) { + return percent_left; + } + else { + return -1; + } +} + + +power_osx::power_osx() : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) { + +} + +power_osx::~power_osx() { + +} diff --git a/platform/osx/power_osx.h b/platform/osx/power_osx.h new file mode 100644 index 0000000000..a4aee31117 --- /dev/null +++ b/platform/osx/power_osx.h @@ -0,0 +1,57 @@ +/*************************************************************************/ +/* power_osx.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 PLATFORM_OSX_POWER_OSX_H_ +#define PLATFORM_OSX_POWER_OSX_H_ + +#include "dir_access_osx.h" +#include "os/file_access.h" +#include "os/power.h" +#include <CoreFoundation/CoreFoundation.h> + +class power_osx { + +private: + int nsecs_left; + int percent_left; + PowerState power_state; + void checkps(CFDictionaryRef dict, bool * have_ac, bool * have_battery, bool * charging); + bool GetPowerInfo_MacOSX(/*PowerState * state, int *seconds, int *percent*/); + bool UpdatePowerInfo(); + +public: + power_osx(); + virtual ~power_osx(); + + PowerState get_power_state(); + int get_power_seconds_left(); + int get_power_percent_left(); +}; + +#endif /* PLATFORM_OSX_POWER_OSX_H_ */ diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index d691ae35bd..ee80080b4e 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -217,6 +217,18 @@ void OS_Server::set_cursor_shape(CursorShape p_shape) { } +PowerState OS_Server::get_power_state() { + return power_manager->get_power_state(); +} + +int OS_Server::get_power_seconds_left() { + return power_manager->get_power_seconds_left(); +} + +int OS_Server::get_power_percent_left() { + return power_manager->get_power_percent_left(); +} + void OS_Server::run() { force_quit = false; diff --git a/platform/server/os_server.h b/platform/server/os_server.h index 2b6225c48d..a035076726 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -38,6 +38,7 @@ #include "servers/audio_server.h" #include "drivers/rtaudio/audio_driver_rtaudio.h" #include "servers/physics_2d/physics_2d_server_sw.h" +#include "../x11/power_x11.h" //bitch #undef CursorShape @@ -65,6 +66,8 @@ class OS_Server : public OS_Unix { bool force_quit; InputDefault *input; + + PowerX11 *power_manager; @@ -105,6 +108,10 @@ public: virtual void move_window_to_foreground(); void run(); + + virtual PowerState get_power_state(); + virtual int get_power_seconds_left(); + virtual int get_power_percent_left(); OS_Server(); }; diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 167a5831cf..52a22a1942 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -69,8 +69,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "version.h" #include "export.h" #include "object.h" -#include "tools/editor/editor_import_export.h" -#include "tools/editor/editor_node.h" +#include "editor/editor_import_export.h" +#include "editor/editor_node.h" #include "platform/uwp/logo.h" #include "os/file_access.h" #include "io/zip.h" @@ -79,7 +79,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "io/sha256.h" #include "io/base64.h" #include "bind/core_bind.h" -#include "globals.h" +#include "global_config.h" #include "io/marshalls.h" #include <zlib.h> @@ -2384,10 +2384,11 @@ EditorExportPlatformUWP::EditorExportPlatformUWP() { EditorExportPlatformUWP::~EditorExportPlatformUWP() {} - +#endif void register_uwp_exporter() { - +#if 0 Ref<EditorExportPlatformUWP> exporter = Ref<EditorExportPlatformUWP>(memnew(EditorExportPlatformUWP)); EditorImportExport::get_singleton()->add_export_platform(exporter); -} #endif +} + diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 90c21e11a1..eb62164fd5 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -28,7 +28,6 @@ /*************************************************************************/ #include "drivers/gles2/rasterizer_gles2.h" #include "os_uwp.h" -#include "drivers/unix/memory_pool_static_malloc.h" #include "os/memory_pool_dynamic_static.h" #include "thread_uwp.h" #include "drivers/windows/semaphore_windows.h" @@ -40,7 +39,7 @@ #include "servers/audio_server.h" //#include "servers/visual/visual_server_wrap_mt.h" #include "os/memory_pool_dynamic_prealloc.h" -#include "globals.h" +#include "global_config.h" #include "io/marshalls.h" #include "platform/windows/packet_peer_udp_winsock.h" #include "platform/windows/stream_peer_winsock.h" @@ -292,6 +291,8 @@ void OSUWP::initialize(const VideoMode& p_desired,int p_video_driver,int p_audio ERR_PRINT("Initializing audio failed."); } + power_manager = memnew ( PowerWinRT ); + managed_object->update_clipboard(); Clipboard::ContentChanged += ref new EventHandler<Platform::Object^>(managed_object, &ManagedType::on_clipboard_changed); @@ -919,6 +920,18 @@ String OSUWP::get_data_dir() const { return String(data_folder->Path->Data()).replace("\\", "/"); } +PowerState OSWinrt::get_power_state() { + return power_manager->get_power_state(); +} + +int OSWinrt::get_power_seconds_left() { + return power_manager->get_power_seconds_left(); +} + +int OSWinrt::get_power_percent_left() { + return power_manager->get_power_percent_left(); +} + OSUWP::OSUWP() { diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index f65aa2d8d9..72cc8a7854 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -42,12 +42,14 @@ #include "core/ustring.h" #include "main/input_default.h" #include "joypad_uwp.h" +#include "power_winrt.h" #include <windows.h> #include <io.h> #include <fcntl.h> #include <stdio.h> + /** @author Juan Linietsky <reduzio@gmail.com> */ @@ -111,6 +113,8 @@ private: AudioDriverXAudio2 audio_driver; + PowerWinRT *power_manager; + MouseMode mouse_mode; bool alt_mem; bool gr_mem; @@ -260,6 +264,10 @@ public: virtual bool get_swap_ok_cancel() { return true; } void input_event(InputEvent &p_event); + + virtual PowerState get_power_state(); + virtual int get_power_seconds_left(); + virtual int get_power_percent_left(); void queue_key_event(KeyEvent &p_event); diff --git a/platform/windows/SCsub b/platform/windows/SCsub index ae8c07384f..befbe00183 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -12,6 +12,7 @@ common_win = [ "packet_peer_udp_winsock.cpp", "stream_peer_winsock.cpp", "joypad.cpp", + "power_windows.cpp", ] restarget = "godot_res" + env["OBJSUFFIX"] diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 88d534887b..44c0acdb2e 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -28,10 +28,11 @@ /*************************************************************************/ #include "export.h" #include "platform/windows/logo.h" -#include "tools/editor/editor_import_export.h" -#if 0 +#include "editor/editor_export.h" + void register_windows_exporter() { +#if 0 Image img(_windows_logo); Ref<ImageTexture> logo = memnew( ImageTexture ); logo->create_from_image(img); @@ -48,6 +49,6 @@ void register_windows_exporter() { EditorImportExport::get_singleton()->add_export_platform(exporter); } - -} #endif +} + diff --git a/platform/windows/joypad.cpp b/platform/windows/joypad.cpp index f2848268fc..4c1eeb425a 100644 --- a/platform/windows/joypad.cpp +++ b/platform/windows/joypad.cpp @@ -87,16 +87,6 @@ bool JoypadWindows::have_device(const GUID &p_guid) { return false; } -int JoypadWindows::check_free_joy_slot() const { - - for (int i = 0; i < JOYPADS_MAX; i++) { - - if (!attached_joypads[i]) - return i; - } - return -1; -} - // adapted from SDL2, works a lot better than the MSDN version bool JoypadWindows::is_xinput_device(const GUID *p_guid) { @@ -146,7 +136,7 @@ bool JoypadWindows::is_xinput_device(const GUID *p_guid) { bool JoypadWindows::setup_dinput_joypad(const DIDEVICEINSTANCE* instance) { HRESULT hr; - int num = check_free_joy_slot(); + int num = input->get_unused_joy_id(); if (have_device(instance->guidInstance) || num == -1) return false; @@ -296,7 +286,7 @@ void JoypadWindows::probe_joypads() { dwResult = xinput_get_state(i, &x_joypads[i].state); if ( dwResult == ERROR_SUCCESS) { - int id = check_free_joy_slot(); + int id = input->get_unused_joy_id(); if (id != -1 && !x_joypads[i].attached) { x_joypads[i].attached = true; diff --git a/platform/windows/joypad.h b/platform/windows/joypad.h index 63eee8c015..d6670c90db 100644 --- a/platform/windows/joypad.h +++ b/platform/windows/joypad.h @@ -132,7 +132,6 @@ private: void load_xinput(); void unload_xinput(); - int check_free_joy_slot() const; unsigned int post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad); bool have_device(const GUID &p_guid); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index b230dda9cb..8a347e5f32 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -44,7 +44,7 @@ #include "packet_peer_udp_winsock.h" #include "stream_peer_winsock.h" #include "lang_table.h" -#include "globals.h" +#include "global_config.h" #include "io/marshalls.h" #include "joypad.h" @@ -400,14 +400,15 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { if (mouse_mode==MOUSE_MODE_CAPTURED) { Point2i c(video_mode.width/2,video_mode.height/2); + old_x = c.x; + old_y = c.y; + if (Point2i(mm.x,mm.y)==c) { center=c; return 0; } Point2i ncenter(mm.x,mm.y); - mm.x = old_x + (mm.x-center.x); - mm.y = old_y + (mm.y-center.y); center=ncenter; POINT pos = { (int) c.x, (int) c.y }; ClientToScreen(hWnd, &pos); @@ -1092,11 +1093,6 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_ RasterizerGLES3::register_config(); RasterizerGLES3::make_current(); -#else - // FIXME: Does DX support still work now that rasterizer is no longer used? -#ifdef DX9_ENABLED - rasterizer = memnew( RasterizerDX9(hWnd) ); -#endif #endif visual_server = memnew( VisualServerRaster ); @@ -1138,6 +1134,8 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_ input = memnew( InputDefault ); joypad = memnew (JoypadWindows(input, &hWnd)); + power_manager = memnew( PowerWindows ); + AudioDriverManager::get_driver(p_audio_driver)->set_singleton(); if (AudioDriverManager::get_driver(p_audio_driver)->init()!=OK) { @@ -1259,6 +1257,10 @@ void OS_Windows::finalize() { main_loop=NULL; + for (int i = 0; i < get_audio_driver_count(); i++) { + AudioDriverManager::get_driver(i)->finish(); + } + memdelete(joypad); memdelete(input); @@ -1268,8 +1270,6 @@ void OS_Windows::finalize() { if (gl_context) memdelete(gl_context); #endif - if (rasterizer) - memdelete(rasterizer); if (user_proc) { SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)user_proc); @@ -1288,8 +1288,8 @@ void OS_Windows::finalize() { memdelete(physics_2d_server); monitor_info.clear(); - } + void OS_Windows::finalize_core() { memdelete(process_map); @@ -1970,10 +1970,10 @@ Error OS_Windows::execute(const String& p_path, const List<String>& p_arguments, String argss; argss="\"\""+p_path+"\""; + + for (const List<String>::Element* E=p_arguments.front(); E; E=E->next()) { - for(int i=0;i<p_arguments.size();i++) { - - argss+=String(" \"")+p_arguments[i]+"\""; + argss+=String(" \"")+E->get()+"\""; } //print_line("ARGS: "+argss); @@ -2395,6 +2395,23 @@ bool OS_Windows::is_vsync_enabled() const{ return true; } +PowerState OS_Windows::get_power_state() { + return power_manager->get_power_state(); +} + +int OS_Windows::get_power_seconds_left() { + return power_manager->get_power_seconds_left(); +} + +int OS_Windows::get_power_percent_left() { + return power_manager->get_power_percent_left(); +} + +bool OS_Windows::check_feature_support(const String& p_feature) { + + return VisualServer::get_singleton()->has_os_feature(p_feature); + +} OS_Windows::OS_Windows(HINSTANCE _hInstance) { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 2c8fa64f8e..c8cacac7a2 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -31,6 +31,7 @@ #include "os/input.h" #include "os/os.h" +#include "power_windows.h" #include "context_gl_win.h" #include "servers/visual_server.h" #include "servers/visual/rasterizer.h" @@ -92,7 +93,6 @@ class OS_Windows : public OS { ContextGL_Win *gl_context; #endif VisualServer *visual_server; - Rasterizer *rasterizer; PhysicsServer *physics_server; Physics2DServer *physics_2d_server; int pressrc; @@ -126,6 +126,8 @@ class OS_Windows : public OS { InputDefault *input; JoypadWindows *joypad; + PowerWindows *power_manager; + #ifdef RTAUDIO_ENABLED AudioDriverRtAudio driver_rtaudio; #endif @@ -286,6 +288,12 @@ public: virtual void set_use_vsync(bool p_enable); virtual bool is_vsync_enabled() const; + virtual PowerState get_power_state(); + virtual int get_power_seconds_left(); + virtual int get_power_percent_left(); + + virtual bool check_feature_support(const String& p_feature); + OS_Windows(HINSTANCE _hInstance); ~OS_Windows(); diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp index 5baa01c289..276b9b6634 100644 --- a/platform/windows/packet_peer_udp_winsock.cpp +++ b/platform/windows/packet_peer_udp_winsock.cpp @@ -73,10 +73,15 @@ Error PacketPeerUDPWinsock::get_packet(const uint8_t **r_buffer,int &r_buffer_si } Error PacketPeerUDPWinsock::put_packet(const uint8_t *p_buffer,int p_buffer_size){ + ERR_FAIL_COND_V(!peer_addr.is_valid(), ERR_UNCONFIGURED); + + if(sock_type==IP::TYPE_NONE) + sock_type = peer_addr.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6; + int sock = _get_socket(); ERR_FAIL_COND_V( sock == -1, FAILED ); struct sockaddr_storage addr; - size_t addr_size = _set_sockaddr(&addr, peer_addr, peer_port, ip_type); + size_t addr_size = _set_sockaddr(&addr, peer_addr, peer_port, sock_type); _set_blocking(true); @@ -114,15 +119,22 @@ void PacketPeerUDPWinsock::_set_blocking(bool p_blocking) { }; } -Error PacketPeerUDPWinsock::listen(int p_port, int p_recv_buffer_size) { +Error PacketPeerUDPWinsock::listen(int p_port, IP_Address p_bind_address, int p_recv_buffer_size) { + + ERR_FAIL_COND_V(sockfd!=-1,ERR_ALREADY_IN_USE); + ERR_FAIL_COND_V(!p_bind_address.is_valid() && !p_bind_address.is_wildcard(),ERR_INVALID_PARAMETER); + + sock_type = IP::TYPE_ANY; + + if(p_bind_address.is_valid()) + sock_type = p_bind_address.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6; - close(); int sock = _get_socket(); if (sock == -1 ) return ERR_CANT_CREATE; struct sockaddr_storage addr = {0}; - size_t addr_size = _set_listen_sockaddr(&addr, p_port, ip_type, NULL); + size_t addr_size = _set_listen_sockaddr(&addr, p_port, sock_type, IP_Address()); if (bind(sock, (struct sockaddr*)&addr, addr_size) == -1 ) { close(); @@ -141,7 +153,8 @@ void PacketPeerUDPWinsock::close(){ if (sockfd != -1) ::closesocket(sockfd); sockfd=-1; - rb.resize(8); + sock_type = IP::TYPE_NONE; + rb.resize(16); queue_count=0; } @@ -152,6 +165,9 @@ Error PacketPeerUDPWinsock::wait() { } Error PacketPeerUDPWinsock::_poll(bool p_wait) { + if (sockfd==-1) { + return FAILED; + } _set_blocking(p_wait); @@ -159,7 +175,7 @@ Error PacketPeerUDPWinsock::_poll(bool p_wait) { struct sockaddr_storage from = {0}; int len = sizeof(struct sockaddr_storage); int ret; - while ( (ret = recvfrom(sockfd, (char*)recv_buffer, MIN((int)sizeof(recv_buffer),MAX(rb.space_left()-12, 0)), 0, (struct sockaddr*)&from, &len)) > 0) { + while ( (ret = recvfrom(sockfd, (char*)recv_buffer, MIN((int)sizeof(recv_buffer),MAX(rb.space_left()-24, 0)), 0, (struct sockaddr*)&from, &len)) > 0) { uint32_t port = 0; @@ -238,10 +254,12 @@ int PacketPeerUDPWinsock::get_packet_port() const{ int PacketPeerUDPWinsock::_get_socket() { + ERR_FAIL_COND_V(sock_type==IP::TYPE_NONE,-1); + if (sockfd != -1) return sockfd; - sockfd = _socket_create(ip_type, SOCK_DGRAM, IPPROTO_UDP); + sockfd = _socket_create(sock_type, SOCK_DGRAM, IPPROTO_UDP); return sockfd; } @@ -271,7 +289,8 @@ PacketPeerUDPWinsock::PacketPeerUDPWinsock() { packet_port=0; queue_count=0; peer_port=0; - ip_type = IP::TYPE_ANY; + sock_type = IP::TYPE_NONE; + rb.resize(16); } PacketPeerUDPWinsock::~PacketPeerUDPWinsock() { diff --git a/platform/windows/packet_peer_udp_winsock.h b/platform/windows/packet_peer_udp_winsock.h index 18e6bd8f3d..dcd9da9a79 100644 --- a/platform/windows/packet_peer_udp_winsock.h +++ b/platform/windows/packet_peer_udp_winsock.h @@ -46,6 +46,7 @@ class PacketPeerUDPWinsock : public PacketPeerUDP { mutable int packet_port; mutable int queue_count; int sockfd; + IP::Type sock_type; IP_Address peer_addr; int peer_port; @@ -67,7 +68,7 @@ public: virtual int get_max_packet_size() const; - virtual Error listen(int p_port, int p_recv_buffer_size=65536); + virtual Error listen(int p_port, IP_Address p_bind_address=IP_Address("*"), int p_recv_buffer_size=65536); virtual void close(); virtual Error wait(); virtual bool is_listening() const; diff --git a/platform/windows/power_windows.cpp b/platform/windows/power_windows.cpp new file mode 100644 index 0000000000..899b620a24 --- /dev/null +++ b/platform/windows/power_windows.cpp @@ -0,0 +1,108 @@ +/*************************************************************************/ +/* power_windows.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "power_windows.h" + +// CODE CHUNK IMPORTED FROM SDL 2.0 + +bool PowerWindows::GetPowerInfo_Windows() +{ + SYSTEM_POWER_STATUS status; + bool need_details = FALSE; + + /* This API should exist back to Win95. */ + if (!GetSystemPowerStatus(&status)) + { + /* !!! FIXME: push GetLastError() into GetError() */ + power_state = POWERSTATE_UNKNOWN; + } else if (status.BatteryFlag == 0xFF) { /* unknown state */ + power_state = POWERSTATE_UNKNOWN; + } else if (status.BatteryFlag & (1 << 7)) { /* no battery */ + power_state = POWERSTATE_NO_BATTERY; + } else if (status.BatteryFlag & (1 << 3)) { /* charging */ + power_state = POWERSTATE_CHARGING; + need_details = TRUE; + } else if (status.ACLineStatus == 1) { + power_state = POWERSTATE_CHARGED; /* on AC, not charging. */ + need_details = TRUE; + } else { + power_state = POWERSTATE_ON_BATTERY; /* not on AC. */ + need_details = TRUE; + } + + percent_left = -1; + nsecs_left = -1; + if (need_details) { + const int pct = (int) status.BatteryLifePercent; + const int secs = (int) status.BatteryLifeTime; + + if (pct != 255) { /* 255 == unknown */ + percent_left = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ + } + if (secs != 0xFFFFFFFF) { /* ((DWORD)-1) == unknown */ + nsecs_left = secs; + } + } + + return TRUE; /* always the definitive answer on Windows. */ +} + +PowerState PowerWindows::get_power_state() { + if (GetPowerInfo_Windows()) { + return power_state; + } + else { + return POWERSTATE_UNKNOWN; + } +} + +int PowerWindows::get_power_seconds_left() { + if (GetPowerInfo_Windows()) { + return nsecs_left; + } + else { + return -1; + } +} + +int PowerWindows::get_power_percent_left() { + if (GetPowerInfo_Windows()) { + return percent_left; + } + else { + return -1; + } +} + +PowerWindows::PowerWindows() : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) { + +} + +PowerWindows::~PowerWindows() { +} diff --git a/platform/windows/power_windows.h b/platform/windows/power_windows.h new file mode 100644 index 0000000000..5c26faa3d1 --- /dev/null +++ b/platform/windows/power_windows.h @@ -0,0 +1,57 @@ +/*************************************************************************/ +/* power_windows.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 PLATFORM_WINDOWS_POWER_WINDOWS_H_ +#define PLATFORM_WINDOWS_POWER_WINDOWS_H_ + +#include "os/dir_access.h" +#include "os/file_access.h" +#include "os/power.h" + +#include <windows.h> + +class PowerWindows { + +private: + int nsecs_left; + int percent_left; + PowerState power_state; + + bool GetPowerInfo_Windows(); + +public: + PowerWindows(); + virtual ~PowerWindows(); + + PowerState get_power_state(); + int get_power_seconds_left(); + int get_power_percent_left(); +}; + +#endif /* PLATFORM_WINDOWS_POWER_WINDOWS_H_ */ diff --git a/platform/windows/stream_peer_winsock.cpp b/platform/windows/stream_peer_winsock.cpp index 9d3e3623da..106eb6a5f5 100644 --- a/platform/windows/stream_peer_winsock.cpp +++ b/platform/windows/stream_peer_winsock.cpp @@ -78,15 +78,10 @@ Error StreamPeerWinsock::_block(int p_sockfd, bool p_read, bool p_write) const { return ret < 0 ? FAILED : OK; }; -Error StreamPeerWinsock::_poll_connection(bool p_block) const { +Error StreamPeerWinsock::_poll_connection() const { ERR_FAIL_COND_V(status != STATUS_CONNECTING || sockfd == INVALID_SOCKET, FAILED); - if (p_block) { - - _block(sockfd, false, true); - }; - struct sockaddr_storage their_addr; size_t addr_size = _set_sockaddr(&their_addr, peer_host, peer_port, sock_type); @@ -122,7 +117,7 @@ Error StreamPeerWinsock::write(const uint8_t* p_data,int p_bytes, int &r_sent, b if (status != STATUS_CONNECTED) { - if (_poll_connection(p_block) != OK) { + if (_poll_connection() != OK) { return FAILED; }; @@ -180,7 +175,7 @@ Error StreamPeerWinsock::read(uint8_t* p_buffer, int p_bytes,int &r_received, bo if (status != STATUS_CONNECTED) { - if (_poll_connection(p_block) != OK) { + if (_poll_connection() != OK) { return FAILED; }; @@ -254,7 +249,7 @@ Error StreamPeerWinsock::get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_ StreamPeerTCP::Status StreamPeerWinsock::get_status() const { if (status == STATUS_CONNECTING) { - _poll_connection(false); + _poll_connection(); }; return status; @@ -287,11 +282,10 @@ void StreamPeerWinsock::disconnect_from_host() { peer_port = 0; }; -void StreamPeerWinsock::set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_ip_type) { +void StreamPeerWinsock::set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_sock_type) { - ip_type = p_ip_type; sockfd = p_sockfd; - sock_type = p_ip_type; + sock_type = p_sock_type; status = STATUS_CONNECTING; peer_host = p_host; peer_port = p_port; @@ -299,7 +293,7 @@ void StreamPeerWinsock::set_socket(int p_sockfd, IP_Address p_host, int p_port, Error StreamPeerWinsock::connect_to_host(const IP_Address& p_host, uint16_t p_port) { - ERR_FAIL_COND_V( p_host == IP_Address(), ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V( !p_host.is_valid(), ERR_INVALID_PARAMETER); sock_type = p_host.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6; sockfd = _socket_create(sock_type, SOCK_STREAM, IPPROTO_TCP); @@ -369,7 +363,6 @@ StreamPeerWinsock::StreamPeerWinsock() { sockfd = INVALID_SOCKET; status = STATUS_NONE; peer_port = 0; - ip_type = IP::TYPE_ANY; }; StreamPeerWinsock::~StreamPeerWinsock() { diff --git a/platform/windows/stream_peer_winsock.h b/platform/windows/stream_peer_winsock.h index 59e4dc0d09..7cf60fc10e 100644 --- a/platform/windows/stream_peer_winsock.h +++ b/platform/windows/stream_peer_winsock.h @@ -47,7 +47,7 @@ protected: Error _block(int p_sockfd, bool p_read, bool p_write) const; - Error _poll_connection(bool p_block) const; + Error _poll_connection() const; IP_Address peer_host; int peer_port; @@ -69,7 +69,7 @@ public: virtual int get_available_bytes() const; - void set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_ip_type); + void set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_sock_type); virtual IP_Address get_connected_host() const; virtual uint16_t get_connected_port() const; diff --git a/platform/windows/tcp_server_winsock.cpp b/platform/windows/tcp_server_winsock.cpp index 1c3682adfa..883741b115 100644 --- a/platform/windows/tcp_server_winsock.cpp +++ b/platform/windows/tcp_server_winsock.cpp @@ -63,10 +63,20 @@ void TCPServerWinsock::cleanup() { }; -Error TCPServerWinsock::listen(uint16_t p_port,const List<String> *p_accepted_hosts) { +Error TCPServerWinsock::listen(uint16_t p_port,const IP_Address p_bind_address) { + + ERR_FAIL_COND_V(listen_sockfd!=-1,ERR_ALREADY_IN_USE); + ERR_FAIL_COND_V(!p_bind_address.is_valid() && !p_bind_address.is_wildcard(), ERR_INVALID_PARAMETER); int sockfd; - sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); + sock_type = IP::TYPE_ANY; + + // If the bind address is valid use its type as the socket type + if (p_bind_address.is_valid()) + sock_type = p_bind_address.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6; + + + sockfd = _socket_create(sock_type, SOCK_STREAM, IPPROTO_TCP); ERR_FAIL_COND_V(sockfd == INVALID_SOCKET, FAILED); unsigned long par = 1; @@ -77,7 +87,7 @@ Error TCPServerWinsock::listen(uint16_t p_port,const List<String> *p_accepted_ho }; struct sockaddr_storage my_addr; - size_t addr_size = _set_listen_sockaddr(&my_addr, p_port, ip_type, p_accepted_hosts); + size_t addr_size = _set_listen_sockaddr(&my_addr, p_port, sock_type, p_bind_address); int reuse=1; if(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, sizeof(reuse)) < 0) { @@ -150,7 +160,7 @@ Ref<StreamPeerTCP> TCPServerWinsock::take_connection() { int port; _set_ip_addr_port(ip, port, &their_addr); - conn->set_socket(fd, ip, port, ip_type); + conn->set_socket(fd, ip, port, sock_type); return conn; }; @@ -162,13 +172,14 @@ void TCPServerWinsock::stop() { }; listen_sockfd = -1; + sock_type = IP::TYPE_NONE; }; TCPServerWinsock::TCPServerWinsock() { listen_sockfd = INVALID_SOCKET; - ip_type = IP::TYPE_ANY; + sock_type = IP::TYPE_NONE; }; TCPServerWinsock::~TCPServerWinsock() { diff --git a/platform/windows/tcp_server_winsock.h b/platform/windows/tcp_server_winsock.h index 5c544436a7..afbd1e9c87 100644 --- a/platform/windows/tcp_server_winsock.h +++ b/platform/windows/tcp_server_winsock.h @@ -34,12 +34,13 @@ class TCPServerWinsock : public TCP_Server { int listen_sockfd; + IP::Type sock_type; static TCP_Server* _create(); public: - virtual Error listen(uint16_t p_port,const List<String> *p_accepted_hosts=NULL); + virtual Error listen(uint16_t p_port, const IP_Address p_bind_address=IP_Address("*")); virtual bool is_connection_available() const; virtual Ref<StreamPeerTCP> take_connection(); diff --git a/platform/x11/SCsub b/platform/x11/SCsub index 4ae8ac07f7..fc9208c563 100644 --- a/platform/x11/SCsub +++ b/platform/x11/SCsub @@ -8,6 +8,7 @@ common_x11 = [\ "os_x11.cpp",\ "key_mapping_x11.cpp",\ "joypad_linux.cpp",\ + "power_x11.cpp",\ ] env.Program('#bin/godot', ['godot_x11.cpp'] + common_x11) diff --git a/platform/x11/export/export.cpp b/platform/x11/export/export.cpp index 5a4751b387..c40b8f3c1f 100644 --- a/platform/x11/export/export.cpp +++ b/platform/x11/export/export.cpp @@ -28,11 +28,27 @@ /*************************************************************************/ #include "export.h" #include "platform/x11/logo.h" -#include "tools/editor/editor_import_export.h" +#include "editor/editor_export.h" #include "scene/resources/texture.h" -#if 0 + + + void register_x11_exporter() { + Ref<EditorExportPlatformPC> platform; + platform.instance(); + + Image img(_x11_logo); + Ref<ImageTexture> logo; + logo.instance(); + logo->create_from_image(img); + platform->set_logo(logo); + platform->set_name("Linux/X11"); + platform->set_extension(""); + + EditorExport::get_singleton()->add_export_platform(platform); + + #if 0 Image img(_x11_logo); Ref<ImageTexture> logo = memnew( ImageTexture ); logo->create_from_image(img); @@ -49,5 +65,6 @@ void register_x11_exporter() { EditorImportExport::get_singleton()->add_export_platform(exporter); } + #endif } -#endif + diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp index f85ba17020..adb919c2f1 100644 --- a/platform/x11/godot_x11.cpp +++ b/platform/x11/godot_x11.cpp @@ -26,6 +26,10 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#include <unistd.h> +#include <limits.h> +#include <stdlib.h> + #include "main/main.h" #include "os_x11.h" @@ -33,6 +37,9 @@ int main(int argc, char* argv[]) { OS_X11 os; + char *cwd = (char*)malloc(PATH_MAX); + getcwd(cwd, PATH_MAX); + Error err = Main::setup(argv[0],argc-1,&argv[1]); if (err!=OK) return 255; @@ -41,5 +48,8 @@ int main(int argc, char* argv[]) { os.run(); // it is actually the OS that decides how to run Main::cleanup(); + chdir(cwd); + free(cwd); + return os.get_exit_code(); } diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp index 362999661e..bdbd2912a6 100644 --- a/platform/x11/joypad_linux.cpp +++ b/platform/x11/joypad_linux.cpp @@ -219,15 +219,6 @@ void JoypadLinux::monitor_joypads() { } } -int JoypadLinux::get_free_joy_slot() const { - - for (int i = 0; i < JOYPADS_MAX; i++) { - - if (joypads[i].fd == -1) return i; - } - return -1; -} - int JoypadLinux::get_joy_from_path(String p_path) const { for (int i = 0; i < JOYPADS_MAX; i++) { @@ -329,7 +320,7 @@ void JoypadLinux::setup_joypad_properties(int p_id) { void JoypadLinux::open_joypad(const char *p_path) { - int joy_num = get_free_joy_slot(); + int joy_num = input->get_unused_joy_id(); int fd = open(p_path, O_RDWR | O_NONBLOCK); if (fd != -1 && joy_num != -1) { diff --git a/platform/x11/joypad_linux.h b/platform/x11/joypad_linux.h index 18ad199f6b..310f5c1488 100644 --- a/platform/x11/joypad_linux.h +++ b/platform/x11/joypad_linux.h @@ -81,7 +81,6 @@ private: static void joy_thread_func(void *p_user); int get_joy_from_path(String path) const; - int get_free_joy_slot() const; void setup_joypad_properties(int p_id); void close_joypad(int p_id = -1); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index e792d0465e..689fe076f1 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -464,6 +464,9 @@ void OS_X11::finalize() { memdelete(main_loop); main_loop=NULL; + for (int i = 0; i < get_audio_driver_count(); i++) { + AudioDriverManager::get_driver(i)->finish(); + } /* if (debugger_connection_console) { @@ -476,7 +479,6 @@ void OS_X11::finalize() { #endif memdelete(input); - visual_server->finish(); memdelete(visual_server); //memdelete(rasterizer); @@ -512,6 +514,7 @@ void OS_X11::finalize() { args.clear(); + } @@ -1238,7 +1241,7 @@ static Property read_property(Display* p_display, Window p_window, Atom p_proper }while(bytes_after != 0); - Property p = {ret, actual_format, nitems, actual_type}; + Property p = {ret, actual_format, (int)nitems, actual_type}; return p; } @@ -2004,6 +2007,18 @@ void OS_X11::set_context(int p_context) { } } +PowerState OS_X11::get_power_state() { + return power_manager->get_power_state(); +} + +int OS_X11::get_power_seconds_left() { + return power_manager->get_power_seconds_left(); +} + +int OS_X11::get_power_percent_left() { + return power_manager->get_power_percent_left(); +} + OS_X11::OS_X11() { #ifdef RTAUDIO_ENABLED diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 3ec358f103..ce2e2df6e9 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -46,6 +46,7 @@ #include "servers/physics_2d/physics_2d_server_wrap_mt.h" #include "main/input_default.h" #include "joypad_linux.h" +#include "power_x11.h" #include <X11/keysym.h> #include <X11/Xlib.h> @@ -164,6 +165,8 @@ class OS_X11 : public OS_Unix { AudioDriverDummy driver_dummy; Atom net_wm_icon; + + PowerX11 *power_manager; int audio_driver_index; unsigned int capture_idle; @@ -260,6 +263,10 @@ public: virtual void set_use_vsync(bool p_enable); virtual bool is_vsync_enabled() const; + virtual PowerState get_power_state(); + virtual int get_power_seconds_left(); + virtual int get_power_percent_left(); + void run(); OS_X11(); diff --git a/platform/x11/power_x11.cpp b/platform/x11/power_x11.cpp new file mode 100644 index 0000000000..472a32bb48 --- /dev/null +++ b/platform/x11/power_x11.cpp @@ -0,0 +1,575 @@ +/*************************************************************************/ +/* power_x11.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "power_x11.h" + +#include <stdio.h> +#include <unistd.h> + +#include <sys/types.h> +#include <sys/stat.h> +#include <dirent.h> +#include <fcntl.h> + +// CODE CHUNK IMPORTED FROM SDL 2.0 + +static const char* proc_apm_path = "/proc/apm"; +static const char* proc_acpi_battery_path = "/proc/acpi/battery"; +static const char* proc_acpi_ac_adapter_path = "/proc/acpi/ac_adapter"; +static const char* sys_class_power_supply_path = "/sys/class/power_supply"; + +FileAccessRef PowerX11::open_power_file(const char* base, const char* node, const char* key) +{ + String path = String(base) + String("/") + String(node) + String("/") + String(key); + FileAccessRef f = FileAccess::open(path,FileAccess::READ); + return f; +} + + +bool PowerX11::read_power_file(const char* base, const char* node, const char* key, char* buf, size_t buflen) +{ + ssize_t br = 0; + FileAccessRef fd = open_power_file(base, node, key); + if (!fd) { + return false; + } + br = fd->get_buffer(reinterpret_cast<uint8_t*>(buf), buflen-1); + fd->close(); + if (br < 0) { + return false; + } + buf[br] = '\0'; // null-terminate the string + return true; +} + + +bool PowerX11::make_proc_acpi_key_val(char **_ptr, char **_key, char **_val) +{ + char *ptr = *_ptr; + + while (*ptr == ' ') { + ptr++; /* skip whitespace. */ + } + + if (*ptr == '\0') { + return false; /* EOF. */ + } + + *_key = ptr; + + while ((*ptr != ':') && (*ptr != '\0')) { + ptr++; + } + + if (*ptr == '\0') { + return false; /* (unexpected) EOF. */ + } + + *(ptr++) = '\0'; /* terminate the key. */ + + while ((*ptr == ' ') && (*ptr != '\0')) { + ptr++; /* skip whitespace. */ + } + + if (*ptr == '\0') { + return false; /* (unexpected) EOF. */ + } + + *_val = ptr; + + while ((*ptr != '\n') && (*ptr != '\0')) { + ptr++; + } + + if (*ptr != '\0') { + *(ptr++) = '\0'; /* terminate the value. */ + } + + *_ptr = ptr; /* store for next time. */ + return true; +} + +void +PowerX11::check_proc_acpi_battery(const char * node, bool * have_battery, bool * charging) +{ + const char *base = proc_acpi_battery_path; + char info[1024]; + char state[1024]; + char *ptr = NULL; + char *key = NULL; + char *val = NULL; + bool charge = false; + bool choose = false; + int maximum = -1; + int remaining = -1; + int secs = -1; + int pct = -1; + + if (!read_power_file(base, node, "state", state, sizeof (state))) { + return; + } else { + if (!read_power_file(base, node, "info", info, sizeof (info))) + return; + } + + ptr = &state[0]; + while (make_proc_acpi_key_val(&ptr, &key, &val)) { + if (String(key) == "present") { + if (String(val) == "yes") { + *have_battery = true; + } + } else if (String(key) == "charging state") { + /* !!! FIXME: what exactly _does_ charging/discharging mean? */ + if (String(val) == "charging/discharging") { + charge = true; + } else if (String(val) == "charging") { + charge = true; + } + } else if (String(key) == "remaining capacity") { + char *endptr = NULL; + //const int cvt = (int) strtol(val, &endptr, 10); + String sval = val; + const int cvt = sval.to_int(); + if (*endptr == ' ') { + remaining = cvt; + } + } + } + + ptr = &info[0]; + while (make_proc_acpi_key_val(&ptr, &key, &val)) { + if (String(key) == "design capacity") { + char *endptr = NULL; + String sval = val; + const int cvt = sval.to_int(); + if (*endptr == ' ') { + maximum = cvt; + } + } + } + + if ((maximum >= 0) && (remaining >= 0)) { + pct = (int) ((((float) remaining) / ((float) maximum)) * 100.0f); + if (pct < 0) { + pct = 0; + } else if (pct > 100) { + pct = 100; + } + } + + /* !!! FIXME: calculate (secs). */ + + /* + * We pick the battery that claims to have the most minutes left. + * (failing a report of minutes, we'll take the highest percent.) + */ + if ((secs < 0) && (this->nsecs_left < 0)) { + if ((pct < 0) && (this->percent_left < 0)) { + choose = true; /* at least we know there's a battery. */ + } + if (pct > this->percent_left) { + choose = true; + } + } else if (secs > this->nsecs_left) { + choose = true; + } + + if (choose) { + this->nsecs_left = secs; + this->percent_left = pct; + *charging = charge; + } +} + +void PowerX11::check_proc_acpi_ac_adapter(const char * node, bool * have_ac) +{ + const char *base = proc_acpi_ac_adapter_path; + char state[256]; + char *ptr = NULL; + char *key = NULL; + char *val = NULL; + + if (!read_power_file(base, node, "state", state, sizeof (state))) { + return; + } + + ptr = &state[0]; + while (make_proc_acpi_key_val(&ptr, &key, &val)) { + String skey = key; + if (skey == "state") { + String sval = val; + if (sval == "on-line") { + *have_ac = true; + } + } + } +} + + +bool PowerX11::GetPowerInfo_Linux_proc_acpi() +{ + String node; + DirAccess *dirp = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + bool have_battery = false; + bool have_ac = false; + bool charging = false; + + this->nsecs_left = -1; + this->percent_left = -1; + this->power_state = POWERSTATE_UNKNOWN; + + + dirp->change_dir(proc_acpi_battery_path); + dirp->list_dir_begin(); + + if (dirp == NULL) { + return false; /* can't use this interface. */ + } else { + node = dirp->get_next(); + while (node != "") { + check_proc_acpi_battery(node.utf8().get_data(), &have_battery, &charging/*, seconds, percent*/); + node = dirp->get_next(); + } + memdelete(dirp); + } + + dirp->change_dir(proc_acpi_ac_adapter_path); + dirp->list_dir_begin(); + if (dirp == NULL) { + return false; /* can't use this interface. */ + } else { + node = dirp->get_next(); + while (node != "") { + check_proc_acpi_ac_adapter(node.utf8().get_data(), &have_ac); + node = dirp->get_next(); + } + memdelete(dirp); + } + + if (!have_battery) { + this->power_state = POWERSTATE_NO_BATTERY; + } else if (charging) { + this->power_state = POWERSTATE_CHARGING; + } else if (have_ac) { + this->power_state = POWERSTATE_CHARGED; + } else { + this->power_state = POWERSTATE_ON_BATTERY; + } + + return true; /* definitive answer. */ +} + + +bool PowerX11::next_string(char **_ptr, char **_str) +{ + char *ptr = *_ptr; + char *str = *_str; + + while (*ptr == ' ') { /* skip any spaces... */ + ptr++; + } + + if (*ptr == '\0') { + return false; + } + + str = ptr; + while ((*ptr != ' ') && (*ptr != '\n') && (*ptr != '\0')) + ptr++; + + if (*ptr != '\0') + *(ptr++) = '\0'; + + *_str = str; + *_ptr = ptr; + return true; +} + +bool PowerX11::int_string(char *str, int *val) +{ + String sval = str; + *val = sval.to_int(); + return (*str != '\0'); +} + +/* http://lxr.linux.no/linux+v2.6.29/drivers/char/apm-emulation.c */ +bool PowerX11::GetPowerInfo_Linux_proc_apm() +{ + bool need_details = false; + int ac_status = 0; + int battery_status = 0; + int battery_flag = 0; + int battery_percent = 0; + int battery_time = 0; + FileAccessRef fd = FileAccess::open(proc_apm_path,FileAccess::READ); + char buf[128]; + char *ptr = &buf[0]; + char *str = NULL; + ssize_t br; + + if (!fd) { + return false; /* can't use this interface. */ + } + + br = fd->get_buffer(reinterpret_cast<uint8_t*>(buf), sizeof (buf) - 1); + fd->close(); + + if (br < 0) { + return false; + } + + buf[br] = '\0'; /* null-terminate the string. */ + if (!next_string(&ptr, &str)) { /* driver version */ + return false; + } + if (!next_string(&ptr, &str)) { /* BIOS version */ + return false; + } + if (!next_string(&ptr, &str)) { /* APM flags */ + return false; + } + + if (!next_string(&ptr, &str)) { /* AC line status */ + return false; + } else if (!int_string(str, &ac_status)) { + return false; + } + + if (!next_string(&ptr, &str)) { /* battery status */ + return false; + } else if (!int_string(str, &battery_status)) { + return false; + } + if (!next_string(&ptr, &str)) { /* battery flag */ + return false; + } else if (!int_string(str, &battery_flag)) { + return false; + } + if (!next_string(&ptr, &str)) { /* remaining battery life percent */ + return false; + } + String sstr = str; + if (sstr[sstr.length() - 1] == '%') { + sstr[sstr.length() - 1] = '\0'; + } + if (!int_string(str, &battery_percent)) { + return false; + } + + if (!next_string(&ptr, &str)) { /* remaining battery life time */ + return false; + } else if (!int_string(str, &battery_time)) { + return false; + } + + if (!next_string(&ptr, &str)) { /* remaining battery life time units */ + return false; + } else if (String(str) == "min") { + battery_time *= 60; + } + + if (battery_flag == 0xFF) { /* unknown state */ + this->power_state = POWERSTATE_UNKNOWN; + } else if (battery_flag & (1 << 7)) { /* no battery */ + this->power_state = POWERSTATE_NO_BATTERY; + } else if (battery_flag & (1 << 3)) { /* charging */ + this->power_state = POWERSTATE_CHARGING; + need_details = true; + } else if (ac_status == 1) { + this->power_state = POWERSTATE_CHARGED; /* on AC, not charging. */ + need_details = true; + } else { + this->power_state = POWERSTATE_ON_BATTERY; + need_details = true; + } + + this->percent_left = -1; + this->nsecs_left = -1; + if (need_details) { + const int pct = battery_percent; + const int secs = battery_time; + + if (pct >= 0) { /* -1 == unknown */ + this->percent_left = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ + } + if (secs >= 0) { /* -1 == unknown */ + this->nsecs_left = secs; + } + } + + return true; +} + +/* !!! FIXME: implement d-bus queries to org.freedesktop.UPower. */ + +bool PowerX11::GetPowerInfo_Linux_sys_class_power_supply(/*PowerState *state, int *seconds, int *percent*/) +{ + const char* base = sys_class_power_supply_path; + String name; + + DirAccess *dirp = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + dirp->change_dir(base); + dirp->list_dir_begin(); + + if (!dirp) { + return false; + } + + this->power_state = POWERSTATE_NO_BATTERY; /* assume we're just plugged in. */ + this->nsecs_left = -1; + this->percent_left = -1; + + name = dirp->get_next(); + + while (name != "") { + bool choose = false; + char str[64]; + PowerState st; + int secs; + int pct; + + if ((name == ".") || (name == "..")) { + name = dirp->get_next(); + continue; //skip these, of course. + } else { + if (!read_power_file(base, name.utf8().get_data(), "type", str, sizeof (str))) { + name = dirp->get_next(); + continue; // Don't know _what_ we're looking at. Give up on it. + } else { + if (String(str) != "Battery\n") { + name = dirp->get_next(); + continue; // we don't care about UPS and such. + } + } + } + + /* some drivers don't offer this, so if it's not explicitly reported assume it's present. */ + if (read_power_file(base, name.utf8().get_data(), "present", str, sizeof (str)) && (String(str) == "0\n")) { + st = POWERSTATE_NO_BATTERY; + } else if (!read_power_file(base, name.utf8().get_data(), "status", str, sizeof (str))) { + st = POWERSTATE_UNKNOWN; /* uh oh */ + } else if (String(str) == "Charging\n") { + st = POWERSTATE_CHARGING; + } else if (String(str) == "Discharging\n") { + st = POWERSTATE_ON_BATTERY; + } else if ((String(str) == "Full\n") || (String(str) == "Not charging\n")) { + st = POWERSTATE_CHARGED; + } else { + st = POWERSTATE_UNKNOWN; /* uh oh */ + } + + if (!read_power_file(base, name.utf8().get_data(), "capacity", str, sizeof (str))) { + pct = -1; + } else { + pct = String(str).to_int(); + pct = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ + } + + if (!read_power_file(base, name.utf8().get_data(), "time_to_empty_now", str, sizeof (str))) { + secs = -1; + } else { + secs = String(str).to_int(); + secs = (secs <= 0) ? -1 : secs; /* 0 == unknown */ + } + + /* + * We pick the battery that claims to have the most minutes left. + * (failing a report of minutes, we'll take the highest percent.) + */ + if ((secs < 0) && (this->nsecs_left < 0)) { + if ((pct < 0) && (this->percent_left < 0)) { + choose = true; /* at least we know there's a battery. */ + } else if (pct > this->percent_left) { + choose = true; + } + } else if (secs > this->nsecs_left) { + choose = true; + } + + if (choose) { + this->nsecs_left = secs; + this->percent_left = pct; + this->power_state = st; + } + + name = dirp->get_next(); + } + + memdelete(dirp); + return true; /* don't look any further*/ +} + + + +bool PowerX11::UpdatePowerInfo() +{ + if (GetPowerInfo_Linux_sys_class_power_supply()) { // try method 1 + return true; + } + if (GetPowerInfo_Linux_proc_acpi()) { // try further + return true; + } + if (GetPowerInfo_Linux_proc_apm()) { // try even further + return true; + } + return false; +} + +PowerX11::PowerX11() : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) { +} + +PowerX11::~PowerX11() { +} + +PowerState PowerX11::get_power_state() { + if (UpdatePowerInfo()) { + return power_state; + } + else { + return POWERSTATE_UNKNOWN; + } +} + +int PowerX11::get_power_seconds_left() { + if (UpdatePowerInfo()) { + return nsecs_left; + } + else { + return -1; + } +} + +int PowerX11::get_power_percent_left() { + if (UpdatePowerInfo()) { + return percent_left; + } + else { + return -1; + } +} diff --git a/platform/x11/power_x11.h b/platform/x11/power_x11.h new file mode 100644 index 0000000000..6efb2de348 --- /dev/null +++ b/platform/x11/power_x11.h @@ -0,0 +1,68 @@ +/*************************************************************************/ +/* power_x11.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 X11_POWER_H_ +#define X11_POWER_H_ + +#include "os/dir_access.h" +#include "os/file_access.h" +#include "os/power.h" + + +class PowerX11 { + +private: + int nsecs_left; + int percent_left; + PowerState power_state; + + + FileAccessRef open_power_file(const char* base, const char* node, const char* key); + bool read_power_file(const char* base, const char* node, const char* key, char* buf, size_t buflen); + bool make_proc_acpi_key_val(char **_ptr, char **_key, char **_val); + void check_proc_acpi_battery(const char * node, bool * have_battery, bool * charging); + void check_proc_acpi_ac_adapter(const char * node, bool * have_ac); + bool GetPowerInfo_Linux_proc_acpi(); + bool next_string(char **_ptr, char **_str); + bool int_string(char *str, int *val); + bool GetPowerInfo_Linux_proc_apm(); + bool GetPowerInfo_Linux_sys_class_power_supply(); + bool UpdatePowerInfo(); + + +public: + PowerX11(); + virtual ~PowerX11(); + + PowerState get_power_state(); + int get_power_seconds_left(); + int get_power_percent_left(); +}; + +#endif /* X11_POWER_H_ */ diff --git a/prop_renames.txt b/prop_renames.txt deleted file mode 100644 index e2156f2368..0000000000 --- a/prop_renames.txt +++ /dev/null @@ -1,524 +0,0 @@ -[Object] -script/script = script - -[Node] -pause/pause_mode = pause_mode - -[Control] - -anchor/left = anchor_left -anchor/right = anchor_right -anchor/bottom = anchor_bottom -anchor/top = anchor_top - -focus_neighbour/left=focus_neighbour_left -focus_neighbour/right=focus_neighbour_right -focus_neighbour/bottom=focus_neighbour_bottom -focus_neighbour/top=focus_neighbour_top -focus/ignore_mouse = focus_ignore_mouse -focus/stop_mouse = focus_stop_mouse - -size_flags/horizontal = size_flags_horizontal -size_flags/vertical = size_flags_vertical -size_flags/stretch_ratio = size_flags_stretch_ratio -theme/theme = theme - -[CanvasItem] - -visibility/visible = visible -visibility/behind_parent = show_behind_parent -visibility/on_top = show_on_top -visibility/light_mask = light_mask -material/material = material -material/use_parent = use_parent_material - - -[Resource] - -resource/path = resource_path -resource/name = resource_name - - -[Area2D] - -collision/layers = collision_layers -collision/mask = collision_mask - -[Camera2D] - -limit/left = limit_left -limit/right = limit_right -limit/bottom = limit_bottom -limit/top = limit_top -limit/smoothed = limit_smoothed - -draw_margin/h_enabled = draw_margin_h_enabled -draw_margin/v_enabled = draw_margin_v_enabled - -smoothing/enable = smoothing_enabled -smoothing/speed = smoothing_speed - -drag_margin/left = drag_margin_left -drag_margin/top = drag_margin_top -drag_margin/right = drag_margin_right -drag_margin/bottom = drag_margin_bottom - -[CollisionObject2D] - -input/pickable = input_pickable - -[Joint2D] - -bias/bias = bias -collision/exclude_nodes = disable_collision - -[Light2D] - -range/height = range_height -range/z_min = range_z_min -range/z_max = range_z_max -range/layer_max = range_layer_max -range/item_cull_mask = range_item_cull_max - -shadow/enabled = shadow_enabled -shadow/color = shadow_color -shadow/buffer_size = shadow_buffer_size -shadow/gradient_length = shadow_gradient_length -shadow/filter = shadow_filter -shadow/item_cull_mask = shadow_item_cull_mask - -[Node2D] - -transform/pos = position -transform/rot = rotation -transform/scale = scale -z/z = z -z/relative = z_as_relative - -[ParallaxBackground] - -scroll/offset = scroll_offset -scroll/base_offset = scroll_base_offset -scroll/base_scale = scroll_base_scale -scroll/limit_begin = scroll_limit_begin -scroll/limit_end = scroll_limit_end -scroll/ignore_camera_zoom = scroll_ignore_camera_zoom - -[ParallaxLayer] - -motion/scale = motion_scale -motion/offset = motion_offset -motion/mirroring = motion_mirroring - -[PhysicsBody2D] - -collision/layers = collision_layer -collision/mask = collision_mask - -[Polygon2D] - -texture/texture = texture -texture/offset = texture_offset -texture/rotation = texture_rotation -texture/scale = texture_scale - -invert/enable = invert_enable -invert/border = invert_border - -[SamplePlayer2D] - -config/polyphony = polyphony -config/samples = samples -config/pitch_random = random_pitch - -[SoundPlayer2D] - -params/volume_db = volume_db -params/pitch_scale = pitch_scale -params/attenuation/min_distance = attenuation_min_distance -params/attenuation/max_distance = attenuation_max_distance -params/attenuation/distance_exp = attenuation_distance_exp - -[TileMap] - -cell/size = cell_size -cell/quadrant_size = cell_quadrant_size -cell/half_offset = cell_half_offset -cell/tile_origin = cell_tile_origin -cell/y_sort = cell_y_sort - -collision/use_kinematic = collision_use_kinematic -collision/friction = collision_friction -collision/bounce = collision_bounce -collision/layers = collision_layers -collision/mask = collision_mask - -occluder/light_mask = occluder_light_mask - -[VisibilityEnabler2D] - -enabler/pause_animations = pause_animations -enabler/freeze_bodies = freeze_bodies -enabler/pause_particles = pause_particles -enabler/pause_animated_sprites = pause_animated_sprites -enabler/process_parent = process_parent -enabler/fixed_process_parent = fixed_process_parent - - -[YSort] - -sort/enabled = sort_enabled - - -[Area] - -collision/layers = collision_layers -collision/mask = collision_mask - - -[CollisionObject] - -input/ray_pickable = input_ray_pickable -input/capture_on_drag = input_capture_on_drag - -[Light] - -light/color = light_color -light/energy = light_energy -light/negative = light_negative -light/specular = light_specular -light/cull_mask = light_cull_mask - -shadow/enabled = shadow_enabled -shadow/color = shadow_color -shadow/bias = shadow_bias -shadow/max_distance = shadow_max_distance -editor/editor_only = editor_only - -[DirectionalLight] - -directional_shadow/mode = directional_shadow_mode -directional_shadow/split_1 = directional_shadow_split_1 -directional_shadow/split_2 = directional_shadow_split_2 -directional_shadow/split_3 = directional_shadow_split_3 -directional_shadow/blend_splits = directional_shadow_blend_splits -directional_shadow/normal_bias = directional_shadow_normal_bias -directional_shadow/bias_split_scale = directional_shadow_bias_split_scale - -[OmniLight] - -omni/range = omni_range -omni/attenuation = omni_attenuation -omni/shadow_mode = omni_shadow_mode -omni/shadow_detail = omni_shadow_detail - -[SpotLight] - -spot/range = spot_range -spot/attenuation = spot_attenuation -spot/angle = spot_angle -spot/spot_attenuation = spot_angle_attenuation - -[MeshInstance] - -mesh/mesh = mesh -mesh/skeleton = skeleton - - -[PhysicsBody] - -collision/layers = collision_layer -collision/mask = collision_mask - -[Quad] - -quad/axis = axis -quad/size = size -quad/offset = offset -quad/centered = centered - -[Spatial] - -transform/local = transform -transform/transiation = translation -transform/rotation = rotation -transform/scale = scale -visibility/visible = visible - -[SpatialPlayer] - -params/volume_db = volume_db -params/pitch_scale = pitch_scale -params/attenuation/min_distance = attenuation_min_distance -params/attenuation/max_distance = attenuation_max_distance -params/attenuation/distance_exp = attenuation_distance_exp -params/emission_cone/degrees = emission_cone_degrees -params/emission_cone/attenuation_db = emission_cone_attenuation_db - -[SpatialSamplePlayer] - -config/polyphony = polyphony -config/samples = samples - -[Sprite3D] - -flags/transparent = transparent -flags/shaded = shaded -flags/alpha_cut = alpha_cut - -[VehicleWheel] - -type/traction = use_as_traction -type/steering = use_as_steering - -wheel/radius = wheel_radius -wheel/rest_length = wheel_rest_length -wheel/friction_slip = wheel_friction_sleep - -suspension/travel = suspension_travel -suspension/stiffness = suspension_stiffness -suspension/max_force = suspension_max_force -damping/compression = damping_compression -damping/relaxation = damping_relaxation - -[VehicleBody] - -motion/engine_force = engine_force -motion/breake = breake -motion/steering = steering -body/mass = mass -body/friction = friction - -[VisibilityEnabler] - -enabler/pause_animations = pause_animations -enabler/freeze_bodies = freeze_bodies - -[GeometryInstance] - -geometry/material_override = material_override -geometry/cast_shadow = cast_shadow -geometry/extra_cull_margin = extra_cull_margin -geometry/billboard = use_as_billboard -geometry/billboard_y = use_as_y_billboard -geometry/depth_scale = use_depth_scale -geometry/visible_in_all_rooms = visible_in_all_rooms -geometry/use_baked_light = use_in_baked_light - - - -[AnimationPlayer] - -playback/process_mode = playback_process_mode -playback/default_blend_time = playback_default_blend_time -root/root = root_node - -[AnimationTreePlayer] - -playback/process_mode = playback_process_mode - -[EventPlayer] - -stream/stream = stream -stream/play = play -stream/loop = loop -stream/volume_db = volume_db -stream/pitch_scale = pitch_scale -stream/tempo_scale = tempo_scale -stream/autoplay = autoplay -stream/paused = paused - -[StreamPlayer] - -stream/stream = stream -stream/play = play -stream/loop = loop -stream/volume_db = volume_db -stream/autoplay = autoplay -stream/paused = paused -stream/loop_restart_time = loop_restart_time -stream/buffering_ms = buffering_ms - -[SpatialStreamPlayer] - -stream/stream = stream -stream/play = play -stream/loop = loop -stream/volume_db = volume_db -stream/autoplay = autoplay -stream/paused = paused -stream/loop_restart_time = loop_restart_time -stream/buffering_ms = buffering_ms - -[WindowDialog] - -window/title = window_title - -[AcceptDialog] - -dialog/text = dialog_text -dialog/hide_on_ok = dialog_hide_on_ok - -[LineEdit] - -placeholder/text = placeholder_text -placeholder/alpha = placeholder_alpha -caret/caret_blink = caret_blink -caret/caret_blink_speed = caret_blink_speed - -[Patch9Frame] - -patch_margin/left = patch_margin_left -patch_margin/right = patch_margin_right -patch_margin/top = patch_margin_top -patch_margin/bottom = patch_margin_bottom - - -[Popup] - -popup/exclusive = popup_exclusive - -[ProgressBar] - -percent/visible = percent_visible - -[Range] - -range/min = min_value -range/max = max_value -range/step = step -range/page = page -range/value = value -range/exp_edit = exp_edit -range/rounded = rounded - - -[RigidBody2D] - -velocity/linear = linear_velocity -velocity/angular = angular_velocity -damp_override_linear = linear_damp -damp_override_angular = angular_damp - - -[RigidBody] - -velocity/linear = linear_velocity -velocity/angular = angular_velocity -damp_override_linear = linear_damp -damp_override_angular = angular_damp - -[Tween] - -playback/process_mode = playback_process_mode - -[RichTextLabel] - -bbcode/enabled = bbcode_enabled -bbcode/bbcode = bbcode_text - -[ScrollContainer] - -scroll/horizontal = scroll_horizontal -scroll/vertical = scroll_vertical - -[SplitContainer] - -split/offset = split_offset -split/collapsed = collapsed -split/dragger_visibility = dragger_visibility - -[TextEdit] - -caret/block_caret = caret_block_mode -caret/caret_blink = caret_blink -caret/caret_blink_speed = caret_blink_speed - -[TextureButton] - -textures/normal = texture_normal -textures/pressed = texture_pressed -textures/hover = texture_hover -textures/disabled = texture_disabled -textures/focused = texture_focused -textures/click_mask = texture_click_mask -params/scale = texture_scale -params/modulate = self_modulate - -[TextureProgress] - -texture/under = texture_under -texture/over = texture_over -texture/progress = texture_progress -mode = fill_mode -radial_fill/initial_angle = radial_initial_angle -radial_fill/fill_degrees = radial_fill_degrees -radial_fill/center_offset = radial_center_offset - -[VideoPlayer] - -stream/audio_track = audio_track -stream/stream = stream -stream/volume_db = volume_db -stream/autoplay = stream_autoplay -stream/paused = stream_paused - -[DynamicFont] - -font/size = size -extra_spacing/top = extra_spacing_top -extra_spacing/bottom = extra_spacing_bottom -extra_spacing/char = extra_spacing_char -extra_spacing/space = extra_spacing_space -font/use_mipmaps = use_mipmaps -font/use_filter = use_filter -font/font=font_data - -[StyleBox] - -content_margin/left = content_margin_left -content_margin/right = content_margin_right -content_margin/bottom = content_margin_bottom -content_margin/top = content_margin_top - - -[StyleBoxTexture] - -margin/left = margin_left -margin/top = margin_top -margin/bottom = margin_bottom -margin/right = margin_right - -expand_margin/left = expand_margin_left -expand_margin/top = expand_margin_top -expand_margin/bottom = expand_margin_bottom -expand_margin/right = expand_margin_right - -modulate/color = modulate_color - - -[AnimatedSprite] - -modulate = self_modulate - -[Sprite] - -modulate = self_modulate - -[Patch9Frame] - -modulate = self_modulate - -[TextureRect] - -modulate = self_modulate - - - - - - - - - - diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 64d6ef5560..faecbf3e6d 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -222,34 +222,34 @@ void SpriteFrames::_set_animations(const Array& p_animations) { void SpriteFrames::_bind_methods() { - ClassDB::bind_method(_MD("add_animation","anim"),&SpriteFrames::add_animation); - ClassDB::bind_method(_MD("has_animation","anim"),&SpriteFrames::has_animation); - ClassDB::bind_method(_MD("remove_animation","anim"),&SpriteFrames::remove_animation); - ClassDB::bind_method(_MD("rename_animation","anim","newname"),&SpriteFrames::rename_animation); + ClassDB::bind_method(D_METHOD("add_animation","anim"),&SpriteFrames::add_animation); + ClassDB::bind_method(D_METHOD("has_animation","anim"),&SpriteFrames::has_animation); + ClassDB::bind_method(D_METHOD("remove_animation","anim"),&SpriteFrames::remove_animation); + ClassDB::bind_method(D_METHOD("rename_animation","anim","newname"),&SpriteFrames::rename_animation); - ClassDB::bind_method(_MD("set_animation_speed","anim","speed"),&SpriteFrames::set_animation_speed); - ClassDB::bind_method(_MD("get_animation_speed","anim"),&SpriteFrames::get_animation_speed); + ClassDB::bind_method(D_METHOD("set_animation_speed","anim","speed"),&SpriteFrames::set_animation_speed); + ClassDB::bind_method(D_METHOD("get_animation_speed","anim"),&SpriteFrames::get_animation_speed); - ClassDB::bind_method(_MD("set_animation_loop","anim","loop"),&SpriteFrames::set_animation_loop); - ClassDB::bind_method(_MD("get_animation_loop","anim"),&SpriteFrames::get_animation_loop); + ClassDB::bind_method(D_METHOD("set_animation_loop","anim","loop"),&SpriteFrames::set_animation_loop); + ClassDB::bind_method(D_METHOD("get_animation_loop","anim"),&SpriteFrames::get_animation_loop); - ClassDB::bind_method(_MD("add_frame","anim","frame","atpos"),&SpriteFrames::add_frame,DEFVAL(-1)); - ClassDB::bind_method(_MD("get_frame_count","anim"),&SpriteFrames::get_frame_count); - ClassDB::bind_method(_MD("get_frame","anim","idx"),&SpriteFrames::get_frame); - ClassDB::bind_method(_MD("set_frame","anim","idx","txt"),&SpriteFrames::set_frame); - ClassDB::bind_method(_MD("remove_frame","anim","idx"),&SpriteFrames::remove_frame); - ClassDB::bind_method(_MD("clear","anim"),&SpriteFrames::clear); - ClassDB::bind_method(_MD("clear_all"),&SpriteFrames::clear_all); + ClassDB::bind_method(D_METHOD("add_frame","anim","frame","atpos"),&SpriteFrames::add_frame,DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("get_frame_count","anim"),&SpriteFrames::get_frame_count); + ClassDB::bind_method(D_METHOD("get_frame","anim","idx"),&SpriteFrames::get_frame); + ClassDB::bind_method(D_METHOD("set_frame","anim","idx","txt"),&SpriteFrames::set_frame); + ClassDB::bind_method(D_METHOD("remove_frame","anim","idx"),&SpriteFrames::remove_frame); + ClassDB::bind_method(D_METHOD("clear","anim"),&SpriteFrames::clear); + ClassDB::bind_method(D_METHOD("clear_all"),&SpriteFrames::clear_all); - ClassDB::bind_method(_MD("_set_frames"),&SpriteFrames::_set_frames); - ClassDB::bind_method(_MD("_get_frames"),&SpriteFrames::_get_frames); + ClassDB::bind_method(D_METHOD("_set_frames"),&SpriteFrames::_set_frames); + ClassDB::bind_method(D_METHOD("_get_frames"),&SpriteFrames::_get_frames); - ADD_PROPERTYNZ( PropertyInfo(Variant::ARRAY,"frames",PROPERTY_HINT_NONE,"",0),_SCS("_set_frames"),_SCS("_get_frames")); //compatibility + ADD_PROPERTYNZ( PropertyInfo(Variant::ARRAY,"frames",PROPERTY_HINT_NONE,"",0),"_set_frames","_get_frames"); //compatibility - ClassDB::bind_method(_MD("_set_animations"),&SpriteFrames::_set_animations); - ClassDB::bind_method(_MD("_get_animations"),&SpriteFrames::_get_animations); + ClassDB::bind_method(D_METHOD("_set_animations"),&SpriteFrames::_set_animations); + ClassDB::bind_method(D_METHOD("_get_animations"),&SpriteFrames::_get_animations); - ADD_PROPERTYNZ( PropertyInfo(Variant::ARRAY,"animations",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_animations"),_SCS("_get_animations")); //compatibility + ADD_PROPERTYNZ( PropertyInfo(Variant::ARRAY,"animations",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_animations","_get_animations"); //compatibility } @@ -653,48 +653,48 @@ String AnimatedSprite::get_configuration_warning() const { void AnimatedSprite::_bind_methods() { - ClassDB::bind_method(_MD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite::set_sprite_frames); - ClassDB::bind_method(_MD("get_sprite_frames:SpriteFrames"),&AnimatedSprite::get_sprite_frames); + ClassDB::bind_method(D_METHOD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite::set_sprite_frames); + ClassDB::bind_method(D_METHOD("get_sprite_frames:SpriteFrames"),&AnimatedSprite::get_sprite_frames); - ClassDB::bind_method(_MD("set_animation","animation"),&AnimatedSprite::set_animation); - ClassDB::bind_method(_MD("get_animation"),&AnimatedSprite::get_animation); + ClassDB::bind_method(D_METHOD("set_animation","animation"),&AnimatedSprite::set_animation); + ClassDB::bind_method(D_METHOD("get_animation"),&AnimatedSprite::get_animation); - ClassDB::bind_method(_MD("_set_playing","playing"),&AnimatedSprite::_set_playing); - ClassDB::bind_method(_MD("_is_playing"),&AnimatedSprite::_is_playing); + ClassDB::bind_method(D_METHOD("_set_playing","playing"),&AnimatedSprite::_set_playing); + ClassDB::bind_method(D_METHOD("_is_playing"),&AnimatedSprite::_is_playing); - ClassDB::bind_method(_MD("play","anim"),&AnimatedSprite::play,DEFVAL(StringName())); - ClassDB::bind_method(_MD("stop"),&AnimatedSprite::stop); - ClassDB::bind_method(_MD("is_playing"),&AnimatedSprite::is_playing); + ClassDB::bind_method(D_METHOD("play","anim"),&AnimatedSprite::play,DEFVAL(StringName())); + ClassDB::bind_method(D_METHOD("stop"),&AnimatedSprite::stop); + ClassDB::bind_method(D_METHOD("is_playing"),&AnimatedSprite::is_playing); - ClassDB::bind_method(_MD("set_centered","centered"),&AnimatedSprite::set_centered); - ClassDB::bind_method(_MD("is_centered"),&AnimatedSprite::is_centered); + ClassDB::bind_method(D_METHOD("set_centered","centered"),&AnimatedSprite::set_centered); + ClassDB::bind_method(D_METHOD("is_centered"),&AnimatedSprite::is_centered); - ClassDB::bind_method(_MD("set_offset","offset"),&AnimatedSprite::set_offset); - ClassDB::bind_method(_MD("get_offset"),&AnimatedSprite::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","offset"),&AnimatedSprite::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&AnimatedSprite::get_offset); - ClassDB::bind_method(_MD("set_flip_h","flip_h"),&AnimatedSprite::set_flip_h); - ClassDB::bind_method(_MD("is_flipped_h"),&AnimatedSprite::is_flipped_h); + ClassDB::bind_method(D_METHOD("set_flip_h","flip_h"),&AnimatedSprite::set_flip_h); + ClassDB::bind_method(D_METHOD("is_flipped_h"),&AnimatedSprite::is_flipped_h); - ClassDB::bind_method(_MD("set_flip_v","flip_v"),&AnimatedSprite::set_flip_v); - ClassDB::bind_method(_MD("is_flipped_v"),&AnimatedSprite::is_flipped_v); + ClassDB::bind_method(D_METHOD("set_flip_v","flip_v"),&AnimatedSprite::set_flip_v); + ClassDB::bind_method(D_METHOD("is_flipped_v"),&AnimatedSprite::is_flipped_v); - ClassDB::bind_method(_MD("set_frame","frame"),&AnimatedSprite::set_frame); - ClassDB::bind_method(_MD("get_frame"),&AnimatedSprite::get_frame); + ClassDB::bind_method(D_METHOD("set_frame","frame"),&AnimatedSprite::set_frame); + ClassDB::bind_method(D_METHOD("get_frame"),&AnimatedSprite::get_frame); - ClassDB::bind_method(_MD("_res_changed"),&AnimatedSprite::_res_changed); + ClassDB::bind_method(D_METHOD("_res_changed"),&AnimatedSprite::_res_changed); ADD_SIGNAL(MethodInfo("frame_changed")); ADD_SIGNAL(MethodInfo("animation_finished")); - ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "frames",PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), _SCS("set_sprite_frames"),_SCS("get_sprite_frames")); - ADD_PROPERTY( PropertyInfo( Variant::STRING, "animation"), _SCS("set_animation"),_SCS("get_animation")); - ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), _SCS("set_frame"),_SCS("get_frame")); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "playing"), _SCS("_set_playing"),_SCS("_is_playing")); - ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "centered"), _SCS("set_centered"),_SCS("is_centered")); - ADD_PROPERTYNZ( PropertyInfo( Variant::VECTOR2, "offset"), _SCS("set_offset"),_SCS("get_offset")); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_h"), _SCS("set_flip_h"),_SCS("is_flipped_h")); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_v"), _SCS("set_flip_v"),_SCS("is_flipped_v")); + ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "frames",PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), "set_sprite_frames","get_sprite_frames"); + ADD_PROPERTY( PropertyInfo( Variant::STRING, "animation"), "set_animation","get_animation"); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), "set_frame","get_frame"); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "playing"), "_set_playing","_is_playing"); + ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "centered"), "set_centered","is_centered"); + ADD_PROPERTYNZ( PropertyInfo( Variant::VECTOR2, "offset"), "set_offset","get_offset"); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_h"), "set_flip_h","is_flipped_h"); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_v"), "set_flip_v","is_flipped_v"); } diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 61ed362cf0..55c7716b6b 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -357,6 +357,10 @@ void Area2D::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; ERR_CONTINUE(!node); + + node->disconnect(SceneStringNames::get_singleton()->tree_entered,this,SceneStringNames::get_singleton()->_body_enter_tree); + node->disconnect(SceneStringNames::get_singleton()->tree_exited,this,SceneStringNames::get_singleton()->_body_exit_tree); + if (!E->get().in_tree) continue; @@ -366,9 +370,6 @@ void Area2D::_clear_monitoring() { } emit_signal(SceneStringNames::get_singleton()->body_exited,obj); - - node->disconnect(SceneStringNames::get_singleton()->tree_entered,this,SceneStringNames::get_singleton()->_body_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exited,this,SceneStringNames::get_singleton()->_body_exit_tree); } } @@ -388,6 +389,9 @@ void Area2D::_clear_monitoring() { continue; //ERR_CONTINUE(!node); + node->disconnect(SceneStringNames::get_singleton()->tree_entered,this,SceneStringNames::get_singleton()->_area_enter_tree); + node->disconnect(SceneStringNames::get_singleton()->tree_exited,this,SceneStringNames::get_singleton()->_area_exit_tree); + if (!E->get().in_tree) continue; @@ -397,9 +401,6 @@ void Area2D::_clear_monitoring() { } emit_signal(SceneStringNames::get_singleton()->area_exited,obj); - - node->disconnect(SceneStringNames::get_singleton()->tree_entered,this,SceneStringNames::get_singleton()->_area_enter_tree); - node->disconnect(SceneStringNames::get_singleton()->tree_exited,this,SceneStringNames::get_singleton()->_area_exit_tree); } } @@ -587,62 +588,62 @@ bool Area2D::get_layer_mask_bit(int p_bit) const{ void Area2D::_bind_methods() { - ClassDB::bind_method(_MD("_body_enter_tree","id"),&Area2D::_body_enter_tree); - ClassDB::bind_method(_MD("_body_exit_tree","id"),&Area2D::_body_exit_tree); + ClassDB::bind_method(D_METHOD("_body_enter_tree","id"),&Area2D::_body_enter_tree); + ClassDB::bind_method(D_METHOD("_body_exit_tree","id"),&Area2D::_body_exit_tree); - ClassDB::bind_method(_MD("_area_enter_tree","id"),&Area2D::_area_enter_tree); - ClassDB::bind_method(_MD("_area_exit_tree","id"),&Area2D::_area_exit_tree); + ClassDB::bind_method(D_METHOD("_area_enter_tree","id"),&Area2D::_area_enter_tree); + ClassDB::bind_method(D_METHOD("_area_exit_tree","id"),&Area2D::_area_exit_tree); - ClassDB::bind_method(_MD("set_space_override_mode","enable"),&Area2D::set_space_override_mode); - ClassDB::bind_method(_MD("get_space_override_mode"),&Area2D::get_space_override_mode); + ClassDB::bind_method(D_METHOD("set_space_override_mode","enable"),&Area2D::set_space_override_mode); + ClassDB::bind_method(D_METHOD("get_space_override_mode"),&Area2D::get_space_override_mode); - ClassDB::bind_method(_MD("set_gravity_is_point","enable"),&Area2D::set_gravity_is_point); - ClassDB::bind_method(_MD("is_gravity_a_point"),&Area2D::is_gravity_a_point); + ClassDB::bind_method(D_METHOD("set_gravity_is_point","enable"),&Area2D::set_gravity_is_point); + ClassDB::bind_method(D_METHOD("is_gravity_a_point"),&Area2D::is_gravity_a_point); - ClassDB::bind_method(_MD("set_gravity_distance_scale","distance_scale"),&Area2D::set_gravity_distance_scale); - ClassDB::bind_method(_MD("get_gravity_distance_scale"),&Area2D::get_gravity_distance_scale); + ClassDB::bind_method(D_METHOD("set_gravity_distance_scale","distance_scale"),&Area2D::set_gravity_distance_scale); + ClassDB::bind_method(D_METHOD("get_gravity_distance_scale"),&Area2D::get_gravity_distance_scale); - ClassDB::bind_method(_MD("set_gravity_vector","vector"),&Area2D::set_gravity_vector); - ClassDB::bind_method(_MD("get_gravity_vector"),&Area2D::get_gravity_vector); + ClassDB::bind_method(D_METHOD("set_gravity_vector","vector"),&Area2D::set_gravity_vector); + ClassDB::bind_method(D_METHOD("get_gravity_vector"),&Area2D::get_gravity_vector); - ClassDB::bind_method(_MD("set_gravity","gravity"),&Area2D::set_gravity); - ClassDB::bind_method(_MD("get_gravity"),&Area2D::get_gravity); + ClassDB::bind_method(D_METHOD("set_gravity","gravity"),&Area2D::set_gravity); + ClassDB::bind_method(D_METHOD("get_gravity"),&Area2D::get_gravity); - ClassDB::bind_method(_MD("set_linear_damp","linear_damp"),&Area2D::set_linear_damp); - ClassDB::bind_method(_MD("get_linear_damp"),&Area2D::get_linear_damp); + ClassDB::bind_method(D_METHOD("set_linear_damp","linear_damp"),&Area2D::set_linear_damp); + ClassDB::bind_method(D_METHOD("get_linear_damp"),&Area2D::get_linear_damp); - ClassDB::bind_method(_MD("set_angular_damp","angular_damp"),&Area2D::set_angular_damp); - ClassDB::bind_method(_MD("get_angular_damp"),&Area2D::get_angular_damp); + ClassDB::bind_method(D_METHOD("set_angular_damp","angular_damp"),&Area2D::set_angular_damp); + ClassDB::bind_method(D_METHOD("get_angular_damp"),&Area2D::get_angular_damp); - ClassDB::bind_method(_MD("set_priority","priority"),&Area2D::set_priority); - ClassDB::bind_method(_MD("get_priority"),&Area2D::get_priority); + ClassDB::bind_method(D_METHOD("set_priority","priority"),&Area2D::set_priority); + ClassDB::bind_method(D_METHOD("get_priority"),&Area2D::get_priority); - ClassDB::bind_method(_MD("set_collision_mask","collision_mask"),&Area2D::set_collision_mask); - ClassDB::bind_method(_MD("get_collision_mask"),&Area2D::get_collision_mask); + ClassDB::bind_method(D_METHOD("set_collision_mask","collision_mask"),&Area2D::set_collision_mask); + ClassDB::bind_method(D_METHOD("get_collision_mask"),&Area2D::get_collision_mask); - ClassDB::bind_method(_MD("set_layer_mask","layer_mask"),&Area2D::set_layer_mask); - ClassDB::bind_method(_MD("get_layer_mask"),&Area2D::get_layer_mask); + ClassDB::bind_method(D_METHOD("set_layer_mask","layer_mask"),&Area2D::set_layer_mask); + ClassDB::bind_method(D_METHOD("get_layer_mask"),&Area2D::get_layer_mask); - ClassDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&Area2D::set_collision_mask_bit); - ClassDB::bind_method(_MD("get_collision_mask_bit","bit"),&Area2D::get_collision_mask_bit); + ClassDB::bind_method(D_METHOD("set_collision_mask_bit","bit","value"),&Area2D::set_collision_mask_bit); + ClassDB::bind_method(D_METHOD("get_collision_mask_bit","bit"),&Area2D::get_collision_mask_bit); - ClassDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&Area2D::set_layer_mask_bit); - ClassDB::bind_method(_MD("get_layer_mask_bit","bit"),&Area2D::get_layer_mask_bit); + ClassDB::bind_method(D_METHOD("set_layer_mask_bit","bit","value"),&Area2D::set_layer_mask_bit); + ClassDB::bind_method(D_METHOD("get_layer_mask_bit","bit"),&Area2D::get_layer_mask_bit); - ClassDB::bind_method(_MD("set_monitoring","enable"),&Area2D::set_monitoring); - ClassDB::bind_method(_MD("is_monitoring"),&Area2D::is_monitoring); + ClassDB::bind_method(D_METHOD("set_monitoring","enable"),&Area2D::set_monitoring); + ClassDB::bind_method(D_METHOD("is_monitoring"),&Area2D::is_monitoring); - ClassDB::bind_method(_MD("set_monitorable","enable"),&Area2D::set_monitorable); - ClassDB::bind_method(_MD("is_monitorable"),&Area2D::is_monitorable); + ClassDB::bind_method(D_METHOD("set_monitorable","enable"),&Area2D::set_monitorable); + ClassDB::bind_method(D_METHOD("is_monitorable"),&Area2D::is_monitorable); - ClassDB::bind_method(_MD("get_overlapping_bodies"),&Area2D::get_overlapping_bodies); - ClassDB::bind_method(_MD("get_overlapping_areas"),&Area2D::get_overlapping_areas); + ClassDB::bind_method(D_METHOD("get_overlapping_bodies"),&Area2D::get_overlapping_bodies); + ClassDB::bind_method(D_METHOD("get_overlapping_areas"),&Area2D::get_overlapping_areas); - ClassDB::bind_method(_MD("overlaps_body","body"),&Area2D::overlaps_body); - ClassDB::bind_method(_MD("overlaps_area","area"),&Area2D::overlaps_area); + ClassDB::bind_method(D_METHOD("overlaps_body","body"),&Area2D::overlaps_body); + ClassDB::bind_method(D_METHOD("overlaps_area","area"),&Area2D::overlaps_area); - ClassDB::bind_method(_MD("_body_inout"),&Area2D::_body_inout); - ClassDB::bind_method(_MD("_area_inout"),&Area2D::_area_inout); + ClassDB::bind_method(D_METHOD("_body_inout"),&Area2D::_body_inout); + ClassDB::bind_method(D_METHOD("_area_inout"),&Area2D::_area_inout); ADD_SIGNAL( MethodInfo("body_shape_entered",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body",PROPERTY_HINT_RESOURCE_TYPE,"PhysicsBody2D"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"area_shape"))); @@ -656,19 +657,19 @@ void Area2D::_bind_methods() { ADD_SIGNAL( MethodInfo("area_exited",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"))); - ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Combine-Replace,Replace,Replace-Combine"),_SCS("set_space_override_mode"),_SCS("get_space_override_mode")); - ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"gravity_point"),_SCS("set_gravity_is_point"),_SCS("is_gravity_a_point")); - ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"gravity_distance_scale", PROPERTY_HINT_RANGE,"0,1024,0.001"),_SCS("set_gravity_distance_scale"),_SCS("get_gravity_distance_scale")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"gravity_vec"),_SCS("set_gravity_vector"),_SCS("get_gravity_vector")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity",PROPERTY_HINT_RANGE,"-1024,1024,0.001"),_SCS("set_gravity"),_SCS("get_gravity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"0,100,0.01"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"0,100,0.01"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); - ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"priority",PROPERTY_HINT_RANGE,"0,128,1"),_SCS("set_priority"),_SCS("get_priority")); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitoring"),_SCS("set_monitoring"),_SCS("is_monitoring")); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitorable"),_SCS("set_monitorable"),_SCS("is_monitorable")); + ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Combine-Replace,Replace,Replace-Combine"),"set_space_override_mode","get_space_override_mode"); + ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"gravity_point"),"set_gravity_is_point","is_gravity_a_point"); + ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"gravity_distance_scale", PROPERTY_HINT_RANGE,"0,1024,0.001"),"set_gravity_distance_scale","get_gravity_distance_scale"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"gravity_vec"),"set_gravity_vector","get_gravity_vector"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity",PROPERTY_HINT_RANGE,"-1024,1024,0.001"),"set_gravity","get_gravity"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"0,100,0.01"),"set_linear_damp","get_linear_damp"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"0,100,0.01"),"set_angular_damp","get_angular_damp"); + ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"priority",PROPERTY_HINT_RANGE,"0,128,1"),"set_priority","get_priority"); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitoring"),"set_monitoring","is_monitoring"); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitorable"),"set_monitorable","is_monitorable"); ADD_GROUP("Collision","collision_"); - ADD_PROPERTYNO( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); - ADD_PROPERTYNO( PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_2D_PHYSICS),"set_layer_mask","get_layer_mask"); + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),"set_collision_mask","get_collision_mask"); } diff --git a/scene/2d/back_buffer_copy.cpp b/scene/2d/back_buffer_copy.cpp index bbeed322b1..eaa33fe70a 100644 --- a/scene/2d/back_buffer_copy.cpp +++ b/scene/2d/back_buffer_copy.cpp @@ -77,14 +77,14 @@ BackBufferCopy::CopyMode BackBufferCopy::get_copy_mode() const{ void BackBufferCopy::_bind_methods() { - ClassDB::bind_method(_MD("set_rect","rect"),&BackBufferCopy::set_rect); - ClassDB::bind_method(_MD("get_rect"),&BackBufferCopy::get_rect); + ClassDB::bind_method(D_METHOD("set_rect","rect"),&BackBufferCopy::set_rect); + ClassDB::bind_method(D_METHOD("get_rect"),&BackBufferCopy::get_rect); - ClassDB::bind_method(_MD("set_copy_mode","copy_mode"),&BackBufferCopy::set_copy_mode); - ClassDB::bind_method(_MD("get_copy_mode"),&BackBufferCopy::get_copy_mode); + ClassDB::bind_method(D_METHOD("set_copy_mode","copy_mode"),&BackBufferCopy::set_copy_mode); + ClassDB::bind_method(D_METHOD("get_copy_mode"),&BackBufferCopy::get_copy_mode); - ADD_PROPERTY( PropertyInfo(Variant::INT,"copy_mode",PROPERTY_HINT_ENUM,"Disabled,Rect,Viewport"),_SCS("set_copy_mode"),_SCS("get_copy_mode")); - ADD_PROPERTY( PropertyInfo(Variant::RECT2,"rect"),_SCS("set_rect"),_SCS("get_rect")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"copy_mode",PROPERTY_HINT_ENUM,"Disabled,Rect,Viewport"),"set_copy_mode","get_copy_mode"); + ADD_PROPERTY( PropertyInfo(Variant::RECT2,"rect"),"set_rect","get_rect"); BIND_CONSTANT( COPY_MODE_DISABLED ); BIND_CONSTANT( COPY_MODE_RECT ); diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 0bafef1b83..9ae2315867 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -590,92 +590,92 @@ Node* Camera2D::get_custom_viewport() const { void Camera2D::_bind_methods() { - ClassDB::bind_method(_MD("set_offset","offset"),&Camera2D::set_offset); - ClassDB::bind_method(_MD("get_offset"),&Camera2D::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","offset"),&Camera2D::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&Camera2D::get_offset); - ClassDB::bind_method(_MD("set_anchor_mode","anchor_mode"),&Camera2D::set_anchor_mode); - ClassDB::bind_method(_MD("get_anchor_mode"),&Camera2D::get_anchor_mode); + ClassDB::bind_method(D_METHOD("set_anchor_mode","anchor_mode"),&Camera2D::set_anchor_mode); + ClassDB::bind_method(D_METHOD("get_anchor_mode"),&Camera2D::get_anchor_mode); - ClassDB::bind_method(_MD("set_rotating","rotating"),&Camera2D::set_rotating); - ClassDB::bind_method(_MD("is_rotating"),&Camera2D::is_rotating); + ClassDB::bind_method(D_METHOD("set_rotating","rotating"),&Camera2D::set_rotating); + ClassDB::bind_method(D_METHOD("is_rotating"),&Camera2D::is_rotating); - ClassDB::bind_method(_MD("make_current"),&Camera2D::make_current); - ClassDB::bind_method(_MD("clear_current"),&Camera2D::clear_current); - ClassDB::bind_method(_MD("_make_current"),&Camera2D::_make_current); + ClassDB::bind_method(D_METHOD("make_current"),&Camera2D::make_current); + ClassDB::bind_method(D_METHOD("clear_current"),&Camera2D::clear_current); + ClassDB::bind_method(D_METHOD("_make_current"),&Camera2D::_make_current); - ClassDB::bind_method(_MD("_update_scroll"),&Camera2D::_update_scroll); + ClassDB::bind_method(D_METHOD("_update_scroll"),&Camera2D::_update_scroll); - ClassDB::bind_method(_MD("_set_current","current"),&Camera2D::_set_current); - ClassDB::bind_method(_MD("is_current"),&Camera2D::is_current); + ClassDB::bind_method(D_METHOD("_set_current","current"),&Camera2D::_set_current); + ClassDB::bind_method(D_METHOD("is_current"),&Camera2D::is_current); - ClassDB::bind_method(_MD("set_limit","margin","limit"),&Camera2D::set_limit); - ClassDB::bind_method(_MD("get_limit","margin"),&Camera2D::get_limit); + ClassDB::bind_method(D_METHOD("set_limit","margin","limit"),&Camera2D::set_limit); + ClassDB::bind_method(D_METHOD("get_limit","margin"),&Camera2D::get_limit); - ClassDB::bind_method(_MD("set_limit_smoothing_enabled","limit_smoothing_enabled"),&Camera2D::set_limit_smoothing_enabled); - ClassDB::bind_method(_MD("is_limit_smoothing_enabled"),&Camera2D::is_limit_smoothing_enabled); + ClassDB::bind_method(D_METHOD("set_limit_smoothing_enabled","limit_smoothing_enabled"),&Camera2D::set_limit_smoothing_enabled); + ClassDB::bind_method(D_METHOD("is_limit_smoothing_enabled"),&Camera2D::is_limit_smoothing_enabled); - ClassDB::bind_method(_MD("set_v_drag_enabled","enabled"),&Camera2D::set_v_drag_enabled); - ClassDB::bind_method(_MD("is_v_drag_enabled"),&Camera2D::is_v_drag_enabled); + ClassDB::bind_method(D_METHOD("set_v_drag_enabled","enabled"),&Camera2D::set_v_drag_enabled); + ClassDB::bind_method(D_METHOD("is_v_drag_enabled"),&Camera2D::is_v_drag_enabled); - ClassDB::bind_method(_MD("set_h_drag_enabled","enabled"),&Camera2D::set_h_drag_enabled); - ClassDB::bind_method(_MD("is_h_drag_enabled"),&Camera2D::is_h_drag_enabled); + ClassDB::bind_method(D_METHOD("set_h_drag_enabled","enabled"),&Camera2D::set_h_drag_enabled); + ClassDB::bind_method(D_METHOD("is_h_drag_enabled"),&Camera2D::is_h_drag_enabled); - ClassDB::bind_method(_MD("set_v_offset","ofs"),&Camera2D::set_v_offset); - ClassDB::bind_method(_MD("get_v_offset"),&Camera2D::get_v_offset); + ClassDB::bind_method(D_METHOD("set_v_offset","ofs"),&Camera2D::set_v_offset); + ClassDB::bind_method(D_METHOD("get_v_offset"),&Camera2D::get_v_offset); - ClassDB::bind_method(_MD("set_h_offset","ofs"),&Camera2D::set_h_offset); - ClassDB::bind_method(_MD("get_h_offset"),&Camera2D::get_h_offset); + ClassDB::bind_method(D_METHOD("set_h_offset","ofs"),&Camera2D::set_h_offset); + ClassDB::bind_method(D_METHOD("get_h_offset"),&Camera2D::get_h_offset); - ClassDB::bind_method(_MD("set_drag_margin","margin","drag_margin"),&Camera2D::set_drag_margin); - ClassDB::bind_method(_MD("get_drag_margin","margin"),&Camera2D::get_drag_margin); + ClassDB::bind_method(D_METHOD("set_drag_margin","margin","drag_margin"),&Camera2D::set_drag_margin); + ClassDB::bind_method(D_METHOD("get_drag_margin","margin"),&Camera2D::get_drag_margin); - ClassDB::bind_method(_MD("get_camera_pos"),&Camera2D::get_camera_pos); - ClassDB::bind_method(_MD("get_camera_screen_center"),&Camera2D::get_camera_screen_center); + ClassDB::bind_method(D_METHOD("get_camera_pos"),&Camera2D::get_camera_pos); + ClassDB::bind_method(D_METHOD("get_camera_screen_center"),&Camera2D::get_camera_screen_center); - ClassDB::bind_method(_MD("set_zoom","zoom"),&Camera2D::set_zoom); - ClassDB::bind_method(_MD("get_zoom"),&Camera2D::get_zoom); + ClassDB::bind_method(D_METHOD("set_zoom","zoom"),&Camera2D::set_zoom); + ClassDB::bind_method(D_METHOD("get_zoom"),&Camera2D::get_zoom); - ClassDB::bind_method(_MD("set_custom_viewport","viewport:Viewport"),&Camera2D::set_custom_viewport); - ClassDB::bind_method(_MD("get_custom_viewport:Viewport"),&Camera2D::get_custom_viewport); + ClassDB::bind_method(D_METHOD("set_custom_viewport","viewport:Viewport"),&Camera2D::set_custom_viewport); + ClassDB::bind_method(D_METHOD("get_custom_viewport:Viewport"),&Camera2D::get_custom_viewport); - ClassDB::bind_method(_MD("set_follow_smoothing","follow_smoothing"),&Camera2D::set_follow_smoothing); - ClassDB::bind_method(_MD("get_follow_smoothing"),&Camera2D::get_follow_smoothing); + ClassDB::bind_method(D_METHOD("set_follow_smoothing","follow_smoothing"),&Camera2D::set_follow_smoothing); + ClassDB::bind_method(D_METHOD("get_follow_smoothing"),&Camera2D::get_follow_smoothing); - ClassDB::bind_method(_MD("set_enable_follow_smoothing","follow_smoothing"),&Camera2D::set_enable_follow_smoothing); - ClassDB::bind_method(_MD("is_follow_smoothing_enabled"),&Camera2D::is_follow_smoothing_enabled); + ClassDB::bind_method(D_METHOD("set_enable_follow_smoothing","follow_smoothing"),&Camera2D::set_enable_follow_smoothing); + ClassDB::bind_method(D_METHOD("is_follow_smoothing_enabled"),&Camera2D::is_follow_smoothing_enabled); - ClassDB::bind_method(_MD("force_update_scroll"),&Camera2D::force_update_scroll); - ClassDB::bind_method(_MD("reset_smoothing"),&Camera2D::reset_smoothing); - ClassDB::bind_method(_MD("align"),&Camera2D::align); + ClassDB::bind_method(D_METHOD("force_update_scroll"),&Camera2D::force_update_scroll); + ClassDB::bind_method(D_METHOD("reset_smoothing"),&Camera2D::reset_smoothing); + ClassDB::bind_method(D_METHOD("align"),&Camera2D::align); - ClassDB::bind_method(_MD("_set_old_smoothing","follow_smoothing"),&Camera2D::_set_old_smoothing); + ClassDB::bind_method(D_METHOD("_set_old_smoothing","follow_smoothing"),&Camera2D::_set_old_smoothing); - ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"offset"),_SCS("set_offset"),_SCS("get_offset")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"anchor_mode",PROPERTY_HINT_ENUM,"Fixed TopLeft,Drag Center"),_SCS("set_anchor_mode"),_SCS("get_anchor_mode")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"rotating"),_SCS("set_rotating"),_SCS("is_rotating")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"current"),_SCS("_set_current"),_SCS("is_current")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"zoom"),_SCS("set_zoom"),_SCS("get_zoom") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"offset"),"set_offset","get_offset"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"anchor_mode",PROPERTY_HINT_ENUM,"Fixed TopLeft,Drag Center"),"set_anchor_mode","get_anchor_mode"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"rotating"),"set_rotating","is_rotating"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"current"),"_set_current","is_current"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"zoom"),"set_zoom","get_zoom") ; ADD_GROUP("Limit","limit_"); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_left"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_LEFT); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_top"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_TOP); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_right"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_RIGHT); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_bottom"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_BOTTOM); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"limit_smoothed"),_SCS("set_limit_smoothing_enabled"),_SCS("is_limit_smoothing_enabled") ); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_left"),"set_limit","get_limit",MARGIN_LEFT); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_top"),"set_limit","get_limit",MARGIN_TOP); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_right"),"set_limit","get_limit",MARGIN_RIGHT); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_bottom"),"set_limit","get_limit",MARGIN_BOTTOM); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"limit_smoothed"),"set_limit_smoothing_enabled","is_limit_smoothing_enabled") ; ADD_GROUP("Draw Margin","draw_margin_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"drag_margin_h_enabled"),_SCS("set_h_drag_enabled"),_SCS("is_h_drag_enabled") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"drag_margin_v_enabled"),_SCS("set_v_drag_enabled"),_SCS("is_v_drag_enabled") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"drag_margin_h_enabled"),"set_h_drag_enabled","is_h_drag_enabled") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"drag_margin_v_enabled"),"set_v_drag_enabled","is_v_drag_enabled") ; ADD_GROUP("Smoothing","smoothing_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"smoothing_enabled"),_SCS("set_enable_follow_smoothing"),_SCS("is_follow_smoothing_enabled") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"smoothing_speed"),_SCS("set_follow_smoothing"),_SCS("get_follow_smoothing") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"smoothing_enabled"),"set_enable_follow_smoothing","is_follow_smoothing_enabled") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"smoothing_speed"),"set_follow_smoothing","get_follow_smoothing") ; ADD_GROUP("Drag Margin","drag_margin_"); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_left",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_LEFT); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_top",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_TOP); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_right",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_RIGHT); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_bottom",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_BOTTOM); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_left",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_drag_margin","get_drag_margin",MARGIN_LEFT); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_top",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_drag_margin","get_drag_margin",MARGIN_TOP); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_right",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_drag_margin","get_drag_margin",MARGIN_RIGHT); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_bottom",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_drag_margin","get_drag_margin",MARGIN_BOTTOM); BIND_CONSTANT( ANCHOR_MODE_DRAG_CENTER ); diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 817707f96e..4f7acf7f97 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -135,10 +135,10 @@ Variant CanvasItemMaterial::get_shader_param(const StringName& p_param) const{ void CanvasItemMaterial::_bind_methods() { - ClassDB::bind_method(_MD("set_shader","shader:Shader"),&CanvasItemMaterial::set_shader); - ClassDB::bind_method(_MD("get_shader:Shader"),&CanvasItemMaterial::get_shader); - ClassDB::bind_method(_MD("set_shader_param","param","value"),&CanvasItemMaterial::set_shader_param); - ClassDB::bind_method(_MD("get_shader_param","param"),&CanvasItemMaterial::get_shader_param); + ClassDB::bind_method(D_METHOD("set_shader","shader:Shader"),&CanvasItemMaterial::set_shader); + ClassDB::bind_method(D_METHOD("get_shader:Shader"),&CanvasItemMaterial::get_shader); + ClassDB::bind_method(D_METHOD("set_shader_param","param","value"),&CanvasItemMaterial::set_shader_param); + ClassDB::bind_method(D_METHOD("get_shader_param","param"),&CanvasItemMaterial::get_shader_param); @@ -747,12 +747,12 @@ float CanvasItem::draw_char(const Ref<Font>& p_font,const Point2& p_pos, const S void CanvasItem::_notify_transform(CanvasItem *p_node) { - if (p_node->xform_change.in_list() && p_node->global_invalid) + if (/*p_node->xform_change.in_list() &&*/ p_node->global_invalid) return; //nothing to do p_node->global_invalid=true; - if (notify_transform && !p_node->xform_change.in_list()) { + if (p_node->notify_transform && !p_node->xform_change.in_list()) { if (!p_node->block_transform_notify) { if (p_node->is_inside_tree()) get_tree()->xform_change_list.add(&p_node->xform_change); @@ -905,105 +905,105 @@ Vector2 CanvasItem::get_local_mouse_pos() const{ void CanvasItem::_bind_methods() { - ClassDB::bind_method(_MD("_toplevel_raise_self"),&CanvasItem::_toplevel_raise_self); - ClassDB::bind_method(_MD("_update_callback"),&CanvasItem::_update_callback); - - ClassDB::bind_method(_MD("edit_set_state","state"),&CanvasItem::edit_set_state); - ClassDB::bind_method(_MD("edit_get_state:Variant"),&CanvasItem::edit_get_state); - ClassDB::bind_method(_MD("edit_set_rect","rect"),&CanvasItem::edit_set_rect); - ClassDB::bind_method(_MD("edit_rotate","degrees"),&CanvasItem::edit_rotate); - - ClassDB::bind_method(_MD("get_item_rect"),&CanvasItem::get_item_rect); - ClassDB::bind_method(_MD("get_item_and_children_rect"),&CanvasItem::get_item_and_children_rect); - //ClassDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform); - - ClassDB::bind_method(_MD("get_canvas_item"),&CanvasItem::get_canvas_item); - - ClassDB::bind_method(_MD("set_visible"),&CanvasItem::set_visible); - ClassDB::bind_method(_MD("is_visible"),&CanvasItem::is_visible); - ClassDB::bind_method(_MD("is_visible_in_tree"),&CanvasItem::is_visible_in_tree); - ClassDB::bind_method(_MD("show"),&CanvasItem::show); - ClassDB::bind_method(_MD("hide"),&CanvasItem::hide); - - ClassDB::bind_method(_MD("update"),&CanvasItem::update); - - ClassDB::bind_method(_MD("set_as_toplevel","enable"),&CanvasItem::set_as_toplevel); - ClassDB::bind_method(_MD("is_set_as_toplevel"),&CanvasItem::is_set_as_toplevel); - - ClassDB::bind_method(_MD("set_light_mask","light_mask"),&CanvasItem::set_light_mask); - ClassDB::bind_method(_MD("get_light_mask"),&CanvasItem::get_light_mask); - - ClassDB::bind_method(_MD("set_modulate","modulate"),&CanvasItem::set_modulate); - ClassDB::bind_method(_MD("get_modulate"),&CanvasItem::get_modulate); - ClassDB::bind_method(_MD("set_self_modulate","self_modulate"),&CanvasItem::set_self_modulate); - ClassDB::bind_method(_MD("get_self_modulate"),&CanvasItem::get_self_modulate); - - ClassDB::bind_method(_MD("set_draw_behind_parent","enable"),&CanvasItem::set_draw_behind_parent); - ClassDB::bind_method(_MD("is_draw_behind_parent_enabled"),&CanvasItem::is_draw_behind_parent_enabled); - - ClassDB::bind_method(_MD("_set_on_top","on_top"),&CanvasItem::_set_on_top); - ClassDB::bind_method(_MD("_is_on_top"),&CanvasItem::_is_on_top); - //ClassDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform); - - ClassDB::bind_method(_MD("draw_line","from","to","color","width","antialiased"),&CanvasItem::draw_line,DEFVAL(1.0),DEFVAL(false)); - ClassDB::bind_method(_MD("draw_rect","rect","color"),&CanvasItem::draw_rect); - ClassDB::bind_method(_MD("draw_circle","pos","radius","color"),&CanvasItem::draw_circle); - ClassDB::bind_method(_MD("draw_texture","texture:Texture","pos","modulate"),&CanvasItem::draw_texture,DEFVAL(Color(1,1,1,1))); - ClassDB::bind_method(_MD("draw_texture_rect","texture:Texture","rect","tile","modulate","transpose"),&CanvasItem::draw_texture_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ClassDB::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)); - ClassDB::bind_method(_MD("draw_style_box","style_box:StyleBox","rect"),&CanvasItem::draw_style_box); - ClassDB::bind_method(_MD("draw_primitive","points","colors","uvs","texture:Texture","width"),&CanvasItem::draw_primitive,DEFVAL(Variant()),DEFVAL(1.0)); - ClassDB::bind_method(_MD("draw_polygon","points","colors","uvs","texture:Texture"),&CanvasItem::draw_polygon,DEFVAL(PoolVector2Array()),DEFVAL(Variant())); - ClassDB::bind_method(_MD("draw_colored_polygon","points","color","uvs","texture:Texture"),&CanvasItem::draw_colored_polygon,DEFVAL(PoolVector2Array()),DEFVAL(Variant())); - ClassDB::bind_method(_MD("draw_string","font:Font","pos","text","modulate","clip_w"),&CanvasItem::draw_string,DEFVAL(Color(1,1,1)),DEFVAL(-1)); - ClassDB::bind_method(_MD("draw_char","font:Font","pos","char","next","modulate"),&CanvasItem::draw_char,DEFVAL(Color(1,1,1))); - - ClassDB::bind_method(_MD("draw_set_transform","pos","rot","scale"),&CanvasItem::draw_set_transform); - ClassDB::bind_method(_MD("draw_set_transform_matrix","xform"),&CanvasItem::draw_set_transform_matrix); - ClassDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform); - ClassDB::bind_method(_MD("get_global_transform"),&CanvasItem::get_global_transform); - ClassDB::bind_method(_MD("get_global_transform_with_canvas"),&CanvasItem::get_global_transform_with_canvas); - ClassDB::bind_method(_MD("get_viewport_transform"),&CanvasItem::get_viewport_transform); - ClassDB::bind_method(_MD("get_viewport_rect"),&CanvasItem::get_viewport_rect); - ClassDB::bind_method(_MD("get_canvas_transform"),&CanvasItem::get_canvas_transform); - ClassDB::bind_method(_MD("get_local_mouse_pos"),&CanvasItem::get_local_mouse_pos); - ClassDB::bind_method(_MD("get_global_mouse_pos"),&CanvasItem::get_global_mouse_pos); - ClassDB::bind_method(_MD("get_canvas"),&CanvasItem::get_canvas); - ClassDB::bind_method(_MD("get_world_2d"),&CanvasItem::get_world_2d); - //ClassDB::bind_method(_MD("get_viewport"),&CanvasItem::get_viewport); - - ClassDB::bind_method(_MD("set_material","material:CanvasItemMaterial"),&CanvasItem::set_material); - ClassDB::bind_method(_MD("get_material:CanvasItemMaterial"),&CanvasItem::get_material); - - ClassDB::bind_method(_MD("set_use_parent_material","enable"),&CanvasItem::set_use_parent_material); - ClassDB::bind_method(_MD("get_use_parent_material"),&CanvasItem::get_use_parent_material); - - ClassDB::bind_method(_MD("set_notify_local_transform","enable"),&CanvasItem::set_notify_local_transform); - ClassDB::bind_method(_MD("is_local_transform_notification_enabled"),&CanvasItem::is_local_transform_notification_enabled); - - ClassDB::bind_method(_MD("set_notify_transform","enable"),&CanvasItem::set_notify_transform); - ClassDB::bind_method(_MD("is_transform_notification_enabled"),&CanvasItem::is_transform_notification_enabled); - - ClassDB::bind_method(_MD("make_canvas_pos_local","screen_point"), + ClassDB::bind_method(D_METHOD("_toplevel_raise_self"),&CanvasItem::_toplevel_raise_self); + ClassDB::bind_method(D_METHOD("_update_callback"),&CanvasItem::_update_callback); + + ClassDB::bind_method(D_METHOD("edit_set_state","state"),&CanvasItem::edit_set_state); + ClassDB::bind_method(D_METHOD("edit_get_state:Variant"),&CanvasItem::edit_get_state); + ClassDB::bind_method(D_METHOD("edit_set_rect","rect"),&CanvasItem::edit_set_rect); + ClassDB::bind_method(D_METHOD("edit_rotate","degrees"),&CanvasItem::edit_rotate); + + ClassDB::bind_method(D_METHOD("get_item_rect"),&CanvasItem::get_item_rect); + ClassDB::bind_method(D_METHOD("get_item_and_children_rect"),&CanvasItem::get_item_and_children_rect); + //ClassDB::bind_method(D_METHOD("get_transform"),&CanvasItem::get_transform); + + ClassDB::bind_method(D_METHOD("get_canvas_item"),&CanvasItem::get_canvas_item); + + ClassDB::bind_method(D_METHOD("set_visible"),&CanvasItem::set_visible); + ClassDB::bind_method(D_METHOD("is_visible"),&CanvasItem::is_visible); + ClassDB::bind_method(D_METHOD("is_visible_in_tree"),&CanvasItem::is_visible_in_tree); + ClassDB::bind_method(D_METHOD("show"),&CanvasItem::show); + ClassDB::bind_method(D_METHOD("hide"),&CanvasItem::hide); + + ClassDB::bind_method(D_METHOD("update"),&CanvasItem::update); + + ClassDB::bind_method(D_METHOD("set_as_toplevel","enable"),&CanvasItem::set_as_toplevel); + ClassDB::bind_method(D_METHOD("is_set_as_toplevel"),&CanvasItem::is_set_as_toplevel); + + ClassDB::bind_method(D_METHOD("set_light_mask","light_mask"),&CanvasItem::set_light_mask); + ClassDB::bind_method(D_METHOD("get_light_mask"),&CanvasItem::get_light_mask); + + ClassDB::bind_method(D_METHOD("set_modulate","modulate"),&CanvasItem::set_modulate); + ClassDB::bind_method(D_METHOD("get_modulate"),&CanvasItem::get_modulate); + ClassDB::bind_method(D_METHOD("set_self_modulate","self_modulate"),&CanvasItem::set_self_modulate); + ClassDB::bind_method(D_METHOD("get_self_modulate"),&CanvasItem::get_self_modulate); + + ClassDB::bind_method(D_METHOD("set_draw_behind_parent","enable"),&CanvasItem::set_draw_behind_parent); + ClassDB::bind_method(D_METHOD("is_draw_behind_parent_enabled"),&CanvasItem::is_draw_behind_parent_enabled); + + ClassDB::bind_method(D_METHOD("_set_on_top","on_top"),&CanvasItem::_set_on_top); + ClassDB::bind_method(D_METHOD("_is_on_top"),&CanvasItem::_is_on_top); + //ClassDB::bind_method(D_METHOD("get_transform"),&CanvasItem::get_transform); + + ClassDB::bind_method(D_METHOD("draw_line","from","to","color","width","antialiased"),&CanvasItem::draw_line,DEFVAL(1.0),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("draw_rect","rect","color"),&CanvasItem::draw_rect); + ClassDB::bind_method(D_METHOD("draw_circle","pos","radius","color"),&CanvasItem::draw_circle); + ClassDB::bind_method(D_METHOD("draw_texture","texture:Texture","pos","modulate"),&CanvasItem::draw_texture,DEFVAL(Color(1,1,1,1))); + ClassDB::bind_method(D_METHOD("draw_texture_rect","texture:Texture","rect","tile","modulate","transpose"),&CanvasItem::draw_texture_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("draw_texture_rect_region","texture:Texture","rect","src_rect","modulate","transpose"),&CanvasItem::draw_texture_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("draw_style_box","style_box:StyleBox","rect"),&CanvasItem::draw_style_box); + ClassDB::bind_method(D_METHOD("draw_primitive","points","colors","uvs","texture:Texture","width"),&CanvasItem::draw_primitive,DEFVAL(Variant()),DEFVAL(1.0)); + ClassDB::bind_method(D_METHOD("draw_polygon","points","colors","uvs","texture:Texture"),&CanvasItem::draw_polygon,DEFVAL(PoolVector2Array()),DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("draw_colored_polygon","points","color","uvs","texture:Texture"),&CanvasItem::draw_colored_polygon,DEFVAL(PoolVector2Array()),DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("draw_string","font:Font","pos","text","modulate","clip_w"),&CanvasItem::draw_string,DEFVAL(Color(1,1,1)),DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("draw_char","font:Font","pos","char","next","modulate"),&CanvasItem::draw_char,DEFVAL(Color(1,1,1))); + + ClassDB::bind_method(D_METHOD("draw_set_transform","pos","rot","scale"),&CanvasItem::draw_set_transform); + ClassDB::bind_method(D_METHOD("draw_set_transform_matrix","xform"),&CanvasItem::draw_set_transform_matrix); + ClassDB::bind_method(D_METHOD("get_transform"),&CanvasItem::get_transform); + ClassDB::bind_method(D_METHOD("get_global_transform"),&CanvasItem::get_global_transform); + ClassDB::bind_method(D_METHOD("get_global_transform_with_canvas"),&CanvasItem::get_global_transform_with_canvas); + ClassDB::bind_method(D_METHOD("get_viewport_transform"),&CanvasItem::get_viewport_transform); + ClassDB::bind_method(D_METHOD("get_viewport_rect"),&CanvasItem::get_viewport_rect); + ClassDB::bind_method(D_METHOD("get_canvas_transform"),&CanvasItem::get_canvas_transform); + ClassDB::bind_method(D_METHOD("get_local_mouse_pos"),&CanvasItem::get_local_mouse_pos); + ClassDB::bind_method(D_METHOD("get_global_mouse_pos"),&CanvasItem::get_global_mouse_pos); + ClassDB::bind_method(D_METHOD("get_canvas"),&CanvasItem::get_canvas); + ClassDB::bind_method(D_METHOD("get_world_2d"),&CanvasItem::get_world_2d); + //ClassDB::bind_method(D_METHOD("get_viewport"),&CanvasItem::get_viewport); + + ClassDB::bind_method(D_METHOD("set_material","material:CanvasItemMaterial"),&CanvasItem::set_material); + ClassDB::bind_method(D_METHOD("get_material:CanvasItemMaterial"),&CanvasItem::get_material); + + ClassDB::bind_method(D_METHOD("set_use_parent_material","enable"),&CanvasItem::set_use_parent_material); + ClassDB::bind_method(D_METHOD("get_use_parent_material"),&CanvasItem::get_use_parent_material); + + ClassDB::bind_method(D_METHOD("set_notify_local_transform","enable"),&CanvasItem::set_notify_local_transform); + ClassDB::bind_method(D_METHOD("is_local_transform_notification_enabled"),&CanvasItem::is_local_transform_notification_enabled); + + ClassDB::bind_method(D_METHOD("set_notify_transform","enable"),&CanvasItem::set_notify_transform); + ClassDB::bind_method(D_METHOD("is_transform_notification_enabled"),&CanvasItem::is_transform_notification_enabled); + + ClassDB::bind_method(D_METHOD("make_canvas_pos_local","screen_point"), &CanvasItem::make_canvas_pos_local); - ClassDB::bind_method(_MD("make_input_local","event"),&CanvasItem::make_input_local); + ClassDB::bind_method(D_METHOD("make_input_local","event"),&CanvasItem::make_input_local); BIND_VMETHOD(MethodInfo("_draw")); ADD_GROUP("Visibility",""); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"visible"), _SCS("set_visible"),_SCS("is_visible") ); - ADD_PROPERTYNO( PropertyInfo(Variant::COLOR,"modulate"), _SCS("set_modulate"),_SCS("get_modulate") ); - ADD_PROPERTYNO( PropertyInfo(Variant::COLOR,"self_modulate"), _SCS("set_self_modulate"),_SCS("get_self_modulate") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"show_behind_parent"), _SCS("set_draw_behind_parent"),_SCS("is_draw_behind_parent_enabled") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"show_on_top",PROPERTY_HINT_NONE,"",0), _SCS("_set_on_top"),_SCS("_is_on_top") ); //compatibility - ADD_PROPERTYNO( PropertyInfo(Variant::INT,"light_mask",PROPERTY_HINT_LAYERS_2D_RENDER), _SCS("set_light_mask"),_SCS("get_light_mask") ); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"visible"), "set_visible","is_visible") ; + ADD_PROPERTYNO( PropertyInfo(Variant::COLOR,"modulate"), "set_modulate","get_modulate") ; + ADD_PROPERTYNO( PropertyInfo(Variant::COLOR,"self_modulate"), "set_self_modulate","get_self_modulate") ; + ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"show_behind_parent"), "set_draw_behind_parent","is_draw_behind_parent_enabled") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"show_on_top",PROPERTY_HINT_NONE,"",0), "_set_on_top","_is_on_top") ; //compatibility + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"light_mask",PROPERTY_HINT_LAYERS_2D_RENDER), "set_light_mask","get_light_mask") ; ADD_GROUP("Material",""); - ADD_PROPERTYNZ( PropertyInfo(Variant::OBJECT,"material",PROPERTY_HINT_RESOURCE_TYPE, "CanvasItemMaterial"), _SCS("set_material"),_SCS("get_material") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"use_parent_material"), _SCS("set_use_parent_material"),_SCS("get_use_parent_material") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::OBJECT,"material",PROPERTY_HINT_RESOURCE_TYPE, "CanvasItemMaterial"), "set_material","get_material") ; + ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"use_parent_material"), "set_use_parent_material","get_use_parent_material") ; //exporting these two things doesn't really make much sense i think - //ADD_PROPERTY( PropertyInfo(Variant::BOOL,"transform/toplevel"), _SCS("set_as_toplevel"),_SCS("is_set_as_toplevel") ); - //ADD_PROPERTY(PropertyInfo(Variant::BOOL,"transform/notify"),_SCS("set_transform_notify"),_SCS("is_transform_notify_enabled")); + //ADD_PROPERTY( PropertyInfo(Variant::BOOL,"transform/toplevel"), "set_as_toplevel","is_set_as_toplevel") ; + //ADD_PROPERTY(PropertyInfo(Variant::BOOL,"transform/notify"),"set_transform_notify","is_transform_notify_enabled"); ADD_SIGNAL( MethodInfo("draw") ); ADD_SIGNAL( MethodInfo("visibility_changed") ); diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index 138589651c..ecc11ea60f 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -62,10 +62,10 @@ void CanvasModulate::_notification(int p_what) { void CanvasModulate::_bind_methods(){ - ClassDB::bind_method(_MD("set_color","color"),&CanvasModulate::set_color); - ClassDB::bind_method(_MD("get_color"),&CanvasModulate::get_color); + ClassDB::bind_method(D_METHOD("set_color","color"),&CanvasModulate::set_color); + ClassDB::bind_method(D_METHOD("get_color"),&CanvasModulate::get_color); - ADD_PROPERTY(PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color")); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"color"),"set_color","get_color"); } diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index 3668963251..f9e1cc0bd7 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -221,20 +221,20 @@ void CollisionObject2D::_update_pickable() { void CollisionObject2D::_bind_methods() { - ClassDB::bind_method(_MD("add_shape","shape:Shape2D","transform"),&CollisionObject2D::add_shape,DEFVAL(Transform2D())); - ClassDB::bind_method(_MD("get_shape_count"),&CollisionObject2D::get_shape_count); - ClassDB::bind_method(_MD("set_shape","shape_idx","shape:Shape"),&CollisionObject2D::set_shape); - ClassDB::bind_method(_MD("set_shape_transform","shape_idx","transform"),&CollisionObject2D::set_shape_transform); - ClassDB::bind_method(_MD("set_shape_as_trigger","shape_idx","enable"),&CollisionObject2D::set_shape_as_trigger); - ClassDB::bind_method(_MD("get_shape:Shape2D","shape_idx"),&CollisionObject2D::get_shape); - ClassDB::bind_method(_MD("get_shape_transform","shape_idx"),&CollisionObject2D::get_shape_transform); - ClassDB::bind_method(_MD("is_shape_set_as_trigger","shape_idx"),&CollisionObject2D::is_shape_set_as_trigger); - ClassDB::bind_method(_MD("remove_shape","shape_idx"),&CollisionObject2D::remove_shape); - ClassDB::bind_method(_MD("clear_shapes"),&CollisionObject2D::clear_shapes); - ClassDB::bind_method(_MD("get_rid"),&CollisionObject2D::get_rid); - - ClassDB::bind_method(_MD("set_pickable","enabled"),&CollisionObject2D::set_pickable); - ClassDB::bind_method(_MD("is_pickable"),&CollisionObject2D::is_pickable); + ClassDB::bind_method(D_METHOD("add_shape","shape:Shape2D","transform"),&CollisionObject2D::add_shape,DEFVAL(Transform2D())); + ClassDB::bind_method(D_METHOD("get_shape_count"),&CollisionObject2D::get_shape_count); + ClassDB::bind_method(D_METHOD("set_shape","shape_idx","shape:Shape"),&CollisionObject2D::set_shape); + ClassDB::bind_method(D_METHOD("set_shape_transform","shape_idx","transform"),&CollisionObject2D::set_shape_transform); + ClassDB::bind_method(D_METHOD("set_shape_as_trigger","shape_idx","enable"),&CollisionObject2D::set_shape_as_trigger); + ClassDB::bind_method(D_METHOD("get_shape:Shape2D","shape_idx"),&CollisionObject2D::get_shape); + ClassDB::bind_method(D_METHOD("get_shape_transform","shape_idx"),&CollisionObject2D::get_shape_transform); + ClassDB::bind_method(D_METHOD("is_shape_set_as_trigger","shape_idx"),&CollisionObject2D::is_shape_set_as_trigger); + ClassDB::bind_method(D_METHOD("remove_shape","shape_idx"),&CollisionObject2D::remove_shape); + ClassDB::bind_method(D_METHOD("clear_shapes"),&CollisionObject2D::clear_shapes); + ClassDB::bind_method(D_METHOD("get_rid"),&CollisionObject2D::get_rid); + + ClassDB::bind_method(D_METHOD("set_pickable","enabled"),&CollisionObject2D::set_pickable); + ClassDB::bind_method(D_METHOD("is_pickable"),&CollisionObject2D::is_pickable); BIND_VMETHOD( MethodInfo("_input_event",PropertyInfo(Variant::OBJECT,"viewport"),PropertyInfo(Variant::INPUT_EVENT,"event"),PropertyInfo(Variant::INT,"shape_idx"))); @@ -243,7 +243,7 @@ void CollisionObject2D::_bind_methods() { ADD_SIGNAL( MethodInfo("mouse_exited")); ADD_GROUP("Pickable","input_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"input_pickable"),_SCS("set_pickable"),_SCS("is_pickable")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"input_pickable"),"set_pickable","is_pickable"); ADD_GROUP("",""); } @@ -348,6 +348,8 @@ CollisionObject2D::CollisionObject2D(RID p_rid, bool p_area) { rid=p_rid; area=p_area; pickable=true; + set_notify_transform(true); + if (p_area) { Physics2DServer::get_singleton()->area_attach_object_instance_ID(rid,get_instance_ID()); diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 4364e5f1fc..85241a79e0 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -314,26 +314,26 @@ String CollisionPolygon2D::get_configuration_warning() const { void CollisionPolygon2D::_bind_methods() { - ClassDB::bind_method(_MD("_add_to_collision_object"),&CollisionPolygon2D::_add_to_collision_object); - ClassDB::bind_method(_MD("set_polygon","polygon"),&CollisionPolygon2D::set_polygon); - ClassDB::bind_method(_MD("get_polygon"),&CollisionPolygon2D::get_polygon); + ClassDB::bind_method(D_METHOD("_add_to_collision_object"),&CollisionPolygon2D::_add_to_collision_object); + ClassDB::bind_method(D_METHOD("set_polygon","polygon"),&CollisionPolygon2D::set_polygon); + ClassDB::bind_method(D_METHOD("get_polygon"),&CollisionPolygon2D::get_polygon); - ClassDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon2D::set_build_mode); - ClassDB::bind_method(_MD("get_build_mode"),&CollisionPolygon2D::get_build_mode); + ClassDB::bind_method(D_METHOD("set_build_mode","build_mode"),&CollisionPolygon2D::set_build_mode); + ClassDB::bind_method(D_METHOD("get_build_mode"),&CollisionPolygon2D::get_build_mode); - ClassDB::bind_method(_MD("set_trigger","trigger"),&CollisionPolygon2D::set_trigger); - ClassDB::bind_method(_MD("is_trigger"),&CollisionPolygon2D::is_trigger); + ClassDB::bind_method(D_METHOD("set_trigger","trigger"),&CollisionPolygon2D::set_trigger); + ClassDB::bind_method(D_METHOD("is_trigger"),&CollisionPolygon2D::is_trigger); - ClassDB::bind_method(_MD("_set_shape_range","shape_range"),&CollisionPolygon2D::_set_shape_range); - ClassDB::bind_method(_MD("_get_shape_range"),&CollisionPolygon2D::_get_shape_range); + ClassDB::bind_method(D_METHOD("_set_shape_range","shape_range"),&CollisionPolygon2D::_set_shape_range); + ClassDB::bind_method(D_METHOD("_get_shape_range"),&CollisionPolygon2D::_get_shape_range); - ClassDB::bind_method(_MD("get_collision_object_first_shape"),&CollisionPolygon2D::get_collision_object_first_shape); - ClassDB::bind_method(_MD("get_collision_object_last_shape"),&CollisionPolygon2D::get_collision_object_last_shape); + ClassDB::bind_method(D_METHOD("get_collision_object_first_shape"),&CollisionPolygon2D::get_collision_object_first_shape); + ClassDB::bind_method(D_METHOD("get_collision_object_last_shape"),&CollisionPolygon2D::get_collision_object_last_shape); - ADD_PROPERTY( PropertyInfo(Variant::INT,"build_mode",PROPERTY_HINT_ENUM,"Solids,Segments"),_SCS("set_build_mode"),_SCS("get_build_mode")); - ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"shape_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_shape_range"),_SCS("_get_shape_range")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"trigger"),_SCS("set_trigger"),_SCS("is_trigger")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"build_mode",PROPERTY_HINT_ENUM,"Solids,Segments"),"set_build_mode","get_build_mode"); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),"set_polygon","get_polygon"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"shape_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_shape_range","_get_shape_range"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"trigger"),"set_trigger","is_trigger"); } diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index 45fc734aef..37a49577b5 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -218,21 +218,21 @@ String CollisionShape2D::get_configuration_warning() const { void CollisionShape2D::_bind_methods() { - ClassDB::bind_method(_MD("set_shape","shape"),&CollisionShape2D::set_shape); - ClassDB::bind_method(_MD("get_shape"),&CollisionShape2D::get_shape); - ClassDB::bind_method(_MD("_shape_changed"),&CollisionShape2D::_shape_changed); - ClassDB::bind_method(_MD("_add_to_collision_object"),&CollisionShape2D::_add_to_collision_object); - ClassDB::bind_method(_MD("set_trigger","enable"),&CollisionShape2D::set_trigger); - ClassDB::bind_method(_MD("is_trigger"),&CollisionShape2D::is_trigger); + ClassDB::bind_method(D_METHOD("set_shape","shape"),&CollisionShape2D::set_shape); + ClassDB::bind_method(D_METHOD("get_shape"),&CollisionShape2D::get_shape); + ClassDB::bind_method(D_METHOD("_shape_changed"),&CollisionShape2D::_shape_changed); + ClassDB::bind_method(D_METHOD("_add_to_collision_object"),&CollisionShape2D::_add_to_collision_object); + ClassDB::bind_method(D_METHOD("set_trigger","enable"),&CollisionShape2D::set_trigger); + ClassDB::bind_method(D_METHOD("is_trigger"),&CollisionShape2D::is_trigger); - ClassDB::bind_method(_MD("_set_update_shape_index","index"),&CollisionShape2D::_set_update_shape_index); - ClassDB::bind_method(_MD("_get_update_shape_index"),&CollisionShape2D::_get_update_shape_index); + ClassDB::bind_method(D_METHOD("_set_update_shape_index","index"),&CollisionShape2D::_set_update_shape_index); + ClassDB::bind_method(D_METHOD("_get_update_shape_index"),&CollisionShape2D::_get_update_shape_index); - ClassDB::bind_method(_MD("get_collision_object_shape_index"),&CollisionShape2D::get_collision_object_shape_index); + ClassDB::bind_method(D_METHOD("get_collision_object_shape_index"),&CollisionShape2D::get_collision_object_shape_index); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"shape",PROPERTY_HINT_RESOURCE_TYPE,"Shape2D"),_SCS("set_shape"),_SCS("get_shape")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"trigger"),_SCS("set_trigger"),_SCS("is_trigger")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "_update_shape_index", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_NOEDITOR), _SCS("_set_update_shape_index"), _SCS("_get_update_shape_index")); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"shape",PROPERTY_HINT_RESOURCE_TYPE,"Shape2D"),"set_shape","get_shape"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"trigger"),"set_trigger","is_trigger"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "_update_shape_index", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_NOEDITOR), "_set_update_shape_index", "_get_update_shape_index"); } diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index 987672df38..6754eb3981 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -128,22 +128,22 @@ bool Joint2D::get_exclude_nodes_from_collision() const{ void Joint2D::_bind_methods() { - ClassDB::bind_method( _MD("set_node_a","node"), &Joint2D::set_node_a ); - ClassDB::bind_method( _MD("get_node_a"), &Joint2D::get_node_a ); + ClassDB::bind_method( D_METHOD("set_node_a","node"), &Joint2D::set_node_a ); + ClassDB::bind_method( D_METHOD("get_node_a"), &Joint2D::get_node_a ); - ClassDB::bind_method( _MD("set_node_b","node"), &Joint2D::set_node_b ); - ClassDB::bind_method( _MD("get_node_b"), &Joint2D::get_node_b ); + ClassDB::bind_method( D_METHOD("set_node_b","node"), &Joint2D::set_node_b ); + ClassDB::bind_method( D_METHOD("get_node_b"), &Joint2D::get_node_b ); - ClassDB::bind_method( _MD("set_bias","bias"), &Joint2D::set_bias ); - ClassDB::bind_method( _MD("get_bias"), &Joint2D::get_bias ); + ClassDB::bind_method( D_METHOD("set_bias","bias"), &Joint2D::set_bias ); + ClassDB::bind_method( D_METHOD("get_bias"), &Joint2D::get_bias ); - ClassDB::bind_method( _MD("set_exclude_nodes_from_collision","enable"), &Joint2D::set_exclude_nodes_from_collision ); - ClassDB::bind_method( _MD("get_exclude_nodes_from_collision"), &Joint2D::get_exclude_nodes_from_collision ); + ClassDB::bind_method( D_METHOD("set_exclude_nodes_from_collision","enable"), &Joint2D::set_exclude_nodes_from_collision ); + ClassDB::bind_method( D_METHOD("get_exclude_nodes_from_collision"), &Joint2D::get_exclude_nodes_from_collision ); - ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "node_a"), _SCS("set_node_a"),_SCS("get_node_a") ); - ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "node_b"), _SCS("set_node_b"),_SCS("get_node_b") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "bias",PROPERTY_HINT_RANGE,"0,0.9,0.001"), _SCS("set_bias"),_SCS("get_bias") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "disable_collision"), _SCS("set_exclude_nodes_from_collision"),_SCS("get_exclude_nodes_from_collision") ); + ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "node_a"), "set_node_a","get_node_a") ; + ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "node_b"), "set_node_b","get_node_b") ; + ADD_PROPERTY( PropertyInfo( Variant::REAL, "bias",PROPERTY_HINT_RANGE,"0,0.9,0.001"), "set_bias","get_bias") ; + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "disable_collision"), "set_exclude_nodes_from_collision","get_exclude_nodes_from_collision") ; } @@ -225,10 +225,10 @@ real_t PinJoint2D::get_softness() const { void PinJoint2D::_bind_methods() { - ClassDB::bind_method(_MD("set_softness","softness"), &PinJoint2D::set_softness); - ClassDB::bind_method(_MD("get_softness"), &PinJoint2D::get_softness); + ClassDB::bind_method(D_METHOD("set_softness","softness"), &PinJoint2D::set_softness); + ClassDB::bind_method(D_METHOD("get_softness"), &PinJoint2D::get_softness); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "softness", PROPERTY_HINT_EXP_RANGE,"0.00,16,0.01"), _SCS("set_softness"), _SCS("get_softness")); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "softness", PROPERTY_HINT_EXP_RANGE,"0.00,16,0.01"), "set_softness", "get_softness"); } PinJoint2D::PinJoint2D() { @@ -321,13 +321,13 @@ real_t GrooveJoint2D::get_initial_offset() const { void GrooveJoint2D::_bind_methods() { - ClassDB::bind_method(_MD("set_length","length"),&GrooveJoint2D::set_length); - ClassDB::bind_method(_MD("get_length"),&GrooveJoint2D::get_length); - ClassDB::bind_method(_MD("set_initial_offset","offset"),&GrooveJoint2D::set_initial_offset); - ClassDB::bind_method(_MD("get_initial_offset"),&GrooveJoint2D::get_initial_offset); + ClassDB::bind_method(D_METHOD("set_length","length"),&GrooveJoint2D::set_length); + ClassDB::bind_method(D_METHOD("get_length"),&GrooveJoint2D::get_length); + ClassDB::bind_method(D_METHOD("set_initial_offset","offset"),&GrooveJoint2D::set_initial_offset); + ClassDB::bind_method(D_METHOD("get_initial_offset"),&GrooveJoint2D::get_initial_offset); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "length", PROPERTY_HINT_EXP_RANGE,"1,65535,1"), _SCS("set_length"),_SCS("get_length")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "initial_offset", PROPERTY_HINT_EXP_RANGE,"1,65535,1"), _SCS("set_initial_offset"),_SCS("get_initial_offset")); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "length", PROPERTY_HINT_EXP_RANGE,"1,65535,1"), "set_length","get_length"); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "initial_offset", PROPERTY_HINT_EXP_RANGE,"1,65535,1"), "set_initial_offset","get_initial_offset"); } GrooveJoint2D::GrooveJoint2D() { @@ -453,19 +453,19 @@ real_t DampedSpringJoint2D::get_damping() const { void DampedSpringJoint2D::_bind_methods() { - ClassDB::bind_method(_MD("set_length","length"),&DampedSpringJoint2D::set_length); - ClassDB::bind_method(_MD("get_length"),&DampedSpringJoint2D::get_length); - ClassDB::bind_method(_MD("set_rest_length","rest_length"),&DampedSpringJoint2D::set_rest_length); - ClassDB::bind_method(_MD("get_rest_length"),&DampedSpringJoint2D::get_rest_length); - ClassDB::bind_method(_MD("set_stiffness","stiffness"),&DampedSpringJoint2D::set_stiffness); - ClassDB::bind_method(_MD("get_stiffness"),&DampedSpringJoint2D::get_stiffness); - ClassDB::bind_method(_MD("set_damping","damping"),&DampedSpringJoint2D::set_damping); - ClassDB::bind_method(_MD("get_damping"),&DampedSpringJoint2D::get_damping); + ClassDB::bind_method(D_METHOD("set_length","length"),&DampedSpringJoint2D::set_length); + ClassDB::bind_method(D_METHOD("get_length"),&DampedSpringJoint2D::get_length); + ClassDB::bind_method(D_METHOD("set_rest_length","rest_length"),&DampedSpringJoint2D::set_rest_length); + ClassDB::bind_method(D_METHOD("get_rest_length"),&DampedSpringJoint2D::get_rest_length); + ClassDB::bind_method(D_METHOD("set_stiffness","stiffness"),&DampedSpringJoint2D::set_stiffness); + ClassDB::bind_method(D_METHOD("get_stiffness"),&DampedSpringJoint2D::get_stiffness); + ClassDB::bind_method(D_METHOD("set_damping","damping"),&DampedSpringJoint2D::set_damping); + ClassDB::bind_method(D_METHOD("get_damping"),&DampedSpringJoint2D::get_damping); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "length", PROPERTY_HINT_EXP_RANGE,"1,65535,1"), _SCS("set_length"),_SCS("get_length")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "rest_length", PROPERTY_HINT_EXP_RANGE,"0,65535,1"), _SCS("set_rest_length"),_SCS("get_rest_length")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "stiffness", PROPERTY_HINT_EXP_RANGE,"0.1,64,0.1"), _SCS("set_stiffness"),_SCS("get_stiffness")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "damping", PROPERTY_HINT_EXP_RANGE,"0.01,16,0.01"), _SCS("set_damping"),_SCS("get_damping")); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "length", PROPERTY_HINT_EXP_RANGE,"1,65535,1"), "set_length","get_length"); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "rest_length", PROPERTY_HINT_EXP_RANGE,"0,65535,1"), "set_rest_length","get_rest_length"); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "stiffness", PROPERTY_HINT_EXP_RANGE,"0.1,64,0.1"), "set_stiffness","get_stiffness"); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "damping", PROPERTY_HINT_EXP_RANGE,"0.01,16,0.01"), "set_damping","get_damping"); } diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 2935f6b9f7..d7f5a890e8 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -365,92 +365,92 @@ String Light2D::get_configuration_warning() const { void Light2D::_bind_methods() { - ClassDB::bind_method(_MD("set_enabled","enabled"),&Light2D::set_enabled); - ClassDB::bind_method(_MD("is_enabled"),&Light2D::is_enabled); + ClassDB::bind_method(D_METHOD("set_enabled","enabled"),&Light2D::set_enabled); + ClassDB::bind_method(D_METHOD("is_enabled"),&Light2D::is_enabled); - ClassDB::bind_method(_MD("set_editor_only","editor_only"), &Light2D::set_editor_only ); - ClassDB::bind_method(_MD("is_editor_only"), &Light2D::is_editor_only ); + ClassDB::bind_method(D_METHOD("set_editor_only","editor_only"), &Light2D::set_editor_only ); + ClassDB::bind_method(D_METHOD("is_editor_only"), &Light2D::is_editor_only ); - ClassDB::bind_method(_MD("set_texture","texture"),&Light2D::set_texture); - ClassDB::bind_method(_MD("get_texture"),&Light2D::get_texture); + ClassDB::bind_method(D_METHOD("set_texture","texture"),&Light2D::set_texture); + ClassDB::bind_method(D_METHOD("get_texture"),&Light2D::get_texture); - ClassDB::bind_method(_MD("set_texture_offset","texture_offset"),&Light2D::set_texture_offset); - ClassDB::bind_method(_MD("get_texture_offset"),&Light2D::get_texture_offset); + ClassDB::bind_method(D_METHOD("set_texture_offset","texture_offset"),&Light2D::set_texture_offset); + ClassDB::bind_method(D_METHOD("get_texture_offset"),&Light2D::get_texture_offset); - ClassDB::bind_method(_MD("set_color","color"),&Light2D::set_color); - ClassDB::bind_method(_MD("get_color"),&Light2D::get_color); + ClassDB::bind_method(D_METHOD("set_color","color"),&Light2D::set_color); + ClassDB::bind_method(D_METHOD("get_color"),&Light2D::get_color); - ClassDB::bind_method(_MD("set_height","height"),&Light2D::set_height); - ClassDB::bind_method(_MD("get_height"),&Light2D::get_height); + ClassDB::bind_method(D_METHOD("set_height","height"),&Light2D::set_height); + ClassDB::bind_method(D_METHOD("get_height"),&Light2D::get_height); - ClassDB::bind_method(_MD("set_energy","energy"),&Light2D::set_energy); - ClassDB::bind_method(_MD("get_energy"),&Light2D::get_energy); + ClassDB::bind_method(D_METHOD("set_energy","energy"),&Light2D::set_energy); + ClassDB::bind_method(D_METHOD("get_energy"),&Light2D::get_energy); - ClassDB::bind_method(_MD("set_texture_scale","texture_scale"),&Light2D::set_texture_scale); - ClassDB::bind_method(_MD("get_texture_scale"),&Light2D::get_texture_scale); + ClassDB::bind_method(D_METHOD("set_texture_scale","texture_scale"),&Light2D::set_texture_scale); + ClassDB::bind_method(D_METHOD("get_texture_scale"),&Light2D::get_texture_scale); - ClassDB::bind_method(_MD("set_z_range_min","z"),&Light2D::set_z_range_min); - ClassDB::bind_method(_MD("get_z_range_min"),&Light2D::get_z_range_min); + ClassDB::bind_method(D_METHOD("set_z_range_min","z"),&Light2D::set_z_range_min); + ClassDB::bind_method(D_METHOD("get_z_range_min"),&Light2D::get_z_range_min); - ClassDB::bind_method(_MD("set_z_range_max","z"),&Light2D::set_z_range_max); - ClassDB::bind_method(_MD("get_z_range_max"),&Light2D::get_z_range_max); + ClassDB::bind_method(D_METHOD("set_z_range_max","z"),&Light2D::set_z_range_max); + ClassDB::bind_method(D_METHOD("get_z_range_max"),&Light2D::get_z_range_max); - ClassDB::bind_method(_MD("set_layer_range_min","layer"),&Light2D::set_layer_range_min); - ClassDB::bind_method(_MD("get_layer_range_min"),&Light2D::get_layer_range_min); + ClassDB::bind_method(D_METHOD("set_layer_range_min","layer"),&Light2D::set_layer_range_min); + ClassDB::bind_method(D_METHOD("get_layer_range_min"),&Light2D::get_layer_range_min); - ClassDB::bind_method(_MD("set_layer_range_max","layer"),&Light2D::set_layer_range_max); - ClassDB::bind_method(_MD("get_layer_range_max"),&Light2D::get_layer_range_max); + ClassDB::bind_method(D_METHOD("set_layer_range_max","layer"),&Light2D::set_layer_range_max); + ClassDB::bind_method(D_METHOD("get_layer_range_max"),&Light2D::get_layer_range_max); - ClassDB::bind_method(_MD("set_item_cull_mask","item_cull_mask"),&Light2D::set_item_cull_mask); - ClassDB::bind_method(_MD("get_item_cull_mask"),&Light2D::get_item_cull_mask); + ClassDB::bind_method(D_METHOD("set_item_cull_mask","item_cull_mask"),&Light2D::set_item_cull_mask); + ClassDB::bind_method(D_METHOD("get_item_cull_mask"),&Light2D::get_item_cull_mask); - ClassDB::bind_method(_MD("set_item_shadow_cull_mask","item_shadow_cull_mask"),&Light2D::set_item_shadow_cull_mask); - ClassDB::bind_method(_MD("get_item_shadow_cull_mask"),&Light2D::get_item_shadow_cull_mask); + ClassDB::bind_method(D_METHOD("set_item_shadow_cull_mask","item_shadow_cull_mask"),&Light2D::set_item_shadow_cull_mask); + ClassDB::bind_method(D_METHOD("get_item_shadow_cull_mask"),&Light2D::get_item_shadow_cull_mask); - ClassDB::bind_method(_MD("set_mode","mode"),&Light2D::set_mode); - ClassDB::bind_method(_MD("get_mode"),&Light2D::get_mode); + ClassDB::bind_method(D_METHOD("set_mode","mode"),&Light2D::set_mode); + ClassDB::bind_method(D_METHOD("get_mode"),&Light2D::get_mode); - ClassDB::bind_method(_MD("set_shadow_enabled","enabled"),&Light2D::set_shadow_enabled); - ClassDB::bind_method(_MD("is_shadow_enabled"),&Light2D::is_shadow_enabled); + ClassDB::bind_method(D_METHOD("set_shadow_enabled","enabled"),&Light2D::set_shadow_enabled); + ClassDB::bind_method(D_METHOD("is_shadow_enabled"),&Light2D::is_shadow_enabled); - ClassDB::bind_method(_MD("set_shadow_buffer_size","size"),&Light2D::set_shadow_buffer_size); - ClassDB::bind_method(_MD("get_shadow_buffer_size"),&Light2D::get_shadow_buffer_size); + ClassDB::bind_method(D_METHOD("set_shadow_buffer_size","size"),&Light2D::set_shadow_buffer_size); + ClassDB::bind_method(D_METHOD("get_shadow_buffer_size"),&Light2D::get_shadow_buffer_size); - ClassDB::bind_method(_MD("set_shadow_gradient_length","multiplier"),&Light2D::set_shadow_gradient_length); - ClassDB::bind_method(_MD("get_shadow_gradient_length"),&Light2D::get_shadow_gradient_length); + ClassDB::bind_method(D_METHOD("set_shadow_gradient_length","multiplier"),&Light2D::set_shadow_gradient_length); + ClassDB::bind_method(D_METHOD("get_shadow_gradient_length"),&Light2D::get_shadow_gradient_length); - ClassDB::bind_method(_MD("set_shadow_filter","filter"),&Light2D::set_shadow_filter); - ClassDB::bind_method(_MD("get_shadow_filter"),&Light2D::get_shadow_filter); + ClassDB::bind_method(D_METHOD("set_shadow_filter","filter"),&Light2D::set_shadow_filter); + ClassDB::bind_method(D_METHOD("get_shadow_filter"),&Light2D::get_shadow_filter); - ClassDB::bind_method(_MD("set_shadow_color","shadow_color"),&Light2D::set_shadow_color); - ClassDB::bind_method(_MD("get_shadow_color"),&Light2D::get_shadow_color); + ClassDB::bind_method(D_METHOD("set_shadow_color","shadow_color"),&Light2D::set_shadow_color); + ClassDB::bind_method(D_METHOD("get_shadow_color"),&Light2D::get_shadow_color); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "editor_only"),_SCS("set_editor_only"),_SCS("is_editor_only")); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"offset"),_SCS("set_texture_offset"),_SCS("get_texture_offset")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"scale",PROPERTY_HINT_RANGE,"0.01,50,0.01"),_SCS("set_texture_scale"),_SCS("get_texture_scale")); - ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_RANGE,"0.01,100,0.01"),_SCS("set_energy"),_SCS("get_energy")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Add,Sub,Mix,Mask"),_SCS("set_mode"),_SCS("get_mode")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),"set_enabled","is_enabled"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "editor_only"),"set_editor_only","is_editor_only"); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"offset"),"set_texture_offset","get_texture_offset"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"scale",PROPERTY_HINT_RANGE,"0.01,50,0.01"),"set_texture_scale","get_texture_scale"); + ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),"set_color","get_color"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_RANGE,"0.01,100,0.01"),"set_energy","get_energy"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Add,Sub,Mix,Mask"),"set_mode","get_mode"); ADD_GROUP("Range","range_"); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"range_height",PROPERTY_HINT_RANGE,"-100,100,0.1"),_SCS("set_height"),_SCS("get_height")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"range_z_min",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z_range_min"),_SCS("get_z_range_min")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"range_z_max",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z_range_max"),_SCS("get_z_range_max")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"range_layer_min",PROPERTY_HINT_RANGE,"-512,512,1"),_SCS("set_layer_range_min"),_SCS("get_layer_range_min")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"range_layer_max",PROPERTY_HINT_RANGE,"-512,512,1"),_SCS("set_layer_range_max"),_SCS("get_layer_range_max")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"range_item_cull_mask",PROPERTY_HINT_LAYERS_2D_RENDER),_SCS("set_item_cull_mask"),_SCS("get_item_cull_mask")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"range_height",PROPERTY_HINT_RANGE,"-100,100,0.1"),"set_height","get_height"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"range_z_min",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),"set_z_range_min","get_z_range_min"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"range_z_max",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),"set_z_range_max","get_z_range_max"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"range_layer_min",PROPERTY_HINT_RANGE,"-512,512,1"),"set_layer_range_min","get_layer_range_min"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"range_layer_max",PROPERTY_HINT_RANGE,"-512,512,1"),"set_layer_range_max","get_layer_range_max"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"range_item_cull_mask",PROPERTY_HINT_LAYERS_2D_RENDER),"set_item_cull_mask","get_item_cull_mask"); ADD_GROUP("Shadow","shadow_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"shadow_enabled"),_SCS("set_shadow_enabled"),_SCS("is_shadow_enabled")); - ADD_PROPERTY( PropertyInfo(Variant::COLOR,"shadow_color"),_SCS("set_shadow_color"),_SCS("get_shadow_color")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow_buffer_size",PROPERTY_HINT_RANGE,"32,16384,1"),_SCS("set_shadow_buffer_size"),_SCS("get_shadow_buffer_size")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"shadow_gradient_length",PROPERTY_HINT_RANGE,"1,4096,0.1"),_SCS("set_shadow_gradient_length"),_SCS("get_shadow_gradient_length")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"shadow_filter",PROPERTY_HINT_ENUM,"None,PCF3,PCF5,PCF9,PCF13"),_SCS("set_shadow_filter"),_SCS("get_shadow_filter")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow_item_cull_mask",PROPERTY_HINT_LAYERS_2D_RENDER),_SCS("set_item_shadow_cull_mask"),_SCS("get_item_shadow_cull_mask")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"shadow_enabled"),"set_shadow_enabled","is_shadow_enabled"); + ADD_PROPERTY( PropertyInfo(Variant::COLOR,"shadow_color"),"set_shadow_color","get_shadow_color"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow_buffer_size",PROPERTY_HINT_RANGE,"32,16384,1"),"set_shadow_buffer_size","get_shadow_buffer_size"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"shadow_gradient_length",PROPERTY_HINT_RANGE,"1,4096,0.1"),"set_shadow_gradient_length","get_shadow_gradient_length"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"shadow_filter",PROPERTY_HINT_ENUM,"None,PCF3,PCF5,PCF9,PCF13"),"set_shadow_filter","get_shadow_filter"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow_item_cull_mask",PROPERTY_HINT_LAYERS_2D_RENDER),"set_item_shadow_cull_mask","get_item_shadow_cull_mask"); BIND_CONSTANT( MODE_ADD ); BIND_CONSTANT( MODE_SUB ); diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index 77c9b8184a..6a024fe330 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -78,18 +78,18 @@ RID OccluderPolygon2D::get_rid() const { void OccluderPolygon2D::_bind_methods() { - ClassDB::bind_method(_MD("set_closed","closed"),&OccluderPolygon2D::set_closed); - ClassDB::bind_method(_MD("is_closed"),&OccluderPolygon2D::is_closed); + ClassDB::bind_method(D_METHOD("set_closed","closed"),&OccluderPolygon2D::set_closed); + ClassDB::bind_method(D_METHOD("is_closed"),&OccluderPolygon2D::is_closed); - ClassDB::bind_method(_MD("set_cull_mode","cull_mode"),&OccluderPolygon2D::set_cull_mode); - ClassDB::bind_method(_MD("get_cull_mode"),&OccluderPolygon2D::get_cull_mode); + ClassDB::bind_method(D_METHOD("set_cull_mode","cull_mode"),&OccluderPolygon2D::set_cull_mode); + ClassDB::bind_method(D_METHOD("get_cull_mode"),&OccluderPolygon2D::get_cull_mode); - ClassDB::bind_method(_MD("set_polygon","polygon"),&OccluderPolygon2D::set_polygon); - ClassDB::bind_method(_MD("get_polygon"),&OccluderPolygon2D::get_polygon); + ClassDB::bind_method(D_METHOD("set_polygon","polygon"),&OccluderPolygon2D::set_polygon); + ClassDB::bind_method(D_METHOD("get_polygon"),&OccluderPolygon2D::get_polygon); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"closed"),_SCS("set_closed"),_SCS("is_closed")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"cull_mode",PROPERTY_HINT_ENUM,"Disabled,ClockWise,CounterClockWise"),_SCS("set_cull_mode"),_SCS("get_cull_mode")); - ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"closed"),"set_closed","is_closed"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"cull_mode",PROPERTY_HINT_ENUM,"Disabled,ClockWise,CounterClockWise"),"set_cull_mode","get_cull_mode"); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),"set_polygon","get_polygon"); BIND_CONSTANT(CULL_DISABLED); BIND_CONSTANT(CULL_CLOCKWISE); @@ -224,18 +224,18 @@ String LightOccluder2D::get_configuration_warning() const { void LightOccluder2D::_bind_methods() { - ClassDB::bind_method(_MD("set_occluder_polygon","polygon:OccluderPolygon2D"),&LightOccluder2D::set_occluder_polygon); - ClassDB::bind_method(_MD("get_occluder_polygon:OccluderPolygon2D"),&LightOccluder2D::get_occluder_polygon); + ClassDB::bind_method(D_METHOD("set_occluder_polygon","polygon:OccluderPolygon2D"),&LightOccluder2D::set_occluder_polygon); + ClassDB::bind_method(D_METHOD("get_occluder_polygon:OccluderPolygon2D"),&LightOccluder2D::get_occluder_polygon); - ClassDB::bind_method(_MD("set_occluder_light_mask","mask"),&LightOccluder2D::set_occluder_light_mask); - ClassDB::bind_method(_MD("get_occluder_light_mask"),&LightOccluder2D::get_occluder_light_mask); + ClassDB::bind_method(D_METHOD("set_occluder_light_mask","mask"),&LightOccluder2D::set_occluder_light_mask); + ClassDB::bind_method(D_METHOD("get_occluder_light_mask"),&LightOccluder2D::get_occluder_light_mask); #ifdef DEBUG_ENABLED ClassDB::bind_method("_poly_changed",&LightOccluder2D::_poly_changed); #endif - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"occluder",PROPERTY_HINT_RESOURCE_TYPE,"OccluderPolygon2D"),_SCS("set_occluder_polygon"),_SCS("get_occluder_polygon")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"light_mask",PROPERTY_HINT_LAYERS_2D_RENDER),_SCS("set_occluder_light_mask"),_SCS("get_occluder_light_mask")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"occluder",PROPERTY_HINT_RESOURCE_TYPE,"OccluderPolygon2D"),"set_occluder_polygon","get_occluder_polygon"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"light_mask",PROPERTY_HINT_LAYERS_2D_RENDER),"set_occluder_light_mask","get_occluder_light_mask"); } LightOccluder2D::LightOccluder2D() { diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp new file mode 100644 index 0000000000..059711549f --- /dev/null +++ b/scene/2d/line_2d.cpp @@ -0,0 +1,336 @@ +/*************************************************************************/ +/* line_2d.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "line_2d.h" + +#include "core_string_names.h" + + +// Needed so we can bind functions +VARIANT_ENUM_CAST(LineJointMode) +VARIANT_ENUM_CAST(LineCapMode) +VARIANT_ENUM_CAST(LineTextureMode) + + +Line2D::Line2D() : Node2D() { + _joint_mode = LINE_JOINT_SHARP; + _begin_cap_mode = LINE_CAP_NONE; + _end_cap_mode = LINE_CAP_NONE; + _width = 10; + _default_color = Color(0.4,0.5,1); + _sharp_limit = 2.f; + _round_precision = 8; +} + +void Line2D::set_points(const PoolVector<Vector2> &p_points) { + _points = p_points; + update(); +} + +void Line2D::set_width(float width) { + if(width < 0.0) + width = 0.0; + _width = width; + update(); +} + +float Line2D::get_width() const { + return _width; +} + +PoolVector<Vector2> Line2D::get_points() const { + return _points; +} + +void Line2D::set_point_pos(int i, Vector2 pos) { + _points.set(i, pos); + update(); +} + +Vector2 Line2D::get_point_pos(int i) const { + return _points.get(i); +} + +int Line2D::get_point_count() const { + return _points.size(); +} + +void Line2D::add_point(Vector2 pos) { + _points.append(pos); + update(); +} + +void Line2D::remove_point(int i) { + _points.remove(i); + update(); +} + +void Line2D::set_default_color(Color color) { + _default_color = color; + update(); +} + +Color Line2D::get_default_color() const { + return _default_color; +} + +void Line2D::set_gradient(const Ref<ColorRamp>& gradient) { + + // Cleanup previous connection if any + if(_gradient.is_valid()) { + (**_gradient).disconnect(CoreStringNames::get_singleton()->changed, this, "_gradient_changed"); + } + + _gradient = gradient; + + // Connect to the gradient so the line will update when the ColorRamp is changed + if(_gradient.is_valid()) { + (**_gradient).connect(CoreStringNames::get_singleton()->changed, this, "_gradient_changed"); + } + + update(); +} + +Ref<ColorRamp> Line2D::get_gradient() const { + return _gradient; +} + +void Line2D::set_texture(const Ref<Texture>& texture) { + _texture = texture; + update(); +} + +Ref<Texture> Line2D::get_texture() const { + return _texture; +} + +void Line2D::set_texture_mode(const LineTextureMode mode) { + _texture_mode = mode; + update(); +} + +LineTextureMode Line2D::get_texture_mode() const { + return _texture_mode; +} + +void Line2D::set_joint_mode(LineJointMode mode) { + _joint_mode = mode; + update(); +} + +LineJointMode Line2D::get_joint_mode() const { + return _joint_mode; +} + +void Line2D::set_begin_cap_mode(LineCapMode mode) { + _begin_cap_mode = mode; + update(); +} + +LineCapMode Line2D::get_begin_cap_mode() const { + return _begin_cap_mode; +} + +void Line2D::set_end_cap_mode(LineCapMode mode) { + _end_cap_mode = mode; + update(); +} + +LineCapMode Line2D::get_end_cap_mode() const { + return _end_cap_mode; +} + +void Line2D::_notification(int p_what) { + switch(p_what) { + case NOTIFICATION_DRAW: + _draw(); + break; + } +} + +void Line2D::set_sharp_limit(float limit) { + if(limit < 0.f) + limit = 0.f; + _sharp_limit = limit; + update(); +} + +float Line2D::get_sharp_limit() const { + return _sharp_limit; +} + +void Line2D::set_round_precision(int precision) { + if(precision < 1) + precision = 1; + _round_precision = precision; + update(); +} + +int Line2D::get_round_precision() const { + return _round_precision; +} + +void Line2D::_draw() { + if(_points.size() <= 1 || _width == 0.f) + return; + + // TODO Is this really needed? + // Copy points for faster access + Vector<Vector2> points; + points.resize(_points.size()); + int len = points.size(); { + PoolVector<Vector2>::Read points_read = _points.read(); + for(int i = 0; i < len; ++i) { + points[i] = points_read[i]; + } + } + + // TODO Maybe have it as member rather than copying parameters and allocating memory? + LineBuilder lb; + lb.points = points; + lb.default_color = _default_color; + lb.gradient = *_gradient; + lb.texture_mode = _texture_mode; + lb.joint_mode = _joint_mode; + lb.begin_cap_mode = _begin_cap_mode; + lb.end_cap_mode = _end_cap_mode; + lb.round_precision = _round_precision; + lb.sharp_limit = _sharp_limit; + lb.width = _width; + + lb.build(); + + RID texture_rid; + if(_texture.is_valid()) + texture_rid = (**_texture).get_rid(); + + VS::get_singleton()->canvas_item_add_triangle_array( + get_canvas_item(), + lb.indices, + lb.vertices, + lb.colors, + lb.uvs, + texture_rid); + + // DEBUG + // Draw wireframe +// if(lb.indices.size() % 3 == 0) { +// Color col(0,0,0); +// for(int i = 0; i < lb.indices.size(); i += 3) { +// int vi = lb.indices[i]; +// int lbvsize = lb.vertices.size(); +// Vector2 a = lb.vertices[lb.indices[i]]; +// Vector2 b = lb.vertices[lb.indices[i+1]]; +// Vector2 c = lb.vertices[lb.indices[i+2]]; +// draw_line(a, b, col); +// draw_line(b, c, col); +// draw_line(c, a, col); +// } +// for(int i = 0; i < lb.vertices.size(); ++i) { +// Vector2 p = lb.vertices[i]; +// draw_rect(Rect2(p.x-1, p.y-1, 2, 2), Color(0,0,0,0.5)); +// } +// } +} + +void Line2D::_gradient_changed() { + update(); +} + +// static +void Line2D::_bind_methods() { + + ClassDB::bind_method(D_METHOD("set_points","points"), &Line2D::set_points); + ClassDB::bind_method(D_METHOD("get_points"), &Line2D::get_points); + + ClassDB::bind_method(D_METHOD("set_point_pos","i", "pos"), &Line2D::set_point_pos); + ClassDB::bind_method(D_METHOD("get_point_pos", "i"), &Line2D::get_point_pos); + + ClassDB::bind_method(D_METHOD("get_point_count"), &Line2D::get_point_count); + + ClassDB::bind_method(D_METHOD("add_point", "pos"), &Line2D::add_point); + ClassDB::bind_method(D_METHOD("remove_point", "i"), &Line2D::remove_point); + + ClassDB::bind_method(D_METHOD("set_width","width"), &Line2D::set_width); + ClassDB::bind_method(D_METHOD("get_width"), &Line2D::get_width); + + ClassDB::bind_method(D_METHOD("set_default_color", "color"), &Line2D::set_default_color); + ClassDB::bind_method(D_METHOD("get_default_color"), &Line2D::get_default_color); + + ClassDB::bind_method(D_METHOD("set_gradient", "color"), &Line2D::set_gradient); + ClassDB::bind_method(D_METHOD("get_gradient"), &Line2D::get_gradient); + + ClassDB::bind_method(D_METHOD("set_texture", "texture"), &Line2D::set_texture); + ClassDB::bind_method(D_METHOD("get_texture"), &Line2D::get_texture); + + ClassDB::bind_method(D_METHOD("set_texture_mode", "mode"), &Line2D::set_texture_mode); + ClassDB::bind_method(D_METHOD("get_texture_mode"), &Line2D::get_texture_mode); + + ClassDB::bind_method(D_METHOD("set_joint_mode", "mode"), &Line2D::set_joint_mode); + ClassDB::bind_method(D_METHOD("get_joint_mode"), &Line2D::get_joint_mode); + + ClassDB::bind_method(D_METHOD("set_begin_cap_mode", "mode"), &Line2D::set_begin_cap_mode); + ClassDB::bind_method(D_METHOD("get_begin_cap_mode"), &Line2D::get_begin_cap_mode); + + ClassDB::bind_method(D_METHOD("set_end_cap_mode", "mode"), &Line2D::set_end_cap_mode); + ClassDB::bind_method(D_METHOD("get_end_cap_mode"), &Line2D::get_end_cap_mode); + + ClassDB::bind_method(D_METHOD("set_sharp_limit", "limit"), &Line2D::set_sharp_limit); + ClassDB::bind_method(D_METHOD("get_sharp_limit"), &Line2D::get_sharp_limit); + + ClassDB::bind_method(D_METHOD("set_round_precision", "precision"), &Line2D::set_round_precision); + ClassDB::bind_method(D_METHOD("get_round_precision"), &Line2D::get_round_precision); + + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR2_ARRAY, "points"), "set_points", "get_points"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "width"), "set_width", "get_width"); + ADD_PROPERTY(PropertyInfo(Variant::COLOR, "default_color"), "set_default_color", "get_default_color"); + ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "gradient", PROPERTY_HINT_RESOURCE_TYPE, "ColorRamp"), "set_gradient", "get_gradient"); + ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture"); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "texture_mode", PROPERTY_HINT_ENUM, "None,Tile" ), "set_texture_mode","get_texture_mode"); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "joint_mode", PROPERTY_HINT_ENUM, "Sharp,Bevel,Round" ), "set_joint_mode","get_joint_mode"); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "begin_cap_mode", PROPERTY_HINT_ENUM, "None,Box,Round" ), "set_begin_cap_mode","get_begin_cap_mode"); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "end_cap_mode", PROPERTY_HINT_ENUM, "None,Box,Round" ), "set_end_cap_mode","get_end_cap_mode"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "sharp_limit"), "set_sharp_limit", "get_sharp_limit"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "round_precision"), "set_round_precision", "get_round_precision"); + + BIND_CONSTANT(LINE_JOINT_SHARP); + BIND_CONSTANT(LINE_JOINT_BEVEL); + BIND_CONSTANT(LINE_JOINT_ROUND); + + BIND_CONSTANT(LINE_CAP_NONE); + BIND_CONSTANT(LINE_CAP_BOX); + BIND_CONSTANT(LINE_CAP_ROUND); + + BIND_CONSTANT(LINE_TEXTURE_NONE); + BIND_CONSTANT(LINE_TEXTURE_TILE); + + ClassDB::bind_method(D_METHOD("_gradient_changed"), &Line2D::_gradient_changed); + +} + + diff --git a/scene/2d/line_2d.h b/scene/2d/line_2d.h new file mode 100644 index 0000000000..5435c7489f --- /dev/null +++ b/scene/2d/line_2d.h @@ -0,0 +1,108 @@ +/*************************************************************************/ +/* line_2d.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 LINE2D_H +#define LINE2D_H + +#include "node_2d.h" +#include "line_builder.h" + + +class Line2D : public Node2D { + + GDCLASS(Line2D, Node2D) + +public: + Line2D(); + + void set_points(const PoolVector<Vector2> & p_points); + PoolVector<Vector2> get_points() const; + + void set_point_pos(int i, Vector2 pos); + Vector2 get_point_pos(int i) const; + + int get_point_count() const; + + void add_point(Vector2 pos); + void remove_point(int i); + + void set_width(float width); + float get_width() const; + + void set_default_color(Color color); + Color get_default_color() const; + + void set_gradient(const Ref<ColorRamp>& gradient); + Ref<ColorRamp> get_gradient() const; + + void set_texture(const Ref<Texture>& texture); + Ref<Texture> get_texture() const; + + void set_texture_mode(const LineTextureMode mode); + LineTextureMode get_texture_mode() const; + + void set_joint_mode(LineJointMode mode); + LineJointMode get_joint_mode() const; + + void set_begin_cap_mode(LineCapMode mode); + LineCapMode get_begin_cap_mode() const; + + void set_end_cap_mode(LineCapMode mode); + LineCapMode get_end_cap_mode() const; + + void set_sharp_limit(float limit); + float get_sharp_limit() const; + + void set_round_precision(int precision); + int get_round_precision() const; + +protected: + void _notification(int p_what); + void _draw(); + + static void _bind_methods(); + +private: + void _gradient_changed(); + +private: + PoolVector<Vector2> _points; + LineJointMode _joint_mode; + LineCapMode _begin_cap_mode; + LineCapMode _end_cap_mode; + float _width; + Color _default_color; + Ref<ColorRamp> _gradient; + Ref<Texture> _texture; + LineTextureMode _texture_mode; + float _sharp_limit; + int _round_precision; + +}; + +#endif // LINE2D_H diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp new file mode 100644 index 0000000000..69543f004d --- /dev/null +++ b/scene/2d/line_builder.cpp @@ -0,0 +1,591 @@ +/*************************************************************************/ +/* line_builder.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "line_builder.h" + +//---------------------------------------------------------------------------- +// Util +//---------------------------------------------------------------------------- + +enum SegmentIntersectionResult { + SEGMENT_PARALLEL = 0, + SEGMENT_NO_INTERSECT = 1, + SEGMENT_INTERSECT = 2 +}; + +static SegmentIntersectionResult segment_intersection( + Vector2 a, Vector2 b, Vector2 c, Vector2 d, + Vector2 * out_intersection) +{ + // http://paulbourke.net/geometry/pointlineplane/ <-- Good stuff + Vector2 cd = d - c; + Vector2 ab = b - a; + float div = cd.y*ab.x - cd.x*ab.y; + + if(Math::abs(div) > 0.001f) { + float ua = (cd.x * (a.y-c.y) - cd.y * (a.x-c.x)) / div; + float ub = (ab.x * (a.y-c.y) - ab.y * (a.x-c.x)) / div; + *out_intersection = a + ua * ab; + if(ua >= 0.f && ua <= 1.f && + ub >= 0.f && ub <= 1.f) + return SEGMENT_INTERSECT; + return SEGMENT_NO_INTERSECT; + } + + return SEGMENT_PARALLEL; +} + +// TODO I'm pretty sure there is an even faster way to swap things +template <typename T> +static inline void swap(T & a, T & b) { + T tmp = a; + a = b; + b = tmp; +} + +static float calculate_total_distance(const Vector<Vector2> & points) { + float d = 0.f; + for(int i = 1; i < points.size(); ++i) { + d += points[i].distance_to(points[i-1]); + } + return d; +} + +static inline Vector2 rotate90(const Vector2 & v) { + // Note: the 2D referential is X-right, Y-down + return Vector2(v.y, -v.x); +} + +static inline Vector2 interpolate(const Rect2 & r, const Vector2 & v) { + return Vector2( + Math::lerp(r.get_pos().x, r.get_pos().x + r.get_size().x, v.x), + Math::lerp(r.get_pos().y, r.get_pos().y + r.get_size().y, v.y) + ); +} + +//---------------------------------------------------------------------------- +// LineBuilder +//---------------------------------------------------------------------------- + +LineBuilder::LineBuilder() { + joint_mode = LINE_JOINT_SHARP; + width = 10; + default_color = Color(0.4,0.5,1); + gradient = NULL; + sharp_limit = 2.f; + round_precision = 8; + begin_cap_mode = LINE_CAP_NONE; + end_cap_mode = LINE_CAP_NONE; + + _interpolate_color = false; + _last_index[0] = 0; + _last_index[1] = 0; +} + + +void LineBuilder::clear_output() { + vertices.clear(); + colors.clear(); + indices.clear(); +} + +void LineBuilder::build() { + + // Need at least 2 points to draw a line + if(points.size() < 2) { + clear_output(); + return; + } + + const float hw = width / 2.f; + const float hw_sq = hw*hw; + const float sharp_limit_sq = sharp_limit * sharp_limit; + const int len = points.size(); + + // Initial values + + Vector2 pos0 = points[0]; + Vector2 pos1 = points[1]; + Vector2 f0 = (pos1 - pos0).normalized(); + Vector2 u0 = rotate90(f0); + Vector2 pos_up0 = pos0 + u0 * hw; + Vector2 pos_down0 = pos0 - u0 * hw; + + Color color0; + Color color1; + + float current_distance0 = 0.f; + float current_distance1 = 0.f; + float total_distance; + _interpolate_color = gradient != NULL; + bool distance_required = _interpolate_color || texture_mode == LINE_TEXTURE_TILE; + if(distance_required) + total_distance = calculate_total_distance(points); + if(_interpolate_color) + color0 = gradient->get_color(0); + else + colors.push_back(default_color); + + float uvx0 = 0.f; + float uvx1 = 0.f; + + // Begin cap + if(begin_cap_mode == LINE_CAP_BOX) { + // Push back first vertices a little bit + pos_up0 -= f0 * hw; + pos_down0 -= f0 * hw; + // The line's outer length will be a little higher due to begin and end caps + total_distance += width; + current_distance0 += hw; + current_distance1 = current_distance0; + } + else if(begin_cap_mode == LINE_CAP_ROUND) { + if(texture_mode == LINE_TEXTURE_TILE) { + uvx0 = 0.5f; + } + new_arc(pos0, pos_up0 - pos0, -Math_PI, color0, Rect2(0.f, 0.f, 1.f, 1.f)); + total_distance += width; + current_distance0 += hw; + current_distance1 = current_distance0; + } + + strip_begin(pos_up0, pos_down0, color0, uvx0); + + // pos_up0 ------------- pos_up1 -------------------- + // | | + // pos0 - - - - - - - - - pos1 - - - - - - - - - pos2 + // | | + // pos_down0 ------------ pos_down1 ------------------ + // + // i-1 i i+1 + + // http://labs.hyperandroid.com/tag/opengl-lines + // (not the same implementation but visuals help a lot) + + // For each additional segment + for(int i = 1; i < len-1; ++i) { + + pos1 = points[i]; + Vector2 pos2 = points[i+1]; + + Vector2 f1 = (pos2 - pos1).normalized(); + Vector2 u1 = rotate90(f1); + + // Determine joint orientation + const float dp = u0.dot(f1); + const Orientation orientation = (dp > 0.f ? UP : DOWN); + + Vector2 inner_normal0, inner_normal1; + if(orientation == UP) { + inner_normal0 = u0 * hw; + inner_normal1 = u1 * hw; + } + else { + inner_normal0 = -u0 * hw; + inner_normal1 = -u1 * hw; + } + + // --------------------------- + // / + // 0 / 1 + // / / + // --------------------x------ / + // / / (here shown with orientation == DOWN) + // / / + // / / + // / / + // 2 / + // / + + // Find inner intersection at the joint + Vector2 corner_pos_in, corner_pos_out; + SegmentIntersectionResult intersection_result = segment_intersection( + pos0 + inner_normal0, pos1 + inner_normal0, + pos1 + inner_normal1, pos2 + inner_normal1, + &corner_pos_in); + + if(intersection_result == SEGMENT_INTERSECT) + // Inner parts of the segments intersect + corner_pos_out = 2.f * pos1 - corner_pos_in; + else { + // No intersection, segments are either parallel or too sharp + corner_pos_in = pos1 + inner_normal0; + corner_pos_out = pos1 - inner_normal0; + } + + Vector2 corner_pos_up, corner_pos_down; + if(orientation == UP) { + corner_pos_up = corner_pos_in; + corner_pos_down = corner_pos_out; + } + else { + corner_pos_up = corner_pos_out; + corner_pos_down = corner_pos_in; + } + + LineJointMode current_joint_mode = joint_mode; + + Vector2 pos_up1, pos_down1; + if(intersection_result == SEGMENT_INTERSECT) { + // Fallback on bevel if sharp angle is too high (because it would produce very long miters) + if(current_joint_mode == LINE_JOINT_SHARP && corner_pos_out.distance_squared_to(pos1) / hw_sq > sharp_limit_sq) { + current_joint_mode = LINE_JOINT_BEVEL; + } + if(current_joint_mode == LINE_JOINT_SHARP) { + // In this case, we won't create joint geometry, + // The previous and next line quads will directly share an edge. + pos_up1 = corner_pos_up; + pos_down1 = corner_pos_down; + } + else { + // Bevel or round + if(orientation == UP) { + pos_up1 = corner_pos_up; + pos_down1 = pos1 - u0 * hw; + } + else { + pos_up1 = pos1 + u0 * hw; + pos_down1 = corner_pos_down; + } + } + } + else { + // No intersection: fallback + pos_up1 = corner_pos_up; + pos_down1 = corner_pos_down; + } + + // Add current line body quad + // Triangles are clockwise + if(distance_required) { + current_distance1 += pos0.distance_to(pos1); + } + if(_interpolate_color) { + color1 = gradient->get_color_at_offset(current_distance1 / total_distance); + } + if(texture_mode == LINE_TEXTURE_TILE) { + uvx0 = current_distance0 / width; + uvx1 = current_distance1 / width; + } + + strip_add_quad(pos_up1, pos_down1, color1, uvx1); + + // Swap vars for use in the next line + color0 = color1; + u0 = u1; + f0 = f1; + pos0 = pos1; + current_distance0 = current_distance1; + if(intersection_result == SEGMENT_INTERSECT) { + if(current_joint_mode == LINE_JOINT_SHARP) { + pos_up0 = pos_up1; + pos_down0 = pos_down1; + } + else { + if(orientation == UP) { + pos_up0 = corner_pos_up; + pos_down0 = pos1 - u1 * hw; + } + else { + pos_up0 = pos1 + u1 * hw; + pos_down0 = corner_pos_down; + } + } + } + else { + pos_up0 = pos1 + u1 * hw; + pos_down0 = pos1 - u1 * hw; + } + // From this point, bu0 and bd0 concern the next segment + + // Add joint geometry + if(current_joint_mode != LINE_JOINT_SHARP) { + + // ________________ cbegin + // / \ + // / \ + // ____________/_ _ _\ cend + // | | + // | | + // | | + + Vector2 cbegin, cend; + if(orientation == UP) { + cbegin = pos_down1; + cend = pos_down0; + } + else { + cbegin = pos_up1; + cend = pos_up0; + } + + if(current_joint_mode == LINE_JOINT_BEVEL) { + strip_add_tri(cend, orientation); + } + else if(current_joint_mode == LINE_JOINT_ROUND) { + Vector2 vbegin = cbegin - pos1; + Vector2 vend = cend - pos1; + strip_add_arc(pos1, vend.angle_to(vbegin), orientation); + } + + if(intersection_result != SEGMENT_INTERSECT) + // In this case the joint is too fucked up to be re-used, + // start again the strip with fallback points + strip_begin(pos_up0, pos_down0, color1, uvx1); + } + } + + // Last (or only) segment + + pos1 = points[points.size()-1]; + + Vector2 pos_up1 = pos1 + u0 * hw; + Vector2 pos_down1 = pos1 - u0 * hw; + + // End cap (box) + if(end_cap_mode == LINE_CAP_BOX) { + pos_up1 += f0 * hw; + pos_down1 += f0 * hw; + } + + if(distance_required) { + current_distance1 += pos0.distance_to(pos1); + } + if(_interpolate_color) { + color1 = gradient->get_color(gradient->get_points_count()-1); + } + if(texture_mode == LINE_TEXTURE_TILE) { + uvx1 = current_distance1 / width; + } + + strip_add_quad(pos_up1, pos_down1, color1, uvx1); + + // End cap (round) + if(end_cap_mode == LINE_CAP_ROUND) { + // Note: color is not used in case we don't interpolate... + Color color = _interpolate_color ? gradient->get_color(gradient->get_points_count()-1) : Color(0,0,0); + new_arc(pos1, pos_up1 - pos1, Math_PI, color, Rect2(uvx1-0.5f, 0.f, 1.f, 1.f)); + } +} + +void LineBuilder::strip_begin(Vector2 up, Vector2 down, Color color, float uvx) { + int vi = vertices.size(); + + vertices.push_back(up); + vertices.push_back(down); + + if(_interpolate_color) { + colors.push_back(color); + colors.push_back(color); + } + + if(texture_mode != LINE_TEXTURE_NONE) { + uvs.push_back(Vector2(uvx, 0.f)); + uvs.push_back(Vector2(uvx, 1.f)); + } + + _last_index[UP] = vi; + _last_index[DOWN] = vi+1; +} + +void LineBuilder::strip_new_quad(Vector2 up, Vector2 down, Color color, float uvx) { + int vi = vertices.size(); + + vertices.push_back(vertices[_last_index[UP]]); + vertices.push_back(vertices[_last_index[DOWN]]); + vertices.push_back(up); + vertices.push_back(down); + + if(_interpolate_color) { + colors.push_back(color); + colors.push_back(color); + colors.push_back(color); + colors.push_back(color); + } + + if(texture_mode != LINE_TEXTURE_NONE) { + uvs.push_back(uvs[_last_index[UP]]); + uvs.push_back(uvs[_last_index[DOWN]]); + uvs.push_back(Vector2(uvx, UP)); + uvs.push_back(Vector2(uvx, DOWN)); + } + + indices.push_back(vi); + indices.push_back(vi+3); + indices.push_back(vi+1); + indices.push_back(vi); + indices.push_back(vi+2); + indices.push_back(vi+3); + + _last_index[UP] = vi+2; + _last_index[DOWN] = vi+3; +} + +void LineBuilder::strip_add_quad(Vector2 up, Vector2 down, Color color, float uvx) { + int vi = vertices.size(); + + vertices.push_back(up); + vertices.push_back(down); + + if(_interpolate_color) { + colors.push_back(color); + colors.push_back(color); + } + + if(texture_mode != LINE_TEXTURE_NONE) { + uvs.push_back(Vector2(uvx, 0.f)); + uvs.push_back(Vector2(uvx, 1.f)); + } + + indices.push_back(_last_index[UP]); + indices.push_back(vi+1); + indices.push_back(_last_index[DOWN]); + indices.push_back(_last_index[UP]); + indices.push_back(vi); + indices.push_back(vi+1); + + _last_index[UP] = vi; + _last_index[DOWN] = vi+1; +} + +void LineBuilder::strip_add_tri(Vector2 up, Orientation orientation) { + int vi = vertices.size(); + + vertices.push_back(up); + + if(_interpolate_color) { + colors.push_back(colors[colors.size()-1]); + } + + Orientation opposite_orientation = orientation == UP ? DOWN : UP; + + if(texture_mode != LINE_TEXTURE_NONE) { + // UVs are just one slice of the texture all along + // (otherwise we can't share the bottom vertice) + uvs.push_back(uvs[_last_index[opposite_orientation]]); + } + + indices.push_back(_last_index[opposite_orientation]); + indices.push_back(vi); + indices.push_back(_last_index[orientation]); + + _last_index[opposite_orientation] = vi; +} + +void LineBuilder::strip_add_arc(Vector2 center, float angle_delta, Orientation orientation) { + + // Take the two last vertices and extrude an arc made of triangles + // that all share one of the initial vertices + + Orientation opposite_orientation = orientation == UP ? DOWN : UP; + Vector2 vbegin = vertices[_last_index[opposite_orientation]] - center; + float radius = vbegin.length(); + float angle_step = Math_PI / static_cast<float>(round_precision); + float steps = Math::abs(angle_delta) / angle_step; + + if(angle_delta < 0.f) + angle_step = -angle_step; + + float t = vbegin.angle_to(Vector2(1, 0)); + float end_angle = t + angle_delta; + Vector2 rpos(0,0); + + // Arc vertices + for(int ti = 0; ti < steps; ++ti, t += angle_step) { + rpos = center + Vector2(Math::cos(t), Math::sin(t)) * radius; + strip_add_tri(rpos, orientation); + } + + // Last arc vertice + rpos = center + Vector2(Math::cos(end_angle), Math::sin(end_angle)) * radius; + strip_add_tri(rpos, orientation); +} + +void LineBuilder::new_arc(Vector2 center, Vector2 vbegin, float angle_delta, Color color, Rect2 uv_rect) { + + // Make a standalone arc that doesn't use existing vertices, + // with undistorted UVs from withing a square section + + float radius = vbegin.length(); + float angle_step = Math_PI / static_cast<float>(round_precision); + float steps = Math::abs(angle_delta) / angle_step; + + if(angle_delta < 0.f) + angle_step = -angle_step; + + float t = vbegin.angle_to(Vector2(1, 0)); + float end_angle = t + angle_delta; + Vector2 rpos(0,0); + float tt_begin = -Math_PI / 2.f; + float tt = tt_begin; + + // Center vertice + int vi = vertices.size(); + vertices.push_back(center); + if(_interpolate_color) + colors.push_back(color); + if(texture_mode != LINE_TEXTURE_NONE) + uvs.push_back(interpolate(uv_rect, Vector2(0.5f, 0.5f))); + + // Arc vertices + for(int ti = 0; ti < steps; ++ti, t += angle_step) { + Vector2 sc = Vector2(Math::cos(t), Math::sin(t)); + rpos = center + sc * radius; + + vertices.push_back(rpos); + if(_interpolate_color) + colors.push_back(color); + if(texture_mode != LINE_TEXTURE_NONE) { + Vector2 tsc = Vector2(Math::cos(tt), Math::sin(tt)); + uvs.push_back(interpolate(uv_rect, 0.5f*(tsc+Vector2(1.f,1.f)))); + tt += angle_step; + } + } + + // Last arc vertice + Vector2 sc = Vector2(Math::cos(end_angle), Math::sin(end_angle)); + rpos = center + sc * radius; + vertices.push_back(rpos); + if(_interpolate_color) + colors.push_back(color); + if(texture_mode != LINE_TEXTURE_NONE) { + tt = tt_begin + angle_delta; + Vector2 tsc = Vector2(Math::cos(tt), Math::sin(tt)); + uvs.push_back(interpolate(uv_rect, 0.5f*(tsc+Vector2(1.f,1.f)))); + } + + // Make up triangles + int vi0 = vi; + for(int ti = 0; ti < steps; ++ti) { + indices.push_back(vi0); + indices.push_back(++vi); + indices.push_back(vi+1); + } +} + + diff --git a/scene/2d/line_builder.h b/scene/2d/line_builder.h new file mode 100644 index 0000000000..3fc9e4bb85 --- /dev/null +++ b/scene/2d/line_builder.h @@ -0,0 +1,104 @@ +/*************************************************************************/ +/* line_builder.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 LINE_BUILDER_H +#define LINE_BUILDER_H + +#include "math_2d.h" +#include "color.h" +#include "scene/resources/color_ramp.h" + +enum LineJointMode { + LINE_JOINT_SHARP = 0, + LINE_JOINT_BEVEL, + LINE_JOINT_ROUND +}; + +enum LineCapMode { + LINE_CAP_NONE = 0, + LINE_CAP_BOX, + LINE_CAP_ROUND +}; + +enum LineTextureMode { + LINE_TEXTURE_NONE = 0, + LINE_TEXTURE_TILE + // TODO STRETCH mode +}; + +class LineBuilder { +public: + // TODO Move in a struct and reference it + // Input + Vector<Vector2> points; + LineJointMode joint_mode; + LineCapMode begin_cap_mode; + LineCapMode end_cap_mode; + float width; + Color default_color; + ColorRamp* gradient; + LineTextureMode texture_mode; + float sharp_limit; + int round_precision; + // TODO offset_joints option (offers alternative implementation of round joints) + + // TODO Move in a struct and reference it + // Output + Vector<Vector2> vertices; + Vector<Color> colors; + Vector<Vector2> uvs; + Vector<int> indices; + + LineBuilder(); + + void build(); + void clear_output(); + +private: + enum Orientation { + UP = 0, + DOWN = 1 + }; + + // Triangle-strip methods + void strip_begin(Vector2 up, Vector2 down, Color color, float uvx); + void strip_new_quad(Vector2 up, Vector2 down, Color color, float uvx); + void strip_add_quad(Vector2 up, Vector2 down, Color color, float uvx); + void strip_add_tri(Vector2 up, Orientation orientation); + void strip_add_arc(Vector2 center, float angle_delta, Orientation orientation); + + void new_arc(Vector2 center, Vector2 vbegin, float angle_delta, Color color, Rect2 uv_rect); + +private: + bool _interpolate_color; + int _last_index[2]; // Index of last up and down vertices of the strip + +}; + + +#endif // LINE_BUILDER_H diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index ec1109b41b..7f48749dc3 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -804,13 +804,13 @@ Object* Navigation2D::get_closest_point_owner(const Vector2& p_point) { void Navigation2D::_bind_methods() { - ClassDB::bind_method(_MD("navpoly_create","mesh:NavigationPolygon","xform","owner"),&Navigation2D::navpoly_create,DEFVAL(Variant())); - ClassDB::bind_method(_MD("navpoly_set_transform","id","xform"),&Navigation2D::navpoly_set_transform); - ClassDB::bind_method(_MD("navpoly_remove","id"),&Navigation2D::navpoly_remove); + ClassDB::bind_method(D_METHOD("navpoly_create","mesh:NavigationPolygon","xform","owner"),&Navigation2D::navpoly_create,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("navpoly_set_transform","id","xform"),&Navigation2D::navpoly_set_transform); + ClassDB::bind_method(D_METHOD("navpoly_remove","id"),&Navigation2D::navpoly_remove); - ClassDB::bind_method(_MD("get_simple_path","start","end","optimize"),&Navigation2D::get_simple_path,DEFVAL(true)); - ClassDB::bind_method(_MD("get_closest_point","to_point"),&Navigation2D::get_closest_point); - ClassDB::bind_method(_MD("get_closest_point_owner","to_point"),&Navigation2D::get_closest_point_owner); + ClassDB::bind_method(D_METHOD("get_simple_path","start","end","optimize"),&Navigation2D::get_simple_path,DEFVAL(true)); + ClassDB::bind_method(D_METHOD("get_closest_point","to_point"),&Navigation2D::get_closest_point); + ClassDB::bind_method(D_METHOD("get_closest_point_owner","to_point"),&Navigation2D::get_closest_point_owner); } diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index 88d6a90e81..9dbbd34ae9 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -247,32 +247,32 @@ void NavigationPolygon::make_polygons_from_outlines(){ void NavigationPolygon::_bind_methods() { - ClassDB::bind_method(_MD("set_vertices","vertices"),&NavigationPolygon::set_vertices); - ClassDB::bind_method(_MD("get_vertices"),&NavigationPolygon::get_vertices); - - ClassDB::bind_method(_MD("add_polygon","polygon"),&NavigationPolygon::add_polygon); - ClassDB::bind_method(_MD("get_polygon_count"),&NavigationPolygon::get_polygon_count); - ClassDB::bind_method(_MD("get_polygon","idx"),&NavigationPolygon::get_polygon); - ClassDB::bind_method(_MD("clear_polygons"),&NavigationPolygon::clear_polygons); - - ClassDB::bind_method(_MD("add_outline","outline"),&NavigationPolygon::add_outline); - ClassDB::bind_method(_MD("add_outline_at_index","outline","index"),&NavigationPolygon::add_outline_at_index); - ClassDB::bind_method(_MD("get_outline_count"),&NavigationPolygon::get_outline_count); - ClassDB::bind_method(_MD("set_outline","idx","outline"),&NavigationPolygon::set_outline); - ClassDB::bind_method(_MD("get_outline","idx"),&NavigationPolygon::get_outline); - ClassDB::bind_method(_MD("remove_outline","idx"),&NavigationPolygon::remove_outline); - ClassDB::bind_method(_MD("clear_outlines"),&NavigationPolygon::clear_outlines); - ClassDB::bind_method(_MD("make_polygons_from_outlines"),&NavigationPolygon::make_polygons_from_outlines); - - ClassDB::bind_method(_MD("_set_polygons","polygons"),&NavigationPolygon::_set_polygons); - ClassDB::bind_method(_MD("_get_polygons"),&NavigationPolygon::_get_polygons); - - ClassDB::bind_method(_MD("_set_outlines","outlines"),&NavigationPolygon::_set_outlines); - ClassDB::bind_method(_MD("_get_outlines"),&NavigationPolygon::_get_outlines); - - ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_polygons"),_SCS("_get_polygons")); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"outlines",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_outlines"),_SCS("_get_outlines")); + ClassDB::bind_method(D_METHOD("set_vertices","vertices"),&NavigationPolygon::set_vertices); + ClassDB::bind_method(D_METHOD("get_vertices"),&NavigationPolygon::get_vertices); + + ClassDB::bind_method(D_METHOD("add_polygon","polygon"),&NavigationPolygon::add_polygon); + ClassDB::bind_method(D_METHOD("get_polygon_count"),&NavigationPolygon::get_polygon_count); + ClassDB::bind_method(D_METHOD("get_polygon","idx"),&NavigationPolygon::get_polygon); + ClassDB::bind_method(D_METHOD("clear_polygons"),&NavigationPolygon::clear_polygons); + + ClassDB::bind_method(D_METHOD("add_outline","outline"),&NavigationPolygon::add_outline); + ClassDB::bind_method(D_METHOD("add_outline_at_index","outline","index"),&NavigationPolygon::add_outline_at_index); + ClassDB::bind_method(D_METHOD("get_outline_count"),&NavigationPolygon::get_outline_count); + ClassDB::bind_method(D_METHOD("set_outline","idx","outline"),&NavigationPolygon::set_outline); + ClassDB::bind_method(D_METHOD("get_outline","idx"),&NavigationPolygon::get_outline); + ClassDB::bind_method(D_METHOD("remove_outline","idx"),&NavigationPolygon::remove_outline); + ClassDB::bind_method(D_METHOD("clear_outlines"),&NavigationPolygon::clear_outlines); + ClassDB::bind_method(D_METHOD("make_polygons_from_outlines"),&NavigationPolygon::make_polygons_from_outlines); + + ClassDB::bind_method(D_METHOD("_set_polygons","polygons"),&NavigationPolygon::_set_polygons); + ClassDB::bind_method(D_METHOD("_get_polygons"),&NavigationPolygon::_get_polygons); + + ClassDB::bind_method(D_METHOD("_set_outlines","outlines"),&NavigationPolygon::_set_outlines); + ClassDB::bind_method(D_METHOD("_get_outlines"),&NavigationPolygon::_get_outlines); + + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_vertices","get_vertices"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_polygons","_get_polygons"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"outlines",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_outlines","_get_outlines"); } NavigationPolygon::NavigationPolygon() { @@ -480,16 +480,16 @@ String NavigationPolygonInstance::get_configuration_warning() const { void NavigationPolygonInstance::_bind_methods() { - ClassDB::bind_method(_MD("set_navigation_polygon","navpoly:NavigationPolygon"),&NavigationPolygonInstance::set_navigation_polygon); - ClassDB::bind_method(_MD("get_navigation_polygon:NavigationPolygon"),&NavigationPolygonInstance::get_navigation_polygon); + ClassDB::bind_method(D_METHOD("set_navigation_polygon","navpoly:NavigationPolygon"),&NavigationPolygonInstance::set_navigation_polygon); + ClassDB::bind_method(D_METHOD("get_navigation_polygon:NavigationPolygon"),&NavigationPolygonInstance::get_navigation_polygon); - ClassDB::bind_method(_MD("set_enabled","enabled"),&NavigationPolygonInstance::set_enabled); - ClassDB::bind_method(_MD("is_enabled"),&NavigationPolygonInstance::is_enabled); + ClassDB::bind_method(D_METHOD("set_enabled","enabled"),&NavigationPolygonInstance::set_enabled); + ClassDB::bind_method(D_METHOD("is_enabled"),&NavigationPolygonInstance::is_enabled); - ClassDB::bind_method(_MD("_navpoly_changed"),&NavigationPolygonInstance::_navpoly_changed); + ClassDB::bind_method(D_METHOD("_navpoly_changed"),&NavigationPolygonInstance::_navpoly_changed); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"navpoly",PROPERTY_HINT_RESOURCE_TYPE,"NavigationPolygon"),_SCS("set_navigation_polygon"),_SCS("get_navigation_polygon")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"navpoly",PROPERTY_HINT_RESOURCE_TYPE,"NavigationPolygon"),"set_navigation_polygon","get_navigation_polygon"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),"set_enabled","is_enabled"); } NavigationPolygonInstance::NavigationPolygonInstance() { diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index fb71a5b536..710f9731c5 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -423,67 +423,67 @@ void Node2D::_bind_methods() { // TODO: Obsolete those two methods (old name) properly (GH-4397) - ClassDB::bind_method(_MD("_get_rotd"),&Node2D::_get_rotd); - ClassDB::bind_method(_MD("_set_rotd","degrees"),&Node2D::_set_rotd); + ClassDB::bind_method(D_METHOD("_get_rotd"),&Node2D::_get_rotd); + ClassDB::bind_method(D_METHOD("_set_rotd","degrees"),&Node2D::_set_rotd); - ClassDB::bind_method(_MD("set_position","pos"),&Node2D::set_position); - ClassDB::bind_method(_MD("set_rotation","radians"),&Node2D::set_rotation); - ClassDB::bind_method(_MD("set_rotation_in_degrees","degrees"),&Node2D::set_rotation_in_degrees); - ClassDB::bind_method(_MD("set_scale","scale"),&Node2D::set_scale); + ClassDB::bind_method(D_METHOD("set_position","pos"),&Node2D::set_position); + ClassDB::bind_method(D_METHOD("set_rotation","radians"),&Node2D::set_rotation); + ClassDB::bind_method(D_METHOD("set_rotation_in_degrees","degrees"),&Node2D::set_rotation_in_degrees); + ClassDB::bind_method(D_METHOD("set_scale","scale"),&Node2D::set_scale); - ClassDB::bind_method(_MD("get_position"),&Node2D::get_position); - ClassDB::bind_method(_MD("get_rotation"),&Node2D::get_rotation); - ClassDB::bind_method(_MD("get_rotation_in_degrees"),&Node2D::get_rotation_in_degrees); - ClassDB::bind_method(_MD("get_scale"),&Node2D::get_scale); + ClassDB::bind_method(D_METHOD("get_position"),&Node2D::get_position); + ClassDB::bind_method(D_METHOD("get_rotation"),&Node2D::get_rotation); + ClassDB::bind_method(D_METHOD("get_rotation_in_degrees"),&Node2D::get_rotation_in_degrees); + ClassDB::bind_method(D_METHOD("get_scale"),&Node2D::get_scale); - ClassDB::bind_method(_MD("rotate","radians"),&Node2D::rotate); - ClassDB::bind_method(_MD("move_local_x","delta","scaled"),&Node2D::move_x,DEFVAL(false)); - ClassDB::bind_method(_MD("move_local_y","delta","scaled"),&Node2D::move_y,DEFVAL(false)); - ClassDB::bind_method(_MD("translate","offset"),&Node2D::translate); - ClassDB::bind_method(_MD("global_translate","offset"),&Node2D::global_translate); - ClassDB::bind_method(_MD("scale","ratio"),&Node2D::scale); + ClassDB::bind_method(D_METHOD("rotate","radians"),&Node2D::rotate); + ClassDB::bind_method(D_METHOD("move_local_x","delta","scaled"),&Node2D::move_x,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("move_local_y","delta","scaled"),&Node2D::move_y,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("translate","offset"),&Node2D::translate); + ClassDB::bind_method(D_METHOD("global_translate","offset"),&Node2D::global_translate); + ClassDB::bind_method(D_METHOD("scale","ratio"),&Node2D::scale); - ClassDB::bind_method(_MD("set_global_position","pos"),&Node2D::set_global_position); - ClassDB::bind_method(_MD("get_global_position"),&Node2D::get_global_position); - ClassDB::bind_method(_MD("set_global_rotation","radians"),&Node2D::set_global_rotation); - ClassDB::bind_method(_MD("get_global_rotation"),&Node2D::get_global_rotation); - ClassDB::bind_method(_MD("set_global_rotation_in_degrees","degrees"),&Node2D::set_global_rotation_in_degrees); - ClassDB::bind_method(_MD("get_global_rotation_in_degrees"),&Node2D::get_global_rotation_in_degrees); - ClassDB::bind_method(_MD("set_global_scale","scale"),&Node2D::set_global_scale); - ClassDB::bind_method(_MD("get_global_scale"),&Node2D::get_global_scale); + ClassDB::bind_method(D_METHOD("set_global_position","pos"),&Node2D::set_global_position); + ClassDB::bind_method(D_METHOD("get_global_position"),&Node2D::get_global_position); + ClassDB::bind_method(D_METHOD("set_global_rotation","radians"),&Node2D::set_global_rotation); + ClassDB::bind_method(D_METHOD("get_global_rotation"),&Node2D::get_global_rotation); + ClassDB::bind_method(D_METHOD("set_global_rotation_in_degrees","degrees"),&Node2D::set_global_rotation_in_degrees); + ClassDB::bind_method(D_METHOD("get_global_rotation_in_degrees"),&Node2D::get_global_rotation_in_degrees); + ClassDB::bind_method(D_METHOD("set_global_scale","scale"),&Node2D::set_global_scale); + ClassDB::bind_method(D_METHOD("get_global_scale"),&Node2D::get_global_scale); - ClassDB::bind_method(_MD("set_transform","xform"),&Node2D::set_transform); - ClassDB::bind_method(_MD("set_global_transform","xform"),&Node2D::set_global_transform); + ClassDB::bind_method(D_METHOD("set_transform","xform"),&Node2D::set_transform); + ClassDB::bind_method(D_METHOD("set_global_transform","xform"),&Node2D::set_global_transform); - ClassDB::bind_method(_MD("look_at","point"),&Node2D::look_at); - ClassDB::bind_method(_MD("get_angle_to","point"),&Node2D::get_angle_to); + ClassDB::bind_method(D_METHOD("look_at","point"),&Node2D::look_at); + ClassDB::bind_method(D_METHOD("get_angle_to","point"),&Node2D::get_angle_to); - ClassDB::bind_method(_MD("set_z","z"),&Node2D::set_z); - ClassDB::bind_method(_MD("get_z"),&Node2D::get_z); + ClassDB::bind_method(D_METHOD("set_z","z"),&Node2D::set_z); + ClassDB::bind_method(D_METHOD("get_z"),&Node2D::get_z); - ClassDB::bind_method(_MD("set_z_as_relative","enable"),&Node2D::set_z_as_relative); - ClassDB::bind_method(_MD("is_z_relative"),&Node2D::is_z_relative); + ClassDB::bind_method(D_METHOD("set_z_as_relative","enable"),&Node2D::set_z_as_relative); + ClassDB::bind_method(D_METHOD("is_z_relative"),&Node2D::is_z_relative); - ClassDB::bind_method(_MD("edit_set_pivot","pivot"),&Node2D::edit_set_pivot); + ClassDB::bind_method(D_METHOD("edit_set_pivot","pivot"),&Node2D::edit_set_pivot); - ClassDB::bind_method(_MD("get_relative_transform_to_parent","parent"),&Node2D::get_relative_transform_to_parent); + ClassDB::bind_method(D_METHOD("get_relative_transform_to_parent","parent"),&Node2D::get_relative_transform_to_parent); ADD_GROUP("Transform",""); - ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"position"),_SCS("set_position"),_SCS("get_position")); - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"rotation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_rotation"),_SCS("get_rotation")); - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"rotation_deg",PROPERTY_HINT_RANGE,"-1440,1440,0.1",PROPERTY_USAGE_EDITOR),_SCS("set_rotation_in_degrees"),_SCS("get_rotation_in_degrees")); - ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2,"scale"),_SCS("set_scale"),_SCS("get_scale")); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D,"transform",PROPERTY_HINT_NONE,"",0),_SCS("set_transform"),_SCS("get_transform")); - - ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_position",PROPERTY_HINT_NONE,"",0),_SCS("set_global_position"),_SCS("get_global_position")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_rotation",PROPERTY_HINT_NONE,"",0),_SCS("set_global_rotation"),_SCS("get_global_rotation")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_rotation_deg",PROPERTY_HINT_NONE,"",0),_SCS("set_global_rotation_in_degrees"),_SCS("get_global_rotation_in_degrees")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_scale",PROPERTY_HINT_NONE,"",0),_SCS("set_global_scale"),_SCS("get_global_scale")); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D,"global_transform",PROPERTY_HINT_NONE,"",0),_SCS("set_global_transform"),_SCS("get_global_transform")); + ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"position"),"set_position","get_position"); + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"rotation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_rotation","get_rotation"); + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"rotation_deg",PROPERTY_HINT_RANGE,"-1440,1440,0.1",PROPERTY_USAGE_EDITOR),"set_rotation_in_degrees","get_rotation_in_degrees"); + ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2,"scale"),"set_scale","get_scale"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D,"transform",PROPERTY_HINT_NONE,"",0),"set_transform","get_transform"); + + ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_position",PROPERTY_HINT_NONE,"",0),"set_global_position","get_global_position"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_rotation",PROPERTY_HINT_NONE,"",0),"set_global_rotation","get_global_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_rotation_deg",PROPERTY_HINT_NONE,"",0),"set_global_rotation_in_degrees","get_global_rotation_in_degrees"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_scale",PROPERTY_HINT_NONE,"",0),"set_global_scale","get_global_scale"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D,"global_transform",PROPERTY_HINT_NONE,"",0),"set_global_transform","get_global_transform"); ADD_GROUP("Z",""); - ADD_PROPERTYNZ(PropertyInfo(Variant::INT,"z",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z"),_SCS("get_z")); - ADD_PROPERTYNO(PropertyInfo(Variant::BOOL,"z_as_relative"),_SCS("set_z_as_relative"),_SCS("is_z_relative")); + ADD_PROPERTYNZ(PropertyInfo(Variant::INT,"z",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),"set_z","get_z"); + ADD_PROPERTYNO(PropertyInfo(Variant::BOOL,"z_as_relative"),"set_z_as_relative","is_z_relative"); } diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp index 1e6a449fce..9336dc51af 100644 --- a/scene/2d/parallax_background.cpp +++ b/scene/2d/parallax_background.cpp @@ -189,28 +189,28 @@ Vector2 ParallaxBackground::get_final_offset() const { void ParallaxBackground::_bind_methods() { - ClassDB::bind_method(_MD("_camera_moved"),&ParallaxBackground::_camera_moved); - ClassDB::bind_method(_MD("set_scroll_offset","ofs"),&ParallaxBackground::set_scroll_offset); - ClassDB::bind_method(_MD("get_scroll_offset"),&ParallaxBackground::get_scroll_offset); - ClassDB::bind_method(_MD("set_scroll_base_offset","ofs"),&ParallaxBackground::set_scroll_base_offset); - ClassDB::bind_method(_MD("get_scroll_base_offset"),&ParallaxBackground::get_scroll_base_offset); - ClassDB::bind_method(_MD("set_scroll_base_scale","scale"),&ParallaxBackground::set_scroll_base_scale); - ClassDB::bind_method(_MD("get_scroll_base_scale"),&ParallaxBackground::get_scroll_base_scale); - ClassDB::bind_method(_MD("set_limit_begin","ofs"),&ParallaxBackground::set_limit_begin); - ClassDB::bind_method(_MD("get_limit_begin"),&ParallaxBackground::get_limit_begin); - ClassDB::bind_method(_MD("set_limit_end","ofs"),&ParallaxBackground::set_limit_end); - ClassDB::bind_method(_MD("get_limit_end"),&ParallaxBackground::get_limit_end); - ClassDB::bind_method(_MD("set_ignore_camera_zoom","ignore"), &ParallaxBackground::set_ignore_camera_zoom); - ClassDB::bind_method(_MD("is_ignore_camera_zoom"), &ParallaxBackground::is_ignore_camera_zoom); + ClassDB::bind_method(D_METHOD("_camera_moved"),&ParallaxBackground::_camera_moved); + ClassDB::bind_method(D_METHOD("set_scroll_offset","ofs"),&ParallaxBackground::set_scroll_offset); + ClassDB::bind_method(D_METHOD("get_scroll_offset"),&ParallaxBackground::get_scroll_offset); + ClassDB::bind_method(D_METHOD("set_scroll_base_offset","ofs"),&ParallaxBackground::set_scroll_base_offset); + ClassDB::bind_method(D_METHOD("get_scroll_base_offset"),&ParallaxBackground::get_scroll_base_offset); + ClassDB::bind_method(D_METHOD("set_scroll_base_scale","scale"),&ParallaxBackground::set_scroll_base_scale); + ClassDB::bind_method(D_METHOD("get_scroll_base_scale"),&ParallaxBackground::get_scroll_base_scale); + ClassDB::bind_method(D_METHOD("set_limit_begin","ofs"),&ParallaxBackground::set_limit_begin); + ClassDB::bind_method(D_METHOD("get_limit_begin"),&ParallaxBackground::get_limit_begin); + ClassDB::bind_method(D_METHOD("set_limit_end","ofs"),&ParallaxBackground::set_limit_end); + ClassDB::bind_method(D_METHOD("get_limit_end"),&ParallaxBackground::get_limit_end); + ClassDB::bind_method(D_METHOD("set_ignore_camera_zoom","ignore"), &ParallaxBackground::set_ignore_camera_zoom); + ClassDB::bind_method(D_METHOD("is_ignore_camera_zoom"), &ParallaxBackground::is_ignore_camera_zoom); ADD_GROUP("Scroll","scroll_"); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_offset"),_SCS("set_scroll_offset"),_SCS("get_scroll_offset")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_base_offset"),_SCS("set_scroll_base_offset"),_SCS("get_scroll_base_offset")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_base_scale"),_SCS("set_scroll_base_scale"),_SCS("get_scroll_base_scale")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_limit_begin"),_SCS("set_limit_begin"),_SCS("get_limit_begin")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_limit_end"),_SCS("set_limit_end"),_SCS("get_limit_end")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "scroll_ignore_camera_zoom"), _SCS("set_ignore_camera_zoom"), _SCS("is_ignore_camera_zoom")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_offset"),"set_scroll_offset","get_scroll_offset"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_base_offset"),"set_scroll_base_offset","get_scroll_base_offset"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_base_scale"),"set_scroll_base_scale","get_scroll_base_scale"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_limit_begin"),"set_limit_begin","get_limit_begin"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_limit_end"),"set_limit_end","get_limit_end"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "scroll_ignore_camera_zoom"), "set_ignore_camera_zoom", "is_ignore_camera_zoom"); } diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 9aa6640727..37d8fb52f1 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -150,17 +150,17 @@ String ParallaxLayer::get_configuration_warning() const { void ParallaxLayer::_bind_methods() { - ClassDB::bind_method(_MD("set_motion_scale","scale"),&ParallaxLayer::set_motion_scale); - ClassDB::bind_method(_MD("get_motion_scale"),&ParallaxLayer::get_motion_scale); - ClassDB::bind_method(_MD("set_motion_offset","offset"),&ParallaxLayer::set_motion_offset); - ClassDB::bind_method(_MD("get_motion_offset"),&ParallaxLayer::get_motion_offset); - ClassDB::bind_method(_MD("set_mirroring","mirror"),&ParallaxLayer::set_mirroring); - ClassDB::bind_method(_MD("get_mirroring"),&ParallaxLayer::get_mirroring); + ClassDB::bind_method(D_METHOD("set_motion_scale","scale"),&ParallaxLayer::set_motion_scale); + ClassDB::bind_method(D_METHOD("get_motion_scale"),&ParallaxLayer::get_motion_scale); + ClassDB::bind_method(D_METHOD("set_motion_offset","offset"),&ParallaxLayer::set_motion_offset); + ClassDB::bind_method(D_METHOD("get_motion_offset"),&ParallaxLayer::get_motion_offset); + ClassDB::bind_method(D_METHOD("set_mirroring","mirror"),&ParallaxLayer::set_mirroring); + ClassDB::bind_method(D_METHOD("get_mirroring"),&ParallaxLayer::get_mirroring); ADD_GROUP("Motion","motion_"); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion_scale"),_SCS("set_motion_scale"),_SCS("get_motion_scale")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion_offset"),_SCS("set_motion_offset"),_SCS("get_motion_offset")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion_mirroring"),_SCS("set_mirroring"),_SCS("get_mirroring")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion_scale"),"set_motion_scale","get_motion_scale"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion_offset"),"set_motion_offset","get_motion_offset"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion_mirroring"),"set_mirroring","get_mirroring"); } diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index 1051d3f5ff..77ace0348a 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -27,6 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "particles_2d.h" +#include "scene/scene_string_names.h" @@ -113,30 +114,30 @@ void ParticleAttractor2D::_set_owner(Particles2D* p_owner) { void ParticleAttractor2D::_bind_methods() { - ClassDB::bind_method(_MD("set_enabled","enabled"),&ParticleAttractor2D::set_enabled); - ClassDB::bind_method(_MD("is_enabled"),&ParticleAttractor2D::is_enabled); + ClassDB::bind_method(D_METHOD("set_enabled","enabled"),&ParticleAttractor2D::set_enabled); + ClassDB::bind_method(D_METHOD("is_enabled"),&ParticleAttractor2D::is_enabled); - ClassDB::bind_method(_MD("set_radius","radius"),&ParticleAttractor2D::set_radius); - ClassDB::bind_method(_MD("get_radius"),&ParticleAttractor2D::get_radius); + ClassDB::bind_method(D_METHOD("set_radius","radius"),&ParticleAttractor2D::set_radius); + ClassDB::bind_method(D_METHOD("get_radius"),&ParticleAttractor2D::get_radius); - ClassDB::bind_method(_MD("set_disable_radius","radius"),&ParticleAttractor2D::set_disable_radius); - ClassDB::bind_method(_MD("get_disable_radius"),&ParticleAttractor2D::get_disable_radius); + ClassDB::bind_method(D_METHOD("set_disable_radius","radius"),&ParticleAttractor2D::set_disable_radius); + ClassDB::bind_method(D_METHOD("get_disable_radius"),&ParticleAttractor2D::get_disable_radius); - ClassDB::bind_method(_MD("set_gravity","gravity"),&ParticleAttractor2D::set_gravity); - ClassDB::bind_method(_MD("get_gravity"),&ParticleAttractor2D::get_gravity); + ClassDB::bind_method(D_METHOD("set_gravity","gravity"),&ParticleAttractor2D::set_gravity); + ClassDB::bind_method(D_METHOD("get_gravity"),&ParticleAttractor2D::get_gravity); - ClassDB::bind_method(_MD("set_absorption","absorption"),&ParticleAttractor2D::set_absorption); - ClassDB::bind_method(_MD("get_absorption"),&ParticleAttractor2D::get_absorption); + ClassDB::bind_method(D_METHOD("set_absorption","absorption"),&ParticleAttractor2D::set_absorption); + ClassDB::bind_method(D_METHOD("get_absorption"),&ParticleAttractor2D::get_absorption); - ClassDB::bind_method(_MD("set_particles_path","path"),&ParticleAttractor2D::set_particles_path); - ClassDB::bind_method(_MD("get_particles_path"),&ParticleAttractor2D::get_particles_path); + ClassDB::bind_method(D_METHOD("set_particles_path","path"),&ParticleAttractor2D::set_particles_path); + ClassDB::bind_method(D_METHOD("get_particles_path"),&ParticleAttractor2D::get_particles_path); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.1,16000,0.1"),_SCS("set_radius"),_SCS("get_radius")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"disable_radius",PROPERTY_HINT_RANGE,"0.1,16000,0.1"),_SCS("set_disable_radius"),_SCS("get_disable_radius")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"gravity",PROPERTY_HINT_RANGE,"-512,512,0.01"),_SCS("set_gravity"),_SCS("get_gravity")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"absorption",PROPERTY_HINT_RANGE,"0,512,0.01"),_SCS("set_absorption"),_SCS("get_absorption")); - ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"particles_path",PROPERTY_HINT_RESOURCE_TYPE,"Particles2D"),_SCS("set_particles_path"),_SCS("get_particles_path")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"enabled"),"set_enabled","is_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.1,16000,0.1"),"set_radius","get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"disable_radius",PROPERTY_HINT_RANGE,"0.1,16000,0.1"),"set_disable_radius","get_disable_radius"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"gravity",PROPERTY_HINT_RANGE,"-512,512,0.01"),"set_gravity","get_gravity"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"absorption",PROPERTY_HINT_RANGE,"0,512,0.01"),"set_absorption","get_absorption"); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"particles_path",PROPERTY_HINT_RESOURCE_TYPE,"Particles2D"),"set_particles_path","get_particles_path"); @@ -227,21 +228,10 @@ ParticleAttractor2D::ParticleAttractor2D() { /****************************************/ -_FORCE_INLINE_ static float _rand_from_seed(uint32_t *seed) { +_FORCE_INLINE_ static float _rand_from_seed(uint64_t *seed) { - uint32_t k; - uint32_t s = (*seed); - if (s == 0) - s = 0x12345987; - k = s / 127773; - s = 16807 * (s - k * 127773) - 2836 * k; - if (s < 0) - s += 2147483647; - (*seed) = s; - - float v=((float)((*seed) & 0xFFFFF))/(float)0xFFFFF; - v=v*2.0-1.0; - return v; + uint32_t r = Math::rand_from_seed(seed); + return 2.0f * (float)r / (float)Math::RANDOM_MAX - 1.0f; } void Particles2D::_process_particles(float p_delta) { @@ -348,7 +338,7 @@ void Particles2D::_process_particles(float p_delta) { } } p.seed=Math::rand() % 12345678; - uint32_t rand_seed=p.seed*(i+1); + uint64_t rand_seed=p.seed*(i+1); float angle = Math::deg2rad(param[PARAM_DIRECTION]+_rand_from_seed(&rand_seed)*param[PARAM_SPREAD]); @@ -377,7 +367,7 @@ void Particles2D::_process_particles(float p_delta) { if (!p.active) continue; - uint32_t rand_seed=p.seed*(i+1); + uint64_t rand_seed=p.seed*(i+1); Vector2 force; @@ -451,8 +441,9 @@ void Particles2D::_process_particles(float p_delta) { time=Math::fmod( time+frame_time, lifetime ); if (!emitting && active_count==0) { + emit_signal(SceneStringNames::get_singleton()->emission_finished); set_process(false); - + set_fixed_process(false); } update(); @@ -470,6 +461,11 @@ void Particles2D::_notification(int p_what) { _process_particles( get_process_delta_time() ); } break; + case NOTIFICATION_FIXED_PROCESS: { + + _process_particles( get_fixed_process_delta_time() ); + } break; + case NOTIFICATION_ENTER_TREE: { float ppt=preprocess; @@ -530,7 +526,7 @@ void Particles2D::_notification(int p_what) { else ptime=(1.0-ptime)+time_pos; - uint32_t rand_seed=p.seed*(i+1); + uint64_t rand_seed=p.seed*(i+1); Color color; @@ -607,6 +603,10 @@ void Particles2D::_notification(int p_what) { src_rect.pos.y = size.y * (frame/h_frames); } + if (flip_h) + src_rect.size.x=-src_rect.size.x; + if (flip_v) + src_rect.size.y=-src_rect.size.y; texture->draw_rect_region(ci,Rect2(Point2(),size),src_rect,color); //VisualServer::get_singleton()->canvas_item_add_texture_rect(ci,r,texrid,false,color); @@ -691,7 +691,8 @@ void Particles2D::set_emitting(bool p_emitting) { if (active_count==0) time=0; - set_process(true); + set_process(process_mode==PROCESS_IDLE); + set_fixed_process(process_mode==PROCESS_FIXED); time_to_live = emit_timeout; }; emitting=p_emitting; @@ -703,6 +704,19 @@ bool Particles2D::is_emitting() const { return emitting; } +void Particles2D::set_process_mode(ProcessMode p_mode) { + + process_mode=p_mode; + const bool should_process=emitting || active_count!=0; + set_process(should_process && process_mode==PROCESS_IDLE); + set_fixed_process(should_process && process_mode==PROCESS_FIXED); +} + +Particles2D::ProcessMode Particles2D::get_process_mode() const { + + return process_mode; +} + void Particles2D::set_amount(int p_amount) { ERR_FAIL_INDEX(p_amount,1024+1); @@ -914,15 +928,6 @@ Vector2 Particles2D::get_emission_half_extents() const { return extents; } -void Particles2D::testee(int a, int b, int c, int d, int e) { - - print_line(itos(a)); - print_line(itos(b)); - print_line(itos(c)); - print_line(itos(d)); - print_line(itos(e)); -} - void Particles2D::set_initial_velocity(const Vector2& p_velocity) { @@ -1013,119 +1018,125 @@ void Particles2D::reset() { void Particles2D::_bind_methods() { - ClassDB::bind_method(_MD("set_emitting","active"),&Particles2D::set_emitting); - ClassDB::bind_method(_MD("is_emitting"),&Particles2D::is_emitting); + ClassDB::bind_method(D_METHOD("set_emitting","active"),&Particles2D::set_emitting); + ClassDB::bind_method(D_METHOD("is_emitting"),&Particles2D::is_emitting); + + ClassDB::bind_method(D_METHOD("set_process_mode","mode"),&Particles2D::set_process_mode); + ClassDB::bind_method(D_METHOD("get_process_mode"),&Particles2D::get_process_mode); + + ClassDB::bind_method(D_METHOD("set_amount","amount"),&Particles2D::set_amount); + ClassDB::bind_method(D_METHOD("get_amount"),&Particles2D::get_amount); - ClassDB::bind_method(_MD("set_amount","amount"),&Particles2D::set_amount); - ClassDB::bind_method(_MD("get_amount"),&Particles2D::get_amount); + ClassDB::bind_method(D_METHOD("set_lifetime","lifetime"),&Particles2D::set_lifetime); + ClassDB::bind_method(D_METHOD("get_lifetime"),&Particles2D::get_lifetime); - ClassDB::bind_method(_MD("set_lifetime","lifetime"),&Particles2D::set_lifetime); - ClassDB::bind_method(_MD("get_lifetime"),&Particles2D::get_lifetime); + ClassDB::bind_method(D_METHOD("set_time_scale","time_scale"),&Particles2D::set_time_scale); + ClassDB::bind_method(D_METHOD("get_time_scale"),&Particles2D::get_time_scale); - ClassDB::bind_method(_MD("set_time_scale","time_scale"),&Particles2D::set_time_scale); - ClassDB::bind_method(_MD("get_time_scale"),&Particles2D::get_time_scale); + ClassDB::bind_method(D_METHOD("set_pre_process_time","time"),&Particles2D::set_pre_process_time); + ClassDB::bind_method(D_METHOD("get_pre_process_time"),&Particles2D::get_pre_process_time); - ClassDB::bind_method(_MD("set_pre_process_time","time"),&Particles2D::set_pre_process_time); - ClassDB::bind_method(_MD("get_pre_process_time"),&Particles2D::get_pre_process_time); + ClassDB::bind_method(D_METHOD("set_emit_timeout","value"),&Particles2D::set_emit_timeout); + ClassDB::bind_method(D_METHOD("get_emit_timeout"),&Particles2D::get_emit_timeout); - ClassDB::bind_method(_MD("set_emit_timeout","value"),&Particles2D::set_emit_timeout); - ClassDB::bind_method(_MD("get_emit_timeout"),&Particles2D::get_emit_timeout); + ClassDB::bind_method(D_METHOD("set_param","param","value"),&Particles2D::set_param); + ClassDB::bind_method(D_METHOD("get_param","param"),&Particles2D::get_param); - ClassDB::bind_method(_MD("set_param","param","value"),&Particles2D::set_param); - ClassDB::bind_method(_MD("get_param","param"),&Particles2D::get_param); + ClassDB::bind_method(D_METHOD("set_randomness","param","value"),&Particles2D::set_randomness); + ClassDB::bind_method(D_METHOD("get_randomness","param"),&Particles2D::get_randomness); - ClassDB::bind_method(_MD("set_randomness","param","value"),&Particles2D::set_randomness); - ClassDB::bind_method(_MD("get_randomness","param"),&Particles2D::get_randomness); + ClassDB::bind_method(D_METHOD("set_texture:Texture","texture"),&Particles2D::set_texture); + ClassDB::bind_method(D_METHOD("get_texture:Texture"),&Particles2D::get_texture); - ClassDB::bind_method(_MD("set_texture:Texture","texture"),&Particles2D::set_texture); - ClassDB::bind_method(_MD("get_texture:Texture"),&Particles2D::get_texture); + ClassDB::bind_method(D_METHOD("set_color","color"),&Particles2D::set_color); + ClassDB::bind_method(D_METHOD("get_color"),&Particles2D::get_color); - ClassDB::bind_method(_MD("set_color","color"),&Particles2D::set_color); - ClassDB::bind_method(_MD("get_color"),&Particles2D::get_color); + ClassDB::bind_method(D_METHOD("set_color_ramp:ColorRamp","color_ramp"),&Particles2D::set_color_ramp); + ClassDB::bind_method(D_METHOD("get_color_ramp:ColorRamp"),&Particles2D::get_color_ramp); - ClassDB::bind_method(_MD("set_color_ramp:ColorRamp","color_ramp"),&Particles2D::set_color_ramp); - ClassDB::bind_method(_MD("get_color_ramp:ColorRamp"),&Particles2D::get_color_ramp); + ClassDB::bind_method(D_METHOD("set_emissor_offset","offset"),&Particles2D::set_emissor_offset); + ClassDB::bind_method(D_METHOD("get_emissor_offset"),&Particles2D::get_emissor_offset); - ClassDB::bind_method(_MD("set_emissor_offset","offset"),&Particles2D::set_emissor_offset); - ClassDB::bind_method(_MD("get_emissor_offset"),&Particles2D::get_emissor_offset); + ClassDB::bind_method(D_METHOD("set_flip_h","enable"),&Particles2D::set_flip_h); + ClassDB::bind_method(D_METHOD("is_flipped_h"),&Particles2D::is_flipped_h); - ClassDB::bind_method(_MD("set_flip_h","enable"),&Particles2D::set_flip_h); - ClassDB::bind_method(_MD("is_flipped_h"),&Particles2D::is_flipped_h); + ClassDB::bind_method(D_METHOD("set_flip_v","enable"),&Particles2D::set_flip_v); + ClassDB::bind_method(D_METHOD("is_flipped_v"),&Particles2D::is_flipped_v); - ClassDB::bind_method(_MD("set_flip_v","enable"),&Particles2D::set_flip_v); - ClassDB::bind_method(_MD("is_flipped_v"),&Particles2D::is_flipped_v); + ClassDB::bind_method(D_METHOD("set_h_frames","enable"),&Particles2D::set_h_frames); + ClassDB::bind_method(D_METHOD("get_h_frames"),&Particles2D::get_h_frames); - ClassDB::bind_method(_MD("set_h_frames","enable"),&Particles2D::set_h_frames); - ClassDB::bind_method(_MD("get_h_frames"),&Particles2D::get_h_frames); + ClassDB::bind_method(D_METHOD("set_v_frames","enable"),&Particles2D::set_v_frames); + ClassDB::bind_method(D_METHOD("get_v_frames"),&Particles2D::get_v_frames); - ClassDB::bind_method(_MD("set_v_frames","enable"),&Particles2D::set_v_frames); - ClassDB::bind_method(_MD("get_v_frames"),&Particles2D::get_v_frames); + ClassDB::bind_method(D_METHOD("set_emission_half_extents","extents"),&Particles2D::set_emission_half_extents); + ClassDB::bind_method(D_METHOD("get_emission_half_extents"),&Particles2D::get_emission_half_extents); - ClassDB::bind_method(_MD("set_emission_half_extents","extents"),&Particles2D::set_emission_half_extents); - ClassDB::bind_method(_MD("get_emission_half_extents"),&Particles2D::get_emission_half_extents); + ClassDB::bind_method(D_METHOD("set_color_phases","phases"),&Particles2D::set_color_phases); + ClassDB::bind_method(D_METHOD("get_color_phases"),&Particles2D::get_color_phases); - ClassDB::bind_method(_MD("set_color_phases","phases"),&Particles2D::set_color_phases); - ClassDB::bind_method(_MD("get_color_phases"),&Particles2D::get_color_phases); + ClassDB::bind_method(D_METHOD("set_color_phase_color","phase","color"),&Particles2D::set_color_phase_color); + ClassDB::bind_method(D_METHOD("get_color_phase_color","phase"),&Particles2D::get_color_phase_color); - ClassDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles2D::set_color_phase_color); - ClassDB::bind_method(_MD("get_color_phase_color","phase"),&Particles2D::get_color_phase_color); + ClassDB::bind_method(D_METHOD("set_color_phase_pos","phase","pos"),&Particles2D::set_color_phase_pos); + ClassDB::bind_method(D_METHOD("get_color_phase_pos","phase"),&Particles2D::get_color_phase_pos); - ClassDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles2D::set_color_phase_pos); - ClassDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles2D::get_color_phase_pos); + ClassDB::bind_method(D_METHOD("pre_process","time"),&Particles2D::pre_process); + ClassDB::bind_method(D_METHOD("reset"),&Particles2D::reset); - ClassDB::bind_method(_MD("pre_process","time"),&Particles2D::pre_process); - ClassDB::bind_method(_MD("reset"),&Particles2D::reset); + ClassDB::bind_method(D_METHOD("set_use_local_space","enable"),&Particles2D::set_use_local_space); + ClassDB::bind_method(D_METHOD("is_using_local_space"),&Particles2D::is_using_local_space); - ClassDB::bind_method(_MD("set_use_local_space","enable"),&Particles2D::set_use_local_space); - ClassDB::bind_method(_MD("is_using_local_space"),&Particles2D::is_using_local_space); + ClassDB::bind_method(D_METHOD("set_initial_velocity","velocity"),&Particles2D::set_initial_velocity); + ClassDB::bind_method(D_METHOD("get_initial_velocity"),&Particles2D::get_initial_velocity); - ClassDB::bind_method(_MD("set_initial_velocity","velocity"),&Particles2D::set_initial_velocity); - ClassDB::bind_method(_MD("get_initial_velocity"),&Particles2D::get_initial_velocity); + ClassDB::bind_method(D_METHOD("set_explosiveness","amount"),&Particles2D::set_explosiveness); + ClassDB::bind_method(D_METHOD("get_explosiveness"),&Particles2D::get_explosiveness); - ClassDB::bind_method(_MD("set_explosiveness","amount"),&Particles2D::set_explosiveness); - ClassDB::bind_method(_MD("get_explosiveness"),&Particles2D::get_explosiveness); + ClassDB::bind_method(D_METHOD("set_emission_points","points"),&Particles2D::set_emission_points); + ClassDB::bind_method(D_METHOD("get_emission_points"),&Particles2D::get_emission_points); - ClassDB::bind_method(_MD("set_emission_points","points"),&Particles2D::set_emission_points); - ClassDB::bind_method(_MD("get_emission_points"),&Particles2D::get_emission_points); + ADD_SIGNAL(MethodInfo("emission_finished")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"config/amount",PROPERTY_HINT_EXP_RANGE,"1,1024"),_SCS("set_amount"),_SCS("get_amount") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"config/lifetime",PROPERTY_HINT_EXP_RANGE,"0.1,3600,0.1"),_SCS("set_lifetime"),_SCS("get_lifetime") ); - ADD_PROPERTYNO(PropertyInfo(Variant::REAL,"config/time_scale",PROPERTY_HINT_EXP_RANGE,"0.01,128,0.01"),_SCS("set_time_scale"),_SCS("get_time_scale") ); - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"config/preprocess",PROPERTY_HINT_EXP_RANGE,"0.1,3600,0.1"),_SCS("set_pre_process_time"),_SCS("get_pre_process_time") ); - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"config/emit_timeout",PROPERTY_HINT_RANGE,"0,3600,0.1"),_SCS("set_emit_timeout"),_SCS("get_emit_timeout") ); - ADD_PROPERTYNO(PropertyInfo(Variant::BOOL,"config/emitting"),_SCS("set_emitting"),_SCS("is_emitting") ); - ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"config/offset"),_SCS("set_emissor_offset"),_SCS("get_emissor_offset")); - ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"config/half_extents"),_SCS("set_emission_half_extents"),_SCS("get_emission_half_extents")); - ADD_PROPERTYNO(PropertyInfo(Variant::BOOL,"config/local_space"),_SCS("set_use_local_space"),_SCS("is_using_local_space")); - ADD_PROPERTYNO(PropertyInfo(Variant::REAL,"config/explosiveness",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_explosiveness"),_SCS("get_explosiveness")); - ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL,"config/flip_h"),_SCS("set_flip_h"),_SCS("is_flipped_h")); - ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL,"config/flip_v"),_SCS("set_flip_v"),_SCS("is_flipped_v")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"config/texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture")); - ADD_PROPERTYNO(PropertyInfo(Variant::INT,"config/h_frames",PROPERTY_HINT_RANGE,"1,512,1"),_SCS("set_h_frames"),_SCS("get_h_frames")); - ADD_PROPERTYNO(PropertyInfo(Variant::INT,"config/v_frames",PROPERTY_HINT_RANGE,"1,512,1"),_SCS("set_v_frames"),_SCS("get_v_frames")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"config/amount",PROPERTY_HINT_EXP_RANGE,"1,1024"),"set_amount","get_amount") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"config/lifetime",PROPERTY_HINT_EXP_RANGE,"0.1,3600,0.1"),"set_lifetime","get_lifetime") ; + ADD_PROPERTYNO(PropertyInfo(Variant::REAL,"config/time_scale",PROPERTY_HINT_EXP_RANGE,"0.01,128,0.01"),"set_time_scale","get_time_scale") ; + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"config/preprocess",PROPERTY_HINT_EXP_RANGE,"0.1,3600,0.1"),"set_pre_process_time","get_pre_process_time") ; + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"config/emit_timeout",PROPERTY_HINT_RANGE,"0,3600,0.1"),"set_emit_timeout","get_emit_timeout") ; + ADD_PROPERTYNO(PropertyInfo(Variant::BOOL,"config/emitting"),"set_emitting","is_emitting") ; + ADD_PROPERTY(PropertyInfo(Variant::INT,"config/process_mode",PROPERTY_HINT_ENUM, "Fixed,Idle"),"set_process_mode","get_process_mode"); + ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"config/offset"),"set_emissor_offset","get_emissor_offset"); + ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"config/half_extents"),"set_emission_half_extents","get_emission_half_extents"); + ADD_PROPERTYNO(PropertyInfo(Variant::BOOL,"config/local_space"),"set_use_local_space","is_using_local_space"); + ADD_PROPERTYNO(PropertyInfo(Variant::REAL,"config/explosiveness",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_explosiveness","get_explosiveness"); + ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL,"config/flip_h"),"set_flip_h","is_flipped_h"); + ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL,"config/flip_v"),"set_flip_v","is_flipped_v"); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"config/texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture"); + ADD_PROPERTYNO(PropertyInfo(Variant::INT,"config/h_frames",PROPERTY_HINT_RANGE,"1,512,1"),"set_h_frames","get_h_frames"); + ADD_PROPERTYNO(PropertyInfo(Variant::INT,"config/v_frames",PROPERTY_HINT_RANGE,"1,512,1"),"set_v_frames","get_v_frames"); for(int i=0;i<PARAM_MAX;i++) { - ADD_PROPERTYI(PropertyInfo(Variant::REAL,_particlesframe_property_names[i],PROPERTY_HINT_RANGE,_particlesframe_property_ranges[i]),_SCS("set_param"),_SCS("get_param"),i); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,_particlesframe_property_names[i],PROPERTY_HINT_RANGE,_particlesframe_property_ranges[i]),"set_param","get_param",i); } for(int i=0;i<PARAM_MAX;i++) { - ADD_PROPERTYINZ(PropertyInfo(Variant::REAL,_particlesframe_property_rnames[i],PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_randomness"),_SCS("get_randomness"),i); + ADD_PROPERTYINZ(PropertyInfo(Variant::REAL,_particlesframe_property_rnames[i],PROPERTY_HINT_RANGE,"-1,1,0.01"),"set_randomness","get_randomness",i); } - ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "color_phases/count",PROPERTY_HINT_RANGE,"0,4,1", 0), _SCS("set_color_phases"), _SCS("get_color_phases")); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "color_phases/count",PROPERTY_HINT_RANGE,"0,4,1", 0), "set_color_phases", "get_color_phases"); //Backward compatibility. They will be converted to color ramp for(int i=0;i<MAX_COLOR_PHASES;i++) { String phase="phase_"+itos(i)+"/"; - ADD_PROPERTYI( PropertyInfo( Variant::REAL, phase+"pos", PROPERTY_HINT_RANGE,"0,1,0.01", 0),_SCS("set_color_phase_pos"),_SCS("get_color_phase_pos"),i ); - ADD_PROPERTYI( PropertyInfo( Variant::COLOR, phase+"color", PROPERTY_HINT_NONE, "", 0),_SCS("set_color_phase_color"),_SCS("get_color_phase_color"),i ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, phase+"pos", PROPERTY_HINT_RANGE,"0,1,0.01", 0),"set_color_phase_pos","get_color_phase_pos",i ); + ADD_PROPERTYI( PropertyInfo( Variant::COLOR, phase+"color", PROPERTY_HINT_NONE, "", 0),"set_color_phase_color","get_color_phase_color",i ); } - ADD_PROPERTYNO(PropertyInfo(Variant::COLOR, "color/color"),_SCS("set_color"),_SCS("get_color")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"color/color_ramp",PROPERTY_HINT_RESOURCE_TYPE,"ColorRamp"),_SCS("set_color_ramp"),_SCS("get_color_ramp")); + ADD_PROPERTYNO(PropertyInfo(Variant::COLOR, "color/color"),"set_color","get_color"); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"color/color_ramp",PROPERTY_HINT_RESOURCE_TYPE,"ColorRamp"),"set_color_ramp","get_color_ramp"); - ADD_PROPERTYNZ(PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"emission_points",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_emission_points"),_SCS("get_emission_points")); + ADD_PROPERTYNZ(PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"emission_points",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_emission_points","get_emission_points"); BIND_CONSTANT( PARAM_DIRECTION ); BIND_CONSTANT( PARAM_SPREAD ); @@ -1176,6 +1187,7 @@ Particles2D::Particles2D() { particles.resize(32); active_count=-1; set_emitting(true); + process_mode=PROCESS_IDLE; local_space=true; preprocess=0; time_scale=1.0; diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h index 91f42c5222..c6ababe3be 100644 --- a/scene/2d/particles_2d.h +++ b/scene/2d/particles_2d.h @@ -111,6 +111,11 @@ public: MAX_COLOR_PHASES=4 }; + enum ProcessMode { + PROCESS_FIXED, + PROCESS_IDLE, + }; + private: float param[PARAM_MAX]; @@ -122,7 +127,7 @@ private: Vector2 velocity; float rot; float frame; - uint32_t seed; + uint64_t seed; Particle() { active=false; seed=123465789; rot=0; frame=0;} }; @@ -153,6 +158,8 @@ private: Vector2 extents; PoolVector<Vector2> emission_points; + ProcessMode process_mode; + float time; int active_count; @@ -162,7 +169,6 @@ private: Color default_color; Ref<ColorRamp> color_ramp; - void testee(int a, int b, int c, int d, int e); void _process_particles(float p_delta); friend class ParticleAttractor2D; @@ -178,6 +184,9 @@ public: void set_emitting(bool p_emitting); bool is_emitting() const; + void set_process_mode(ProcessMode p_mode); + ProcessMode get_process_mode() const; + void set_amount(int p_amount); int get_amount() const; @@ -254,6 +263,7 @@ public: Particles2D(); }; +VARIANT_ENUM_CAST( Particles2D::ProcessMode ); VARIANT_ENUM_CAST( Particles2D::Parameter ); #endif // PARTICLES_FRAME_H diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index e1d1920cc5..63531ae599 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -85,11 +85,11 @@ Ref<Curve2D> Path2D::get_curve() const{ void Path2D::_bind_methods() { - ClassDB::bind_method(_MD("set_curve","curve:Curve2D"),&Path2D::set_curve); - ClassDB::bind_method(_MD("get_curve:Curve2D","curve"),&Path2D::get_curve); - ClassDB::bind_method(_MD("_curve_changed"),&Path2D::_curve_changed); + ClassDB::bind_method(D_METHOD("set_curve","curve:Curve2D"),&Path2D::set_curve); + ClassDB::bind_method(D_METHOD("get_curve:Curve2D","curve"),&Path2D::get_curve); + ClassDB::bind_method(D_METHOD("_curve_changed"),&Path2D::_curve_changed); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve2D"), _SCS("set_curve"),_SCS("get_curve")); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve2D"), "set_curve","get_curve"); } Path2D::Path2D() { @@ -252,26 +252,26 @@ String PathFollow2D::get_configuration_warning() const { void PathFollow2D::_bind_methods() { - ClassDB::bind_method(_MD("set_offset","offset"),&PathFollow2D::set_offset); - ClassDB::bind_method(_MD("get_offset"),&PathFollow2D::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","offset"),&PathFollow2D::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&PathFollow2D::get_offset); - ClassDB::bind_method(_MD("set_h_offset","h_offset"),&PathFollow2D::set_h_offset); - ClassDB::bind_method(_MD("get_h_offset"),&PathFollow2D::get_h_offset); + ClassDB::bind_method(D_METHOD("set_h_offset","h_offset"),&PathFollow2D::set_h_offset); + ClassDB::bind_method(D_METHOD("get_h_offset"),&PathFollow2D::get_h_offset); - ClassDB::bind_method(_MD("set_v_offset","v_offset"),&PathFollow2D::set_v_offset); - ClassDB::bind_method(_MD("get_v_offset"),&PathFollow2D::get_v_offset); + ClassDB::bind_method(D_METHOD("set_v_offset","v_offset"),&PathFollow2D::set_v_offset); + ClassDB::bind_method(D_METHOD("get_v_offset"),&PathFollow2D::get_v_offset); - ClassDB::bind_method(_MD("set_unit_offset","unit_offset"),&PathFollow2D::set_unit_offset); - ClassDB::bind_method(_MD("get_unit_offset"),&PathFollow2D::get_unit_offset); + ClassDB::bind_method(D_METHOD("set_unit_offset","unit_offset"),&PathFollow2D::set_unit_offset); + ClassDB::bind_method(D_METHOD("get_unit_offset"),&PathFollow2D::get_unit_offset); - ClassDB::bind_method(_MD("set_rotate","enable"),&PathFollow2D::set_rotate); - ClassDB::bind_method(_MD("is_rotating"),&PathFollow2D::is_rotating); + ClassDB::bind_method(D_METHOD("set_rotate","enable"),&PathFollow2D::set_rotate); + ClassDB::bind_method(D_METHOD("is_rotating"),&PathFollow2D::is_rotating); - ClassDB::bind_method(_MD("set_cubic_interpolation","enable"),&PathFollow2D::set_cubic_interpolation); - ClassDB::bind_method(_MD("get_cubic_interpolation"),&PathFollow2D::get_cubic_interpolation); + ClassDB::bind_method(D_METHOD("set_cubic_interpolation","enable"),&PathFollow2D::set_cubic_interpolation); + ClassDB::bind_method(D_METHOD("get_cubic_interpolation"),&PathFollow2D::get_cubic_interpolation); - ClassDB::bind_method(_MD("set_loop","loop"),&PathFollow2D::set_loop); - ClassDB::bind_method(_MD("has_loop"),&PathFollow2D::has_loop); + ClassDB::bind_method(D_METHOD("set_loop","loop"),&PathFollow2D::set_loop); + ClassDB::bind_method(D_METHOD("has_loop"),&PathFollow2D::has_loop); } diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 96d90a1de6..0ffaf81e3d 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -81,34 +81,34 @@ uint32_t PhysicsBody2D::_get_layers() const{ void PhysicsBody2D::_bind_methods() { - ClassDB::bind_method(_MD("set_collision_layer","mask"),&PhysicsBody2D::set_collision_layer); - ClassDB::bind_method(_MD("get_collision_layer"),&PhysicsBody2D::get_collision_layer); - ClassDB::bind_method(_MD("set_collision_mask","mask"),&PhysicsBody2D::set_collision_mask); - ClassDB::bind_method(_MD("get_collision_mask"),&PhysicsBody2D::get_collision_mask); + ClassDB::bind_method(D_METHOD("set_collision_layer","mask"),&PhysicsBody2D::set_collision_layer); + ClassDB::bind_method(D_METHOD("get_collision_layer"),&PhysicsBody2D::get_collision_layer); + ClassDB::bind_method(D_METHOD("set_collision_mask","mask"),&PhysicsBody2D::set_collision_mask); + ClassDB::bind_method(D_METHOD("get_collision_mask"),&PhysicsBody2D::get_collision_mask); - ClassDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&PhysicsBody2D::set_collision_mask_bit); - ClassDB::bind_method(_MD("get_collision_mask_bit","bit"),&PhysicsBody2D::get_collision_mask_bit); + ClassDB::bind_method(D_METHOD("set_collision_mask_bit","bit","value"),&PhysicsBody2D::set_collision_mask_bit); + ClassDB::bind_method(D_METHOD("get_collision_mask_bit","bit"),&PhysicsBody2D::get_collision_mask_bit); - ClassDB::bind_method(_MD("set_collision_layer_bit","bit","value"),&PhysicsBody2D::set_collision_layer_bit); - ClassDB::bind_method(_MD("get_collision_layer_bit","bit"),&PhysicsBody2D::get_collision_layer_bit); + ClassDB::bind_method(D_METHOD("set_collision_layer_bit","bit","value"),&PhysicsBody2D::set_collision_layer_bit); + ClassDB::bind_method(D_METHOD("get_collision_layer_bit","bit"),&PhysicsBody2D::get_collision_layer_bit); - ClassDB::bind_method(_MD("_set_layers","mask"),&PhysicsBody2D::_set_layers); - ClassDB::bind_method(_MD("_get_layers"),&PhysicsBody2D::_get_layers); - ClassDB::bind_method(_MD("set_one_way_collision_direction","dir"),&PhysicsBody2D::set_one_way_collision_direction); - ClassDB::bind_method(_MD("get_one_way_collision_direction"),&PhysicsBody2D::get_one_way_collision_direction); - ClassDB::bind_method(_MD("set_one_way_collision_max_depth","depth"),&PhysicsBody2D::set_one_way_collision_max_depth); - ClassDB::bind_method(_MD("get_one_way_collision_max_depth"),&PhysicsBody2D::get_one_way_collision_max_depth); - ClassDB::bind_method(_MD("add_collision_exception_with","body:PhysicsBody2D"),&PhysicsBody2D::add_collision_exception_with); - ClassDB::bind_method(_MD("remove_collision_exception_with","body:PhysicsBody2D"),&PhysicsBody2D::remove_collision_exception_with); - ADD_PROPERTY(PropertyInfo(Variant::INT,"layers",PROPERTY_HINT_LAYERS_2D_PHYSICS,"",0),_SCS("_set_layers"),_SCS("_get_layers")); //for backwards compat + ClassDB::bind_method(D_METHOD("_set_layers","mask"),&PhysicsBody2D::_set_layers); + ClassDB::bind_method(D_METHOD("_get_layers"),&PhysicsBody2D::_get_layers); + ClassDB::bind_method(D_METHOD("set_one_way_collision_direction","dir"),&PhysicsBody2D::set_one_way_collision_direction); + ClassDB::bind_method(D_METHOD("get_one_way_collision_direction"),&PhysicsBody2D::get_one_way_collision_direction); + ClassDB::bind_method(D_METHOD("set_one_way_collision_max_depth","depth"),&PhysicsBody2D::set_one_way_collision_max_depth); + ClassDB::bind_method(D_METHOD("get_one_way_collision_max_depth"),&PhysicsBody2D::get_one_way_collision_max_depth); + ClassDB::bind_method(D_METHOD("add_collision_exception_with","body:PhysicsBody2D"),&PhysicsBody2D::add_collision_exception_with); + ClassDB::bind_method(D_METHOD("remove_collision_exception_with","body:PhysicsBody2D"),&PhysicsBody2D::remove_collision_exception_with); + ADD_PROPERTY(PropertyInfo(Variant::INT,"layers",PROPERTY_HINT_LAYERS_2D_PHYSICS,"",0),"_set_layers","_get_layers"); //for backwards compat ADD_GROUP("Collision","collision_"); - ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_layer",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_collision_layer"),_SCS("get_collision_layer")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_layer",PROPERTY_HINT_LAYERS_2D_PHYSICS),"set_collision_layer","get_collision_layer"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),"set_collision_mask","get_collision_mask"); ADD_GROUP("",""); - ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"one_way_collision/direction"),_SCS("set_one_way_collision_direction"),_SCS("get_one_way_collision_direction")); - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"one_way_collision/max_depth"),_SCS("set_one_way_collision_max_depth"),_SCS("get_one_way_collision_max_depth")); + ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"one_way_collision/direction"),"set_one_way_collision_direction","get_one_way_collision_direction"); + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"one_way_collision/max_depth"),"set_one_way_collision_max_depth","get_one_way_collision_max_depth"); } void PhysicsBody2D::set_collision_layer(uint32_t p_mask) { @@ -271,20 +271,20 @@ real_t StaticBody2D::get_bounce() const{ void StaticBody2D::_bind_methods() { - ClassDB::bind_method(_MD("set_constant_linear_velocity","vel"),&StaticBody2D::set_constant_linear_velocity); - ClassDB::bind_method(_MD("set_constant_angular_velocity","vel"),&StaticBody2D::set_constant_angular_velocity); - ClassDB::bind_method(_MD("get_constant_linear_velocity"),&StaticBody2D::get_constant_linear_velocity); - ClassDB::bind_method(_MD("get_constant_angular_velocity"),&StaticBody2D::get_constant_angular_velocity); - ClassDB::bind_method(_MD("set_friction","friction"),&StaticBody2D::set_friction); - ClassDB::bind_method(_MD("get_friction"),&StaticBody2D::get_friction); + ClassDB::bind_method(D_METHOD("set_constant_linear_velocity","vel"),&StaticBody2D::set_constant_linear_velocity); + ClassDB::bind_method(D_METHOD("set_constant_angular_velocity","vel"),&StaticBody2D::set_constant_angular_velocity); + ClassDB::bind_method(D_METHOD("get_constant_linear_velocity"),&StaticBody2D::get_constant_linear_velocity); + ClassDB::bind_method(D_METHOD("get_constant_angular_velocity"),&StaticBody2D::get_constant_angular_velocity); + ClassDB::bind_method(D_METHOD("set_friction","friction"),&StaticBody2D::set_friction); + ClassDB::bind_method(D_METHOD("get_friction"),&StaticBody2D::get_friction); - ClassDB::bind_method(_MD("set_bounce","bounce"),&StaticBody2D::set_bounce); - ClassDB::bind_method(_MD("get_bounce"),&StaticBody2D::get_bounce); + ClassDB::bind_method(D_METHOD("set_bounce","bounce"),&StaticBody2D::set_bounce); + ClassDB::bind_method(D_METHOD("get_bounce"),&StaticBody2D::get_bounce); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"constant_linear_velocity"),_SCS("set_constant_linear_velocity"),_SCS("get_constant_linear_velocity")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"constant_angular_velocity"),_SCS("set_constant_angular_velocity"),_SCS("get_constant_angular_velocity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_friction"),_SCS("get_friction")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_bounce"),_SCS("get_bounce")); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"constant_linear_velocity"),"set_constant_linear_velocity","get_constant_linear_velocity"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"constant_angular_velocity"),"set_constant_angular_velocity","get_constant_angular_velocity"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_friction","get_friction"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_bounce","get_bounce"); } StaticBody2D::StaticBody2D() : PhysicsBody2D(Physics2DServer::BODY_MODE_STATIC) { @@ -882,96 +882,96 @@ bool RigidBody2D::is_contact_monitor_enabled() const { void RigidBody2D::_bind_methods() { - ClassDB::bind_method(_MD("set_mode","mode"),&RigidBody2D::set_mode); - ClassDB::bind_method(_MD("get_mode"),&RigidBody2D::get_mode); + ClassDB::bind_method(D_METHOD("set_mode","mode"),&RigidBody2D::set_mode); + ClassDB::bind_method(D_METHOD("get_mode"),&RigidBody2D::get_mode); - ClassDB::bind_method(_MD("set_mass","mass"),&RigidBody2D::set_mass); - ClassDB::bind_method(_MD("get_mass"),&RigidBody2D::get_mass); + ClassDB::bind_method(D_METHOD("set_mass","mass"),&RigidBody2D::set_mass); + ClassDB::bind_method(D_METHOD("get_mass"),&RigidBody2D::get_mass); - ClassDB::bind_method(_MD("get_inertia"),&RigidBody2D::get_inertia); - ClassDB::bind_method(_MD("set_inertia","inertia"),&RigidBody2D::set_inertia); + ClassDB::bind_method(D_METHOD("get_inertia"),&RigidBody2D::get_inertia); + ClassDB::bind_method(D_METHOD("set_inertia","inertia"),&RigidBody2D::set_inertia); - ClassDB::bind_method(_MD("set_weight","weight"),&RigidBody2D::set_weight); - ClassDB::bind_method(_MD("get_weight"),&RigidBody2D::get_weight); + ClassDB::bind_method(D_METHOD("set_weight","weight"),&RigidBody2D::set_weight); + ClassDB::bind_method(D_METHOD("get_weight"),&RigidBody2D::get_weight); - ClassDB::bind_method(_MD("set_friction","friction"),&RigidBody2D::set_friction); - ClassDB::bind_method(_MD("get_friction"),&RigidBody2D::get_friction); + ClassDB::bind_method(D_METHOD("set_friction","friction"),&RigidBody2D::set_friction); + ClassDB::bind_method(D_METHOD("get_friction"),&RigidBody2D::get_friction); - ClassDB::bind_method(_MD("set_bounce","bounce"),&RigidBody2D::set_bounce); - ClassDB::bind_method(_MD("get_bounce"),&RigidBody2D::get_bounce); + ClassDB::bind_method(D_METHOD("set_bounce","bounce"),&RigidBody2D::set_bounce); + ClassDB::bind_method(D_METHOD("get_bounce"),&RigidBody2D::get_bounce); - ClassDB::bind_method(_MD("set_gravity_scale","gravity_scale"),&RigidBody2D::set_gravity_scale); - ClassDB::bind_method(_MD("get_gravity_scale"),&RigidBody2D::get_gravity_scale); + ClassDB::bind_method(D_METHOD("set_gravity_scale","gravity_scale"),&RigidBody2D::set_gravity_scale); + ClassDB::bind_method(D_METHOD("get_gravity_scale"),&RigidBody2D::get_gravity_scale); - ClassDB::bind_method(_MD("set_linear_damp","linear_damp"),&RigidBody2D::set_linear_damp); - ClassDB::bind_method(_MD("get_linear_damp"),&RigidBody2D::get_linear_damp); + ClassDB::bind_method(D_METHOD("set_linear_damp","linear_damp"),&RigidBody2D::set_linear_damp); + ClassDB::bind_method(D_METHOD("get_linear_damp"),&RigidBody2D::get_linear_damp); - ClassDB::bind_method(_MD("set_angular_damp","angular_damp"),&RigidBody2D::set_angular_damp); - ClassDB::bind_method(_MD("get_angular_damp"),&RigidBody2D::get_angular_damp); + ClassDB::bind_method(D_METHOD("set_angular_damp","angular_damp"),&RigidBody2D::set_angular_damp); + ClassDB::bind_method(D_METHOD("get_angular_damp"),&RigidBody2D::get_angular_damp); - ClassDB::bind_method(_MD("set_linear_velocity","linear_velocity"),&RigidBody2D::set_linear_velocity); - ClassDB::bind_method(_MD("get_linear_velocity"),&RigidBody2D::get_linear_velocity); + ClassDB::bind_method(D_METHOD("set_linear_velocity","linear_velocity"),&RigidBody2D::set_linear_velocity); + ClassDB::bind_method(D_METHOD("get_linear_velocity"),&RigidBody2D::get_linear_velocity); - ClassDB::bind_method(_MD("set_angular_velocity","angular_velocity"),&RigidBody2D::set_angular_velocity); - ClassDB::bind_method(_MD("get_angular_velocity"),&RigidBody2D::get_angular_velocity); + ClassDB::bind_method(D_METHOD("set_angular_velocity","angular_velocity"),&RigidBody2D::set_angular_velocity); + ClassDB::bind_method(D_METHOD("get_angular_velocity"),&RigidBody2D::get_angular_velocity); - ClassDB::bind_method(_MD("set_max_contacts_reported","amount"),&RigidBody2D::set_max_contacts_reported); - ClassDB::bind_method(_MD("get_max_contacts_reported"),&RigidBody2D::get_max_contacts_reported); + ClassDB::bind_method(D_METHOD("set_max_contacts_reported","amount"),&RigidBody2D::set_max_contacts_reported); + ClassDB::bind_method(D_METHOD("get_max_contacts_reported"),&RigidBody2D::get_max_contacts_reported); - ClassDB::bind_method(_MD("set_use_custom_integrator","enable"),&RigidBody2D::set_use_custom_integrator); - ClassDB::bind_method(_MD("is_using_custom_integrator"),&RigidBody2D::is_using_custom_integrator); + ClassDB::bind_method(D_METHOD("set_use_custom_integrator","enable"),&RigidBody2D::set_use_custom_integrator); + ClassDB::bind_method(D_METHOD("is_using_custom_integrator"),&RigidBody2D::is_using_custom_integrator); - ClassDB::bind_method(_MD("set_contact_monitor","enabled"),&RigidBody2D::set_contact_monitor); - ClassDB::bind_method(_MD("is_contact_monitor_enabled"),&RigidBody2D::is_contact_monitor_enabled); + ClassDB::bind_method(D_METHOD("set_contact_monitor","enabled"),&RigidBody2D::set_contact_monitor); + ClassDB::bind_method(D_METHOD("is_contact_monitor_enabled"),&RigidBody2D::is_contact_monitor_enabled); - ClassDB::bind_method(_MD("set_continuous_collision_detection_mode","mode"),&RigidBody2D::set_continuous_collision_detection_mode); - ClassDB::bind_method(_MD("get_continuous_collision_detection_mode"),&RigidBody2D::get_continuous_collision_detection_mode); + ClassDB::bind_method(D_METHOD("set_continuous_collision_detection_mode","mode"),&RigidBody2D::set_continuous_collision_detection_mode); + ClassDB::bind_method(D_METHOD("get_continuous_collision_detection_mode"),&RigidBody2D::get_continuous_collision_detection_mode); - ClassDB::bind_method(_MD("set_axis_velocity","axis_velocity"),&RigidBody2D::set_axis_velocity); - ClassDB::bind_method(_MD("apply_impulse","offset","impulse"),&RigidBody2D::apply_impulse); + ClassDB::bind_method(D_METHOD("set_axis_velocity","axis_velocity"),&RigidBody2D::set_axis_velocity); + ClassDB::bind_method(D_METHOD("apply_impulse","offset","impulse"),&RigidBody2D::apply_impulse); - ClassDB::bind_method(_MD("set_applied_force","force"),&RigidBody2D::set_applied_force); - ClassDB::bind_method(_MD("get_applied_force"),&RigidBody2D::get_applied_force); + ClassDB::bind_method(D_METHOD("set_applied_force","force"),&RigidBody2D::set_applied_force); + ClassDB::bind_method(D_METHOD("get_applied_force"),&RigidBody2D::get_applied_force); - ClassDB::bind_method(_MD("set_applied_torque","torque"),&RigidBody2D::set_applied_torque); - ClassDB::bind_method(_MD("get_applied_torque"),&RigidBody2D::get_applied_torque); + ClassDB::bind_method(D_METHOD("set_applied_torque","torque"),&RigidBody2D::set_applied_torque); + ClassDB::bind_method(D_METHOD("get_applied_torque"),&RigidBody2D::get_applied_torque); - ClassDB::bind_method(_MD("add_force","offset","force"),&RigidBody2D::add_force); + ClassDB::bind_method(D_METHOD("add_force","offset","force"),&RigidBody2D::add_force); - ClassDB::bind_method(_MD("set_sleeping","sleeping"),&RigidBody2D::set_sleeping); - ClassDB::bind_method(_MD("is_sleeping"),&RigidBody2D::is_sleeping); + ClassDB::bind_method(D_METHOD("set_sleeping","sleeping"),&RigidBody2D::set_sleeping); + ClassDB::bind_method(D_METHOD("is_sleeping"),&RigidBody2D::is_sleeping); - ClassDB::bind_method(_MD("set_can_sleep","able_to_sleep"),&RigidBody2D::set_can_sleep); - ClassDB::bind_method(_MD("is_able_to_sleep"),&RigidBody2D::is_able_to_sleep); + ClassDB::bind_method(D_METHOD("set_can_sleep","able_to_sleep"),&RigidBody2D::set_can_sleep); + ClassDB::bind_method(D_METHOD("is_able_to_sleep"),&RigidBody2D::is_able_to_sleep); - ClassDB::bind_method(_MD("test_motion","motion","margin","result:Physics2DTestMotionResult"),&RigidBody2D::_test_motion,DEFVAL(0.08),DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("test_motion","motion","margin","result:Physics2DTestMotionResult"),&RigidBody2D::_test_motion,DEFVAL(0.08),DEFVAL(Variant())); - ClassDB::bind_method(_MD("_direct_state_changed"),&RigidBody2D::_direct_state_changed); - ClassDB::bind_method(_MD("_body_enter_tree"),&RigidBody2D::_body_enter_tree); - ClassDB::bind_method(_MD("_body_exit_tree"),&RigidBody2D::_body_exit_tree); + ClassDB::bind_method(D_METHOD("_direct_state_changed"),&RigidBody2D::_direct_state_changed); + ClassDB::bind_method(D_METHOD("_body_enter_tree"),&RigidBody2D::_body_enter_tree); + ClassDB::bind_method(D_METHOD("_body_exit_tree"),&RigidBody2D::_body_exit_tree); - ClassDB::bind_method(_MD("get_colliding_bodies"),&RigidBody2D::get_colliding_bodies); + ClassDB::bind_method(D_METHOD("get_colliding_bodies"),&RigidBody2D::get_colliding_bodies); BIND_VMETHOD(MethodInfo("_integrate_forces",PropertyInfo(Variant::OBJECT,"state:Physics2DDirectBodyState"))); - ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Rigid,Static,Character,Kinematic"),_SCS("set_mode"),_SCS("get_mode")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"mass",PROPERTY_HINT_EXP_RANGE,"0.01,65535,0.01"),_SCS("set_mass"),_SCS("get_mass")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"weight",PROPERTY_HINT_EXP_RANGE,"0.01,65535,0.01",PROPERTY_USAGE_EDITOR),_SCS("set_weight"),_SCS("get_weight")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_friction"),_SCS("get_friction")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_bounce"),_SCS("get_bounce")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity_scale",PROPERTY_HINT_RANGE,"-128,128,0.01"),_SCS("set_gravity_scale"),_SCS("get_gravity_scale")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"custom_integrator"),_SCS("set_use_custom_integrator"),_SCS("is_using_custom_integrator")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"continuous_cd",PROPERTY_HINT_ENUM,"Disabled,Cast Ray,Cast Shape"),_SCS("set_continuous_collision_detection_mode"),_SCS("get_continuous_collision_detection_mode")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"contacts_reported"),_SCS("set_max_contacts_reported"),_SCS("get_max_contacts_reported")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"contact_monitor"),_SCS("set_contact_monitor"),_SCS("is_contact_monitor_enabled")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"sleeping"),_SCS("set_sleeping"),_SCS("is_sleeping")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"can_sleep"),_SCS("set_can_sleep"),_SCS("is_able_to_sleep")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Rigid,Static,Character,Kinematic"),"set_mode","get_mode"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"mass",PROPERTY_HINT_EXP_RANGE,"0.01,65535,0.01"),"set_mass","get_mass"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"weight",PROPERTY_HINT_EXP_RANGE,"0.01,65535,0.01",PROPERTY_USAGE_EDITOR),"set_weight","get_weight"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_friction","get_friction"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_bounce","get_bounce"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity_scale",PROPERTY_HINT_RANGE,"-128,128,0.01"),"set_gravity_scale","get_gravity_scale"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"custom_integrator"),"set_use_custom_integrator","is_using_custom_integrator"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"continuous_cd",PROPERTY_HINT_ENUM,"Disabled,Cast Ray,Cast Shape"),"set_continuous_collision_detection_mode","get_continuous_collision_detection_mode"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"contacts_reported"),"set_max_contacts_reported","get_max_contacts_reported"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"contact_monitor"),"set_contact_monitor","is_contact_monitor_enabled"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"sleeping"),"set_sleeping","is_sleeping"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"can_sleep"),"set_can_sleep","is_able_to_sleep"); ADD_GROUP("Linear","linear_"); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"linear_velocity"),_SCS("set_linear_velocity"),_SCS("get_linear_velocity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"linear_velocity"),"set_linear_velocity","get_linear_velocity"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),"set_linear_damp","get_linear_damp"); ADD_GROUP("Angular","angular_"); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_velocity"),_SCS("set_angular_velocity"),_SCS("get_angular_velocity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_velocity"),"set_angular_velocity","get_angular_velocity"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),"set_angular_damp","get_angular_damp"); ADD_SIGNAL( MethodInfo("body_shape_entered",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"local_shape"))); ADD_SIGNAL( MethodInfo("body_shape_exited",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"local_shape"))); @@ -1388,31 +1388,31 @@ float KinematicBody2D::get_collision_margin() const{ void KinematicBody2D::_bind_methods() { - ClassDB::bind_method(_MD("move","rel_vec"),&KinematicBody2D::move); - ClassDB::bind_method(_MD("move_to","position"),&KinematicBody2D::move_to); - ClassDB::bind_method(_MD("move_and_slide","linear_velocity","floor_normal","slope_stop_min_velocity","max_bounces"),&KinematicBody2D::move_and_slide,DEFVAL(Vector2(0,0)),DEFVAL(5),DEFVAL(4)); + ClassDB::bind_method(D_METHOD("move","rel_vec"),&KinematicBody2D::move); + ClassDB::bind_method(D_METHOD("move_to","position"),&KinematicBody2D::move_to); + ClassDB::bind_method(D_METHOD("move_and_slide","linear_velocity","floor_normal","slope_stop_min_velocity","max_bounces"),&KinematicBody2D::move_and_slide,DEFVAL(Vector2(0,0)),DEFVAL(5),DEFVAL(4)); - ClassDB::bind_method(_MD("test_move","from","rel_vec"),&KinematicBody2D::test_move); - ClassDB::bind_method(_MD("get_travel"),&KinematicBody2D::get_travel); - ClassDB::bind_method(_MD("revert_motion"),&KinematicBody2D::revert_motion); + ClassDB::bind_method(D_METHOD("test_move","from","rel_vec"),&KinematicBody2D::test_move); + ClassDB::bind_method(D_METHOD("get_travel"),&KinematicBody2D::get_travel); + ClassDB::bind_method(D_METHOD("revert_motion"),&KinematicBody2D::revert_motion); - ClassDB::bind_method(_MD("is_colliding"),&KinematicBody2D::is_colliding); + ClassDB::bind_method(D_METHOD("is_colliding"),&KinematicBody2D::is_colliding); - ClassDB::bind_method(_MD("get_collision_pos"),&KinematicBody2D::get_collision_pos); - ClassDB::bind_method(_MD("get_collision_normal"),&KinematicBody2D::get_collision_normal); - ClassDB::bind_method(_MD("get_collider_velocity"),&KinematicBody2D::get_collider_velocity); - ClassDB::bind_method(_MD("get_collider:Variant"),&KinematicBody2D::_get_collider); - ClassDB::bind_method(_MD("get_collider_shape"),&KinematicBody2D::get_collider_shape); - ClassDB::bind_method(_MD("get_collider_metadata:Variant"),&KinematicBody2D::get_collider_metadata); - ClassDB::bind_method(_MD("get_move_and_slide_colliders"),&KinematicBody2D::get_move_and_slide_colliders); - ClassDB::bind_method(_MD("is_move_and_slide_on_floor"),&KinematicBody2D::is_move_and_slide_on_floor); - ClassDB::bind_method(_MD("is_move_and_slide_on_ceiling"),&KinematicBody2D::is_move_and_slide_on_ceiling); - ClassDB::bind_method(_MD("is_move_and_slide_on_wall"),&KinematicBody2D::is_move_and_slide_on_wall); + ClassDB::bind_method(D_METHOD("get_collision_pos"),&KinematicBody2D::get_collision_pos); + ClassDB::bind_method(D_METHOD("get_collision_normal"),&KinematicBody2D::get_collision_normal); + ClassDB::bind_method(D_METHOD("get_collider_velocity"),&KinematicBody2D::get_collider_velocity); + ClassDB::bind_method(D_METHOD("get_collider:Variant"),&KinematicBody2D::_get_collider); + ClassDB::bind_method(D_METHOD("get_collider_shape"),&KinematicBody2D::get_collider_shape); + ClassDB::bind_method(D_METHOD("get_collider_metadata:Variant"),&KinematicBody2D::get_collider_metadata); + ClassDB::bind_method(D_METHOD("get_move_and_slide_colliders"),&KinematicBody2D::get_move_and_slide_colliders); + ClassDB::bind_method(D_METHOD("is_move_and_slide_on_floor"),&KinematicBody2D::is_move_and_slide_on_floor); + ClassDB::bind_method(D_METHOD("is_move_and_slide_on_ceiling"),&KinematicBody2D::is_move_and_slide_on_ceiling); + ClassDB::bind_method(D_METHOD("is_move_and_slide_on_wall"),&KinematicBody2D::is_move_and_slide_on_wall); - ClassDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody2D::set_collision_margin); - ClassDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody2D::get_collision_margin); + ClassDB::bind_method(D_METHOD("set_collision_margin","pixels"),&KinematicBody2D::set_collision_margin); + ClassDB::bind_method(D_METHOD("get_collision_margin","pixels"),&KinematicBody2D::get_collision_margin); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision/margin",PROPERTY_HINT_RANGE,"0.001,256,0.001"),_SCS("set_collision_margin"),_SCS("get_collision_margin")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision/margin",PROPERTY_HINT_RANGE,"0.001,256,0.001"),"set_collision_margin","get_collision_margin"); } diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 30e22a8437..ec6729844b 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -333,60 +333,60 @@ Vector2 Polygon2D::get_offset() const { void Polygon2D::_bind_methods() { - ClassDB::bind_method(_MD("set_polygon","polygon"),&Polygon2D::set_polygon); - ClassDB::bind_method(_MD("get_polygon"),&Polygon2D::get_polygon); + ClassDB::bind_method(D_METHOD("set_polygon","polygon"),&Polygon2D::set_polygon); + ClassDB::bind_method(D_METHOD("get_polygon"),&Polygon2D::get_polygon); - ClassDB::bind_method(_MD("set_uv","uv"),&Polygon2D::set_uv); - ClassDB::bind_method(_MD("get_uv"),&Polygon2D::get_uv); + ClassDB::bind_method(D_METHOD("set_uv","uv"),&Polygon2D::set_uv); + ClassDB::bind_method(D_METHOD("get_uv"),&Polygon2D::get_uv); - ClassDB::bind_method(_MD("set_color","color"),&Polygon2D::set_color); - ClassDB::bind_method(_MD("get_color"),&Polygon2D::get_color); + ClassDB::bind_method(D_METHOD("set_color","color"),&Polygon2D::set_color); + ClassDB::bind_method(D_METHOD("get_color"),&Polygon2D::get_color); - ClassDB::bind_method(_MD("set_vertex_colors","vertex_colors"),&Polygon2D::set_vertex_colors); - ClassDB::bind_method(_MD("get_vertex_colors"),&Polygon2D::get_vertex_colors); + ClassDB::bind_method(D_METHOD("set_vertex_colors","vertex_colors"),&Polygon2D::set_vertex_colors); + ClassDB::bind_method(D_METHOD("get_vertex_colors"),&Polygon2D::get_vertex_colors); - ClassDB::bind_method(_MD("set_texture","texture"),&Polygon2D::set_texture); - ClassDB::bind_method(_MD("get_texture"),&Polygon2D::get_texture); + ClassDB::bind_method(D_METHOD("set_texture","texture"),&Polygon2D::set_texture); + ClassDB::bind_method(D_METHOD("get_texture"),&Polygon2D::get_texture); - ClassDB::bind_method(_MD("set_texture_offset","texture_offset"),&Polygon2D::set_texture_offset); - ClassDB::bind_method(_MD("get_texture_offset"),&Polygon2D::get_texture_offset); + ClassDB::bind_method(D_METHOD("set_texture_offset","texture_offset"),&Polygon2D::set_texture_offset); + ClassDB::bind_method(D_METHOD("get_texture_offset"),&Polygon2D::get_texture_offset); - ClassDB::bind_method(_MD("set_texture_rotation","texture_rotation"),&Polygon2D::set_texture_rotation); - ClassDB::bind_method(_MD("get_texture_rotation"),&Polygon2D::get_texture_rotation); + ClassDB::bind_method(D_METHOD("set_texture_rotation","texture_rotation"),&Polygon2D::set_texture_rotation); + ClassDB::bind_method(D_METHOD("get_texture_rotation"),&Polygon2D::get_texture_rotation); - ClassDB::bind_method(_MD("_set_texture_rotationd","texture_rotation"),&Polygon2D::_set_texture_rotationd); - ClassDB::bind_method(_MD("_get_texture_rotationd"),&Polygon2D::_get_texture_rotationd); + ClassDB::bind_method(D_METHOD("_set_texture_rotationd","texture_rotation"),&Polygon2D::_set_texture_rotationd); + ClassDB::bind_method(D_METHOD("_get_texture_rotationd"),&Polygon2D::_get_texture_rotationd); - ClassDB::bind_method(_MD("set_texture_scale","texture_scale"),&Polygon2D::set_texture_scale); - ClassDB::bind_method(_MD("get_texture_scale"),&Polygon2D::get_texture_scale); + ClassDB::bind_method(D_METHOD("set_texture_scale","texture_scale"),&Polygon2D::set_texture_scale); + ClassDB::bind_method(D_METHOD("get_texture_scale"),&Polygon2D::get_texture_scale); - ClassDB::bind_method(_MD("set_invert","invert"),&Polygon2D::set_invert); - ClassDB::bind_method(_MD("get_invert"),&Polygon2D::get_invert); + ClassDB::bind_method(D_METHOD("set_invert","invert"),&Polygon2D::set_invert); + ClassDB::bind_method(D_METHOD("get_invert"),&Polygon2D::get_invert); - ClassDB::bind_method(_MD("set_invert_border","invert_border"),&Polygon2D::set_invert_border); - ClassDB::bind_method(_MD("get_invert_border"),&Polygon2D::get_invert_border); + ClassDB::bind_method(D_METHOD("set_invert_border","invert_border"),&Polygon2D::set_invert_border); + ClassDB::bind_method(D_METHOD("get_invert_border"),&Polygon2D::get_invert_border); - ClassDB::bind_method(_MD("set_offset","offset"),&Polygon2D::set_offset); - ClassDB::bind_method(_MD("get_offset"),&Polygon2D::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","offset"),&Polygon2D::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&Polygon2D::get_offset); - ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); - ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"uv"),_SCS("set_uv"),_SCS("get_uv")); - ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color")); - ADD_PROPERTY( PropertyInfo(Variant::POOL_COLOR_ARRAY,"vertex_colors"),_SCS("set_vertex_colors"),_SCS("get_vertex_colors")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"offset"),_SCS("set_offset"),_SCS("get_offset")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),"set_polygon","get_polygon"); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"uv"),"set_uv","get_uv"); + ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),"set_color","get_color"); + ADD_PROPERTY( PropertyInfo(Variant::POOL_COLOR_ARRAY,"vertex_colors"),"set_vertex_colors","get_vertex_colors"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"offset"),"set_offset","get_offset"); ADD_GROUP("Texture",""); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture"); ADD_GROUP("Texture","texture_"); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"texture_offset"),_SCS("set_texture_offset"),_SCS("get_texture_offset")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"texture_scale"),_SCS("set_texture_scale"),_SCS("get_texture_scale")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"texture_rotation",PROPERTY_HINT_RANGE,"-1440,1440,0.1"),_SCS("_set_texture_rotationd"),_SCS("_get_texture_rotationd")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"texture_offset"),"set_texture_offset","get_texture_offset"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"texture_scale"),"set_texture_scale","get_texture_scale"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"texture_rotation",PROPERTY_HINT_RANGE,"-1440,1440,0.1"),"_set_texture_rotationd","_get_texture_rotationd"); ADD_GROUP("Invert","invert_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"invert_enable"),_SCS("set_invert"),_SCS("get_invert")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"invert_border",PROPERTY_HINT_RANGE,"0.1,16384,0.1"),_SCS("set_invert_border"),_SCS("get_invert_border")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"invert_enable"),"set_invert","get_invert"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"invert_border",PROPERTY_HINT_RANGE,"0.1,16384,0.1"),"set_invert_border","get_invert_border"); } diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index 14dfc10d9f..72247811dc 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -263,42 +263,42 @@ void RayCast2D::clear_exceptions(){ void RayCast2D::_bind_methods() { - ClassDB::bind_method(_MD("set_enabled","enabled"),&RayCast2D::set_enabled); - ClassDB::bind_method(_MD("is_enabled"),&RayCast2D::is_enabled); + ClassDB::bind_method(D_METHOD("set_enabled","enabled"),&RayCast2D::set_enabled); + ClassDB::bind_method(D_METHOD("is_enabled"),&RayCast2D::is_enabled); - ClassDB::bind_method(_MD("set_cast_to","local_point"),&RayCast2D::set_cast_to); - ClassDB::bind_method(_MD("get_cast_to"),&RayCast2D::get_cast_to); + ClassDB::bind_method(D_METHOD("set_cast_to","local_point"),&RayCast2D::set_cast_to); + ClassDB::bind_method(D_METHOD("get_cast_to"),&RayCast2D::get_cast_to); - ClassDB::bind_method(_MD("is_colliding"),&RayCast2D::is_colliding); - ClassDB::bind_method(_MD("force_raycast_update"),&RayCast2D::force_raycast_update); + ClassDB::bind_method(D_METHOD("is_colliding"),&RayCast2D::is_colliding); + ClassDB::bind_method(D_METHOD("force_raycast_update"),&RayCast2D::force_raycast_update); - ClassDB::bind_method(_MD("get_collider"),&RayCast2D::get_collider); - ClassDB::bind_method(_MD("get_collider_shape"),&RayCast2D::get_collider_shape); - ClassDB::bind_method(_MD("get_collision_point"),&RayCast2D::get_collision_point); - ClassDB::bind_method(_MD("get_collision_normal"),&RayCast2D::get_collision_normal); + ClassDB::bind_method(D_METHOD("get_collider"),&RayCast2D::get_collider); + ClassDB::bind_method(D_METHOD("get_collider_shape"),&RayCast2D::get_collider_shape); + ClassDB::bind_method(D_METHOD("get_collision_point"),&RayCast2D::get_collision_point); + ClassDB::bind_method(D_METHOD("get_collision_normal"),&RayCast2D::get_collision_normal); - ClassDB::bind_method(_MD("add_exception_rid","rid"),&RayCast2D::add_exception_rid); - ClassDB::bind_method(_MD("add_exception","node"),&RayCast2D::add_exception); + ClassDB::bind_method(D_METHOD("add_exception_rid","rid"),&RayCast2D::add_exception_rid); + ClassDB::bind_method(D_METHOD("add_exception","node"),&RayCast2D::add_exception); - ClassDB::bind_method(_MD("remove_exception_rid","rid"),&RayCast2D::remove_exception_rid); - ClassDB::bind_method(_MD("remove_exception","node"),&RayCast2D::remove_exception); + ClassDB::bind_method(D_METHOD("remove_exception_rid","rid"),&RayCast2D::remove_exception_rid); + ClassDB::bind_method(D_METHOD("remove_exception","node"),&RayCast2D::remove_exception); - ClassDB::bind_method(_MD("clear_exceptions"),&RayCast2D::clear_exceptions); + ClassDB::bind_method(D_METHOD("clear_exceptions"),&RayCast2D::clear_exceptions); - ClassDB::bind_method(_MD("set_layer_mask","mask"),&RayCast2D::set_layer_mask); - ClassDB::bind_method(_MD("get_layer_mask"),&RayCast2D::get_layer_mask); + ClassDB::bind_method(D_METHOD("set_layer_mask","mask"),&RayCast2D::set_layer_mask); + ClassDB::bind_method(D_METHOD("get_layer_mask"),&RayCast2D::get_layer_mask); - ClassDB::bind_method(_MD("set_type_mask","mask"),&RayCast2D::set_type_mask); - ClassDB::bind_method(_MD("get_type_mask"),&RayCast2D::get_type_mask); + ClassDB::bind_method(D_METHOD("set_type_mask","mask"),&RayCast2D::set_type_mask); + ClassDB::bind_method(D_METHOD("get_type_mask"),&RayCast2D::get_type_mask); - ClassDB::bind_method(_MD("set_exclude_parent_body","mask"),&RayCast2D::set_exclude_parent_body); - ClassDB::bind_method(_MD("get_exclude_parent_body"),&RayCast2D::get_exclude_parent_body); + ClassDB::bind_method(D_METHOD("set_exclude_parent_body","mask"),&RayCast2D::set_exclude_parent_body); + ClassDB::bind_method(D_METHOD("get_exclude_parent_body"),&RayCast2D::get_exclude_parent_body); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"exclude_parent"),_SCS("set_exclude_parent_body"),_SCS("get_exclude_parent_body")); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"cast_to"),_SCS("set_cast_to"),_SCS("get_cast_to")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"layer_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"type_mask",PROPERTY_HINT_FLAGS,"Static,Kinematic,Rigid,Character,Area"),_SCS("set_type_mask"),_SCS("get_type_mask")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"enabled"),"set_enabled","is_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"exclude_parent"),"set_exclude_parent_body","get_exclude_parent_body"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"cast_to"),"set_cast_to","get_cast_to"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"layer_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),"set_layer_mask","get_layer_mask"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"type_mask",PROPERTY_HINT_FLAGS,"Static,Kinematic,Rigid,Character,Area"),"set_type_mask","get_type_mask"); } RayCast2D::RayCast2D() { diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index 77f1a9d500..e1f360c0c1 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -118,10 +118,10 @@ String RemoteTransform2D::get_configuration_warning() const { void RemoteTransform2D::_bind_methods() { - ClassDB::bind_method(_MD("set_remote_node","path"),&RemoteTransform2D::set_remote_node); - ClassDB::bind_method(_MD("get_remote_node"),&RemoteTransform2D::get_remote_node); + ClassDB::bind_method(D_METHOD("set_remote_node","path"),&RemoteTransform2D::set_remote_node); + ClassDB::bind_method(D_METHOD("get_remote_node"),&RemoteTransform2D::get_remote_node); - ADD_PROPERTY( PropertyInfo(Variant::NODE_PATH,"remote_path"),_SCS("set_remote_node"),_SCS("get_remote_node")); + ADD_PROPERTY( PropertyInfo(Variant::NODE_PATH,"remote_path"),"set_remote_node","get_remote_node"); } RemoteTransform2D::RemoteTransform2D() { diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 20db63b66f..4b607e9261 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -63,6 +63,38 @@ Ref<BitMap> TouchScreenButton::get_bitmask() const{ return bitmask; } +void TouchScreenButton::set_shape(const Ref<Shape2D>& p_shape){ + + shape=p_shape; + + if (!is_inside_tree()) + return; + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) + return; + update(); +} + +Ref<Shape2D> TouchScreenButton::get_shape() const{ + + return shape; +} + +void TouchScreenButton::set_shape_centered(bool p_shape_centered) { + + shape_centered=p_shape_centered; + + if (!is_inside_tree()) + return; + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) + return; + update(); +} + +bool TouchScreenButton::is_shape_centered() const { + + return shape_centered; +} + void TouchScreenButton::_notification(int p_what) { switch(p_what) { @@ -86,6 +118,15 @@ void TouchScreenButton::_notification(int p_what) { draw_texture(texture,Point2()); } + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) + return; + if (shape.is_valid()) { + Color draw_col=get_tree()->get_debug_collisions_color(); + Vector2 pos=shape_centered ? get_item_rect().size*0.5f : Vector2(); + draw_set_transform_matrix(get_canvas_transform().translated(pos)); + shape->draw(get_canvas_item(),draw_col); + } + } break; case NOTIFICATION_ENTER_TREE: { @@ -104,8 +145,12 @@ void TouchScreenButton::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { if (is_pressed()) - Input::get_singleton()->action_release(action); + _release(true); } break; + case NOTIFICATION_PAUSED: { + // So the button can be pressed again even though the release gets unhandled because of coming during pause + allow_repress=true; + } } } @@ -143,22 +188,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (p_event.type==InputEvent::SCREEN_TOUCH && !p_event.screen_touch.pressed && finger_pressed==p_event.screen_touch.index) { - emit_signal("released"); - - if (action_id!=-1) { - - Input::get_singleton()->action_release(action); - InputEvent ie; - ie.type=InputEvent::ACTION; - ie.ID=0; - ie.action.action=action_id; - ie.action.pressed=false; - get_tree()->input_event(ie); - } - finger_pressed=-1; - - update(); - + _release(); } if ((p_event.type==InputEvent::SCREEN_TOUCH && p_event.screen_touch.pressed)|| p_event.type==InputEvent::SCREEN_DRAG) { @@ -184,44 +214,12 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (touched) { - if (finger_pressed==-1) { - finger_pressed=p_event.screen_touch.index; - //emit change stuff - emit_signal("pressed"); - if (action_id!=-1) { - - Input::get_singleton()->action_press(action); - InputEvent ie; - ie.type=InputEvent::ACTION; - ie.ID=0; - ie.action.action=action_id; - ie.action.pressed=true; - get_tree()->input_event(ie); - } - - update(); + _press(p_event.screen_touch.index); } - } else { - if (finger_pressed!=-1) { - - emit_signal("released"); - - if (action_id!=-1) { - - Input::get_singleton()->action_release(action); - InputEvent ie; - ie.type=InputEvent::ACTION; - ie.ID=0; - ie.action.action=action_id; - ie.action.pressed=false; - get_tree()->input_event(ie); - } - finger_pressed=-1; - - update(); + _release(); } } @@ -239,68 +237,91 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (!is_visible_in_tree()) return; - if (finger_pressed!=-1) + const bool can_press=finger_pressed==-1 || allow_repress; + if (!can_press) return; //already fingering Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); + Rect2 item_rect = get_item_rect(); bool touched=false; + bool check_rect=true; + if (shape.is_valid()) { + + check_rect=false; + Transform2D xform=shape_centered ? Transform2D().translated(get_item_rect().size*0.5f) : Transform2D(); + touched=shape->collide(xform, unit_rect, Transform2D(0, coord + Vector2(0.5,0.5))); + } + if (bitmask.is_valid()) { - if (Rect2(Point2(),bitmask->get_size()).has_point(coord)) { + check_rect=false; + if (!touched && Rect2(Point2(),bitmask->get_size()).has_point(coord)) { if (bitmask->get_bit(coord)) touched=true; } - } else { - if (!texture.is_null()) - touched=Rect2(Point2(),texture->get_size()).has_point(coord); } + if (!touched && check_rect) { + if (!texture.is_null()) + touched=item_rect.has_point(coord); + } if (touched) { - - finger_pressed=p_event.screen_touch.index; - //emit change stuff - emit_signal("pressed"); - if (action_id!=-1) { - - Input::get_singleton()->action_press(action); - InputEvent ie; - ie.type=InputEvent::ACTION; - ie.ID=0; - ie.action.action=action_id; - ie.action.pressed=true; - get_tree()->input_event(ie); - } - update(); - + _press(p_event.screen_touch.index); } } else { + if (p_event.screen_touch.index==finger_pressed) { + _release(); + } + } + } + } +} +void TouchScreenButton::_press(int p_finger_pressed) { - if (p_event.screen_touch.index==finger_pressed) { - //untouch + finger_pressed=p_finger_pressed; + allow_repress=false; - emit_signal("released"); + if (action_id!=-1) { - if (action_id!=-1) { + Input::get_singleton()->action_press(action); + InputEvent ie; + ie.type=InputEvent::ACTION; + ie.ID=0; + ie.action.action=action_id; + ie.action.pressed=true; + get_tree()->input_event(ie); + } - Input::get_singleton()->action_release(action); - InputEvent ie; - ie.type=InputEvent::ACTION; - ie.ID=0; - ie.action.action=action_id; - ie.action.pressed=false; - get_tree()->input_event(ie); - } - finger_pressed=-1; - update(); - } - } + emit_signal("pressed"); + update(); +} + +void TouchScreenButton::_release(bool p_exiting_tree) { + + finger_pressed=-1; + + if (action_id!=-1) { + + Input::get_singleton()->action_release(action); + if (!p_exiting_tree) { + InputEvent ie; + ie.type=InputEvent::ACTION; + ie.ID=0; + ie.action.action=action_id; + ie.action.pressed=false; + get_tree()->input_event(ie); } } + + if (!p_exiting_tree) { + emit_signal("released"); + update(); + } } Rect2 TouchScreenButton::get_item_rect() const { @@ -340,34 +361,42 @@ bool TouchScreenButton::is_passby_press_enabled() const{ void TouchScreenButton::_bind_methods() { - ClassDB::bind_method(_MD("set_texture","texture"),&TouchScreenButton::set_texture); - ClassDB::bind_method(_MD("get_texture"),&TouchScreenButton::get_texture); + ClassDB::bind_method(D_METHOD("set_texture","texture"),&TouchScreenButton::set_texture); + ClassDB::bind_method(D_METHOD("get_texture"),&TouchScreenButton::get_texture); + + ClassDB::bind_method(D_METHOD("set_texture_pressed","texture_pressed"),&TouchScreenButton::set_texture_pressed); + ClassDB::bind_method(D_METHOD("get_texture_pressed"),&TouchScreenButton::get_texture_pressed); + + ClassDB::bind_method(D_METHOD("set_bitmask","bitmask"),&TouchScreenButton::set_bitmask); + ClassDB::bind_method(D_METHOD("get_bitmask"),&TouchScreenButton::get_bitmask); - ClassDB::bind_method(_MD("set_texture_pressed","texture_pressed"),&TouchScreenButton::set_texture_pressed); - ClassDB::bind_method(_MD("get_texture_pressed"),&TouchScreenButton::get_texture_pressed); + ClassDB::bind_method(D_METHOD("set_shape","shape"),&TouchScreenButton::set_shape); + ClassDB::bind_method(D_METHOD("get_shape"),&TouchScreenButton::get_shape); - ClassDB::bind_method(_MD("set_bitmask","bitmask"),&TouchScreenButton::set_bitmask); - ClassDB::bind_method(_MD("get_bitmask"),&TouchScreenButton::get_bitmask); + ClassDB::bind_method(D_METHOD("set_shape_centered","bool"),&TouchScreenButton::set_shape_centered); + ClassDB::bind_method(D_METHOD("is_shape_centered"),&TouchScreenButton::is_shape_centered); - ClassDB::bind_method(_MD("set_action","action"),&TouchScreenButton::set_action); - ClassDB::bind_method(_MD("get_action"),&TouchScreenButton::get_action); + ClassDB::bind_method(D_METHOD("set_action","action"),&TouchScreenButton::set_action); + ClassDB::bind_method(D_METHOD("get_action"),&TouchScreenButton::get_action); - ClassDB::bind_method(_MD("set_visibility_mode","mode"),&TouchScreenButton::set_visibility_mode); - ClassDB::bind_method(_MD("get_visibility_mode"),&TouchScreenButton::get_visibility_mode); + ClassDB::bind_method(D_METHOD("set_visibility_mode","mode"),&TouchScreenButton::set_visibility_mode); + ClassDB::bind_method(D_METHOD("get_visibility_mode"),&TouchScreenButton::get_visibility_mode); - ClassDB::bind_method(_MD("set_passby_press","enabled"),&TouchScreenButton::set_passby_press); - ClassDB::bind_method(_MD("is_passby_press_enabled"),&TouchScreenButton::is_passby_press_enabled); + ClassDB::bind_method(D_METHOD("set_passby_press","enabled"),&TouchScreenButton::set_passby_press); + ClassDB::bind_method(D_METHOD("is_passby_press_enabled"),&TouchScreenButton::is_passby_press_enabled); - ClassDB::bind_method(_MD("is_pressed"),&TouchScreenButton::is_pressed); + ClassDB::bind_method(D_METHOD("is_pressed"),&TouchScreenButton::is_pressed); - ClassDB::bind_method(_MD("_input"),&TouchScreenButton::_input); + ClassDB::bind_method(D_METHOD("_input"),&TouchScreenButton::_input); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture")); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"pressed",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture_pressed"),_SCS("get_texture_pressed")); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"bitmask",PROPERTY_HINT_RESOURCE_TYPE,"BitMap"),_SCS("set_bitmask"),_SCS("get_bitmask")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"passby_press"),_SCS("set_passby_press"),_SCS("is_passby_press_enabled")); - ADD_PROPERTY( PropertyInfo(Variant::STRING,"action"),_SCS("set_action"),_SCS("get_action")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"visibility_mode",PROPERTY_HINT_ENUM,"Always,TouchScreen Only"),_SCS("set_visibility_mode"),_SCS("get_visibility_mode")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture"); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"pressed",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture_pressed","get_texture_pressed"); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"bitmask",PROPERTY_HINT_RESOURCE_TYPE,"BitMap"),"set_bitmask","get_bitmask"); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"shape",PROPERTY_HINT_RESOURCE_TYPE,"Shape2D"),"set_shape","get_shape"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"shape_centered"),"set_shape_centered","is_shape_centered"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"passby_press"),"set_passby_press","is_passby_press_enabled"); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"action"),"set_action","get_action"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"visibility_mode",PROPERTY_HINT_ENUM,"Always,TouchScreen Only"),"set_visibility_mode","get_visibility_mode"); ADD_SIGNAL( MethodInfo("pressed" ) ); ADD_SIGNAL( MethodInfo("released" ) ); @@ -379,7 +408,11 @@ void TouchScreenButton::_bind_methods() { TouchScreenButton::TouchScreenButton() { finger_pressed=-1; + allow_repress=false; action_id=-1; passby_press=false; visibility=VISIBILITY_ALWAYS; + shape_centered=true; + unit_rect=Ref<RectangleShape2D>(memnew(RectangleShape2D)); + unit_rect->set_extents(Vector2(0.5,0.5)); } diff --git a/scene/2d/screen_button.h b/scene/2d/screen_button.h index 34e02d644b..8ce378c660 100644 --- a/scene/2d/screen_button.h +++ b/scene/2d/screen_button.h @@ -32,6 +32,7 @@ #include "scene/2d/node_2d.h" #include "scene/resources/texture.h" #include "scene/resources/bit_mask.h" +#include "scene/resources/rectangle_shape_2d.h" class TouchScreenButton : public Node2D { @@ -47,16 +48,24 @@ private: Ref<Texture> texture; Ref<Texture> texture_pressed; Ref<BitMap> bitmask; + Ref<Shape2D> shape; + bool shape_centered; + + Ref<RectangleShape2D> unit_rect; StringName action; bool passby_press; int finger_pressed; + bool allow_repress; int action_id; VisibilityMode visibility; void _input(const InputEvent& p_Event); + void _press(int p_finger_pressed); + void _release(bool p_exiting_tree=false); + protected: void _notification(int p_what); @@ -73,6 +82,12 @@ public: void set_bitmask(const Ref<BitMap>& p_bitmask); Ref<BitMap> get_bitmask() const; + void set_shape(const Ref<Shape2D>& p_shape); + Ref<Shape2D> get_shape() const; + + void set_shape_centered(bool p_shape_centered); + bool is_shape_centered() const; + void set_action(const String& p_action); String get_action() const; diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index bea45aae4e..26c2756acd 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -294,49 +294,49 @@ void Sprite::_validate_property(PropertyInfo& property) const { void Sprite::_bind_methods() { - ClassDB::bind_method(_MD("set_texture","texture:Texture"),&Sprite::set_texture); - ClassDB::bind_method(_MD("get_texture:Texture"),&Sprite::get_texture); + ClassDB::bind_method(D_METHOD("set_texture","texture:Texture"),&Sprite::set_texture); + ClassDB::bind_method(D_METHOD("get_texture:Texture"),&Sprite::get_texture); - ClassDB::bind_method(_MD("set_centered","centered"),&Sprite::set_centered); - ClassDB::bind_method(_MD("is_centered"),&Sprite::is_centered); + ClassDB::bind_method(D_METHOD("set_centered","centered"),&Sprite::set_centered); + ClassDB::bind_method(D_METHOD("is_centered"),&Sprite::is_centered); - ClassDB::bind_method(_MD("set_offset","offset"),&Sprite::set_offset); - ClassDB::bind_method(_MD("get_offset"),&Sprite::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","offset"),&Sprite::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&Sprite::get_offset); - ClassDB::bind_method(_MD("set_flip_h","flip_h"),&Sprite::set_flip_h); - ClassDB::bind_method(_MD("is_flipped_h"),&Sprite::is_flipped_h); + ClassDB::bind_method(D_METHOD("set_flip_h","flip_h"),&Sprite::set_flip_h); + ClassDB::bind_method(D_METHOD("is_flipped_h"),&Sprite::is_flipped_h); - ClassDB::bind_method(_MD("set_flip_v","flip_v"),&Sprite::set_flip_v); - ClassDB::bind_method(_MD("is_flipped_v"),&Sprite::is_flipped_v); + ClassDB::bind_method(D_METHOD("set_flip_v","flip_v"),&Sprite::set_flip_v); + ClassDB::bind_method(D_METHOD("is_flipped_v"),&Sprite::is_flipped_v); - ClassDB::bind_method(_MD("set_region","enabled"),&Sprite::set_region); - ClassDB::bind_method(_MD("is_region"),&Sprite::is_region); + ClassDB::bind_method(D_METHOD("set_region","enabled"),&Sprite::set_region); + ClassDB::bind_method(D_METHOD("is_region"),&Sprite::is_region); - ClassDB::bind_method(_MD("set_region_rect","rect"),&Sprite::set_region_rect); - ClassDB::bind_method(_MD("get_region_rect"),&Sprite::get_region_rect); + ClassDB::bind_method(D_METHOD("set_region_rect","rect"),&Sprite::set_region_rect); + ClassDB::bind_method(D_METHOD("get_region_rect"),&Sprite::get_region_rect); - ClassDB::bind_method(_MD("set_frame","frame"),&Sprite::set_frame); - ClassDB::bind_method(_MD("get_frame"),&Sprite::get_frame); + ClassDB::bind_method(D_METHOD("set_frame","frame"),&Sprite::set_frame); + ClassDB::bind_method(D_METHOD("get_frame"),&Sprite::get_frame); - ClassDB::bind_method(_MD("set_vframes","vframes"),&Sprite::set_vframes); - ClassDB::bind_method(_MD("get_vframes"),&Sprite::get_vframes); + ClassDB::bind_method(D_METHOD("set_vframes","vframes"),&Sprite::set_vframes); + ClassDB::bind_method(D_METHOD("get_vframes"),&Sprite::get_vframes); - ClassDB::bind_method(_MD("set_hframes","hframes"),&Sprite::set_hframes); - ClassDB::bind_method(_MD("get_hframes"),&Sprite::get_hframes); + ClassDB::bind_method(D_METHOD("set_hframes","hframes"),&Sprite::set_hframes); + ClassDB::bind_method(D_METHOD("get_hframes"),&Sprite::get_hframes); ADD_SIGNAL(MethodInfo("frame_changed")); ADD_SIGNAL(MethodInfo("texture_changed")); - ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_texture"),_SCS("get_texture")); - ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "centered"), _SCS("set_centered"),_SCS("is_centered")); - ADD_PROPERTYNZ( PropertyInfo( Variant::VECTOR2, "offset"), _SCS("set_offset"),_SCS("get_offset")); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_h"), _SCS("set_flip_h"),_SCS("is_flipped_h")); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_v"), _SCS("set_flip_v"),_SCS("is_flipped_v")); - ADD_PROPERTYNO( PropertyInfo( Variant::INT, "vframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_vframes"),_SCS("get_vframes")); - ADD_PROPERTYNO( PropertyInfo( Variant::INT, "hframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_hframes"),_SCS("get_hframes")); - ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), _SCS("set_frame"),_SCS("get_frame")); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "region"), _SCS("set_region"),_SCS("is_region")); - ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect")); + ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), "set_texture","get_texture"); + ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "centered"), "set_centered","is_centered"); + ADD_PROPERTYNZ( PropertyInfo( Variant::VECTOR2, "offset"), "set_offset","get_offset"); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_h"), "set_flip_h","is_flipped_h"); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_v"), "set_flip_v","is_flipped_v"); + ADD_PROPERTYNO( PropertyInfo( Variant::INT, "vframes",PROPERTY_HINT_RANGE,"1,16384,1"), "set_vframes","get_vframes"); + ADD_PROPERTYNO( PropertyInfo( Variant::INT, "hframes",PROPERTY_HINT_RANGE,"1,16384,1"), "set_hframes","get_hframes"); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), "set_frame","get_frame"); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "region"), "set_region","is_region"); + ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), "set_region_rect","get_region_rect"); } @@ -552,22 +552,22 @@ String ViewportSprite::get_configuration_warning() const { void ViewportSprite::_bind_methods() { - ClassDB::bind_method(_MD("set_viewport_path","path"),&ViewportSprite::set_viewport_path); - ClassDB::bind_method(_MD("get_viewport_path"),&ViewportSprite::get_viewport_path); + ClassDB::bind_method(D_METHOD("set_viewport_path","path"),&ViewportSprite::set_viewport_path); + ClassDB::bind_method(D_METHOD("get_viewport_path"),&ViewportSprite::get_viewport_path); - ClassDB::bind_method(_MD("set_centered","centered"),&ViewportSprite::set_centered); - ClassDB::bind_method(_MD("is_centered"),&ViewportSprite::is_centered); + ClassDB::bind_method(D_METHOD("set_centered","centered"),&ViewportSprite::set_centered); + ClassDB::bind_method(D_METHOD("is_centered"),&ViewportSprite::is_centered); - ClassDB::bind_method(_MD("set_offset","offset"),&ViewportSprite::set_offset); - ClassDB::bind_method(_MD("get_offset"),&ViewportSprite::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","offset"),&ViewportSprite::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&ViewportSprite::get_offset); - ClassDB::bind_method(_MD("set_modulate","modulate"),&ViewportSprite::set_modulate); - ClassDB::bind_method(_MD("get_modulate"),&ViewportSprite::get_modulate); + ClassDB::bind_method(D_METHOD("set_modulate","modulate"),&ViewportSprite::set_modulate); + ClassDB::bind_method(D_METHOD("get_modulate"),&ViewportSprite::get_modulate); - ADD_PROPERTYNZ( PropertyInfo( Variant::NODE_PATH, "viewport"), _SCS("set_viewport_path"),_SCS("get_viewport_path")); - ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "centered"), _SCS("set_centered"),_SCS("is_centered")); - ADD_PROPERTYNZ( PropertyInfo( Variant::VECTOR2, "offset"), _SCS("set_offset"),_SCS("get_offset")); - ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate")); + ADD_PROPERTYNZ( PropertyInfo( Variant::NODE_PATH, "viewport"), "set_viewport_path","get_viewport_path"); + ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "centered"), "set_centered","is_centered"); + ADD_PROPERTYNZ( PropertyInfo( Variant::VECTOR2, "offset"), "set_offset","get_offset"); + ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), "set_modulate","get_modulate"); } diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index d6d713920c..f89a72e1b9 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -458,6 +458,9 @@ void TileMap::_update_dirty_quadrants() { Color modulate = tile_set->tile_get_modulate(c.id); + Color self_modulate = get_self_modulate(); + modulate = Color(modulate.r*self_modulate.r, modulate.g*self_modulate.g, + modulate.b*self_modulate.b, modulate.a*self_modulate.a); if (r==Rect2()) { tex->draw_rect(canvas_item,rect,false,modulate,c.transpose); } else { @@ -730,6 +733,7 @@ void TileMap::set_cell(int p_x,int p_y,int p_tile,bool p_flip_x,bool p_flip_y,bo c.transpose=p_transpose; _make_quadrant_dirty(Q); + used_size_cache_dirty=true; } @@ -818,6 +822,7 @@ void TileMap::clear() { _clear_quadrants(); tile_map.clear(); + used_size_cache_dirty=true; } void TileMap::_set_tile_data(const PoolVector<int>& p_data) { @@ -1159,6 +1164,28 @@ Array TileMap::get_used_cells() const { return a; } +Rect2 TileMap::get_used_rect() { // Not const because of cache + + if (used_size_cache_dirty) { + if(tile_map.size() > 0) { + used_size_cache = Rect2(tile_map.front()->key().x, tile_map.front()->key().y, 0, 0); + + for (Map<PosKey,Cell>::Element *E=tile_map.front();E;E=E->next()) { + used_size_cache.expand_to(Vector2(E->key().x, E->key().y)); + } + + used_size_cache.size += Vector2(1,1); + } else { + used_size_cache = Rect2(); + } + + used_size_cache_dirty = false; + } + + return used_size_cache; +} + + void TileMap::set_occluder_light_mask(int p_mask) { occluder_light_mask=p_mask; @@ -1189,101 +1216,102 @@ void TileMap::set_light_mask(int p_light_mask) { void TileMap::_bind_methods() { - ClassDB::bind_method(_MD("set_tileset","tileset:TileSet"),&TileMap::set_tileset); - ClassDB::bind_method(_MD("get_tileset:TileSet"),&TileMap::get_tileset); + ClassDB::bind_method(D_METHOD("set_tileset","tileset:TileSet"),&TileMap::set_tileset); + ClassDB::bind_method(D_METHOD("get_tileset:TileSet"),&TileMap::get_tileset); - ClassDB::bind_method(_MD("set_mode","mode"),&TileMap::set_mode); - ClassDB::bind_method(_MD("get_mode"),&TileMap::get_mode); + ClassDB::bind_method(D_METHOD("set_mode","mode"),&TileMap::set_mode); + ClassDB::bind_method(D_METHOD("get_mode"),&TileMap::get_mode); - ClassDB::bind_method(_MD("set_half_offset","half_offset"),&TileMap::set_half_offset); - ClassDB::bind_method(_MD("get_half_offset"),&TileMap::get_half_offset); + ClassDB::bind_method(D_METHOD("set_half_offset","half_offset"),&TileMap::set_half_offset); + ClassDB::bind_method(D_METHOD("get_half_offset"),&TileMap::get_half_offset); - ClassDB::bind_method(_MD("set_custom_transform","custom_transform"),&TileMap::set_custom_transform); - ClassDB::bind_method(_MD("get_custom_transform"),&TileMap::get_custom_transform); + ClassDB::bind_method(D_METHOD("set_custom_transform","custom_transform"),&TileMap::set_custom_transform); + ClassDB::bind_method(D_METHOD("get_custom_transform"),&TileMap::get_custom_transform); - ClassDB::bind_method(_MD("set_cell_size","size"),&TileMap::set_cell_size); - ClassDB::bind_method(_MD("get_cell_size"),&TileMap::get_cell_size); + ClassDB::bind_method(D_METHOD("set_cell_size","size"),&TileMap::set_cell_size); + ClassDB::bind_method(D_METHOD("get_cell_size"),&TileMap::get_cell_size); - ClassDB::bind_method(_MD("_set_old_cell_size","size"),&TileMap::_set_old_cell_size); - ClassDB::bind_method(_MD("_get_old_cell_size"),&TileMap::_get_old_cell_size); + ClassDB::bind_method(D_METHOD("_set_old_cell_size","size"),&TileMap::_set_old_cell_size); + ClassDB::bind_method(D_METHOD("_get_old_cell_size"),&TileMap::_get_old_cell_size); - ClassDB::bind_method(_MD("set_quadrant_size","size"),&TileMap::set_quadrant_size); - ClassDB::bind_method(_MD("get_quadrant_size"),&TileMap::get_quadrant_size); + ClassDB::bind_method(D_METHOD("set_quadrant_size","size"),&TileMap::set_quadrant_size); + ClassDB::bind_method(D_METHOD("get_quadrant_size"),&TileMap::get_quadrant_size); - ClassDB::bind_method(_MD("set_tile_origin","origin"),&TileMap::set_tile_origin); - ClassDB::bind_method(_MD("get_tile_origin"),&TileMap::get_tile_origin); + ClassDB::bind_method(D_METHOD("set_tile_origin","origin"),&TileMap::set_tile_origin); + ClassDB::bind_method(D_METHOD("get_tile_origin"),&TileMap::get_tile_origin); - ClassDB::bind_method(_MD("set_center_x","enable"),&TileMap::set_center_x); - ClassDB::bind_method(_MD("get_center_x"),&TileMap::get_center_x); + ClassDB::bind_method(D_METHOD("set_center_x","enable"),&TileMap::set_center_x); + ClassDB::bind_method(D_METHOD("get_center_x"),&TileMap::get_center_x); - ClassDB::bind_method(_MD("set_center_y","enable"),&TileMap::set_center_y); - ClassDB::bind_method(_MD("get_center_y"),&TileMap::get_center_y); + ClassDB::bind_method(D_METHOD("set_center_y","enable"),&TileMap::set_center_y); + ClassDB::bind_method(D_METHOD("get_center_y"),&TileMap::get_center_y); - ClassDB::bind_method(_MD("set_y_sort_mode","enable"),&TileMap::set_y_sort_mode); - ClassDB::bind_method(_MD("is_y_sort_mode_enabled"),&TileMap::is_y_sort_mode_enabled); + ClassDB::bind_method(D_METHOD("set_y_sort_mode","enable"),&TileMap::set_y_sort_mode); + ClassDB::bind_method(D_METHOD("is_y_sort_mode_enabled"),&TileMap::is_y_sort_mode_enabled); - ClassDB::bind_method(_MD("set_collision_use_kinematic","use_kinematic"),&TileMap::set_collision_use_kinematic); - ClassDB::bind_method(_MD("get_collision_use_kinematic"),&TileMap::get_collision_use_kinematic); + ClassDB::bind_method(D_METHOD("set_collision_use_kinematic","use_kinematic"),&TileMap::set_collision_use_kinematic); + ClassDB::bind_method(D_METHOD("get_collision_use_kinematic"),&TileMap::get_collision_use_kinematic); - ClassDB::bind_method(_MD("set_collision_layer","mask"),&TileMap::set_collision_layer); - ClassDB::bind_method(_MD("get_collision_layer"),&TileMap::get_collision_layer); + ClassDB::bind_method(D_METHOD("set_collision_layer","mask"),&TileMap::set_collision_layer); + ClassDB::bind_method(D_METHOD("get_collision_layer"),&TileMap::get_collision_layer); - ClassDB::bind_method(_MD("set_collision_mask","mask"),&TileMap::set_collision_mask); - ClassDB::bind_method(_MD("get_collision_mask"),&TileMap::get_collision_mask); + ClassDB::bind_method(D_METHOD("set_collision_mask","mask"),&TileMap::set_collision_mask); + ClassDB::bind_method(D_METHOD("get_collision_mask"),&TileMap::get_collision_mask); - ClassDB::bind_method(_MD("set_collision_friction","value"),&TileMap::set_collision_friction); - ClassDB::bind_method(_MD("get_collision_friction"),&TileMap::get_collision_friction); + ClassDB::bind_method(D_METHOD("set_collision_friction","value"),&TileMap::set_collision_friction); + ClassDB::bind_method(D_METHOD("get_collision_friction"),&TileMap::get_collision_friction); - ClassDB::bind_method(_MD("set_collision_bounce","value"),&TileMap::set_collision_bounce); - ClassDB::bind_method(_MD("get_collision_bounce"),&TileMap::get_collision_bounce); + ClassDB::bind_method(D_METHOD("set_collision_bounce","value"),&TileMap::set_collision_bounce); + ClassDB::bind_method(D_METHOD("get_collision_bounce"),&TileMap::get_collision_bounce); - ClassDB::bind_method(_MD("set_occluder_light_mask","mask"),&TileMap::set_occluder_light_mask); - ClassDB::bind_method(_MD("get_occluder_light_mask"),&TileMap::get_occluder_light_mask); + ClassDB::bind_method(D_METHOD("set_occluder_light_mask","mask"),&TileMap::set_occluder_light_mask); + ClassDB::bind_method(D_METHOD("get_occluder_light_mask"),&TileMap::get_occluder_light_mask); - ClassDB::bind_method(_MD("set_cell","x","y","tile","flip_x","flip_y","transpose"),&TileMap::set_cell,DEFVAL(false),DEFVAL(false),DEFVAL(false)); - ClassDB::bind_method(_MD("set_cellv","pos","tile","flip_x","flip_y","transpose"),&TileMap::set_cellv,DEFVAL(false),DEFVAL(false),DEFVAL(false)); - ClassDB::bind_method(_MD("get_cell","x","y"),&TileMap::get_cell); - ClassDB::bind_method(_MD("get_cellv","pos"),&TileMap::get_cellv); - ClassDB::bind_method(_MD("is_cell_x_flipped","x","y"),&TileMap::is_cell_x_flipped); - ClassDB::bind_method(_MD("is_cell_y_flipped","x","y"),&TileMap::is_cell_y_flipped); - ClassDB::bind_method(_MD("is_cell_transposed","x","y"),&TileMap::is_cell_transposed); + ClassDB::bind_method(D_METHOD("set_cell","x","y","tile","flip_x","flip_y","transpose"),&TileMap::set_cell,DEFVAL(false),DEFVAL(false),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("set_cellv","pos","tile","flip_x","flip_y","transpose"),&TileMap::set_cellv,DEFVAL(false),DEFVAL(false),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_cell","x","y"),&TileMap::get_cell); + ClassDB::bind_method(D_METHOD("get_cellv","pos"),&TileMap::get_cellv); + ClassDB::bind_method(D_METHOD("is_cell_x_flipped","x","y"),&TileMap::is_cell_x_flipped); + ClassDB::bind_method(D_METHOD("is_cell_y_flipped","x","y"),&TileMap::is_cell_y_flipped); + ClassDB::bind_method(D_METHOD("is_cell_transposed","x","y"),&TileMap::is_cell_transposed); - ClassDB::bind_method(_MD("clear"),&TileMap::clear); + ClassDB::bind_method(D_METHOD("clear"),&TileMap::clear); - ClassDB::bind_method(_MD("get_used_cells"),&TileMap::get_used_cells); + ClassDB::bind_method(D_METHOD("get_used_cells"),&TileMap::get_used_cells); + ClassDB::bind_method(D_METHOD("get_used_rect"),&TileMap::get_used_rect); - ClassDB::bind_method(_MD("map_to_world","mappos","ignore_half_ofs"),&TileMap::map_to_world,DEFVAL(false)); - ClassDB::bind_method(_MD("world_to_map","worldpos"),&TileMap::world_to_map); + ClassDB::bind_method(D_METHOD("map_to_world","mappos","ignore_half_ofs"),&TileMap::map_to_world,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("world_to_map","worldpos"),&TileMap::world_to_map); - ClassDB::bind_method(_MD("_clear_quadrants"),&TileMap::_clear_quadrants); - ClassDB::bind_method(_MD("_recreate_quadrants"),&TileMap::_recreate_quadrants); - ClassDB::bind_method(_MD("_update_dirty_quadrants"),&TileMap::_update_dirty_quadrants); + ClassDB::bind_method(D_METHOD("_clear_quadrants"),&TileMap::_clear_quadrants); + ClassDB::bind_method(D_METHOD("_recreate_quadrants"),&TileMap::_recreate_quadrants); + ClassDB::bind_method(D_METHOD("_update_dirty_quadrants"),&TileMap::_update_dirty_quadrants); - ClassDB::bind_method(_MD("_set_tile_data"),&TileMap::_set_tile_data); - ClassDB::bind_method(_MD("_get_tile_data"),&TileMap::_get_tile_data); + ClassDB::bind_method(D_METHOD("_set_tile_data"),&TileMap::_set_tile_data); + ClassDB::bind_method(D_METHOD("_get_tile_data"),&TileMap::_get_tile_data); - ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Square,Isometric,Custom"),_SCS("set_mode"),_SCS("get_mode")); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"tile_set",PROPERTY_HINT_RESOURCE_TYPE,"TileSet"),_SCS("set_tileset"),_SCS("get_tileset")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Square,Isometric,Custom"),"set_mode","get_mode"); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"tile_set",PROPERTY_HINT_RESOURCE_TYPE,"TileSet"),"set_tileset","get_tileset"); ADD_GROUP("Cell","cell_"); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"cell_size",PROPERTY_HINT_RANGE,"1,8192,1"),_SCS("set_cell_size"),_SCS("get_cell_size")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_quadrant_size",PROPERTY_HINT_RANGE,"1,128,1"),_SCS("set_quadrant_size"),_SCS("get_quadrant_size")); - ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM2D,"cell_custom_transform"),_SCS("set_custom_transform"),_SCS("get_custom_transform")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_half_offset",PROPERTY_HINT_ENUM,"Offset X,Offset Y,Disabled"),_SCS("set_half_offset"),_SCS("get_half_offset")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_tile_origin",PROPERTY_HINT_ENUM,"Top Left,Center,Bottom Left"),_SCS("set_tile_origin"),_SCS("get_tile_origin")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"cell_y_sort"),_SCS("set_y_sort_mode"),_SCS("is_y_sort_mode_enabled")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"cell_size",PROPERTY_HINT_RANGE,"1,8192,1"),"set_cell_size","get_cell_size"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_quadrant_size",PROPERTY_HINT_RANGE,"1,128,1"),"set_quadrant_size","get_quadrant_size"); + ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM2D,"cell_custom_transform"),"set_custom_transform","get_custom_transform"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_half_offset",PROPERTY_HINT_ENUM,"Offset X,Offset Y,Disabled"),"set_half_offset","get_half_offset"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_tile_origin",PROPERTY_HINT_ENUM,"Top Left,Center,Bottom Left"),"set_tile_origin","get_tile_origin"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"cell_y_sort"),"set_y_sort_mode","is_y_sort_mode_enabled"); ADD_GROUP("Collision","collision_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collision_use_kinematic",PROPERTY_HINT_NONE,""),_SCS("set_collision_use_kinematic"),_SCS("get_collision_use_kinematic")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision_friction",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_collision_friction"),_SCS("get_collision_friction")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision_bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_collision_bounce"),_SCS("get_collision_bounce")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_collision_layer"),_SCS("get_collision_layer")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collision_use_kinematic",PROPERTY_HINT_NONE,""),"set_collision_use_kinematic","get_collision_use_kinematic"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision_friction",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_collision_friction","get_collision_friction"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision_bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_collision_bounce","get_collision_bounce"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_2D_PHYSICS),"set_collision_layer","get_collision_layer"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),"set_collision_mask","get_collision_mask"); ADD_GROUP("Occluder","occluder_"); - ADD_PROPERTY( PropertyInfo(Variant::INT,"occluder_light_mask",PROPERTY_HINT_LAYERS_2D_RENDER),_SCS("set_occluder_light_mask"),_SCS("get_occluder_light_mask")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"occluder_light_mask",PROPERTY_HINT_LAYERS_2D_RENDER),"set_occluder_light_mask","get_occluder_light_mask"); ADD_GROUP("",""); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"tile_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_tile_data"),_SCS("_get_tile_data")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"tile_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_tile_data","_get_tile_data"); ADD_SIGNAL(MethodInfo("settings_changed")); @@ -1305,6 +1333,7 @@ TileMap::TileMap() { rect_cache_dirty=true; + used_size_cache_dirty=true; pending_update=false; quadrant_order_dirty=false; quadrant_size=16; diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index ba6de62f8e..c581aa8056 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -141,6 +141,8 @@ private: Rect2 rect_cache; bool rect_cache_dirty; + Rect2 used_size_cache; + bool used_size_cache_dirty; bool quadrant_order_dirty; bool y_sort_mode; float fp_adjust; @@ -176,8 +178,6 @@ private: _FORCE_INLINE_ Vector2 _map_to_world(int p_x,int p_y,bool p_ignore_ofs=false) const; - Array get_used_cells() const; - protected: @@ -252,6 +252,9 @@ public: void set_y_sort_mode(bool p_enable); bool is_y_sort_mode_enabled() const; + Array get_used_cells() const; + Rect2 get_used_rect(); // Not const because of cache + void set_occluder_light_mask(int p_mask); int get_occluder_light_mask() const; diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index f1c70a8f60..64ab333e48 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -129,11 +129,11 @@ bool VisibilityNotifier2D::is_on_screen() const { void VisibilityNotifier2D::_bind_methods(){ - ClassDB::bind_method(_MD("set_rect","rect"),&VisibilityNotifier2D::set_rect); - ClassDB::bind_method(_MD("get_rect"),&VisibilityNotifier2D::get_rect); - ClassDB::bind_method(_MD("is_on_screen"),&VisibilityNotifier2D::is_on_screen); + ClassDB::bind_method(D_METHOD("set_rect","rect"),&VisibilityNotifier2D::set_rect); + ClassDB::bind_method(D_METHOD("get_rect"),&VisibilityNotifier2D::get_rect); + ClassDB::bind_method(D_METHOD("is_on_screen"),&VisibilityNotifier2D::is_on_screen); - ADD_PROPERTY( PropertyInfo(Variant::RECT2,"rect"),_SCS("set_rect"),_SCS("get_rect")); + ADD_PROPERTY( PropertyInfo(Variant::RECT2,"rect"),"set_rect","get_rect"); ADD_SIGNAL( MethodInfo("viewport_entered",PropertyInfo(Variant::OBJECT,"viewport",PROPERTY_HINT_RESOURCE_TYPE,"Viewport")) ); ADD_SIGNAL( MethodInfo("viewport_exited",PropertyInfo(Variant::OBJECT,"viewport",PROPERTY_HINT_RESOURCE_TYPE,"Viewport")) ); @@ -355,16 +355,16 @@ String VisibilityEnabler2D::get_configuration_warning() const { void VisibilityEnabler2D::_bind_methods(){ - ClassDB::bind_method(_MD("set_enabler","enabler","enabled"),&VisibilityEnabler2D::set_enabler); - ClassDB::bind_method(_MD("is_enabler_enabled","enabler"),&VisibilityEnabler2D::is_enabler_enabled); - ClassDB::bind_method(_MD("_node_removed"),&VisibilityEnabler2D::_node_removed); + ClassDB::bind_method(D_METHOD("set_enabler","enabler","enabled"),&VisibilityEnabler2D::set_enabler); + ClassDB::bind_method(D_METHOD("is_enabler_enabled","enabler"),&VisibilityEnabler2D::is_enabler_enabled); + ClassDB::bind_method(D_METHOD("_node_removed"),&VisibilityEnabler2D::_node_removed); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_animations"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_ANIMATIONS ); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"freeze_bodies"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_FREEZE_BODIES); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_particles"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_PARTICLES); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_animated_sprites"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_ANIMATED_SPRITES); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"process_parent"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PARENT_PROCESS); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"fixed_process_parent"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PARENT_FIXED_PROCESS); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_animations"),"set_enabler","is_enabler_enabled", ENABLER_PAUSE_ANIMATIONS ); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"freeze_bodies"),"set_enabler","is_enabler_enabled", ENABLER_FREEZE_BODIES); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_particles"),"set_enabler","is_enabler_enabled", ENABLER_PAUSE_PARTICLES); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_animated_sprites"),"set_enabler","is_enabler_enabled", ENABLER_PAUSE_ANIMATED_SPRITES); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"process_parent"),"set_enabler","is_enabler_enabled", ENABLER_PARENT_PROCESS); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"fixed_process_parent"),"set_enabler","is_enabler_enabled", ENABLER_PARENT_FIXED_PROCESS); BIND_CONSTANT( ENABLER_FREEZE_BODIES ); BIND_CONSTANT( ENABLER_PAUSE_ANIMATIONS ); diff --git a/scene/2d/y_sort.cpp b/scene/2d/y_sort.cpp index 588f343048..cb9a494e87 100644 --- a/scene/2d/y_sort.cpp +++ b/scene/2d/y_sort.cpp @@ -43,11 +43,11 @@ bool YSort::is_sort_enabled() const { void YSort::_bind_methods() { - ClassDB::bind_method(_MD("set_sort_enabled","enabled"),&YSort::set_sort_enabled); - ClassDB::bind_method(_MD("is_sort_enabled"),&YSort::is_sort_enabled); + ClassDB::bind_method(D_METHOD("set_sort_enabled","enabled"),&YSort::set_sort_enabled); + ClassDB::bind_method(D_METHOD("is_sort_enabled"),&YSort::is_sort_enabled); ADD_GROUP("Sort","sort_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"sort_enabled"),_SCS("set_sort_enabled"),_SCS("is_sort_enabled")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"sort_enabled"),"set_sort_enabled","is_sort_enabled"); } diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index 3301c4d754..92ac091fc5 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -576,63 +576,63 @@ bool Area::get_layer_mask_bit(int p_bit) const{ void Area::_bind_methods() { - ClassDB::bind_method(_MD("_body_enter_tree","id"),&Area::_body_enter_tree); - ClassDB::bind_method(_MD("_body_exit_tree","id"),&Area::_body_exit_tree); + ClassDB::bind_method(D_METHOD("_body_enter_tree","id"),&Area::_body_enter_tree); + ClassDB::bind_method(D_METHOD("_body_exit_tree","id"),&Area::_body_exit_tree); - ClassDB::bind_method(_MD("_area_enter_tree","id"),&Area::_area_enter_tree); - ClassDB::bind_method(_MD("_area_exit_tree","id"),&Area::_area_exit_tree); + ClassDB::bind_method(D_METHOD("_area_enter_tree","id"),&Area::_area_enter_tree); + ClassDB::bind_method(D_METHOD("_area_exit_tree","id"),&Area::_area_exit_tree); - ClassDB::bind_method(_MD("set_space_override_mode","enable"),&Area::set_space_override_mode); - ClassDB::bind_method(_MD("get_space_override_mode"),&Area::get_space_override_mode); + ClassDB::bind_method(D_METHOD("set_space_override_mode","enable"),&Area::set_space_override_mode); + ClassDB::bind_method(D_METHOD("get_space_override_mode"),&Area::get_space_override_mode); - ClassDB::bind_method(_MD("set_gravity_is_point","enable"),&Area::set_gravity_is_point); - ClassDB::bind_method(_MD("is_gravity_a_point"),&Area::is_gravity_a_point); + ClassDB::bind_method(D_METHOD("set_gravity_is_point","enable"),&Area::set_gravity_is_point); + ClassDB::bind_method(D_METHOD("is_gravity_a_point"),&Area::is_gravity_a_point); - ClassDB::bind_method(_MD("set_gravity_distance_scale","distance_scale"),&Area::set_gravity_distance_scale); - ClassDB::bind_method(_MD("get_gravity_distance_scale"),&Area::get_gravity_distance_scale); + ClassDB::bind_method(D_METHOD("set_gravity_distance_scale","distance_scale"),&Area::set_gravity_distance_scale); + ClassDB::bind_method(D_METHOD("get_gravity_distance_scale"),&Area::get_gravity_distance_scale); - ClassDB::bind_method(_MD("set_gravity_vector","vector"),&Area::set_gravity_vector); - ClassDB::bind_method(_MD("get_gravity_vector"),&Area::get_gravity_vector); + ClassDB::bind_method(D_METHOD("set_gravity_vector","vector"),&Area::set_gravity_vector); + ClassDB::bind_method(D_METHOD("get_gravity_vector"),&Area::get_gravity_vector); - ClassDB::bind_method(_MD("set_gravity","gravity"),&Area::set_gravity); - ClassDB::bind_method(_MD("get_gravity"),&Area::get_gravity); + ClassDB::bind_method(D_METHOD("set_gravity","gravity"),&Area::set_gravity); + ClassDB::bind_method(D_METHOD("get_gravity"),&Area::get_gravity); - ClassDB::bind_method(_MD("set_angular_damp","angular_damp"),&Area::set_angular_damp); - ClassDB::bind_method(_MD("get_angular_damp"),&Area::get_angular_damp); + ClassDB::bind_method(D_METHOD("set_angular_damp","angular_damp"),&Area::set_angular_damp); + ClassDB::bind_method(D_METHOD("get_angular_damp"),&Area::get_angular_damp); - ClassDB::bind_method(_MD("set_linear_damp","linear_damp"),&Area::set_linear_damp); - ClassDB::bind_method(_MD("get_linear_damp"),&Area::get_linear_damp); + ClassDB::bind_method(D_METHOD("set_linear_damp","linear_damp"),&Area::set_linear_damp); + ClassDB::bind_method(D_METHOD("get_linear_damp"),&Area::get_linear_damp); - ClassDB::bind_method(_MD("set_priority","priority"),&Area::set_priority); - ClassDB::bind_method(_MD("get_priority"),&Area::get_priority); + ClassDB::bind_method(D_METHOD("set_priority","priority"),&Area::set_priority); + ClassDB::bind_method(D_METHOD("get_priority"),&Area::get_priority); - ClassDB::bind_method(_MD("set_collision_mask","collision_mask"),&Area::set_collision_mask); - ClassDB::bind_method(_MD("get_collision_mask"),&Area::get_collision_mask); + ClassDB::bind_method(D_METHOD("set_collision_mask","collision_mask"),&Area::set_collision_mask); + ClassDB::bind_method(D_METHOD("get_collision_mask"),&Area::get_collision_mask); - ClassDB::bind_method(_MD("set_layer_mask","layer_mask"),&Area::set_layer_mask); - ClassDB::bind_method(_MD("get_layer_mask"),&Area::get_layer_mask); + ClassDB::bind_method(D_METHOD("set_layer_mask","layer_mask"),&Area::set_layer_mask); + ClassDB::bind_method(D_METHOD("get_layer_mask"),&Area::get_layer_mask); - ClassDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&Area::set_collision_mask_bit); - ClassDB::bind_method(_MD("get_collision_mask_bit","bit"),&Area::get_collision_mask_bit); + ClassDB::bind_method(D_METHOD("set_collision_mask_bit","bit","value"),&Area::set_collision_mask_bit); + ClassDB::bind_method(D_METHOD("get_collision_mask_bit","bit"),&Area::get_collision_mask_bit); - ClassDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&Area::set_layer_mask_bit); - ClassDB::bind_method(_MD("get_layer_mask_bit","bit"),&Area::get_layer_mask_bit); + ClassDB::bind_method(D_METHOD("set_layer_mask_bit","bit","value"),&Area::set_layer_mask_bit); + ClassDB::bind_method(D_METHOD("get_layer_mask_bit","bit"),&Area::get_layer_mask_bit); - ClassDB::bind_method(_MD("set_monitorable","enable"),&Area::set_monitorable); - ClassDB::bind_method(_MD("is_monitorable"),&Area::is_monitorable); + ClassDB::bind_method(D_METHOD("set_monitorable","enable"),&Area::set_monitorable); + ClassDB::bind_method(D_METHOD("is_monitorable"),&Area::is_monitorable); - ClassDB::bind_method(_MD("set_monitoring","enable"),&Area::set_monitoring); - ClassDB::bind_method(_MD("is_monitoring"),&Area::is_monitoring); + ClassDB::bind_method(D_METHOD("set_monitoring","enable"),&Area::set_monitoring); + ClassDB::bind_method(D_METHOD("is_monitoring"),&Area::is_monitoring); - ClassDB::bind_method(_MD("get_overlapping_bodies"),&Area::get_overlapping_bodies); - ClassDB::bind_method(_MD("get_overlapping_areas"),&Area::get_overlapping_areas); + ClassDB::bind_method(D_METHOD("get_overlapping_bodies"),&Area::get_overlapping_bodies); + ClassDB::bind_method(D_METHOD("get_overlapping_areas"),&Area::get_overlapping_areas); - ClassDB::bind_method(_MD("overlaps_body","body"),&Area::overlaps_body); - ClassDB::bind_method(_MD("overlaps_area","area"),&Area::overlaps_area); + ClassDB::bind_method(D_METHOD("overlaps_body","body"),&Area::overlaps_body); + ClassDB::bind_method(D_METHOD("overlaps_area","area"),&Area::overlaps_area); - ClassDB::bind_method(_MD("_body_inout"),&Area::_body_inout); - ClassDB::bind_method(_MD("_area_inout"),&Area::_area_inout); + ClassDB::bind_method(D_METHOD("_body_inout"),&Area::_body_inout); + ClassDB::bind_method(D_METHOD("_area_inout"),&Area::_area_inout); ADD_SIGNAL( MethodInfo("body_shape_entered",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"area_shape"))); @@ -645,19 +645,19 @@ void Area::_bind_methods() { ADD_SIGNAL( MethodInfo("area_entered",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"))); ADD_SIGNAL( MethodInfo("area_exited",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"))); - ADD_PROPERTY( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Combine-Replace,Replace,Replace-Combine"),_SCS("set_space_override_mode"),_SCS("get_space_override_mode")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"gravity_point"),_SCS("set_gravity_is_point"),_SCS("is_gravity_a_point")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity_distance_scale", PROPERTY_HINT_RANGE,"0,1024,0.001"),_SCS("set_gravity_distance_scale"),_SCS("get_gravity_distance_scale")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"gravity_vec"),_SCS("set_gravity_vector"),_SCS("get_gravity_vector")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity",PROPERTY_HINT_RANGE,"-1024,1024,0.01"),_SCS("set_gravity"),_SCS("get_gravity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"0,1024,0.001"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"0,1024,0.001"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"priority",PROPERTY_HINT_RANGE,"0,128,1"),_SCS("set_priority"),_SCS("get_priority")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"monitoring"),_SCS("set_monitoring"),_SCS("is_monitoring")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"monitorable"),_SCS("set_monitorable"),_SCS("is_monitorable")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"space_override",PROPERTY_HINT_ENUM,"Disabled,Combine,Combine-Replace,Replace,Replace-Combine"),"set_space_override_mode","get_space_override_mode"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"gravity_point"),"set_gravity_is_point","is_gravity_a_point"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity_distance_scale", PROPERTY_HINT_RANGE,"0,1024,0.001"),"set_gravity_distance_scale","get_gravity_distance_scale"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"gravity_vec"),"set_gravity_vector","get_gravity_vector"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity",PROPERTY_HINT_RANGE,"-1024,1024,0.01"),"set_gravity","get_gravity"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"0,1024,0.001"),"set_linear_damp","get_linear_damp"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"0,1024,0.001"),"set_angular_damp","get_angular_damp"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"priority",PROPERTY_HINT_RANGE,"0,128,1"),"set_priority","get_priority"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"monitoring"),"set_monitoring","is_monitoring"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"monitorable"),"set_monitorable","is_monitorable"); ADD_GROUP("Collision","collision_"); - ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_3D_PHYSICS),"set_layer_mask","get_layer_mask"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_3D_PHYSICS),"set_collision_mask","get_collision_mask"); } diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp index b67b75d48f..e20d8faafd 100644 --- a/scene/3d/baked_light_instance.cpp +++ b/scene/3d/baked_light_instance.cpp @@ -1718,26 +1718,26 @@ void BakedLight::_debug_mesh_light() { void BakedLight::_bind_methods() { - ClassDB::bind_method(_MD("set_cell_subdiv","steps"),&BakedLight::set_cell_subdiv); - ClassDB::bind_method(_MD("get_cell_subdiv"),&BakedLight::get_cell_subdiv); + ClassDB::bind_method(D_METHOD("set_cell_subdiv","steps"),&BakedLight::set_cell_subdiv); + ClassDB::bind_method(D_METHOD("get_cell_subdiv"),&BakedLight::get_cell_subdiv); - ClassDB::bind_method(_MD("bake"),&BakedLight::bake); - ClassDB::set_method_flags(get_class_static(),_SCS("bake"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(D_METHOD("bake"),&BakedLight::bake); + ClassDB::set_method_flags(get_class_static(),_scs_create("bake"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ClassDB::bind_method(_MD("bake_lights"),&BakedLight::bake_lights); - ClassDB::set_method_flags(get_class_static(),_SCS("bake_lights"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(D_METHOD("bake_lights"),&BakedLight::bake_lights); + ClassDB::set_method_flags(get_class_static(),_scs_create("bake_lights"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ClassDB::bind_method(_MD("bake_radiance"),&BakedLight::bake_radiance); - ClassDB::set_method_flags(get_class_static(),_SCS("bake_radiance"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(D_METHOD("bake_radiance"),&BakedLight::bake_radiance); + ClassDB::set_method_flags(get_class_static(),_scs_create("bake_radiance"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ClassDB::bind_method(_MD("debug_mesh_albedo"),&BakedLight::_debug_mesh_albedo); - ClassDB::set_method_flags(get_class_static(),_SCS("debug_mesh_albedo"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(D_METHOD("debug_mesh_albedo"),&BakedLight::_debug_mesh_albedo); + ClassDB::set_method_flags(get_class_static(),_scs_create("debug_mesh_albedo"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ClassDB::bind_method(_MD("debug_mesh_light"),&BakedLight::_debug_mesh_light); - ClassDB::set_method_flags(get_class_static(),_SCS("debug_mesh_light"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(D_METHOD("debug_mesh_light"),&BakedLight::_debug_mesh_light); + ClassDB::set_method_flags(get_class_static(),_scs_create("debug_mesh_light"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ADD_PROPERTY(PropertyInfo(Variant::INT,"cell_subdiv"),_SCS("set_cell_subdiv"),_SCS("get_cell_subdiv")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"cell_subdiv"),"set_cell_subdiv","get_cell_subdiv"); ADD_SIGNAL( MethodInfo("baked_light_changed")); } @@ -1797,11 +1797,11 @@ DVector<Face3> BakedLightSampler::get_faces(uint32_t p_usage_flags) const { void BakedLightSampler::_bind_methods() { - ClassDB::bind_method(_MD("set_param","param","value"),&BakedLightSampler::set_param); - ClassDB::bind_method(_MD("get_param","param"),&BakedLightSampler::get_param); + ClassDB::bind_method(D_METHOD("set_param","param","value"),&BakedLightSampler::set_param); + ClassDB::bind_method(D_METHOD("get_param","param"),&BakedLightSampler::get_param); - ClassDB::bind_method(_MD("set_resolution","resolution"),&BakedLightSampler::set_resolution); - ClassDB::bind_method(_MD("get_resolution"),&BakedLightSampler::get_resolution); + ClassDB::bind_method(D_METHOD("set_resolution","resolution"),&BakedLightSampler::set_resolution); + ClassDB::bind_method(D_METHOD("get_resolution"),&BakedLightSampler::get_resolution); BIND_CONSTANT( PARAM_RADIUS ); @@ -1810,12 +1810,12 @@ void BakedLightSampler::_bind_methods() { BIND_CONSTANT( PARAM_DETAIL_RATIO ); BIND_CONSTANT( PARAM_MAX ); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/radius",PROPERTY_HINT_RANGE,"0.01,1024,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_RADIUS); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/strength",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_STRENGTH); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/attenuation",PROPERTY_HINT_EXP_EASING),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/detail_ratio",PROPERTY_HINT_RANGE,"0.01,1.0,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_DETAIL_RATIO); - //ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/detail_ratio",PROPERTY_HINT_RANGE,"0,20,1"),_SCS("set_param"),_SCS("get_param"),PARAM_DETAIL_RATIO); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"params/resolution",PROPERTY_HINT_RANGE,"4,32,1"),_SCS("set_resolution"),_SCS("get_resolution")); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/radius",PROPERTY_HINT_RANGE,"0.01,1024,0.01"),"set_param","get_param",PARAM_RADIUS); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/strength",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param","get_param",PARAM_STRENGTH); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/attenuation",PROPERTY_HINT_EXP_EASING),"set_param","get_param",PARAM_ATTENUATION); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/detail_ratio",PROPERTY_HINT_RANGE,"0.01,1.0,0.01"),"set_param","get_param",PARAM_DETAIL_RATIO); + //ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/detail_ratio",PROPERTY_HINT_RANGE,"0,20,1"),"set_param","get_param",PARAM_DETAIL_RATIO); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"params/resolution",PROPERTY_HINT_RANGE,"4,32,1"),"set_resolution","get_resolution"); } diff --git a/scene/3d/body_shape.cpp b/scene/3d/body_shape.cpp index f3c839d525..af3fe3c0a4 100644 --- a/scene/3d/body_shape.cpp +++ b/scene/3d/body_shape.cpp @@ -414,22 +414,22 @@ String CollisionShape::get_configuration_warning() const { void CollisionShape::_bind_methods() { //not sure if this should do anything - ClassDB::bind_method(_MD("resource_changed","resource"),&CollisionShape::resource_changed); - ClassDB::bind_method(_MD("set_shape","shape"),&CollisionShape::set_shape); - ClassDB::bind_method(_MD("get_shape"),&CollisionShape::get_shape); - ClassDB::bind_method(_MD("_add_to_collision_object"),&CollisionShape::_add_to_collision_object); - ClassDB::bind_method(_MD("set_trigger","enable"),&CollisionShape::set_trigger); - ClassDB::bind_method(_MD("is_trigger"),&CollisionShape::is_trigger); - ClassDB::bind_method(_MD("make_convex_from_brothers"),&CollisionShape::make_convex_from_brothers); + ClassDB::bind_method(D_METHOD("resource_changed","resource"),&CollisionShape::resource_changed); + ClassDB::bind_method(D_METHOD("set_shape","shape"),&CollisionShape::set_shape); + ClassDB::bind_method(D_METHOD("get_shape"),&CollisionShape::get_shape); + ClassDB::bind_method(D_METHOD("_add_to_collision_object"),&CollisionShape::_add_to_collision_object); + ClassDB::bind_method(D_METHOD("set_trigger","enable"),&CollisionShape::set_trigger); + ClassDB::bind_method(D_METHOD("is_trigger"),&CollisionShape::is_trigger); + ClassDB::bind_method(D_METHOD("make_convex_from_brothers"),&CollisionShape::make_convex_from_brothers); ClassDB::set_method_flags("CollisionShape","make_convex_from_brothers",METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ClassDB::bind_method(_MD("_set_update_shape_index","index"),&CollisionShape::_set_update_shape_index); - ClassDB::bind_method(_MD("_get_update_shape_index"),&CollisionShape::_get_update_shape_index); + ClassDB::bind_method(D_METHOD("_set_update_shape_index","index"),&CollisionShape::_set_update_shape_index); + ClassDB::bind_method(D_METHOD("_get_update_shape_index"),&CollisionShape::_get_update_shape_index); - ClassDB::bind_method(_MD("get_collision_object_shape_index"),&CollisionShape::get_collision_object_shape_index); + ClassDB::bind_method(D_METHOD("get_collision_object_shape_index"),&CollisionShape::get_collision_object_shape_index); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape"), _SCS("set_shape"), _SCS("get_shape")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"trigger"),_SCS("set_trigger"),_SCS("is_trigger")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "_update_shape_index", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_NOEDITOR), _SCS("_set_update_shape_index"), _SCS("_get_update_shape_index")); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape"), "set_shape", "get_shape"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"trigger"),"set_trigger","is_trigger"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "_update_shape_index", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_NOEDITOR), "_set_update_shape_index", "_get_update_shape_index"); } diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp index 825cf1c535..1a2680e3b8 100644 --- a/scene/3d/bone_attachment.cpp +++ b/scene/3d/bone_attachment.cpp @@ -139,6 +139,6 @@ BoneAttachment::BoneAttachment() } void BoneAttachment::_bind_methods(){ - ClassDB::bind_method(_MD("set_bone_name","bone_name"),&BoneAttachment::set_bone_name); - ClassDB::bind_method(_MD("get_bone_name"),&BoneAttachment::get_bone_name); + ClassDB::bind_method(D_METHOD("set_bone_name","bone_name"),&BoneAttachment::set_bone_name); + ClassDB::bind_method(D_METHOD("get_bone_name"),&BoneAttachment::get_bone_name); } diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 5bd2c771ee..2e04f2d8bc 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -548,34 +548,34 @@ Camera::KeepAspect Camera::get_keep_aspect_mode() const{ void Camera::_bind_methods() { - ClassDB::bind_method( _MD("project_ray_normal","screen_point"), &Camera::project_ray_normal); - ClassDB::bind_method( _MD("project_local_ray_normal","screen_point"), &Camera::project_local_ray_normal); - ClassDB::bind_method( _MD("project_ray_origin","screen_point"), &Camera::project_ray_origin); - ClassDB::bind_method( _MD("unproject_position","world_point"), &Camera::unproject_position); - ClassDB::bind_method( _MD("is_position_behind","world_point"), &Camera::is_position_behind); - ClassDB::bind_method( _MD("project_position","screen_point"), &Camera::project_position); - ClassDB::bind_method( _MD("set_perspective","fov","z_near","z_far"),&Camera::set_perspective ); - ClassDB::bind_method( _MD("set_orthogonal","size","z_near","z_far"),&Camera::set_orthogonal ); - ClassDB::bind_method( _MD("make_current"),&Camera::make_current ); - ClassDB::bind_method( _MD("clear_current"),&Camera::clear_current ); - ClassDB::bind_method( _MD("is_current"),&Camera::is_current ); - ClassDB::bind_method( _MD("get_camera_transform"),&Camera::get_camera_transform ); - ClassDB::bind_method( _MD("get_fov"),&Camera::get_fov ); - ClassDB::bind_method( _MD("get_size"),&Camera::get_size ); - ClassDB::bind_method( _MD("get_zfar"),&Camera::get_zfar ); - ClassDB::bind_method( _MD("get_znear"),&Camera::get_znear ); - ClassDB::bind_method( _MD("get_projection"),&Camera::get_projection ); - ClassDB::bind_method( _MD("set_h_offset","ofs"),&Camera::set_h_offset ); - ClassDB::bind_method( _MD("get_h_offset"),&Camera::get_h_offset ); - ClassDB::bind_method( _MD("set_v_offset","ofs"),&Camera::set_v_offset ); - ClassDB::bind_method( _MD("get_v_offset"),&Camera::get_v_offset ); - ClassDB::bind_method( _MD("set_cull_mask","mask"),&Camera::set_cull_mask ); - ClassDB::bind_method( _MD("get_cull_mask"),&Camera::get_cull_mask ); - ClassDB::bind_method( _MD("set_environment","env:Environment"),&Camera::set_environment ); - ClassDB::bind_method( _MD("get_environment:Environment"),&Camera::get_environment ); - ClassDB::bind_method( _MD("set_keep_aspect_mode","mode"),&Camera::set_keep_aspect_mode ); - ClassDB::bind_method( _MD("get_keep_aspect_mode"),&Camera::get_keep_aspect_mode ); - //ClassDB::bind_method( _MD("_camera_make_current"),&Camera::_camera_make_current ); + ClassDB::bind_method(D_METHOD("project_ray_normal","screen_point"), &Camera::project_ray_normal); + ClassDB::bind_method(D_METHOD("project_local_ray_normal","screen_point"), &Camera::project_local_ray_normal); + ClassDB::bind_method(D_METHOD("project_ray_origin","screen_point"), &Camera::project_ray_origin); + ClassDB::bind_method(D_METHOD("unproject_position","world_point"), &Camera::unproject_position); + ClassDB::bind_method(D_METHOD("is_position_behind","world_point"), &Camera::is_position_behind); + ClassDB::bind_method(D_METHOD("project_position","screen_point"), &Camera::project_position); + ClassDB::bind_method(D_METHOD("set_perspective","fov","z_near","z_far"),&Camera::set_perspective ); + ClassDB::bind_method(D_METHOD("set_orthogonal","size","z_near","z_far"),&Camera::set_orthogonal ); + ClassDB::bind_method(D_METHOD("make_current"),&Camera::make_current ); + ClassDB::bind_method(D_METHOD("clear_current"),&Camera::clear_current ); + ClassDB::bind_method(D_METHOD("is_current"),&Camera::is_current ); + ClassDB::bind_method(D_METHOD("get_camera_transform"),&Camera::get_camera_transform ); + ClassDB::bind_method(D_METHOD("get_fov"),&Camera::get_fov ); + ClassDB::bind_method(D_METHOD("get_size"),&Camera::get_size ); + ClassDB::bind_method(D_METHOD("get_zfar"),&Camera::get_zfar ); + ClassDB::bind_method(D_METHOD("get_znear"),&Camera::get_znear ); + ClassDB::bind_method(D_METHOD("get_projection"),&Camera::get_projection ); + ClassDB::bind_method(D_METHOD("set_h_offset","ofs"),&Camera::set_h_offset ); + ClassDB::bind_method(D_METHOD("get_h_offset"),&Camera::get_h_offset ); + ClassDB::bind_method(D_METHOD("set_v_offset","ofs"),&Camera::set_v_offset ); + ClassDB::bind_method(D_METHOD("get_v_offset"),&Camera::get_v_offset ); + ClassDB::bind_method(D_METHOD("set_cull_mask","mask"),&Camera::set_cull_mask ); + ClassDB::bind_method(D_METHOD("get_cull_mask"),&Camera::get_cull_mask ); + ClassDB::bind_method(D_METHOD("set_environment","env:Environment"),&Camera::set_environment ); + ClassDB::bind_method(D_METHOD("get_environment:Environment"),&Camera::get_environment ); + ClassDB::bind_method(D_METHOD("set_keep_aspect_mode","mode"),&Camera::set_keep_aspect_mode ); + ClassDB::bind_method(D_METHOD("get_keep_aspect_mode"),&Camera::get_keep_aspect_mode ); + //ClassDB::bind_method(D_METHOD("_camera_make_current"),&Camera::_camera_make_current ); BIND_CONSTANT( PROJECTION_PERSPECTIVE ); BIND_CONSTANT( PROJECTION_ORTHOGONAL ); diff --git a/scene/3d/character_camera.cpp b/scene/3d/character_camera.cpp index 211619d0df..424a7fc79c 100644 --- a/scene/3d/character_camera.cpp +++ b/scene/3d/character_camera.cpp @@ -634,30 +634,30 @@ float CharacterCamera::get_autoturn_speed() const { void CharacterCamera::_bind_methods() { - ClassDB::bind_method(_MD("set_camera_type","type"),&CharacterCamera::set_camera_type); - ClassDB::bind_method(_MD("get_camera_type"),&CharacterCamera::get_camera_type); - ClassDB::bind_method(_MD("set_orbit","orbit"),&CharacterCamera::set_orbit); - ClassDB::bind_method(_MD("get_orbit"),&CharacterCamera::get_orbit); - ClassDB::bind_method(_MD("set_orbit_x","x"),&CharacterCamera::set_orbit_x); - ClassDB::bind_method(_MD("set_orbit_y","y"),&CharacterCamera::set_orbit_y); - ClassDB::bind_method(_MD("set_min_orbit_x","x"),&CharacterCamera::set_min_orbit_x); - ClassDB::bind_method(_MD("get_min_orbit_x"),&CharacterCamera::get_min_orbit_x); - ClassDB::bind_method(_MD("set_max_orbit_x","x"),&CharacterCamera::set_max_orbit_x); - ClassDB::bind_method(_MD("get_max_orbit_x"),&CharacterCamera::get_max_orbit_x); - ClassDB::bind_method(_MD("rotate_orbit"),&CharacterCamera::rotate_orbit); - ClassDB::bind_method(_MD("set_distance","distance"),&CharacterCamera::set_distance); - ClassDB::bind_method(_MD("get_distance"),&CharacterCamera::get_distance); - ClassDB::bind_method(_MD("set_clip","enable"),&CharacterCamera::set_clip); - ClassDB::bind_method(_MD("has_clip"),&CharacterCamera::has_clip); - ClassDB::bind_method(_MD("set_autoturn","enable"),&CharacterCamera::set_autoturn); - ClassDB::bind_method(_MD("has_autoturn"),&CharacterCamera::has_autoturn); - ClassDB::bind_method(_MD("set_autoturn_tolerance","degrees"),&CharacterCamera::set_autoturn_tolerance); - ClassDB::bind_method(_MD("get_autoturn_tolerance"),&CharacterCamera::get_autoturn_tolerance); - ClassDB::bind_method(_MD("set_autoturn_speed","speed"),&CharacterCamera::set_autoturn_speed); - ClassDB::bind_method(_MD("get_autoturn_speed"),&CharacterCamera::get_autoturn_speed); - ClassDB::bind_method(_MD("set_use_lookat_target","use","lookat"),&CharacterCamera::set_use_lookat_target, DEFVAL(Vector3())); - - ClassDB::bind_method(_MD("_ray_collision"),&CharacterCamera::_ray_collision); + ClassDB::bind_method(D_METHOD("set_camera_type","type"),&CharacterCamera::set_camera_type); + ClassDB::bind_method(D_METHOD("get_camera_type"),&CharacterCamera::get_camera_type); + ClassDB::bind_method(D_METHOD("set_orbit","orbit"),&CharacterCamera::set_orbit); + ClassDB::bind_method(D_METHOD("get_orbit"),&CharacterCamera::get_orbit); + ClassDB::bind_method(D_METHOD("set_orbit_x","x"),&CharacterCamera::set_orbit_x); + ClassDB::bind_method(D_METHOD("set_orbit_y","y"),&CharacterCamera::set_orbit_y); + ClassDB::bind_method(D_METHOD("set_min_orbit_x","x"),&CharacterCamera::set_min_orbit_x); + ClassDB::bind_method(D_METHOD("get_min_orbit_x"),&CharacterCamera::get_min_orbit_x); + ClassDB::bind_method(D_METHOD("set_max_orbit_x","x"),&CharacterCamera::set_max_orbit_x); + ClassDB::bind_method(D_METHOD("get_max_orbit_x"),&CharacterCamera::get_max_orbit_x); + ClassDB::bind_method(D_METHOD("rotate_orbit"),&CharacterCamera::rotate_orbit); + ClassDB::bind_method(D_METHOD("set_distance","distance"),&CharacterCamera::set_distance); + ClassDB::bind_method(D_METHOD("get_distance"),&CharacterCamera::get_distance); + ClassDB::bind_method(D_METHOD("set_clip","enable"),&CharacterCamera::set_clip); + ClassDB::bind_method(D_METHOD("has_clip"),&CharacterCamera::has_clip); + ClassDB::bind_method(D_METHOD("set_autoturn","enable"),&CharacterCamera::set_autoturn); + ClassDB::bind_method(D_METHOD("has_autoturn"),&CharacterCamera::has_autoturn); + ClassDB::bind_method(D_METHOD("set_autoturn_tolerance","degrees"),&CharacterCamera::set_autoturn_tolerance); + ClassDB::bind_method(D_METHOD("get_autoturn_tolerance"),&CharacterCamera::get_autoturn_tolerance); + ClassDB::bind_method(D_METHOD("set_autoturn_speed","speed"),&CharacterCamera::set_autoturn_speed); + ClassDB::bind_method(D_METHOD("get_autoturn_speed"),&CharacterCamera::get_autoturn_speed); + ClassDB::bind_method(D_METHOD("set_use_lookat_target","use","lookat"),&CharacterCamera::set_use_lookat_target, DEFVAL(Vector3())); + + ClassDB::bind_method(D_METHOD("_ray_collision"),&CharacterCamera::_ray_collision); BIND_CONSTANT( CAMERA_FIXED ); BIND_CONSTANT( CAMERA_FOLLOW ); diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp index 7bba382db0..32e60f0d57 100644 --- a/scene/3d/collision_object.cpp +++ b/scene/3d/collision_object.cpp @@ -228,30 +228,30 @@ bool CollisionObject::is_ray_pickable() const { void CollisionObject::_bind_methods() { - ClassDB::bind_method(_MD("add_shape","shape:Shape","transform"),&CollisionObject::add_shape,DEFVAL(Transform())); - ClassDB::bind_method(_MD("get_shape_count"),&CollisionObject::get_shape_count); - ClassDB::bind_method(_MD("set_shape","shape_idx","shape:Shape"),&CollisionObject::set_shape); - ClassDB::bind_method(_MD("set_shape_transform","shape_idx","transform"),&CollisionObject::set_shape_transform); -// ClassDB::bind_method(_MD("set_shape_transform","shape_idx","transform"),&CollisionObject::set_shape_transform); - ClassDB::bind_method(_MD("set_shape_as_trigger","shape_idx","enable"),&CollisionObject::set_shape_as_trigger); - ClassDB::bind_method(_MD("is_shape_set_as_trigger","shape_idx"),&CollisionObject::is_shape_set_as_trigger); - ClassDB::bind_method(_MD("get_shape:Shape","shape_idx"),&CollisionObject::get_shape); - ClassDB::bind_method(_MD("get_shape_transform","shape_idx"),&CollisionObject::get_shape_transform); - ClassDB::bind_method(_MD("remove_shape","shape_idx"),&CollisionObject::remove_shape); - ClassDB::bind_method(_MD("clear_shapes"),&CollisionObject::clear_shapes); - ClassDB::bind_method(_MD("set_ray_pickable","ray_pickable"),&CollisionObject::set_ray_pickable); - ClassDB::bind_method(_MD("is_ray_pickable"),&CollisionObject::is_ray_pickable); - ClassDB::bind_method(_MD("set_capture_input_on_drag","enable"),&CollisionObject::set_capture_input_on_drag); - ClassDB::bind_method(_MD("get_capture_input_on_drag"),&CollisionObject::get_capture_input_on_drag); - ClassDB::bind_method(_MD("get_rid"),&CollisionObject::get_rid); + ClassDB::bind_method(D_METHOD("add_shape","shape:Shape","transform"),&CollisionObject::add_shape,DEFVAL(Transform())); + ClassDB::bind_method(D_METHOD("get_shape_count"),&CollisionObject::get_shape_count); + ClassDB::bind_method(D_METHOD("set_shape","shape_idx","shape:Shape"),&CollisionObject::set_shape); + ClassDB::bind_method(D_METHOD("set_shape_transform","shape_idx","transform"),&CollisionObject::set_shape_transform); +// ClassDB::bind_method(D_METHOD("set_shape_transform","shape_idx","transform"),&CollisionObject::set_shape_transform); + ClassDB::bind_method(D_METHOD("set_shape_as_trigger","shape_idx","enable"),&CollisionObject::set_shape_as_trigger); + ClassDB::bind_method(D_METHOD("is_shape_set_as_trigger","shape_idx"),&CollisionObject::is_shape_set_as_trigger); + ClassDB::bind_method(D_METHOD("get_shape:Shape","shape_idx"),&CollisionObject::get_shape); + ClassDB::bind_method(D_METHOD("get_shape_transform","shape_idx"),&CollisionObject::get_shape_transform); + ClassDB::bind_method(D_METHOD("remove_shape","shape_idx"),&CollisionObject::remove_shape); + ClassDB::bind_method(D_METHOD("clear_shapes"),&CollisionObject::clear_shapes); + ClassDB::bind_method(D_METHOD("set_ray_pickable","ray_pickable"),&CollisionObject::set_ray_pickable); + ClassDB::bind_method(D_METHOD("is_ray_pickable"),&CollisionObject::is_ray_pickable); + ClassDB::bind_method(D_METHOD("set_capture_input_on_drag","enable"),&CollisionObject::set_capture_input_on_drag); + ClassDB::bind_method(D_METHOD("get_capture_input_on_drag"),&CollisionObject::get_capture_input_on_drag); + ClassDB::bind_method(D_METHOD("get_rid"),&CollisionObject::get_rid); BIND_VMETHOD( MethodInfo("_input_event",PropertyInfo(Variant::OBJECT,"camera"),PropertyInfo(Variant::INPUT_EVENT,"event"),PropertyInfo(Variant::VECTOR3,"click_pos"),PropertyInfo(Variant::VECTOR3,"click_normal"),PropertyInfo(Variant::INT,"shape_idx"))); ADD_SIGNAL( MethodInfo("input_event",PropertyInfo(Variant::OBJECT,"camera"),PropertyInfo(Variant::INPUT_EVENT,"event"),PropertyInfo(Variant::VECTOR3,"click_pos"),PropertyInfo(Variant::VECTOR3,"click_normal"),PropertyInfo(Variant::INT,"shape_idx"))); ADD_SIGNAL( MethodInfo("mouse_entered")); ADD_SIGNAL( MethodInfo("mouse_exited")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"input_ray_pickable"),_SCS("set_ray_pickable"),_SCS("is_ray_pickable")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"input_capture_on_drag"),_SCS("set_capture_input_on_drag"),_SCS("get_capture_input_on_drag")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"input_ray_pickable"),"set_ray_pickable","is_ray_pickable"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"input_capture_on_drag"),"set_capture_input_on_drag","get_capture_input_on_drag"); } @@ -334,6 +334,7 @@ CollisionObject::CollisionObject(RID p_rid, bool p_area) { area=p_area; capture_input_on_drag=false; ray_pickable=true; + set_notify_transform(true); if (p_area) { PhysicsServer::get_singleton()->area_attach_object_instance_ID(rid,get_instance_ID()); } else { diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index d0612986df..82637c2488 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -275,27 +275,27 @@ String CollisionPolygon::get_configuration_warning() const { void CollisionPolygon::_bind_methods() { - ClassDB::bind_method(_MD("_add_to_collision_object"),&CollisionPolygon::_add_to_collision_object); + ClassDB::bind_method(D_METHOD("_add_to_collision_object"),&CollisionPolygon::_add_to_collision_object); - ClassDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon::set_build_mode); - ClassDB::bind_method(_MD("get_build_mode"),&CollisionPolygon::get_build_mode); + ClassDB::bind_method(D_METHOD("set_build_mode","build_mode"),&CollisionPolygon::set_build_mode); + ClassDB::bind_method(D_METHOD("get_build_mode"),&CollisionPolygon::get_build_mode); - ClassDB::bind_method(_MD("set_depth","depth"),&CollisionPolygon::set_depth); - ClassDB::bind_method(_MD("get_depth"),&CollisionPolygon::get_depth); + ClassDB::bind_method(D_METHOD("set_depth","depth"),&CollisionPolygon::set_depth); + ClassDB::bind_method(D_METHOD("get_depth"),&CollisionPolygon::get_depth); - ClassDB::bind_method(_MD("set_polygon","polygon"),&CollisionPolygon::set_polygon); - ClassDB::bind_method(_MD("get_polygon"),&CollisionPolygon::get_polygon); + ClassDB::bind_method(D_METHOD("set_polygon","polygon"),&CollisionPolygon::set_polygon); + ClassDB::bind_method(D_METHOD("get_polygon"),&CollisionPolygon::get_polygon); - ClassDB::bind_method(_MD("_set_shape_range","shape_range"),&CollisionPolygon::_set_shape_range); - ClassDB::bind_method(_MD("_get_shape_range"),&CollisionPolygon::_get_shape_range); + ClassDB::bind_method(D_METHOD("_set_shape_range","shape_range"),&CollisionPolygon::_set_shape_range); + ClassDB::bind_method(D_METHOD("_get_shape_range"),&CollisionPolygon::_get_shape_range); - ClassDB::bind_method(_MD("get_collision_object_first_shape"),&CollisionPolygon::get_collision_object_first_shape); - ClassDB::bind_method(_MD("get_collision_object_last_shape"),&CollisionPolygon::get_collision_object_last_shape); + ClassDB::bind_method(D_METHOD("get_collision_object_first_shape"),&CollisionPolygon::get_collision_object_first_shape); + ClassDB::bind_method(D_METHOD("get_collision_object_last_shape"),&CollisionPolygon::get_collision_object_last_shape); - ADD_PROPERTY( PropertyInfo(Variant::INT,"build_mode",PROPERTY_HINT_ENUM,"Solids,Triangles"),_SCS("set_build_mode"),_SCS("get_build_mode")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"depth"),_SCS("set_depth"),_SCS("get_depth")); - ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"shape_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_shape_range"),_SCS("_get_shape_range")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"build_mode",PROPERTY_HINT_ENUM,"Solids,Triangles"),"set_build_mode","get_build_mode"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"depth"),"set_depth","get_depth"); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),"set_polygon","get_polygon"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"shape_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_shape_range","_get_shape_range"); } CollisionPolygon::CollisionPolygon() { diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 4c33590568..b22795e74d 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -1,4 +1,33 @@ +/*************************************************************************/ +/* gi_probe.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "gi_probe.h" + #include "mesh_instance.h" @@ -64,6 +93,19 @@ float GIProbeData::get_energy() const{ } + +void GIProbeData::set_bias(float p_range) { + + VS::get_singleton()->gi_probe_set_bias(probe,p_range); +} + +float GIProbeData::get_bias() const{ + + return VS::get_singleton()->gi_probe_get_bias(probe); + +} + + void GIProbeData::set_propagation(float p_range) { VS::get_singleton()->gi_probe_set_propagation(probe,p_range); @@ -115,43 +157,47 @@ RID GIProbeData::get_rid() const { void GIProbeData::_bind_methods() { - ClassDB::bind_method(_MD("set_bounds","bounds"),&GIProbeData::set_bounds); - ClassDB::bind_method(_MD("get_bounds"),&GIProbeData::get_bounds); + ClassDB::bind_method(D_METHOD("set_bounds","bounds"),&GIProbeData::set_bounds); + ClassDB::bind_method(D_METHOD("get_bounds"),&GIProbeData::get_bounds); + + ClassDB::bind_method(D_METHOD("set_cell_size","cell_size"),&GIProbeData::set_cell_size); + ClassDB::bind_method(D_METHOD("get_cell_size"),&GIProbeData::get_cell_size); - ClassDB::bind_method(_MD("set_cell_size","cell_size"),&GIProbeData::set_cell_size); - ClassDB::bind_method(_MD("get_cell_size"),&GIProbeData::get_cell_size); + ClassDB::bind_method(D_METHOD("set_to_cell_xform","to_cell_xform"),&GIProbeData::set_to_cell_xform); + ClassDB::bind_method(D_METHOD("get_to_cell_xform"),&GIProbeData::get_to_cell_xform); - ClassDB::bind_method(_MD("set_to_cell_xform","to_cell_xform"),&GIProbeData::set_to_cell_xform); - ClassDB::bind_method(_MD("get_to_cell_xform"),&GIProbeData::get_to_cell_xform); + ClassDB::bind_method(D_METHOD("set_dynamic_data","dynamic_data"),&GIProbeData::set_dynamic_data); + ClassDB::bind_method(D_METHOD("get_dynamic_data"),&GIProbeData::get_dynamic_data); - ClassDB::bind_method(_MD("set_dynamic_data","dynamic_data"),&GIProbeData::set_dynamic_data); - ClassDB::bind_method(_MD("get_dynamic_data"),&GIProbeData::get_dynamic_data); + ClassDB::bind_method(D_METHOD("set_dynamic_range","dynamic_range"),&GIProbeData::set_dynamic_range); + ClassDB::bind_method(D_METHOD("get_dynamic_range"),&GIProbeData::get_dynamic_range); - ClassDB::bind_method(_MD("set_dynamic_range","dynamic_range"),&GIProbeData::set_dynamic_range); - ClassDB::bind_method(_MD("get_dynamic_range"),&GIProbeData::get_dynamic_range); + ClassDB::bind_method(D_METHOD("set_energy","energy"),&GIProbeData::set_energy); + ClassDB::bind_method(D_METHOD("get_energy"),&GIProbeData::get_energy); - ClassDB::bind_method(_MD("set_energy","energy"),&GIProbeData::set_energy); - ClassDB::bind_method(_MD("get_energy"),&GIProbeData::get_energy); + ClassDB::bind_method(D_METHOD("set_bias","bias"),&GIProbeData::set_bias); + ClassDB::bind_method(D_METHOD("get_bias"),&GIProbeData::get_bias); - ClassDB::bind_method(_MD("set_propagation","propagation"),&GIProbeData::set_propagation); - ClassDB::bind_method(_MD("get_propagation"),&GIProbeData::get_propagation); + ClassDB::bind_method(D_METHOD("set_propagation","propagation"),&GIProbeData::set_propagation); + ClassDB::bind_method(D_METHOD("get_propagation"),&GIProbeData::get_propagation); - ClassDB::bind_method(_MD("set_interior","interior"),&GIProbeData::set_interior); - ClassDB::bind_method(_MD("is_interior"),&GIProbeData::is_interior); + ClassDB::bind_method(D_METHOD("set_interior","interior"),&GIProbeData::set_interior); + ClassDB::bind_method(D_METHOD("is_interior"),&GIProbeData::is_interior); - ClassDB::bind_method(_MD("set_compress","compress"),&GIProbeData::set_compress); - ClassDB::bind_method(_MD("is_compressed"),&GIProbeData::is_compressed); + ClassDB::bind_method(D_METHOD("set_compress","compress"),&GIProbeData::set_compress); + ClassDB::bind_method(D_METHOD("is_compressed"),&GIProbeData::is_compressed); - ADD_PROPERTY(PropertyInfo(Variant::RECT3,"bounds",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_bounds"),_SCS("get_bounds")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"cell_size",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_cell_size"),_SCS("get_cell_size")); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM,"to_cell_xform",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_to_cell_xform"),_SCS("get_to_cell_xform")); + ADD_PROPERTY(PropertyInfo(Variant::RECT3,"bounds",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_bounds","get_bounds"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"cell_size",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_cell_size","get_cell_size"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM,"to_cell_xform",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_to_cell_xform","get_to_cell_xform"); - ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY,"dynamic_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_data"),_SCS("get_dynamic_data")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_energy"),_SCS("get_energy")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"propagation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_propagation"),_SCS("get_propagation")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"interior",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_interior"),_SCS("is_interior")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"compress",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_compress"),_SCS("is_compressed")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY,"dynamic_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_dynamic_data","get_dynamic_data"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_dynamic_range","get_dynamic_range"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_energy","get_energy"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"bias",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_bias","get_bias"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"propagation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_propagation","get_propagation"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"interior",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_interior","is_interior"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"compress",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_compress","is_compressed"); } @@ -230,6 +276,18 @@ float GIProbe::get_energy() const { return energy; } +void GIProbe::set_bias(float p_bias) { + + bias=p_bias; + if (probe_data.is_valid()) { + probe_data->set_bias(bias); + } +} +float GIProbe::get_bias() const { + + return bias; +} + void GIProbe::set_propagation(float p_propagation) { propagation=p_propagation; @@ -466,7 +524,8 @@ void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const V int closest_axis; float closest_dot; - Vector3 normal = Plane(p_vtx[0],p_vtx[1],p_vtx[2]).normal; + Plane plane = Plane(p_vtx[0],p_vtx[1],p_vtx[2]); + Vector3 normal = plane.normal; for(int i=0;i<3;i++) { @@ -479,6 +538,7 @@ void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const V } } + Vector3 axis; axis[closest_axis]=1.0; Vector3 t1; @@ -517,24 +577,23 @@ void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const V Vector3 ray_from = from + (t1+t2)*0.5 - axis * p_aabb.size[closest_axis]; Vector3 ray_to = ray_from + axis * p_aabb.size[closest_axis]*2; + if (normal.dot(ray_from-ray_to)<0) { + SWAP(ray_from,ray_to); + } + Vector3 intersection; - if (!Geometry::ray_intersects_triangle(ray_from,ray_to,p_vtx[0],p_vtx[1],p_vtx[2],&intersection)) { - //no intersect? look in edges - - float closest_dist=1e20; - for(int j=0;j<3;j++) { - Vector3 c; - Vector3 inters; - Geometry::get_closest_points_between_segments(p_vtx[j],p_vtx[(j+1)%3],ray_from,ray_to,inters,c); - float d=c.distance_to(intersection); - if (j==0 || d<closest_dist) { - closest_dist=d; - intersection=inters; - } + if (!plane.intersects_segment(ray_from,ray_to,&intersection)) { + if (ABS(plane.distance_to(ray_from)) < ABS(plane.distance_to(ray_to))) { + intersection = plane.project(ray_from); + } else { + + intersection = plane.project(ray_to); } } + intersection=Face3(p_vtx[0],p_vtx[1],p_vtx[2]).get_closest_point_to(intersection); + Vector2 uv = get_uv(intersection,p_vtx,p_uv); @@ -856,6 +915,10 @@ Vector<Color> GIProbe::_get_bake_texture(Image &p_image,const Color& p_color) { return ret; } + if (p_image.is_compressed()) { + print_line("DECOMPRESSING!!!!"); + p_image.decompress(); + } p_image.convert(Image::FORMAT_RGBA8); p_image.resize(bake_texture_size,bake_texture_size,Image::INTERPOLATE_CUBIC); @@ -892,13 +955,14 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater if (mat.is_valid()) { - - Ref<ImageTexture> albedo_tex = mat->get_texture(FixedSpatialMaterial::TEXTURE_ALBEDO); + Ref<Texture> albedo_tex = mat->get_texture(FixedSpatialMaterial::TEXTURE_ALBEDO); Image img_albedo; if (albedo_tex.is_valid()) { img_albedo = albedo_tex->get_data(); + } else { + } mc.albedo=_get_bake_texture(img_albedo,mat->get_albedo()); @@ -950,6 +1014,7 @@ void GIProbe::_plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_b src_material=p_materials[i]; } else { src_material=p_mesh->surface_get_material(i); + } Baker::MaterialCache material = _get_material_cache(src_material,p_baker); @@ -1056,6 +1121,31 @@ void GIProbe::_find_meshes(Node *p_at_node,Baker *p_baker){ } } + if (p_at_node->cast_to<Spatial>()) { + + Spatial *s = p_at_node->cast_to<Spatial>(); + Array meshes = p_at_node->call("get_meshes"); + for(int i=0;i<meshes.size();i+=2) { + + Transform mxf = meshes[i]; + Ref<Mesh> mesh = meshes[i+1]; + if (!mesh.is_valid()) + continue; + + Rect3 aabb = mesh->get_aabb(); + + Transform xf = get_global_transform().affine_inverse() * (s->get_global_transform() * mxf); + + if (Rect3(-extents,extents*2).intersects(xf.xform(aabb))) { + Baker::PlotMesh pm; + pm.local_xform=xf; + pm.mesh=mesh; + p_baker->mesh_list.push_back(pm); + + } + } + } + for(int i=0;i<p_at_node->get_child_count();i++) { Node *child = p_at_node->get_child(i); @@ -1208,26 +1298,30 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ } - Ref<GIProbeData> probe_data; - probe_data.instance(); - probe_data->set_bounds(Rect3(-extents,extents*2.0)); - probe_data->set_cell_size(baker.po2_bounds.size[longest_axis]/baker.axis_cell_size[longest_axis]); - probe_data->set_dynamic_data(data); - probe_data->set_dynamic_range(dynamic_range); - probe_data->set_energy(energy); - probe_data->set_interior(interior); - probe_data->set_compress(compress); - probe_data->set_to_cell_xform(baker.to_cell_space); - - set_probe_data(probe_data); + if (p_create_visual_debug) { + _create_debug_mesh(&baker); + } else { + Ref<GIProbeData> probe_data; + probe_data.instance(); + probe_data->set_bounds(Rect3(-extents,extents*2.0)); + probe_data->set_cell_size(baker.po2_bounds.size[longest_axis]/baker.axis_cell_size[longest_axis]); + probe_data->set_dynamic_data(data); + probe_data->set_dynamic_range(dynamic_range); + probe_data->set_energy(energy); + probe_data->set_bias(bias); + probe_data->set_propagation(propagation); + probe_data->set_interior(interior); + probe_data->set_compress(compress); + probe_data->set_to_cell_xform(baker.to_cell_space); - if (p_create_visual_debug) { - //_create_debug_mesh(&baker); + set_probe_data(probe_data); } + + } @@ -1384,42 +1478,46 @@ PoolVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const { void GIProbe::_bind_methods() { - ClassDB::bind_method(_MD("set_probe_data","data"),&GIProbe::set_probe_data); - ClassDB::bind_method(_MD("get_probe_data"),&GIProbe::get_probe_data); + ClassDB::bind_method(D_METHOD("set_probe_data","data"),&GIProbe::set_probe_data); + ClassDB::bind_method(D_METHOD("get_probe_data"),&GIProbe::get_probe_data); + + ClassDB::bind_method(D_METHOD("set_subdiv","subdiv"),&GIProbe::set_subdiv); + ClassDB::bind_method(D_METHOD("get_subdiv"),&GIProbe::get_subdiv); - ClassDB::bind_method(_MD("set_subdiv","subdiv"),&GIProbe::set_subdiv); - ClassDB::bind_method(_MD("get_subdiv"),&GIProbe::get_subdiv); + ClassDB::bind_method(D_METHOD("set_extents","extents"),&GIProbe::set_extents); + ClassDB::bind_method(D_METHOD("get_extents"),&GIProbe::get_extents); - ClassDB::bind_method(_MD("set_extents","extents"),&GIProbe::set_extents); - ClassDB::bind_method(_MD("get_extents"),&GIProbe::get_extents); + ClassDB::bind_method(D_METHOD("set_dynamic_range","max"),&GIProbe::set_dynamic_range); + ClassDB::bind_method(D_METHOD("get_dynamic_range"),&GIProbe::get_dynamic_range); - ClassDB::bind_method(_MD("set_dynamic_range","max"),&GIProbe::set_dynamic_range); - ClassDB::bind_method(_MD("get_dynamic_range"),&GIProbe::get_dynamic_range); + ClassDB::bind_method(D_METHOD("set_energy","max"),&GIProbe::set_energy); + ClassDB::bind_method(D_METHOD("get_energy"),&GIProbe::get_energy); - ClassDB::bind_method(_MD("set_energy","max"),&GIProbe::set_energy); - ClassDB::bind_method(_MD("get_energy"),&GIProbe::get_energy); + ClassDB::bind_method(D_METHOD("set_bias","max"),&GIProbe::set_bias); + ClassDB::bind_method(D_METHOD("get_bias"),&GIProbe::get_bias); - ClassDB::bind_method(_MD("set_propagation","max"),&GIProbe::set_propagation); - ClassDB::bind_method(_MD("get_propagation"),&GIProbe::get_propagation); + ClassDB::bind_method(D_METHOD("set_propagation","max"),&GIProbe::set_propagation); + ClassDB::bind_method(D_METHOD("get_propagation"),&GIProbe::get_propagation); - ClassDB::bind_method(_MD("set_interior","enable"),&GIProbe::set_interior); - ClassDB::bind_method(_MD("is_interior"),&GIProbe::is_interior); + ClassDB::bind_method(D_METHOD("set_interior","enable"),&GIProbe::set_interior); + ClassDB::bind_method(D_METHOD("is_interior"),&GIProbe::is_interior); - ClassDB::bind_method(_MD("set_compress","enable"),&GIProbe::set_compress); - ClassDB::bind_method(_MD("is_compressed"),&GIProbe::is_compressed); + ClassDB::bind_method(D_METHOD("set_compress","enable"),&GIProbe::set_compress); + ClassDB::bind_method(D_METHOD("is_compressed"),&GIProbe::is_compressed); - ClassDB::bind_method(_MD("bake","from_node","create_visual_debug"),&GIProbe::bake,DEFVAL(Variant()),DEFVAL(false)); - ClassDB::bind_method(_MD("debug_bake"),&GIProbe::_debug_bake); - ClassDB::set_method_flags(get_class_static(),_SCS("debug_bake"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(D_METHOD("bake","from_node","create_visual_debug"),&GIProbe::bake,DEFVAL(Variant()),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("debug_bake"),&GIProbe::_debug_bake); + ClassDB::set_method_flags(get_class_static(),_scs_create("debug_bake"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ADD_PROPERTY( PropertyInfo(Variant::INT,"subdiv",PROPERTY_HINT_ENUM,"64,128,256,512"),_SCS("set_subdiv"),_SCS("get_subdiv")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"extents"),_SCS("set_extents"),_SCS("get_extents")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_RANGE,"1,16,1"),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_energy"),_SCS("get_energy")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"propagation",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_propagation"),_SCS("get_propagation")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"interior"),_SCS("set_interior"),_SCS("is_interior")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"compress"),_SCS("set_compress"),_SCS("is_compressed")); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"data",PROPERTY_HINT_RESOURCE_TYPE,"GIProbeData"),_SCS("set_probe_data"),_SCS("get_probe_data")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"subdiv",PROPERTY_HINT_ENUM,"64,128,256,512"),"set_subdiv","get_subdiv"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"extents"),"set_extents","get_extents"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_RANGE,"1,16,1"),"set_dynamic_range","get_dynamic_range"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_RANGE,"0,16,0.01"),"set_energy","get_energy"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"propagation",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_propagation","get_propagation"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"bias",PROPERTY_HINT_RANGE,"0,4,0.001"),"set_bias","get_bias"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"interior"),"set_interior","is_interior"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"compress"),"set_compress","is_compressed"); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"data",PROPERTY_HINT_RESOURCE_TYPE,"GIProbeData"),"set_probe_data","get_probe_data"); BIND_CONSTANT( SUBDIV_64 ); @@ -1434,6 +1532,7 @@ GIProbe::GIProbe() { subdiv=SUBDIV_128; dynamic_range=4; energy=1.0; + bias=0.4; propagation=1.0; extents=Vector3(10,10,10); color_scan_cell_width=4; diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index f03a558908..a45e80806a 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* gi_probe.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 GIPROBE_H #define GIPROBE_H @@ -38,6 +66,9 @@ public: void set_energy(float p_range); float get_energy() const; + void set_bias(float p_range); + float get_bias() const; + void set_interior(bool p_enable); bool is_interior() const; @@ -137,6 +168,7 @@ private: Vector3 extents; int dynamic_range; float energy; + float bias; float propagation; bool interior; bool compress; @@ -176,6 +208,9 @@ public: void set_energy(float p_energy); float get_energy() const; + void set_bias(float p_bias); + float get_bias() const; + void set_propagation(float p_propagation); float get_propagation() const; diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp index 08fc1f59e8..6adbbe9ccf 100644 --- a/scene/3d/immediate_geometry.cpp +++ b/scene/3d/immediate_geometry.cpp @@ -154,16 +154,16 @@ void ImmediateGeometry::add_sphere(int p_lats, int p_lons, float p_radius, bool void ImmediateGeometry::_bind_methods() { - ClassDB::bind_method(_MD("begin","primitive","texture:Texture"),&ImmediateGeometry::begin,DEFVAL(Ref<Texture>())); - ClassDB::bind_method(_MD("set_normal","normal"),&ImmediateGeometry::set_normal); - ClassDB::bind_method(_MD("set_tangent","tangent"),&ImmediateGeometry::set_tangent); - ClassDB::bind_method(_MD("set_color","color"),&ImmediateGeometry::set_color); - ClassDB::bind_method(_MD("set_uv","uv"),&ImmediateGeometry::set_uv); - ClassDB::bind_method(_MD("set_uv2","uv"),&ImmediateGeometry::set_uv2); - ClassDB::bind_method(_MD("add_vertex","pos"),&ImmediateGeometry::add_vertex); - ClassDB::bind_method(_MD("add_sphere","lats","lons","radius","add_uv"),&ImmediateGeometry::add_sphere,DEFVAL(true)); - ClassDB::bind_method(_MD("end"),&ImmediateGeometry::end); - ClassDB::bind_method(_MD("clear"),&ImmediateGeometry::clear); + ClassDB::bind_method(D_METHOD("begin","primitive","texture:Texture"),&ImmediateGeometry::begin,DEFVAL(Ref<Texture>())); + ClassDB::bind_method(D_METHOD("set_normal","normal"),&ImmediateGeometry::set_normal); + ClassDB::bind_method(D_METHOD("set_tangent","tangent"),&ImmediateGeometry::set_tangent); + ClassDB::bind_method(D_METHOD("set_color","color"),&ImmediateGeometry::set_color); + ClassDB::bind_method(D_METHOD("set_uv","uv"),&ImmediateGeometry::set_uv); + ClassDB::bind_method(D_METHOD("set_uv2","uv"),&ImmediateGeometry::set_uv2); + ClassDB::bind_method(D_METHOD("add_vertex","pos"),&ImmediateGeometry::add_vertex); + ClassDB::bind_method(D_METHOD("add_sphere","lats","lons","radius","add_uv"),&ImmediateGeometry::add_sphere,DEFVAL(true)); + ClassDB::bind_method(D_METHOD("end"),&ImmediateGeometry::end); + ClassDB::bind_method(D_METHOD("clear"),&ImmediateGeometry::clear); } diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp index c7464d3c5d..15ee971b7e 100644 --- a/scene/3d/interpolated_camera.cpp +++ b/scene/3d/interpolated_camera.cpp @@ -134,19 +134,19 @@ real_t InterpolatedCamera::get_speed() const { void InterpolatedCamera::_bind_methods() { - ClassDB::bind_method(_MD("set_target_path","target_path"),&InterpolatedCamera::set_target_path); - ClassDB::bind_method(_MD("get_target_path"),&InterpolatedCamera::get_target_path); - ClassDB::bind_method(_MD("set_target","target:Camera"),&InterpolatedCamera::_set_target); + ClassDB::bind_method(D_METHOD("set_target_path","target_path"),&InterpolatedCamera::set_target_path); + ClassDB::bind_method(D_METHOD("get_target_path"),&InterpolatedCamera::get_target_path); + ClassDB::bind_method(D_METHOD("set_target","target:Camera"),&InterpolatedCamera::_set_target); - ClassDB::bind_method(_MD("set_speed","speed"),&InterpolatedCamera::set_speed); - ClassDB::bind_method(_MD("get_speed"),&InterpolatedCamera::get_speed); + ClassDB::bind_method(D_METHOD("set_speed","speed"),&InterpolatedCamera::set_speed); + ClassDB::bind_method(D_METHOD("get_speed"),&InterpolatedCamera::get_speed); - ClassDB::bind_method(_MD("set_interpolation_enabled","target_path"),&InterpolatedCamera::set_interpolation_enabled); - ClassDB::bind_method(_MD("is_interpolation_enabled"),&InterpolatedCamera::is_interpolation_enabled); + ClassDB::bind_method(D_METHOD("set_interpolation_enabled","target_path"),&InterpolatedCamera::set_interpolation_enabled); + ClassDB::bind_method(D_METHOD("is_interpolation_enabled"),&InterpolatedCamera::is_interpolation_enabled); - ADD_PROPERTY( PropertyInfo(Variant::NODE_PATH,"target"), _SCS("set_target_path"), _SCS("get_target_path") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"speed"), _SCS("set_speed"), _SCS("get_speed") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"), _SCS("set_interpolation_enabled"), _SCS("is_interpolation_enabled") ); + ADD_PROPERTY( PropertyInfo(Variant::NODE_PATH,"target"), "set_target_path", "get_target_path") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"speed"), "set_speed", "get_speed") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"), "set_interpolation_enabled", "is_interpolation_enabled") ; } InterpolatedCamera::InterpolatedCamera() { diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 799c00d266..473bca8d3b 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "light.h" -#include "globals.h" +#include "global_config.h" #include "scene/resources/surface_tool.h" #include "baked_light_instance.h" @@ -221,42 +221,42 @@ bool Light::is_editor_only() const{ void Light::_bind_methods() { - ClassDB::bind_method(_MD("set_editor_only","editor_only"), &Light::set_editor_only ); - ClassDB::bind_method(_MD("is_editor_only"), &Light::is_editor_only ); + ClassDB::bind_method(D_METHOD("set_editor_only","editor_only"), &Light::set_editor_only ); + ClassDB::bind_method(D_METHOD("is_editor_only"), &Light::is_editor_only ); - ClassDB::bind_method(_MD("set_param","param","value"), &Light::set_param ); - ClassDB::bind_method(_MD("get_param","param"), &Light::get_param ); + ClassDB::bind_method(D_METHOD("set_param","param","value"), &Light::set_param ); + ClassDB::bind_method(D_METHOD("get_param","param"), &Light::get_param ); - ClassDB::bind_method(_MD("set_shadow","enabled"), &Light::set_shadow ); - ClassDB::bind_method(_MD("has_shadow"), &Light::has_shadow ); + ClassDB::bind_method(D_METHOD("set_shadow","enabled"), &Light::set_shadow ); + ClassDB::bind_method(D_METHOD("has_shadow"), &Light::has_shadow ); - ClassDB::bind_method(_MD("set_negative","enabled"), &Light::set_negative ); - ClassDB::bind_method(_MD("is_negative"), &Light::is_negative ); + ClassDB::bind_method(D_METHOD("set_negative","enabled"), &Light::set_negative ); + ClassDB::bind_method(D_METHOD("is_negative"), &Light::is_negative ); - ClassDB::bind_method(_MD("set_cull_mask","cull_mask"), &Light::set_cull_mask ); - ClassDB::bind_method(_MD("get_cull_mask"), &Light::get_cull_mask ); + ClassDB::bind_method(D_METHOD("set_cull_mask","cull_mask"), &Light::set_cull_mask ); + ClassDB::bind_method(D_METHOD("get_cull_mask"), &Light::get_cull_mask ); - ClassDB::bind_method(_MD("set_color","color"), &Light::set_color ); - ClassDB::bind_method(_MD("get_color"), &Light::get_color ); + ClassDB::bind_method(D_METHOD("set_color","color"), &Light::set_color ); + ClassDB::bind_method(D_METHOD("get_color"), &Light::get_color ); - ClassDB::bind_method(_MD("set_shadow_color","shadow_color"), &Light::set_shadow_color ); - ClassDB::bind_method(_MD("get_shadow_color"), &Light::get_shadow_color ); + ClassDB::bind_method(D_METHOD("set_shadow_color","shadow_color"), &Light::set_shadow_color ); + ClassDB::bind_method(D_METHOD("get_shadow_color"), &Light::get_shadow_color ); ADD_GROUP("Light","light_"); - ADD_PROPERTY( PropertyInfo( Variant::COLOR, "light_color",PROPERTY_HINT_COLOR_NO_ALPHA), _SCS("set_color"), _SCS("get_color")); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "light_energy",PROPERTY_HINT_RANGE,"0,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_ENERGY); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "light_negative"), _SCS("set_negative"), _SCS("is_negative")); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "light_specular",PROPERTY_HINT_RANGE,"0,1,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_SPECULAR); - ADD_PROPERTY( PropertyInfo( Variant::INT, "light_cull_mask",PROPERTY_HINT_LAYERS_3D_RENDER), _SCS("set_cull_mask"), _SCS("get_cull_mask")); + ADD_PROPERTY( PropertyInfo( Variant::COLOR, "light_color",PROPERTY_HINT_COLOR_NO_ALPHA), "set_color", "get_color"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "light_energy",PROPERTY_HINT_RANGE,"0,16,0.01"), "set_param", "get_param", PARAM_ENERGY); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "light_negative"), "set_negative", "is_negative"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "light_specular",PROPERTY_HINT_RANGE,"0,1,0.01"), "set_param", "get_param", PARAM_SPECULAR); + ADD_PROPERTY( PropertyInfo( Variant::INT, "light_cull_mask",PROPERTY_HINT_LAYERS_3D_RENDER), "set_cull_mask", "get_cull_mask"); ADD_GROUP("Shadow","shadow_"); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "shadow_enabled"), _SCS("set_shadow"), _SCS("has_shadow")); - ADD_PROPERTY( PropertyInfo( Variant::COLOR, "shadow_color",PROPERTY_HINT_COLOR_NO_ALPHA), _SCS("set_shadow_color"), _SCS("get_shadow_color")); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_bias",PROPERTY_HINT_RANGE,"-16,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_BIAS); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_contact",PROPERTY_HINT_RANGE,"0,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_CONTACT_SHADOW_SIZE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_max_distance",PROPERTY_HINT_RANGE,"0,65536,0.1"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_MAX_DISTANCE); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "shadow_enabled"), "set_shadow", "has_shadow"); + ADD_PROPERTY( PropertyInfo( Variant::COLOR, "shadow_color",PROPERTY_HINT_COLOR_NO_ALPHA), "set_shadow_color", "get_shadow_color"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_bias",PROPERTY_HINT_RANGE,"-16,16,0.01"), "set_param", "get_param", PARAM_SHADOW_BIAS); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_contact",PROPERTY_HINT_RANGE,"0,16,0.01"), "set_param", "get_param", PARAM_CONTACT_SHADOW_SIZE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_max_distance",PROPERTY_HINT_RANGE,"0,65536,0.1"), "set_param", "get_param", PARAM_SHADOW_MAX_DISTANCE); ADD_GROUP("Editor",""); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "editor_only"), _SCS("set_editor_only"), _SCS("is_editor_only")); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "editor_only"), "set_editor_only", "is_editor_only"); ADD_GROUP("",""); BIND_CONSTANT( PARAM_ENERGY ); @@ -352,20 +352,20 @@ bool DirectionalLight::is_blend_splits_enabled() const { void DirectionalLight::_bind_methods() { - ClassDB::bind_method( _MD("set_shadow_mode","mode"),&DirectionalLight::set_shadow_mode); - ClassDB::bind_method( _MD("get_shadow_mode"),&DirectionalLight::get_shadow_mode); + ClassDB::bind_method( D_METHOD("set_shadow_mode","mode"),&DirectionalLight::set_shadow_mode); + ClassDB::bind_method( D_METHOD("get_shadow_mode"),&DirectionalLight::get_shadow_mode); - ClassDB::bind_method( _MD("set_blend_splits","enabled"),&DirectionalLight::set_blend_splits); - ClassDB::bind_method( _MD("is_blend_splits_enabled"),&DirectionalLight::is_blend_splits_enabled); + ClassDB::bind_method( D_METHOD("set_blend_splits","enabled"),&DirectionalLight::set_blend_splits); + ClassDB::bind_method( D_METHOD("is_blend_splits_enabled"),&DirectionalLight::is_blend_splits_enabled); ADD_GROUP("Directional Shadow","directional_shadow_"); - ADD_PROPERTY( PropertyInfo( Variant::INT, "directional_shadow_mode",PROPERTY_HINT_ENUM,"Orthogonal,PSSM 2 Splits,PSSM 4 Splits"), _SCS("set_shadow_mode"), _SCS("get_shadow_mode")); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_split_1",PROPERTY_HINT_RANGE,"0,1,0.001"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_SPLIT_1_OFFSET); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_split_2",PROPERTY_HINT_RANGE,"0,1,0.001"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_SPLIT_2_OFFSET); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_split_3",PROPERTY_HINT_RANGE,"0,1,0.001"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_SPLIT_3_OFFSET); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "directional_shadow_blend_splits"), _SCS("set_blend_splits"), _SCS("is_blend_splits_enabled")); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_normal_bias",PROPERTY_HINT_RANGE,"0,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_NORMAL_BIAS); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_bias_split_scale",PROPERTY_HINT_RANGE,"0,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_BIAS_SPLIT_SCALE); + ADD_PROPERTY( PropertyInfo( Variant::INT, "directional_shadow_mode",PROPERTY_HINT_ENUM,"Orthogonal,PSSM 2 Splits,PSSM 4 Splits"), "set_shadow_mode", "get_shadow_mode"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_split_1",PROPERTY_HINT_RANGE,"0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_1_OFFSET); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_split_2",PROPERTY_HINT_RANGE,"0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_2_OFFSET); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_split_3",PROPERTY_HINT_RANGE,"0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_3_OFFSET); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "directional_shadow_blend_splits"), "set_blend_splits", "is_blend_splits_enabled"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_normal_bias",PROPERTY_HINT_RANGE,"0,16,0.01"), "set_param", "get_param", PARAM_SHADOW_NORMAL_BIAS); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_bias_split_scale",PROPERTY_HINT_RANGE,"0,16,0.01"), "set_param", "get_param", PARAM_SHADOW_BIAS_SPLIT_SCALE); BIND_CONSTANT( SHADOW_ORTHOGONAL ); BIND_CONSTANT( SHADOW_PARALLEL_2_SPLITS ); @@ -406,17 +406,17 @@ OmniLight::ShadowDetail OmniLight::get_shadow_detail() const{ void OmniLight::_bind_methods() { - ClassDB::bind_method( _MD("set_shadow_mode","mode"),&OmniLight::set_shadow_mode); - ClassDB::bind_method( _MD("get_shadow_mode"),&OmniLight::get_shadow_mode); + ClassDB::bind_method( D_METHOD("set_shadow_mode","mode"),&OmniLight::set_shadow_mode); + ClassDB::bind_method( D_METHOD("get_shadow_mode"),&OmniLight::get_shadow_mode); - ClassDB::bind_method( _MD("set_shadow_detail","detail"),&OmniLight::set_shadow_detail); - ClassDB::bind_method( _MD("get_shadow_detail"),&OmniLight::get_shadow_detail); + ClassDB::bind_method( D_METHOD("set_shadow_detail","detail"),&OmniLight::set_shadow_detail); + ClassDB::bind_method( D_METHOD("get_shadow_detail"),&OmniLight::get_shadow_detail); ADD_GROUP("Omni","omni_"); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "omni_range",PROPERTY_HINT_RANGE,"0,65536,0.1"), _SCS("set_param"), _SCS("get_param"), PARAM_RANGE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "omni_attenuation",PROPERTY_HINT_EXP_EASING), _SCS("set_param"), _SCS("get_param"), PARAM_ATTENUATION); - ADD_PROPERTY( PropertyInfo( Variant::INT, "omni_shadow_mode",PROPERTY_HINT_ENUM,"Dual Paraboloid,Cube"), _SCS("set_shadow_mode"), _SCS("get_shadow_mode")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "omni_shadow_detail",PROPERTY_HINT_ENUM,"Vertical,Horizontal"), _SCS("set_shadow_detail"), _SCS("get_shadow_detail")); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "omni_range",PROPERTY_HINT_RANGE,"0,65536,0.1"), "set_param", "get_param", PARAM_RANGE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "omni_attenuation",PROPERTY_HINT_EXP_EASING), "set_param", "get_param", PARAM_ATTENUATION); + ADD_PROPERTY( PropertyInfo( Variant::INT, "omni_shadow_mode",PROPERTY_HINT_ENUM,"Dual Paraboloid,Cube"), "set_shadow_mode", "get_shadow_mode"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "omni_shadow_detail",PROPERTY_HINT_ENUM,"Vertical,Horizontal"), "set_shadow_detail", "get_shadow_detail"); } @@ -430,9 +430,9 @@ OmniLight::OmniLight() : Light( VisualServer::LIGHT_OMNI ) { void SpotLight::_bind_methods() { ADD_GROUP("Spot","spot_"); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_range",PROPERTY_HINT_RANGE,"0,65536,0.1"), _SCS("set_param"), _SCS("get_param"), PARAM_RANGE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_attenuation",PROPERTY_HINT_EXP_EASING), _SCS("set_param"), _SCS("get_param"), PARAM_ATTENUATION); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_angle",PROPERTY_HINT_RANGE,"0,180,0.1"), _SCS("set_param"), _SCS("get_param"), PARAM_SPOT_ANGLE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_angle_attenuation",PROPERTY_HINT_EXP_EASING), _SCS("set_param"), _SCS("get_param"), PARAM_SPOT_ATTENUATION); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_range",PROPERTY_HINT_RANGE,"0,65536,0.1"), "set_param", "get_param", PARAM_RANGE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_attenuation",PROPERTY_HINT_EXP_EASING), "set_param", "get_param", PARAM_ATTENUATION); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_angle",PROPERTY_HINT_RANGE,"0,180,0.1"), "set_param", "get_param", PARAM_SPOT_ANGLE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_angle_attenuation",PROPERTY_HINT_EXP_EASING), "set_param", "get_param", PARAM_SPOT_ATTENUATION); } diff --git a/scene/3d/listener.cpp b/scene/3d/listener.cpp index 0aa1128bdb..578044ad09 100644 --- a/scene/3d/listener.cpp +++ b/scene/3d/listener.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* listener.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "listener.h" #include "scene/resources/mesh.h" @@ -146,10 +174,10 @@ RES Listener::_get_gizmo_geometry() const { void Listener::_bind_methods() { - ClassDB::bind_method( _MD("make_current"),&Listener::make_current ); - ClassDB::bind_method( _MD("clear_current"),&Listener::clear_current ); - ClassDB::bind_method( _MD("is_current"),&Listener::is_current ); - ClassDB::bind_method( _MD("get_listener_transform"),&Listener::get_listener_transform ); + ClassDB::bind_method( D_METHOD("make_current"),&Listener::make_current ); + ClassDB::bind_method( D_METHOD("clear_current"),&Listener::clear_current ); + ClassDB::bind_method( D_METHOD("is_current"),&Listener::is_current ); + ClassDB::bind_method( D_METHOD("get_listener_transform"),&Listener::get_listener_transform ); } Listener::Listener() { diff --git a/scene/3d/listener.h b/scene/3d/listener.h index be1b793716..3b6e39bec5 100644 --- a/scene/3d/listener.h +++ b/scene/3d/listener.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* listener.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 LISTENER_H #define LISTENER_H diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 2198f538b8..e6bd69aed2 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -294,19 +294,19 @@ void MeshInstance::_mesh_changed() { void MeshInstance::_bind_methods() { - ClassDB::bind_method(_MD("set_mesh","mesh:Mesh"),&MeshInstance::set_mesh); - ClassDB::bind_method(_MD("get_mesh:Mesh"),&MeshInstance::get_mesh); - ClassDB::bind_method(_MD("set_skeleton_path","skeleton_path:NodePath"),&MeshInstance::set_skeleton_path); - ClassDB::bind_method(_MD("get_skeleton_path:NodePath"),&MeshInstance::get_skeleton_path); + ClassDB::bind_method(D_METHOD("set_mesh","mesh:Mesh"),&MeshInstance::set_mesh); + ClassDB::bind_method(D_METHOD("get_mesh:Mesh"),&MeshInstance::get_mesh); + ClassDB::bind_method(D_METHOD("set_skeleton_path","skeleton_path:NodePath"),&MeshInstance::set_skeleton_path); + ClassDB::bind_method(D_METHOD("get_skeleton_path:NodePath"),&MeshInstance::get_skeleton_path); - ClassDB::bind_method(_MD("create_trimesh_collision"),&MeshInstance::create_trimesh_collision); + ClassDB::bind_method(D_METHOD("create_trimesh_collision"),&MeshInstance::create_trimesh_collision); ClassDB::set_method_flags("MeshInstance","create_trimesh_collision",METHOD_FLAGS_DEFAULT); - ClassDB::bind_method(_MD("create_convex_collision"),&MeshInstance::create_convex_collision); + ClassDB::bind_method(D_METHOD("create_convex_collision"),&MeshInstance::create_convex_collision); ClassDB::set_method_flags("MeshInstance","create_convex_collision",METHOD_FLAGS_DEFAULT); - ClassDB::bind_method(_MD("_mesh_changed"),&MeshInstance::_mesh_changed); + ClassDB::bind_method(D_METHOD("_mesh_changed"),&MeshInstance::_mesh_changed); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "mesh", PROPERTY_HINT_RESOURCE_TYPE, "Mesh" ), _SCS("set_mesh"), _SCS("get_mesh")); - ADD_PROPERTY( PropertyInfo (Variant::NODE_PATH, "skeleton"), _SCS("set_skeleton_path"), _SCS("get_skeleton_path")); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "mesh", PROPERTY_HINT_RESOURCE_TYPE, "Mesh" ), "set_mesh", "get_mesh"); + ADD_PROPERTY( PropertyInfo (Variant::NODE_PATH, "skeleton"), "set_skeleton_path", "get_skeleton_path"); } MeshInstance::MeshInstance() diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp index 31843fadaa..e1acdfca53 100644 --- a/scene/3d/multimesh_instance.cpp +++ b/scene/3d/multimesh_instance.cpp @@ -34,9 +34,9 @@ void MultiMeshInstance::_bind_methods() { - ClassDB::bind_method(_MD("set_multimesh","multimesh"),&MultiMeshInstance::set_multimesh); - ClassDB::bind_method(_MD("get_multimesh"),&MultiMeshInstance::get_multimesh); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"multimesh",PROPERTY_HINT_RESOURCE_TYPE,"MultiMesh"), _SCS("set_multimesh"), _SCS("get_multimesh")); + ClassDB::bind_method(D_METHOD("set_multimesh","multimesh"),&MultiMeshInstance::set_multimesh); + ClassDB::bind_method(D_METHOD("get_multimesh"),&MultiMeshInstance::get_multimesh); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"multimesh",PROPERTY_HINT_RESOURCE_TYPE,"MultiMesh"), "set_multimesh", "get_multimesh"); } diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index 38893598d6..5c8fe6bb67 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -730,20 +730,20 @@ Vector3 Navigation::get_up_vector() const{ void Navigation::_bind_methods() { - ClassDB::bind_method(_MD("navmesh_create","mesh:NavigationMesh","xform","owner"),&Navigation::navmesh_create,DEFVAL(Variant())); - ClassDB::bind_method(_MD("navmesh_set_transform","id","xform"),&Navigation::navmesh_set_transform); - ClassDB::bind_method(_MD("navmesh_remove","id"),&Navigation::navmesh_remove); + ClassDB::bind_method(D_METHOD("navmesh_create","mesh:NavigationMesh","xform","owner"),&Navigation::navmesh_create,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("navmesh_set_transform","id","xform"),&Navigation::navmesh_set_transform); + ClassDB::bind_method(D_METHOD("navmesh_remove","id"),&Navigation::navmesh_remove); - ClassDB::bind_method(_MD("get_simple_path","start","end","optimize"),&Navigation::get_simple_path,DEFVAL(true)); - ClassDB::bind_method(_MD("get_closest_point_to_segment","start","end","use_collision"),&Navigation::get_closest_point_to_segment,DEFVAL(false)); - ClassDB::bind_method(_MD("get_closest_point","to_point"),&Navigation::get_closest_point); - ClassDB::bind_method(_MD("get_closest_point_normal","to_point"),&Navigation::get_closest_point_normal); - ClassDB::bind_method(_MD("get_closest_point_owner","to_point"),&Navigation::get_closest_point_owner); + ClassDB::bind_method(D_METHOD("get_simple_path","start","end","optimize"),&Navigation::get_simple_path,DEFVAL(true)); + ClassDB::bind_method(D_METHOD("get_closest_point_to_segment","start","end","use_collision"),&Navigation::get_closest_point_to_segment,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_closest_point","to_point"),&Navigation::get_closest_point); + ClassDB::bind_method(D_METHOD("get_closest_point_normal","to_point"),&Navigation::get_closest_point_normal); + ClassDB::bind_method(D_METHOD("get_closest_point_owner","to_point"),&Navigation::get_closest_point_owner); - ClassDB::bind_method(_MD("set_up_vector","up"),&Navigation::set_up_vector); - ClassDB::bind_method(_MD("get_up_vector"),&Navigation::get_up_vector); + ClassDB::bind_method(D_METHOD("set_up_vector","up"),&Navigation::set_up_vector); + ClassDB::bind_method(D_METHOD("get_up_vector"),&Navigation::get_up_vector); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"up_vector"),_SCS("set_up_vector"),_SCS("get_up_vector")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"up_vector"),"set_up_vector","get_up_vector"); } Navigation::Navigation() { diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp index 4018045390..8efb9bb333 100644 --- a/scene/3d/navigation_mesh.cpp +++ b/scene/3d/navigation_mesh.cpp @@ -208,19 +208,19 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() { void NavigationMesh::_bind_methods() { - ClassDB::bind_method(_MD("set_vertices","vertices"),&NavigationMesh::set_vertices); - ClassDB::bind_method(_MD("get_vertices"),&NavigationMesh::get_vertices); + ClassDB::bind_method(D_METHOD("set_vertices","vertices"),&NavigationMesh::set_vertices); + ClassDB::bind_method(D_METHOD("get_vertices"),&NavigationMesh::get_vertices); - ClassDB::bind_method(_MD("add_polygon","polygon"),&NavigationMesh::add_polygon); - ClassDB::bind_method(_MD("get_polygon_count"),&NavigationMesh::get_polygon_count); - ClassDB::bind_method(_MD("get_polygon","idx"),&NavigationMesh::get_polygon); - ClassDB::bind_method(_MD("clear_polygons"),&NavigationMesh::clear_polygons); + ClassDB::bind_method(D_METHOD("add_polygon","polygon"),&NavigationMesh::add_polygon); + ClassDB::bind_method(D_METHOD("get_polygon_count"),&NavigationMesh::get_polygon_count); + ClassDB::bind_method(D_METHOD("get_polygon","idx"),&NavigationMesh::get_polygon); + ClassDB::bind_method(D_METHOD("clear_polygons"),&NavigationMesh::clear_polygons); - ClassDB::bind_method(_MD("_set_polygons","polygons"),&NavigationMesh::_set_polygons); - ClassDB::bind_method(_MD("_get_polygons"),&NavigationMesh::_get_polygons); + ClassDB::bind_method(D_METHOD("_set_polygons","polygons"),&NavigationMesh::_set_polygons); + ClassDB::bind_method(D_METHOD("_get_polygons"),&NavigationMesh::_get_polygons); - ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_polygons"),_SCS("_get_polygons")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_vertices","get_vertices"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_polygons","_get_polygons"); } NavigationMesh::NavigationMesh() { @@ -394,14 +394,14 @@ String NavigationMeshInstance::get_configuration_warning() const { void NavigationMeshInstance::_bind_methods() { - ClassDB::bind_method(_MD("set_navigation_mesh","navmesh"),&NavigationMeshInstance::set_navigation_mesh); - ClassDB::bind_method(_MD("get_navigation_mesh"),&NavigationMeshInstance::get_navigation_mesh); + ClassDB::bind_method(D_METHOD("set_navigation_mesh","navmesh"),&NavigationMeshInstance::set_navigation_mesh); + ClassDB::bind_method(D_METHOD("get_navigation_mesh"),&NavigationMeshInstance::get_navigation_mesh); - ClassDB::bind_method(_MD("set_enabled","enabled"),&NavigationMeshInstance::set_enabled); - ClassDB::bind_method(_MD("is_enabled"),&NavigationMeshInstance::is_enabled); + ClassDB::bind_method(D_METHOD("set_enabled","enabled"),&NavigationMeshInstance::set_enabled); + ClassDB::bind_method(D_METHOD("is_enabled"),&NavigationMeshInstance::is_enabled); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"navmesh",PROPERTY_HINT_RESOURCE_TYPE,"NavigationMesh"),_SCS("set_navigation_mesh"),_SCS("get_navigation_mesh")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"navmesh",PROPERTY_HINT_RESOURCE_TYPE,"NavigationMesh"),"set_navigation_mesh","get_navigation_mesh"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),"set_enabled","is_enabled"); } NavigationMeshInstance::NavigationMeshInstance() { diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 72fab4cccc..0e0c1e9dc6 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -406,79 +406,79 @@ RES Particles::_get_gizmo_geometry() const { void Particles::_bind_methods() { - ClassDB::bind_method(_MD("set_amount","amount"),&Particles::set_amount); - ClassDB::bind_method(_MD("get_amount"),&Particles::get_amount); - ClassDB::bind_method(_MD("set_emitting","enabled"),&Particles::set_emitting); - ClassDB::bind_method(_MD("is_emitting"),&Particles::is_emitting); - ClassDB::bind_method(_MD("set_visibility_aabb","aabb"),&Particles::set_visibility_aabb); - ClassDB::bind_method(_MD("get_visibility_aabb"),&Particles::get_visibility_aabb); - ClassDB::bind_method(_MD("set_emission_half_extents","half_extents"),&Particles::set_emission_half_extents); - ClassDB::bind_method(_MD("get_emission_half_extents"),&Particles::get_emission_half_extents); - ClassDB::bind_method(_MD("set_emission_base_velocity","base_velocity"),&Particles::set_emission_base_velocity); - ClassDB::bind_method(_MD("get_emission_base_velocity"),&Particles::get_emission_base_velocity); - ClassDB::bind_method(_MD("set_emission_points","points"),&Particles::set_emission_points); - ClassDB::bind_method(_MD("get_emission_points"),&Particles::get_emission_points); - ClassDB::bind_method(_MD("set_gravity_normal","normal"),&Particles::set_gravity_normal); - ClassDB::bind_method(_MD("get_gravity_normal"),&Particles::get_gravity_normal); - ClassDB::bind_method(_MD("set_variable","variable","value"),&Particles::set_variable); - ClassDB::bind_method(_MD("get_variable","variable"),&Particles::get_variable); - ClassDB::bind_method(_MD("set_randomness","variable","randomness"),&Particles::set_randomness); - ClassDB::bind_method(_MD("get_randomness","variable"),&Particles::get_randomness); - ClassDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles::set_color_phase_pos); - ClassDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles::get_color_phase_pos); - ClassDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles::set_color_phase_color); - ClassDB::bind_method(_MD("get_color_phase_color","phase"),&Particles::get_color_phase_color); - ClassDB::bind_method(_MD("set_material","material:Material"),&Particles::set_material); - ClassDB::bind_method(_MD("get_material:Material"),&Particles::get_material); - ClassDB::bind_method(_MD("set_emit_timeout","timeout"),&Particles::set_emit_timeout); - ClassDB::bind_method(_MD("get_emit_timeout"),&Particles::get_emit_timeout); - ClassDB::bind_method(_MD("set_height_from_velocity","enable"),&Particles::set_height_from_velocity); - ClassDB::bind_method(_MD("has_height_from_velocity"),&Particles::has_height_from_velocity); - ClassDB::bind_method(_MD("set_use_local_coordinates","enable"),&Particles::set_use_local_coordinates); - ClassDB::bind_method(_MD("is_using_local_coordinates"),&Particles::is_using_local_coordinates); - - ClassDB::bind_method(_MD("set_color_phases","count"),&Particles::set_color_phases); - ClassDB::bind_method(_MD("get_color_phases"),&Particles::get_color_phases); - - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "Material" ), _SCS("set_material"), _SCS("get_material") ); - - ADD_PROPERTY( PropertyInfo( Variant::INT, "amount", PROPERTY_HINT_RANGE, "1,1024,1" ), _SCS("set_amount"), _SCS("get_amount") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "emitting" ), _SCS("set_emitting"), _SCS("is_emitting") ); - ADD_PROPERTY( PropertyInfo( Variant::_AABB, "visibility" ), _SCS("set_visibility_aabb"), _SCS("get_visibility_aabb") ); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "emission_extents" ), _SCS("set_emission_half_extents"), _SCS("get_emission_half_extents") ); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "emission_base_velocity" ), _SCS("set_emission_base_velocity"), _SCS("get_emission_base_velocity") ); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "emission_points" ), _SCS("set_emission_points"), _SCS("get_emission_points") ); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "gravity_normal" ), _SCS("set_gravity_normal"), _SCS("get_gravity_normal") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "local_coords" ), _SCS("set_use_local_coordinates"), _SCS("is_using_local_coordinates") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "emit_timeout",PROPERTY_HINT_RANGE,"0,256,0.01"), _SCS("set_emit_timeout"), _SCS("get_emit_timeout") ); - - - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/lifetime", PROPERTY_HINT_RANGE,"0.1,60,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_LIFETIME ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/spread", PROPERTY_HINT_RANGE,"0,1,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_SPREAD ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/gravity", PROPERTY_HINT_RANGE,"-48,48,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_GRAVITY ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/linear_vel", PROPERTY_HINT_RANGE,"-100,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_LINEAR_VELOCITY ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/angular_vel", PROPERTY_HINT_RANGE,"-100,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_ANGULAR_VELOCITY ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/linear_accel", PROPERTY_HINT_RANGE,"-100,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_LINEAR_ACCELERATION ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/radial_accel", PROPERTY_HINT_RANGE,"-100,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_DRAG ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/tan_accel", PROPERTY_HINT_RANGE,"-100,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_TANGENTIAL_ACCELERATION ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/damping", PROPERTY_HINT_RANGE,"0,128,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_DAMPING ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/initial_size", PROPERTY_HINT_RANGE,"0,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_INITIAL_SIZE ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/final_size", PROPERTY_HINT_RANGE,"0,100,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_FINAL_SIZE ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/initial_angle",PROPERTY_HINT_RANGE,"0,1,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_INITIAL_ANGLE ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "vars/height_from_velocity"), _SCS("set_height_from_velocity"), _SCS("has_height_from_velocity") ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/height",PROPERTY_HINT_RANGE,"0,4096,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_HEIGHT); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/height_speed_scale",PROPERTY_HINT_RANGE,"0,4096,0.01"), _SCS("set_variable"), _SCS("get_variable"), VAR_HEIGHT_SPEED_SCALE ); + ClassDB::bind_method(D_METHOD("set_amount","amount"),&Particles::set_amount); + ClassDB::bind_method(D_METHOD("get_amount"),&Particles::get_amount); + ClassDB::bind_method(D_METHOD("set_emitting","enabled"),&Particles::set_emitting); + ClassDB::bind_method(D_METHOD("is_emitting"),&Particles::is_emitting); + ClassDB::bind_method(D_METHOD("set_visibility_aabb","aabb"),&Particles::set_visibility_aabb); + ClassDB::bind_method(D_METHOD("get_visibility_aabb"),&Particles::get_visibility_aabb); + ClassDB::bind_method(D_METHOD("set_emission_half_extents","half_extents"),&Particles::set_emission_half_extents); + ClassDB::bind_method(D_METHOD("get_emission_half_extents"),&Particles::get_emission_half_extents); + ClassDB::bind_method(D_METHOD("set_emission_base_velocity","base_velocity"),&Particles::set_emission_base_velocity); + ClassDB::bind_method(D_METHOD("get_emission_base_velocity"),&Particles::get_emission_base_velocity); + ClassDB::bind_method(D_METHOD("set_emission_points","points"),&Particles::set_emission_points); + ClassDB::bind_method(D_METHOD("get_emission_points"),&Particles::get_emission_points); + ClassDB::bind_method(D_METHOD("set_gravity_normal","normal"),&Particles::set_gravity_normal); + ClassDB::bind_method(D_METHOD("get_gravity_normal"),&Particles::get_gravity_normal); + ClassDB::bind_method(D_METHOD("set_variable","variable","value"),&Particles::set_variable); + ClassDB::bind_method(D_METHOD("get_variable","variable"),&Particles::get_variable); + ClassDB::bind_method(D_METHOD("set_randomness","variable","randomness"),&Particles::set_randomness); + ClassDB::bind_method(D_METHOD("get_randomness","variable"),&Particles::get_randomness); + ClassDB::bind_method(D_METHOD("set_color_phase_pos","phase","pos"),&Particles::set_color_phase_pos); + ClassDB::bind_method(D_METHOD("get_color_phase_pos","phase"),&Particles::get_color_phase_pos); + ClassDB::bind_method(D_METHOD("set_color_phase_color","phase","color"),&Particles::set_color_phase_color); + ClassDB::bind_method(D_METHOD("get_color_phase_color","phase"),&Particles::get_color_phase_color); + ClassDB::bind_method(D_METHOD("set_material","material:Material"),&Particles::set_material); + ClassDB::bind_method(D_METHOD("get_material:Material"),&Particles::get_material); + ClassDB::bind_method(D_METHOD("set_emit_timeout","timeout"),&Particles::set_emit_timeout); + ClassDB::bind_method(D_METHOD("get_emit_timeout"),&Particles::get_emit_timeout); + ClassDB::bind_method(D_METHOD("set_height_from_velocity","enable"),&Particles::set_height_from_velocity); + ClassDB::bind_method(D_METHOD("has_height_from_velocity"),&Particles::has_height_from_velocity); + ClassDB::bind_method(D_METHOD("set_use_local_coordinates","enable"),&Particles::set_use_local_coordinates); + ClassDB::bind_method(D_METHOD("is_using_local_coordinates"),&Particles::is_using_local_coordinates); + + ClassDB::bind_method(D_METHOD("set_color_phases","count"),&Particles::set_color_phases); + ClassDB::bind_method(D_METHOD("get_color_phases"),&Particles::get_color_phases); + + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "Material" ), "set_material", "get_material") ; + + ADD_PROPERTY( PropertyInfo( Variant::INT, "amount", PROPERTY_HINT_RANGE, "1,1024,1" ), "set_amount", "get_amount") ; + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "emitting" ), "set_emitting", "is_emitting") ; + ADD_PROPERTY( PropertyInfo( Variant::_AABB, "visibility" ), "set_visibility_aabb", "get_visibility_aabb") ; + ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "emission_extents" ), "set_emission_half_extents", "get_emission_half_extents") ; + ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "emission_base_velocity" ), "set_emission_base_velocity", "get_emission_base_velocity") ; + ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "emission_points" ), "set_emission_points", "get_emission_points") ; + ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "gravity_normal" ), "set_gravity_normal", "get_gravity_normal") ; + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "local_coords" ), "set_use_local_coordinates", "is_using_local_coordinates") ; + ADD_PROPERTY( PropertyInfo( Variant::REAL, "emit_timeout",PROPERTY_HINT_RANGE,"0,256,0.01"), "set_emit_timeout", "get_emit_timeout") ; + + + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/lifetime", PROPERTY_HINT_RANGE,"0.1,60,0.01"), "set_variable", "get_variable", VAR_LIFETIME ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/spread", PROPERTY_HINT_RANGE,"0,1,0.01"), "set_variable", "get_variable", VAR_SPREAD ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/gravity", PROPERTY_HINT_RANGE,"-48,48,0.01"), "set_variable", "get_variable", VAR_GRAVITY ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/linear_vel", PROPERTY_HINT_RANGE,"-100,100,0.01"), "set_variable", "get_variable", VAR_LINEAR_VELOCITY ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/angular_vel", PROPERTY_HINT_RANGE,"-100,100,0.01"), "set_variable", "get_variable", VAR_ANGULAR_VELOCITY ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/linear_accel", PROPERTY_HINT_RANGE,"-100,100,0.01"), "set_variable", "get_variable", VAR_LINEAR_ACCELERATION ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/radial_accel", PROPERTY_HINT_RANGE,"-100,100,0.01"), "set_variable", "get_variable", VAR_DRAG ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/tan_accel", PROPERTY_HINT_RANGE,"-100,100,0.01"), "set_variable", "get_variable", VAR_TANGENTIAL_ACCELERATION ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/damping", PROPERTY_HINT_RANGE,"0,128,0.01"), "set_variable", "get_variable", VAR_DAMPING ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/initial_size", PROPERTY_HINT_RANGE,"0,100,0.01"), "set_variable", "get_variable", VAR_INITIAL_SIZE ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/final_size", PROPERTY_HINT_RANGE,"0,100,0.01"), "set_variable", "get_variable", VAR_FINAL_SIZE ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/initial_angle",PROPERTY_HINT_RANGE,"0,1,0.01"), "set_variable", "get_variable", VAR_INITIAL_ANGLE ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "vars/height_from_velocity"), "set_height_from_velocity", "has_height_from_velocity") ; + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/height",PROPERTY_HINT_RANGE,"0,4096,0.01"), "set_variable", "get_variable", VAR_HEIGHT); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "vars/height_speed_scale",PROPERTY_HINT_RANGE,"0,4096,0.01"), "set_variable", "get_variable", VAR_HEIGHT_SPEED_SCALE ); for(int i=0;i<VAR_MAX;i++) - ADD_PROPERTYI( PropertyInfo( Variant::REAL, _rand_names[i], PROPERTY_HINT_RANGE,"-16.0,16.0,0.01"),_SCS("set_randomness"), _SCS("get_randomness"),_var_indices[i] ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, _rand_names[i], PROPERTY_HINT_RANGE,"-16.0,16.0,0.01"),"set_randomness", "get_randomness",_var_indices[i] ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "color_phases/count",PROPERTY_HINT_RANGE,"0,4,1"), _SCS("set_color_phases"), _SCS("get_color_phases")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "color_phases/count",PROPERTY_HINT_RANGE,"0,4,1"), "set_color_phases", "get_color_phases"); for(int i=0;i<VS::MAX_PARTICLE_COLOR_PHASES;i++) { String phase="phase_"+itos(i)+"/"; - ADD_PROPERTYI( PropertyInfo( Variant::REAL, phase+"pos", PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_color_phase_pos"),_SCS("get_color_phase_pos"),i ); - ADD_PROPERTYI( PropertyInfo( Variant::COLOR, phase+"color"),_SCS("set_color_phase_color"),_SCS("get_color_phase_color"),i ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, phase+"pos", PROPERTY_HINT_RANGE,"0,1,0.01"),"set_color_phase_pos","get_color_phase_pos",i ); + ADD_PROPERTYI( PropertyInfo( Variant::COLOR, phase+"color"),"set_color_phase_color","get_color_phase_color",i ); } BIND_CONSTANT( VAR_LIFETIME ); diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index 5e8ded3867..ead150e40b 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -80,11 +80,11 @@ Ref<Curve3D> Path::get_curve() const{ void Path::_bind_methods() { - ClassDB::bind_method(_MD("set_curve","curve:Curve3D"),&Path::set_curve); - ClassDB::bind_method(_MD("get_curve:Curve3D","curve"),&Path::get_curve); - ClassDB::bind_method(_MD("_curve_changed"),&Path::_curve_changed); + ClassDB::bind_method(D_METHOD("set_curve","curve:Curve3D"),&Path::set_curve); + ClassDB::bind_method(D_METHOD("get_curve:Curve3D","curve"),&Path::get_curve); + ClassDB::bind_method(D_METHOD("_curve_changed"),&Path::_curve_changed); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve3D"), _SCS("set_curve"),_SCS("get_curve")); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve3D"), "set_curve","get_curve"); } Path::Path() { @@ -257,26 +257,26 @@ void PathFollow::_get_property_list( List<PropertyInfo> *p_list) const{ void PathFollow::_bind_methods() { - ClassDB::bind_method(_MD("set_offset","offset"),&PathFollow::set_offset); - ClassDB::bind_method(_MD("get_offset"),&PathFollow::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","offset"),&PathFollow::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&PathFollow::get_offset); - ClassDB::bind_method(_MD("set_h_offset","h_offset"),&PathFollow::set_h_offset); - ClassDB::bind_method(_MD("get_h_offset"),&PathFollow::get_h_offset); + ClassDB::bind_method(D_METHOD("set_h_offset","h_offset"),&PathFollow::set_h_offset); + ClassDB::bind_method(D_METHOD("get_h_offset"),&PathFollow::get_h_offset); - ClassDB::bind_method(_MD("set_v_offset","v_offset"),&PathFollow::set_v_offset); - ClassDB::bind_method(_MD("get_v_offset"),&PathFollow::get_v_offset); + ClassDB::bind_method(D_METHOD("set_v_offset","v_offset"),&PathFollow::set_v_offset); + ClassDB::bind_method(D_METHOD("get_v_offset"),&PathFollow::get_v_offset); - ClassDB::bind_method(_MD("set_unit_offset","unit_offset"),&PathFollow::set_unit_offset); - ClassDB::bind_method(_MD("get_unit_offset"),&PathFollow::get_unit_offset); + ClassDB::bind_method(D_METHOD("set_unit_offset","unit_offset"),&PathFollow::set_unit_offset); + ClassDB::bind_method(D_METHOD("get_unit_offset"),&PathFollow::get_unit_offset); - ClassDB::bind_method(_MD("set_rotation_mode","rotation_mode"),&PathFollow::set_rotation_mode); - ClassDB::bind_method(_MD("get_rotation_mode"),&PathFollow::get_rotation_mode); + ClassDB::bind_method(D_METHOD("set_rotation_mode","rotation_mode"),&PathFollow::set_rotation_mode); + ClassDB::bind_method(D_METHOD("get_rotation_mode"),&PathFollow::get_rotation_mode); - ClassDB::bind_method(_MD("set_cubic_interpolation","enable"),&PathFollow::set_cubic_interpolation); - ClassDB::bind_method(_MD("get_cubic_interpolation"),&PathFollow::get_cubic_interpolation); + ClassDB::bind_method(D_METHOD("set_cubic_interpolation","enable"),&PathFollow::set_cubic_interpolation); + ClassDB::bind_method(D_METHOD("get_cubic_interpolation"),&PathFollow::get_cubic_interpolation); - ClassDB::bind_method(_MD("set_loop","loop"),&PathFollow::set_loop); - ClassDB::bind_method(_MD("has_loop"),&PathFollow::has_loop); + ClassDB::bind_method(D_METHOD("set_loop","loop"),&PathFollow::set_loop); + ClassDB::bind_method(D_METHOD("has_loop"),&PathFollow::has_loop); BIND_CONSTANT( ROTATION_NONE ); BIND_CONSTANT( ROTATION_Y ); diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 0a44ad9c3d..af514a171f 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -147,24 +147,24 @@ uint32_t PhysicsBody::_get_layers() const{ } void PhysicsBody::_bind_methods() { - ClassDB::bind_method(_MD("set_collision_layer","layer"),&PhysicsBody::set_collision_layer); - ClassDB::bind_method(_MD("get_collision_layer"),&PhysicsBody::get_collision_layer); + ClassDB::bind_method(D_METHOD("set_collision_layer","layer"),&PhysicsBody::set_collision_layer); + ClassDB::bind_method(D_METHOD("get_collision_layer"),&PhysicsBody::get_collision_layer); - ClassDB::bind_method(_MD("set_collision_mask","mask"),&PhysicsBody::set_collision_mask); - ClassDB::bind_method(_MD("get_collision_mask"),&PhysicsBody::get_collision_mask); + ClassDB::bind_method(D_METHOD("set_collision_mask","mask"),&PhysicsBody::set_collision_mask); + ClassDB::bind_method(D_METHOD("get_collision_mask"),&PhysicsBody::get_collision_mask); - ClassDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&PhysicsBody::set_collision_mask_bit); - ClassDB::bind_method(_MD("get_collision_mask_bit","bit"),&PhysicsBody::get_collision_mask_bit); + ClassDB::bind_method(D_METHOD("set_collision_mask_bit","bit","value"),&PhysicsBody::set_collision_mask_bit); + ClassDB::bind_method(D_METHOD("get_collision_mask_bit","bit"),&PhysicsBody::get_collision_mask_bit); - ClassDB::bind_method(_MD("set_collision_layer_bit","bit","value"),&PhysicsBody::set_collision_layer_bit); - ClassDB::bind_method(_MD("get_collision_layer_bit","bit"),&PhysicsBody::get_collision_layer_bit); + ClassDB::bind_method(D_METHOD("set_collision_layer_bit","bit","value"),&PhysicsBody::set_collision_layer_bit); + ClassDB::bind_method(D_METHOD("get_collision_layer_bit","bit"),&PhysicsBody::get_collision_layer_bit); - ClassDB::bind_method(_MD("_set_layers","mask"),&PhysicsBody::_set_layers); - ClassDB::bind_method(_MD("_get_layers"),&PhysicsBody::_get_layers); + ClassDB::bind_method(D_METHOD("_set_layers","mask"),&PhysicsBody::_set_layers); + ClassDB::bind_method(D_METHOD("_get_layers"),&PhysicsBody::_get_layers); ADD_GROUP("Collision","collision_"); - ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_layer",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_collision_layer"),_SCS("get_collision_layer")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_layer",PROPERTY_HINT_LAYERS_3D_PHYSICS),"set_collision_layer","get_collision_layer"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_3D_PHYSICS),"set_collision_mask","get_collision_mask"); } @@ -230,25 +230,25 @@ Vector3 StaticBody::get_constant_angular_velocity() const { void StaticBody::_bind_methods() { - ClassDB::bind_method(_MD("set_constant_linear_velocity","vel"),&StaticBody::set_constant_linear_velocity); - ClassDB::bind_method(_MD("set_constant_angular_velocity","vel"),&StaticBody::set_constant_angular_velocity); - ClassDB::bind_method(_MD("get_constant_linear_velocity"),&StaticBody::get_constant_linear_velocity); - ClassDB::bind_method(_MD("get_constant_angular_velocity"),&StaticBody::get_constant_angular_velocity); + ClassDB::bind_method(D_METHOD("set_constant_linear_velocity","vel"),&StaticBody::set_constant_linear_velocity); + ClassDB::bind_method(D_METHOD("set_constant_angular_velocity","vel"),&StaticBody::set_constant_angular_velocity); + ClassDB::bind_method(D_METHOD("get_constant_linear_velocity"),&StaticBody::get_constant_linear_velocity); + ClassDB::bind_method(D_METHOD("get_constant_angular_velocity"),&StaticBody::get_constant_angular_velocity); - ClassDB::bind_method(_MD("set_friction","friction"),&StaticBody::set_friction); - ClassDB::bind_method(_MD("get_friction"),&StaticBody::get_friction); + ClassDB::bind_method(D_METHOD("set_friction","friction"),&StaticBody::set_friction); + ClassDB::bind_method(D_METHOD("get_friction"),&StaticBody::get_friction); - ClassDB::bind_method(_MD("set_bounce","bounce"),&StaticBody::set_bounce); - ClassDB::bind_method(_MD("get_bounce"),&StaticBody::get_bounce); + ClassDB::bind_method(D_METHOD("set_bounce","bounce"),&StaticBody::set_bounce); + ClassDB::bind_method(D_METHOD("get_bounce"),&StaticBody::get_bounce); - ClassDB::bind_method(_MD("add_collision_exception_with","body:PhysicsBody"),&PhysicsBody::add_collision_exception_with); - ClassDB::bind_method(_MD("remove_collision_exception_with","body:PhysicsBody"),&PhysicsBody::remove_collision_exception_with); + ClassDB::bind_method(D_METHOD("add_collision_exception_with","body:PhysicsBody"),&PhysicsBody::add_collision_exception_with); + ClassDB::bind_method(D_METHOD("remove_collision_exception_with","body:PhysicsBody"),&PhysicsBody::remove_collision_exception_with); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_friction"),_SCS("get_friction")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_bounce"),_SCS("get_bounce")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_friction","get_friction"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_bounce","get_bounce"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3,"constant_linear_velocity"),_SCS("set_constant_linear_velocity"),_SCS("get_constant_linear_velocity")); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3,"constant_angular_velocity"),_SCS("set_constant_angular_velocity"),_SCS("get_constant_angular_velocity")); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3,"constant_linear_velocity"),"set_constant_linear_velocity","get_constant_linear_velocity"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3,"constant_angular_velocity"),"set_constant_angular_velocity","get_constant_angular_velocity"); } StaticBody::StaticBody() : PhysicsBody(PhysicsServer::BODY_MODE_STATIC) { @@ -800,88 +800,88 @@ Array RigidBody::get_colliding_bodies() const { void RigidBody::_bind_methods() { - ClassDB::bind_method(_MD("set_mode","mode"),&RigidBody::set_mode); - ClassDB::bind_method(_MD("get_mode"),&RigidBody::get_mode); + ClassDB::bind_method(D_METHOD("set_mode","mode"),&RigidBody::set_mode); + ClassDB::bind_method(D_METHOD("get_mode"),&RigidBody::get_mode); - ClassDB::bind_method(_MD("set_mass","mass"),&RigidBody::set_mass); - ClassDB::bind_method(_MD("get_mass"),&RigidBody::get_mass); + ClassDB::bind_method(D_METHOD("set_mass","mass"),&RigidBody::set_mass); + ClassDB::bind_method(D_METHOD("get_mass"),&RigidBody::get_mass); - ClassDB::bind_method(_MD("set_weight","weight"),&RigidBody::set_weight); - ClassDB::bind_method(_MD("get_weight"),&RigidBody::get_weight); + ClassDB::bind_method(D_METHOD("set_weight","weight"),&RigidBody::set_weight); + ClassDB::bind_method(D_METHOD("get_weight"),&RigidBody::get_weight); - ClassDB::bind_method(_MD("set_friction","friction"),&RigidBody::set_friction); - ClassDB::bind_method(_MD("get_friction"),&RigidBody::get_friction); + ClassDB::bind_method(D_METHOD("set_friction","friction"),&RigidBody::set_friction); + ClassDB::bind_method(D_METHOD("get_friction"),&RigidBody::get_friction); - ClassDB::bind_method(_MD("set_bounce","bounce"),&RigidBody::set_bounce); - ClassDB::bind_method(_MD("get_bounce"),&RigidBody::get_bounce); + ClassDB::bind_method(D_METHOD("set_bounce","bounce"),&RigidBody::set_bounce); + ClassDB::bind_method(D_METHOD("get_bounce"),&RigidBody::get_bounce); - ClassDB::bind_method(_MD("set_linear_velocity","linear_velocity"),&RigidBody::set_linear_velocity); - ClassDB::bind_method(_MD("get_linear_velocity"),&RigidBody::get_linear_velocity); + ClassDB::bind_method(D_METHOD("set_linear_velocity","linear_velocity"),&RigidBody::set_linear_velocity); + ClassDB::bind_method(D_METHOD("get_linear_velocity"),&RigidBody::get_linear_velocity); - ClassDB::bind_method(_MD("set_angular_velocity","angular_velocity"),&RigidBody::set_angular_velocity); - ClassDB::bind_method(_MD("get_angular_velocity"),&RigidBody::get_angular_velocity); + ClassDB::bind_method(D_METHOD("set_angular_velocity","angular_velocity"),&RigidBody::set_angular_velocity); + ClassDB::bind_method(D_METHOD("get_angular_velocity"),&RigidBody::get_angular_velocity); - ClassDB::bind_method(_MD("set_gravity_scale","gravity_scale"),&RigidBody::set_gravity_scale); - ClassDB::bind_method(_MD("get_gravity_scale"),&RigidBody::get_gravity_scale); + ClassDB::bind_method(D_METHOD("set_gravity_scale","gravity_scale"),&RigidBody::set_gravity_scale); + ClassDB::bind_method(D_METHOD("get_gravity_scale"),&RigidBody::get_gravity_scale); - ClassDB::bind_method(_MD("set_linear_damp","linear_damp"),&RigidBody::set_linear_damp); - ClassDB::bind_method(_MD("get_linear_damp"),&RigidBody::get_linear_damp); + ClassDB::bind_method(D_METHOD("set_linear_damp","linear_damp"),&RigidBody::set_linear_damp); + ClassDB::bind_method(D_METHOD("get_linear_damp"),&RigidBody::get_linear_damp); - ClassDB::bind_method(_MD("set_angular_damp","angular_damp"),&RigidBody::set_angular_damp); - ClassDB::bind_method(_MD("get_angular_damp"),&RigidBody::get_angular_damp); + ClassDB::bind_method(D_METHOD("set_angular_damp","angular_damp"),&RigidBody::set_angular_damp); + ClassDB::bind_method(D_METHOD("get_angular_damp"),&RigidBody::get_angular_damp); - ClassDB::bind_method(_MD("set_max_contacts_reported","amount"),&RigidBody::set_max_contacts_reported); - ClassDB::bind_method(_MD("get_max_contacts_reported"),&RigidBody::get_max_contacts_reported); + ClassDB::bind_method(D_METHOD("set_max_contacts_reported","amount"),&RigidBody::set_max_contacts_reported); + ClassDB::bind_method(D_METHOD("get_max_contacts_reported"),&RigidBody::get_max_contacts_reported); - ClassDB::bind_method(_MD("set_use_custom_integrator","enable"),&RigidBody::set_use_custom_integrator); - ClassDB::bind_method(_MD("is_using_custom_integrator"),&RigidBody::is_using_custom_integrator); + ClassDB::bind_method(D_METHOD("set_use_custom_integrator","enable"),&RigidBody::set_use_custom_integrator); + ClassDB::bind_method(D_METHOD("is_using_custom_integrator"),&RigidBody::is_using_custom_integrator); - ClassDB::bind_method(_MD("set_contact_monitor","enabled"),&RigidBody::set_contact_monitor); - ClassDB::bind_method(_MD("is_contact_monitor_enabled"),&RigidBody::is_contact_monitor_enabled); + ClassDB::bind_method(D_METHOD("set_contact_monitor","enabled"),&RigidBody::set_contact_monitor); + ClassDB::bind_method(D_METHOD("is_contact_monitor_enabled"),&RigidBody::is_contact_monitor_enabled); - ClassDB::bind_method(_MD("set_use_continuous_collision_detection","enable"),&RigidBody::set_use_continuous_collision_detection); - ClassDB::bind_method(_MD("is_using_continuous_collision_detection"),&RigidBody::is_using_continuous_collision_detection); + ClassDB::bind_method(D_METHOD("set_use_continuous_collision_detection","enable"),&RigidBody::set_use_continuous_collision_detection); + ClassDB::bind_method(D_METHOD("is_using_continuous_collision_detection"),&RigidBody::is_using_continuous_collision_detection); - ClassDB::bind_method(_MD("set_axis_velocity","axis_velocity"),&RigidBody::set_axis_velocity); - ClassDB::bind_method(_MD("apply_impulse","pos","impulse"),&RigidBody::apply_impulse); + ClassDB::bind_method(D_METHOD("set_axis_velocity","axis_velocity"),&RigidBody::set_axis_velocity); + ClassDB::bind_method(D_METHOD("apply_impulse","pos","impulse"),&RigidBody::apply_impulse); - ClassDB::bind_method(_MD("set_sleeping","sleeping"),&RigidBody::set_sleeping); - ClassDB::bind_method(_MD("is_sleeping"),&RigidBody::is_sleeping); + ClassDB::bind_method(D_METHOD("set_sleeping","sleeping"),&RigidBody::set_sleeping); + ClassDB::bind_method(D_METHOD("is_sleeping"),&RigidBody::is_sleeping); - ClassDB::bind_method(_MD("set_can_sleep","able_to_sleep"),&RigidBody::set_can_sleep); - ClassDB::bind_method(_MD("is_able_to_sleep"),&RigidBody::is_able_to_sleep); + ClassDB::bind_method(D_METHOD("set_can_sleep","able_to_sleep"),&RigidBody::set_can_sleep); + ClassDB::bind_method(D_METHOD("is_able_to_sleep"),&RigidBody::is_able_to_sleep); - ClassDB::bind_method(_MD("_direct_state_changed"),&RigidBody::_direct_state_changed); - ClassDB::bind_method(_MD("_body_enter_tree"),&RigidBody::_body_enter_tree); - ClassDB::bind_method(_MD("_body_exit_tree"),&RigidBody::_body_exit_tree); + ClassDB::bind_method(D_METHOD("_direct_state_changed"),&RigidBody::_direct_state_changed); + ClassDB::bind_method(D_METHOD("_body_enter_tree"),&RigidBody::_body_enter_tree); + ClassDB::bind_method(D_METHOD("_body_exit_tree"),&RigidBody::_body_exit_tree); - ClassDB::bind_method(_MD("set_axis_lock","axis_lock"),&RigidBody::set_axis_lock); - ClassDB::bind_method(_MD("get_axis_lock"),&RigidBody::get_axis_lock); + ClassDB::bind_method(D_METHOD("set_axis_lock","axis_lock"),&RigidBody::set_axis_lock); + ClassDB::bind_method(D_METHOD("get_axis_lock"),&RigidBody::get_axis_lock); - ClassDB::bind_method(_MD("get_colliding_bodies"),&RigidBody::get_colliding_bodies); + ClassDB::bind_method(D_METHOD("get_colliding_bodies"),&RigidBody::get_colliding_bodies); BIND_VMETHOD(MethodInfo("_integrate_forces",PropertyInfo(Variant::OBJECT,"state:PhysicsDirectBodyState"))); - ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Rigid,Static,Character,Kinematic"),_SCS("set_mode"),_SCS("get_mode")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"mass",PROPERTY_HINT_EXP_RANGE,"0.01,65535,0.01"),_SCS("set_mass"),_SCS("get_mass")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"weight",PROPERTY_HINT_EXP_RANGE,"0.01,65535,0.01",PROPERTY_USAGE_EDITOR),_SCS("set_weight"),_SCS("get_weight")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_friction"),_SCS("get_friction")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_bounce"),_SCS("get_bounce")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity_scale",PROPERTY_HINT_RANGE,"-128,128,0.01"),_SCS("set_gravity_scale"),_SCS("get_gravity_scale")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"custom_integrator"),_SCS("set_use_custom_integrator"),_SCS("is_using_custom_integrator")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"continuous_cd"),_SCS("set_use_continuous_collision_detection"),_SCS("is_using_continuous_collision_detection")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"contacts_reported"),_SCS("set_max_contacts_reported"),_SCS("get_max_contacts_reported")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"contact_monitor"),_SCS("set_contact_monitor"),_SCS("is_contact_monitor_enabled")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"sleeping"),_SCS("set_sleeping"),_SCS("is_sleeping")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"can_sleep"),_SCS("set_can_sleep"),_SCS("is_able_to_sleep")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"axis_lock",PROPERTY_HINT_ENUM,"Disabled,Lock X,Lock Y,Lock Z"),_SCS("set_axis_lock"),_SCS("get_axis_lock")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Rigid,Static,Character,Kinematic"),"set_mode","get_mode"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"mass",PROPERTY_HINT_EXP_RANGE,"0.01,65535,0.01"),"set_mass","get_mass"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"weight",PROPERTY_HINT_EXP_RANGE,"0.01,65535,0.01",PROPERTY_USAGE_EDITOR),"set_weight","get_weight"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_friction","get_friction"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_bounce","get_bounce"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"gravity_scale",PROPERTY_HINT_RANGE,"-128,128,0.01"),"set_gravity_scale","get_gravity_scale"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"custom_integrator"),"set_use_custom_integrator","is_using_custom_integrator"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"continuous_cd"),"set_use_continuous_collision_detection","is_using_continuous_collision_detection"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"contacts_reported"),"set_max_contacts_reported","get_max_contacts_reported"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"contact_monitor"),"set_contact_monitor","is_contact_monitor_enabled"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"sleeping"),"set_sleeping","is_sleeping"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"can_sleep"),"set_can_sleep","is_able_to_sleep"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"axis_lock",PROPERTY_HINT_ENUM,"Disabled,Lock X,Lock Y,Lock Z"),"set_axis_lock","get_axis_lock"); ADD_GROUP("Linear","linear_"); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"linear_velocity"),_SCS("set_linear_velocity"),_SCS("get_linear_velocity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"linear_velocity"),"set_linear_velocity","get_linear_velocity"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),"set_linear_damp","get_linear_damp"); ADD_GROUP("Angular","angular_"); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"angular_velocity"),_SCS("set_angular_velocity"),_SCS("get_angular_velocity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"angular_velocity"),"set_angular_velocity","get_angular_velocity"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),"set_angular_damp","get_angular_damp"); ADD_SIGNAL( MethodInfo("body_shape_entered",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"local_shape"))); ADD_SIGNAL( MethodInfo("body_shape_exited",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"local_shape"))); @@ -1298,40 +1298,40 @@ float KinematicBody::get_collision_margin() const{ void KinematicBody::_bind_methods() { - ClassDB::bind_method(_MD("move","rel_vec"),&KinematicBody::move); - ClassDB::bind_method(_MD("move_to","position"),&KinematicBody::move_to); + ClassDB::bind_method(D_METHOD("move","rel_vec"),&KinematicBody::move); + ClassDB::bind_method(D_METHOD("move_to","position"),&KinematicBody::move_to); - ClassDB::bind_method(_MD("can_teleport_to","position"),&KinematicBody::can_teleport_to); + ClassDB::bind_method(D_METHOD("can_teleport_to","position"),&KinematicBody::can_teleport_to); - ClassDB::bind_method(_MD("is_colliding"),&KinematicBody::is_colliding); + ClassDB::bind_method(D_METHOD("is_colliding"),&KinematicBody::is_colliding); - ClassDB::bind_method(_MD("get_collision_pos"),&KinematicBody::get_collision_pos); - ClassDB::bind_method(_MD("get_collision_normal"),&KinematicBody::get_collision_normal); - ClassDB::bind_method(_MD("get_collider_velocity"),&KinematicBody::get_collider_velocity); - ClassDB::bind_method(_MD("get_collider:Variant"),&KinematicBody::_get_collider); - ClassDB::bind_method(_MD("get_collider_shape"),&KinematicBody::get_collider_shape); + ClassDB::bind_method(D_METHOD("get_collision_pos"),&KinematicBody::get_collision_pos); + ClassDB::bind_method(D_METHOD("get_collision_normal"),&KinematicBody::get_collision_normal); + ClassDB::bind_method(D_METHOD("get_collider_velocity"),&KinematicBody::get_collider_velocity); + ClassDB::bind_method(D_METHOD("get_collider:Variant"),&KinematicBody::_get_collider); + ClassDB::bind_method(D_METHOD("get_collider_shape"),&KinematicBody::get_collider_shape); - ClassDB::bind_method(_MD("set_collide_with_static_bodies","enable"),&KinematicBody::set_collide_with_static_bodies); - ClassDB::bind_method(_MD("can_collide_with_static_bodies"),&KinematicBody::can_collide_with_static_bodies); + ClassDB::bind_method(D_METHOD("set_collide_with_static_bodies","enable"),&KinematicBody::set_collide_with_static_bodies); + ClassDB::bind_method(D_METHOD("can_collide_with_static_bodies"),&KinematicBody::can_collide_with_static_bodies); - ClassDB::bind_method(_MD("set_collide_with_kinematic_bodies","enable"),&KinematicBody::set_collide_with_kinematic_bodies); - ClassDB::bind_method(_MD("can_collide_with_kinematic_bodies"),&KinematicBody::can_collide_with_kinematic_bodies); + ClassDB::bind_method(D_METHOD("set_collide_with_kinematic_bodies","enable"),&KinematicBody::set_collide_with_kinematic_bodies); + ClassDB::bind_method(D_METHOD("can_collide_with_kinematic_bodies"),&KinematicBody::can_collide_with_kinematic_bodies); - ClassDB::bind_method(_MD("set_collide_with_rigid_bodies","enable"),&KinematicBody::set_collide_with_rigid_bodies); - ClassDB::bind_method(_MD("can_collide_with_rigid_bodies"),&KinematicBody::can_collide_with_rigid_bodies); + ClassDB::bind_method(D_METHOD("set_collide_with_rigid_bodies","enable"),&KinematicBody::set_collide_with_rigid_bodies); + ClassDB::bind_method(D_METHOD("can_collide_with_rigid_bodies"),&KinematicBody::can_collide_with_rigid_bodies); - ClassDB::bind_method(_MD("set_collide_with_character_bodies","enable"),&KinematicBody::set_collide_with_character_bodies); - ClassDB::bind_method(_MD("can_collide_with_character_bodies"),&KinematicBody::can_collide_with_character_bodies); + ClassDB::bind_method(D_METHOD("set_collide_with_character_bodies","enable"),&KinematicBody::set_collide_with_character_bodies); + ClassDB::bind_method(D_METHOD("can_collide_with_character_bodies"),&KinematicBody::can_collide_with_character_bodies); - ClassDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody::set_collision_margin); - ClassDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody::get_collision_margin); + ClassDB::bind_method(D_METHOD("set_collision_margin","pixels"),&KinematicBody::set_collision_margin); + ClassDB::bind_method(D_METHOD("get_collision_margin","pixels"),&KinematicBody::get_collision_margin); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collide_with/static"),_SCS("set_collide_with_static_bodies"),_SCS("can_collide_with_static_bodies")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collide_with/kinematic"),_SCS("set_collide_with_kinematic_bodies"),_SCS("can_collide_with_kinematic_bodies")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collide_with/rigid"),_SCS("set_collide_with_rigid_bodies"),_SCS("can_collide_with_rigid_bodies")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collide_with/character"),_SCS("set_collide_with_character_bodies"),_SCS("can_collide_with_character_bodies")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision/margin",PROPERTY_HINT_RANGE,"0.001,256,0.001"),_SCS("set_collision_margin"),_SCS("get_collision_margin")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collide_with/static"),"set_collide_with_static_bodies","can_collide_with_static_bodies"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collide_with/kinematic"),"set_collide_with_kinematic_bodies","can_collide_with_kinematic_bodies"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collide_with/rigid"),"set_collide_with_rigid_bodies","can_collide_with_rigid_bodies"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collide_with/character"),"set_collide_with_character_bodies","can_collide_with_character_bodies"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision/margin",PROPERTY_HINT_RANGE,"0.001,256,0.001"),"set_collision_margin","get_collision_margin"); } diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp index f2668480f5..d48d75f464 100644 --- a/scene/3d/physics_joint.cpp +++ b/scene/3d/physics_joint.cpp @@ -167,23 +167,23 @@ bool Joint::get_exclude_nodes_from_collision() const{ void Joint::_bind_methods() { - ClassDB::bind_method( _MD("set_node_a","node"), &Joint::set_node_a ); - ClassDB::bind_method( _MD("get_node_a"), &Joint::get_node_a ); + ClassDB::bind_method( D_METHOD("set_node_a","node"), &Joint::set_node_a ); + ClassDB::bind_method( D_METHOD("get_node_a"), &Joint::get_node_a ); - ClassDB::bind_method( _MD("set_node_b","node"), &Joint::set_node_b ); - ClassDB::bind_method( _MD("get_node_b"), &Joint::get_node_b ); + ClassDB::bind_method( D_METHOD("set_node_b","node"), &Joint::set_node_b ); + ClassDB::bind_method( D_METHOD("get_node_b"), &Joint::get_node_b ); - ClassDB::bind_method( _MD("set_solver_priority","priority"), &Joint::set_solver_priority ); - ClassDB::bind_method( _MD("get_solver_priority"), &Joint::get_solver_priority ); + ClassDB::bind_method( D_METHOD("set_solver_priority","priority"), &Joint::set_solver_priority ); + ClassDB::bind_method( D_METHOD("get_solver_priority"), &Joint::get_solver_priority ); - ClassDB::bind_method( _MD("set_exclude_nodes_from_collision","enable"), &Joint::set_exclude_nodes_from_collision ); - ClassDB::bind_method( _MD("get_exclude_nodes_from_collision"), &Joint::get_exclude_nodes_from_collision ); + ClassDB::bind_method( D_METHOD("set_exclude_nodes_from_collision","enable"), &Joint::set_exclude_nodes_from_collision ); + ClassDB::bind_method( D_METHOD("get_exclude_nodes_from_collision"), &Joint::get_exclude_nodes_from_collision ); - ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "nodes/node_a"), _SCS("set_node_a"),_SCS("get_node_a") ); - ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "nodes/node_b"), _SCS("set_node_b"),_SCS("get_node_b") ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "solver/priority",PROPERTY_HINT_RANGE,"1,8,1"), _SCS("set_solver_priority"),_SCS("get_solver_priority") ); + ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "nodes/node_a"), "set_node_a","get_node_a") ; + ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "nodes/node_b"), "set_node_b","get_node_b") ; + ADD_PROPERTY( PropertyInfo( Variant::INT, "solver/priority",PROPERTY_HINT_RANGE,"1,8,1"), "set_solver_priority","get_solver_priority") ; - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "collision/exclude_nodes"), _SCS("set_exclude_nodes_from_collision"),_SCS("get_exclude_nodes_from_collision") ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "collision/exclude_nodes"), "set_exclude_nodes_from_collision","get_exclude_nodes_from_collision") ; @@ -203,12 +203,12 @@ Joint::Joint() { void PinJoint::_bind_methods() { - ClassDB::bind_method(_MD("set_param","param","value"),&PinJoint::set_param); - ClassDB::bind_method(_MD("get_param","param"),&PinJoint::get_param); + ClassDB::bind_method(D_METHOD("set_param","param","value"),&PinJoint::set_param); + ClassDB::bind_method(D_METHOD("get_param","param"),&PinJoint::get_param); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/bias",PROPERTY_HINT_RANGE,"0.01,0.99,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_BIAS ); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/damping",PROPERTY_HINT_RANGE,"0.01,8.0,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_DAMPING ); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/impulse_clamp",PROPERTY_HINT_RANGE,"0.0,64.0,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_IMPULSE_CLAMP ); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/bias",PROPERTY_HINT_RANGE,"0.01,0.99,0.01"),"set_param","get_param", PARAM_BIAS ); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/damping",PROPERTY_HINT_RANGE,"0.01,8.0,0.01"),"set_param","get_param", PARAM_DAMPING ); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/impulse_clamp",PROPERTY_HINT_RANGE,"0.0,64.0,0.01"),"set_param","get_param", PARAM_IMPULSE_CLAMP ); BIND_CONSTANT( PARAM_BIAS ); BIND_CONSTANT( PARAM_DAMPING ); @@ -292,30 +292,30 @@ float HingeJoint::_get_lower_limit() const { void HingeJoint::_bind_methods() { - ClassDB::bind_method(_MD("set_param","param","value"),&HingeJoint::set_param); - ClassDB::bind_method(_MD("get_param","param"),&HingeJoint::get_param); + ClassDB::bind_method(D_METHOD("set_param","param","value"),&HingeJoint::set_param); + ClassDB::bind_method(D_METHOD("get_param","param"),&HingeJoint::get_param); - ClassDB::bind_method(_MD("set_flag","flag","enabled"),&HingeJoint::set_flag); - ClassDB::bind_method(_MD("get_flag","flag"),&HingeJoint::get_flag); + ClassDB::bind_method(D_METHOD("set_flag","flag","enabled"),&HingeJoint::set_flag); + ClassDB::bind_method(D_METHOD("get_flag","flag"),&HingeJoint::get_flag); - ClassDB::bind_method(_MD("_set_upper_limit","upper_limit"),&HingeJoint::_set_upper_limit); - ClassDB::bind_method(_MD("_get_upper_limit"),&HingeJoint::_get_upper_limit); + ClassDB::bind_method(D_METHOD("_set_upper_limit","upper_limit"),&HingeJoint::_set_upper_limit); + ClassDB::bind_method(D_METHOD("_get_upper_limit"),&HingeJoint::_get_upper_limit); - ClassDB::bind_method(_MD("_set_lower_limit","lower_limit"),&HingeJoint::_set_lower_limit); - ClassDB::bind_method(_MD("_get_lower_limit"),&HingeJoint::_get_lower_limit); + ClassDB::bind_method(D_METHOD("_set_lower_limit","lower_limit"),&HingeJoint::_set_lower_limit); + ClassDB::bind_method(D_METHOD("_get_lower_limit"),&HingeJoint::_get_lower_limit); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/bias",PROPERTY_HINT_RANGE,"0.01,0.99,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_BIAS ); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/bias",PROPERTY_HINT_RANGE,"0.01,0.99,0.01"),"set_param","get_param", PARAM_BIAS ); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"angular_limit/enable"),_SCS("set_flag"),_SCS("get_flag"), FLAG_USE_LIMIT ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_limit/upper",PROPERTY_HINT_RANGE,"-180,180,0.1"),_SCS("_set_upper_limit"),_SCS("_get_upper_limit") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_limit/lower",PROPERTY_HINT_RANGE,"-180,180,0.1"),_SCS("_set_lower_limit"),_SCS("_get_lower_limit") ); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/bias",PROPERTY_HINT_RANGE,"0.01,0.99,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_LIMIT_BIAS ); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_LIMIT_SOFTNESS ); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/relaxation",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_LIMIT_RELAXATION ); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"angular_limit/enable"),"set_flag","get_flag", FLAG_USE_LIMIT ); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_limit/upper",PROPERTY_HINT_RANGE,"-180,180,0.1"),"_set_upper_limit","_get_upper_limit") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_limit/lower",PROPERTY_HINT_RANGE,"-180,180,0.1"),"_set_lower_limit","_get_lower_limit") ; + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/bias",PROPERTY_HINT_RANGE,"0.01,0.99,0.01"),"set_param","get_param", PARAM_LIMIT_BIAS ); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param","get_param", PARAM_LIMIT_SOFTNESS ); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/relaxation",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param","get_param", PARAM_LIMIT_RELAXATION ); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"motor/enable"),_SCS("set_flag"),_SCS("get_flag"), FLAG_ENABLE_MOTOR ); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"motor/target_velocity",PROPERTY_HINT_RANGE,"0.01,4096,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_MOTOR_TARGET_VELOCITY ); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"motor/max_impulse",PROPERTY_HINT_RANGE,"0.01,1024,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_MOTOR_MAX_IMPULSE); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"motor/enable"),"set_flag","get_flag", FLAG_ENABLE_MOTOR ); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"motor/target_velocity",PROPERTY_HINT_RANGE,"0.01,4096,0.01"),"set_param","get_param", PARAM_MOTOR_TARGET_VELOCITY ); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"motor/max_impulse",PROPERTY_HINT_RANGE,"0.01,1024,0.01"),"set_param","get_param", PARAM_MOTOR_MAX_IMPULSE); BIND_CONSTANT( PARAM_BIAS ); @@ -447,40 +447,40 @@ float SliderJoint::_get_lower_limit_angular() const { void SliderJoint::_bind_methods() { - ClassDB::bind_method(_MD("set_param","param","value"),&SliderJoint::set_param); - ClassDB::bind_method(_MD("get_param","param"),&SliderJoint::get_param); + ClassDB::bind_method(D_METHOD("set_param","param","value"),&SliderJoint::set_param); + ClassDB::bind_method(D_METHOD("get_param","param"),&SliderJoint::get_param); - ClassDB::bind_method(_MD("_set_upper_limit_angular","upper_limit_angular"),&SliderJoint::_set_upper_limit_angular); - ClassDB::bind_method(_MD("_get_upper_limit_angular"),&SliderJoint::_get_upper_limit_angular); + ClassDB::bind_method(D_METHOD("_set_upper_limit_angular","upper_limit_angular"),&SliderJoint::_set_upper_limit_angular); + ClassDB::bind_method(D_METHOD("_get_upper_limit_angular"),&SliderJoint::_get_upper_limit_angular); - ClassDB::bind_method(_MD("_set_lower_limit_angular","lower_limit_angular"),&SliderJoint::_set_lower_limit_angular); - ClassDB::bind_method(_MD("_get_lower_limit_angular"),&SliderJoint::_get_lower_limit_angular); + ClassDB::bind_method(D_METHOD("_set_lower_limit_angular","lower_limit_angular"),&SliderJoint::_set_lower_limit_angular); + ClassDB::bind_method(D_METHOD("_get_lower_limit_angular"),&SliderJoint::_get_lower_limit_angular); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/upper_distance",PROPERTY_HINT_RANGE,"-1024,1024,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_LIMIT_UPPER); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/lower_distance",PROPERTY_HINT_RANGE,"-1024,1024,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_LIMIT_LOWER); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_LIMIT_SOFTNESS); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_LIMIT_RESTITUTION); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_LIMIT_DAMPING); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_motion/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_MOTION_SOFTNESS); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_motion/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_MOTION_RESTITUTION); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_motion/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_MOTION_DAMPING); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_ortho/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_ORTHOGONAL_SOFTNESS); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_ortho/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_ORTHOGONAL_RESTITUTION); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_ortho/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_ORTHOGONAL_DAMPING); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/upper_distance",PROPERTY_HINT_RANGE,"-1024,1024,0.01"),"set_param","get_param", PARAM_LINEAR_LIMIT_UPPER); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/lower_distance",PROPERTY_HINT_RANGE,"-1024,1024,0.01"),"set_param","get_param", PARAM_LINEAR_LIMIT_LOWER); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_LINEAR_LIMIT_SOFTNESS); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_LINEAR_LIMIT_RESTITUTION); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,"set_param","get_param", PARAM_LINEAR_LIMIT_DAMPING); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_motion/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_LINEAR_MOTION_SOFTNESS); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_motion/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_LINEAR_MOTION_RESTITUTION); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_motion/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,"set_param","get_param", PARAM_LINEAR_MOTION_DAMPING); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_ortho/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_LINEAR_ORTHOGONAL_SOFTNESS); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_ortho/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_LINEAR_ORTHOGONAL_RESTITUTION); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_ortho/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,"set_param","get_param", PARAM_LINEAR_ORTHOGONAL_DAMPING); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_limit/upper_angle",PROPERTY_HINT_RANGE,"-180,180,0.1"),_SCS("_set_upper_limit_angular"),_SCS("_get_upper_limit_angular") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_limit/lower_angle",PROPERTY_HINT_RANGE,"-180,180,0.1"),_SCS("_set_lower_limit_angular"),_SCS("_get_lower_limit_angular") ); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_ANGULAR_LIMIT_SOFTNESS); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_ANGULAR_LIMIT_RESTITUTION); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_ANGULAR_LIMIT_DAMPING); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_motion/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_ANGULAR_MOTION_SOFTNESS); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_motion/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_ANGULAR_MOTION_RESTITUTION); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_motion/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_ANGULAR_MOTION_DAMPING); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_ortho/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_ANGULAR_ORTHOGONAL_SOFTNESS); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_ortho/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_ANGULAR_ORTHOGONAL_RESTITUTION); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_ortho/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_ANGULAR_ORTHOGONAL_DAMPING); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_limit/upper_angle",PROPERTY_HINT_RANGE,"-180,180,0.1"),"_set_upper_limit_angular","_get_upper_limit_angular") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_limit/lower_angle",PROPERTY_HINT_RANGE,"-180,180,0.1"),"_set_lower_limit_angular","_get_lower_limit_angular") ; + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_ANGULAR_LIMIT_SOFTNESS); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_ANGULAR_LIMIT_RESTITUTION); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_limit/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,"set_param","get_param", PARAM_ANGULAR_LIMIT_DAMPING); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_motion/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_ANGULAR_MOTION_SOFTNESS); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_motion/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_ANGULAR_MOTION_RESTITUTION); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_motion/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,"set_param","get_param", PARAM_ANGULAR_MOTION_DAMPING); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_ortho/softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_ANGULAR_ORTHOGONAL_SOFTNESS); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_ortho/restitution",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_ANGULAR_ORTHOGONAL_RESTITUTION); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"angular_ortho/damping",PROPERTY_HINT_RANGE,"0,16.0,0.01") ,"set_param","get_param", PARAM_ANGULAR_ORTHOGONAL_DAMPING); BIND_CONSTANT( PARAM_LINEAR_LIMIT_UPPER); @@ -612,24 +612,24 @@ float ConeTwistJoint::_get_twist_span() const { void ConeTwistJoint::_bind_methods() { - ClassDB::bind_method(_MD("set_param","param","value"),&ConeTwistJoint::set_param); - ClassDB::bind_method(_MD("get_param","param"),&ConeTwistJoint::get_param); + ClassDB::bind_method(D_METHOD("set_param","param","value"),&ConeTwistJoint::set_param); + ClassDB::bind_method(D_METHOD("get_param","param"),&ConeTwistJoint::get_param); - ClassDB::bind_method(_MD("_set_swing_span","swing_span"),&ConeTwistJoint::_set_swing_span); - ClassDB::bind_method(_MD("_get_swing_span"),&ConeTwistJoint::_get_swing_span); + ClassDB::bind_method(D_METHOD("_set_swing_span","swing_span"),&ConeTwistJoint::_set_swing_span); + ClassDB::bind_method(D_METHOD("_get_swing_span"),&ConeTwistJoint::_get_swing_span); - ClassDB::bind_method(_MD("_set_twist_span","twist_span"),&ConeTwistJoint::_set_twist_span); - ClassDB::bind_method(_MD("_get_twist_span"),&ConeTwistJoint::_get_twist_span); + ClassDB::bind_method(D_METHOD("_set_twist_span","twist_span"),&ConeTwistJoint::_set_twist_span); + ClassDB::bind_method(D_METHOD("_get_twist_span"),&ConeTwistJoint::_get_twist_span); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"swing_span",PROPERTY_HINT_RANGE,"-180,180,0.1"),_SCS("_set_swing_span"),_SCS("_get_swing_span") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"twist_span",PROPERTY_HINT_RANGE,"-40000,40000,0.1"),_SCS("_set_twist_span"),_SCS("_get_twist_span") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"swing_span",PROPERTY_HINT_RANGE,"-180,180,0.1"),"_set_swing_span","_get_swing_span") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"twist_span",PROPERTY_HINT_RANGE,"-40000,40000,0.1"),"_set_twist_span","_get_twist_span") ; - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"bias",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_BIAS ); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_SOFTNESS); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"relaxation",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,_SCS("set_param"),_SCS("get_param"), PARAM_RELAXATION); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"bias",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_BIAS ); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"softness",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_SOFTNESS); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"relaxation",PROPERTY_HINT_RANGE,"0.01,16.0,0.01") ,"set_param","get_param", PARAM_RELAXATION); BIND_CONSTANT( PARAM_SWING_SPAN ); BIND_CONSTANT( PARAM_TWIST_SPAN ); @@ -771,96 +771,96 @@ float Generic6DOFJoint::_get_angular_lo_limit_z() const{ void Generic6DOFJoint::_bind_methods(){ - ClassDB::bind_method(_MD("_set_angular_hi_limit_x","angle"),&Generic6DOFJoint::_set_angular_hi_limit_x); - ClassDB::bind_method(_MD("_get_angular_hi_limit_x"),&Generic6DOFJoint::_get_angular_hi_limit_x); - - ClassDB::bind_method(_MD("_set_angular_lo_limit_x","angle"),&Generic6DOFJoint::_set_angular_lo_limit_x); - ClassDB::bind_method(_MD("_get_angular_lo_limit_x"),&Generic6DOFJoint::_get_angular_lo_limit_x); - - ClassDB::bind_method(_MD("_set_angular_hi_limit_y","angle"),&Generic6DOFJoint::_set_angular_hi_limit_y); - ClassDB::bind_method(_MD("_get_angular_hi_limit_y"),&Generic6DOFJoint::_get_angular_hi_limit_y); - - ClassDB::bind_method(_MD("_set_angular_lo_limit_y","angle"),&Generic6DOFJoint::_set_angular_lo_limit_y); - ClassDB::bind_method(_MD("_get_angular_lo_limit_y"),&Generic6DOFJoint::_get_angular_lo_limit_y); - - ClassDB::bind_method(_MD("_set_angular_hi_limit_z","angle"),&Generic6DOFJoint::_set_angular_hi_limit_z); - ClassDB::bind_method(_MD("_get_angular_hi_limit_z"),&Generic6DOFJoint::_get_angular_hi_limit_z); - - ClassDB::bind_method(_MD("_set_angular_lo_limit_z","angle"),&Generic6DOFJoint::_set_angular_lo_limit_z); - ClassDB::bind_method(_MD("_get_angular_lo_limit_z"),&Generic6DOFJoint::_get_angular_lo_limit_z); - - ClassDB::bind_method(_MD("set_param_x","param","value"),&Generic6DOFJoint::set_param_x); - ClassDB::bind_method(_MD("get_param_x","param"),&Generic6DOFJoint::get_param_x); - - ClassDB::bind_method(_MD("set_param_y","param","value"),&Generic6DOFJoint::set_param_y); - ClassDB::bind_method(_MD("get_param_y","param"),&Generic6DOFJoint::get_param_y); - - ClassDB::bind_method(_MD("set_param_z","param","value"),&Generic6DOFJoint::set_param_z); - ClassDB::bind_method(_MD("get_param_z","param"),&Generic6DOFJoint::get_param_z); - - ClassDB::bind_method(_MD("set_flag_x","flag","value"),&Generic6DOFJoint::set_flag_x); - ClassDB::bind_method(_MD("get_flag_x","flag"),&Generic6DOFJoint::get_flag_x); - - ClassDB::bind_method(_MD("set_flag_y","flag","value"),&Generic6DOFJoint::set_flag_y); - ClassDB::bind_method(_MD("get_flag_y","flag"),&Generic6DOFJoint::get_flag_y); - - ClassDB::bind_method(_MD("set_flag_z","flag","value"),&Generic6DOFJoint::set_flag_z); - ClassDB::bind_method(_MD("get_flag_z","flag"),&Generic6DOFJoint::get_flag_z); - - - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"linear_limit_x/enabled"),_SCS("set_flag_x"),_SCS("get_flag_x"),FLAG_ENABLE_LINEAR_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_x/upper_distance"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_LINEAR_UPPER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_x/lower_distance"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_LINEAR_LOWER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_x/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_LINEAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_x/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_LINEAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_x/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_LINEAR_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_limit_x/enabled"),_SCS("set_flag_x"),_SCS("get_flag_x"),FLAG_ENABLE_ANGULAR_LIMIT); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_x/upper_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),_SCS("_set_angular_hi_limit_x"),_SCS("_get_angular_hi_limit_x")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_x/lower_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),_SCS("_set_angular_lo_limit_x"),_SCS("_get_angular_lo_limit_x")); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_x/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_ANGULAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_x/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_ANGULAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_x/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_ANGULAR_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_x/force_limit"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_ANGULAR_FORCE_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_x/erp"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_ANGULAR_ERP); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_motor_x/enabled"),_SCS("set_flag_x"),_SCS("get_flag_x"),FLAG_ENABLE_MOTOR); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_x/target_velocity"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_x/force_limit"),_SCS("set_param_x"),_SCS("get_param_x"),PARAM_ANGULAR_MOTOR_FORCE_LIMIT); - - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"linear_limit_y/enabled"),_SCS("set_flag_y"),_SCS("get_flag_y"),FLAG_ENABLE_LINEAR_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_y/upper_distance"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_LINEAR_UPPER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_y/lower_distance"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_LINEAR_LOWER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_y/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_LINEAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_y/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_LINEAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_y/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_LINEAR_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_limit_y/enabled"),_SCS("set_flag_y"),_SCS("get_flag_y"),FLAG_ENABLE_ANGULAR_LIMIT); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_y/upper_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),_SCS("_set_angular_hi_limit_y"),_SCS("_get_angular_hi_limit_y")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_y/lower_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),_SCS("_set_angular_lo_limit_y"),_SCS("_get_angular_lo_limit_y")); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_y/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_ANGULAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_y/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_ANGULAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_y/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_ANGULAR_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_y/force_limit"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_ANGULAR_FORCE_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_y/erp"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_ANGULAR_ERP); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_motor_y/enabled"),_SCS("set_flag_y"),_SCS("get_flag_y"),FLAG_ENABLE_MOTOR); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_y/target_velocity"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_y/force_limit"),_SCS("set_param_y"),_SCS("get_param_y"),PARAM_ANGULAR_MOTOR_FORCE_LIMIT); - - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"linear_limit_z/enabled"),_SCS("set_flag_z"),_SCS("get_flag_z"),FLAG_ENABLE_LINEAR_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_z/upper_distance"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_LINEAR_UPPER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_z/lower_distance"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_LINEAR_LOWER_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_z/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_LINEAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_z/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_LINEAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_z/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_LINEAR_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_limit_z/enabled"),_SCS("set_flag_z"),_SCS("get_flag_z"),FLAG_ENABLE_ANGULAR_LIMIT); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_z/upper_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),_SCS("_set_angular_hi_limit_z"),_SCS("_get_angular_hi_limit_z")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_z/lower_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),_SCS("_set_angular_lo_limit_z"),_SCS("_get_angular_lo_limit_z")); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_z/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_ANGULAR_LIMIT_SOFTNESS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_z/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_ANGULAR_RESTITUTION); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_z/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_ANGULAR_DAMPING); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_z/force_limit"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_ANGULAR_FORCE_LIMIT); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_z/erp"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_ANGULAR_ERP); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_motor_z/enabled"),_SCS("set_flag_z"),_SCS("get_flag_z"),FLAG_ENABLE_MOTOR); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_z/target_velocity"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_z/force_limit"),_SCS("set_param_z"),_SCS("get_param_z"),PARAM_ANGULAR_MOTOR_FORCE_LIMIT); + ClassDB::bind_method(D_METHOD("_set_angular_hi_limit_x","angle"),&Generic6DOFJoint::_set_angular_hi_limit_x); + ClassDB::bind_method(D_METHOD("_get_angular_hi_limit_x"),&Generic6DOFJoint::_get_angular_hi_limit_x); + + ClassDB::bind_method(D_METHOD("_set_angular_lo_limit_x","angle"),&Generic6DOFJoint::_set_angular_lo_limit_x); + ClassDB::bind_method(D_METHOD("_get_angular_lo_limit_x"),&Generic6DOFJoint::_get_angular_lo_limit_x); + + ClassDB::bind_method(D_METHOD("_set_angular_hi_limit_y","angle"),&Generic6DOFJoint::_set_angular_hi_limit_y); + ClassDB::bind_method(D_METHOD("_get_angular_hi_limit_y"),&Generic6DOFJoint::_get_angular_hi_limit_y); + + ClassDB::bind_method(D_METHOD("_set_angular_lo_limit_y","angle"),&Generic6DOFJoint::_set_angular_lo_limit_y); + ClassDB::bind_method(D_METHOD("_get_angular_lo_limit_y"),&Generic6DOFJoint::_get_angular_lo_limit_y); + + ClassDB::bind_method(D_METHOD("_set_angular_hi_limit_z","angle"),&Generic6DOFJoint::_set_angular_hi_limit_z); + ClassDB::bind_method(D_METHOD("_get_angular_hi_limit_z"),&Generic6DOFJoint::_get_angular_hi_limit_z); + + ClassDB::bind_method(D_METHOD("_set_angular_lo_limit_z","angle"),&Generic6DOFJoint::_set_angular_lo_limit_z); + ClassDB::bind_method(D_METHOD("_get_angular_lo_limit_z"),&Generic6DOFJoint::_get_angular_lo_limit_z); + + ClassDB::bind_method(D_METHOD("set_param_x","param","value"),&Generic6DOFJoint::set_param_x); + ClassDB::bind_method(D_METHOD("get_param_x","param"),&Generic6DOFJoint::get_param_x); + + ClassDB::bind_method(D_METHOD("set_param_y","param","value"),&Generic6DOFJoint::set_param_y); + ClassDB::bind_method(D_METHOD("get_param_y","param"),&Generic6DOFJoint::get_param_y); + + ClassDB::bind_method(D_METHOD("set_param_z","param","value"),&Generic6DOFJoint::set_param_z); + ClassDB::bind_method(D_METHOD("get_param_z","param"),&Generic6DOFJoint::get_param_z); + + ClassDB::bind_method(D_METHOD("set_flag_x","flag","value"),&Generic6DOFJoint::set_flag_x); + ClassDB::bind_method(D_METHOD("get_flag_x","flag"),&Generic6DOFJoint::get_flag_x); + + ClassDB::bind_method(D_METHOD("set_flag_y","flag","value"),&Generic6DOFJoint::set_flag_y); + ClassDB::bind_method(D_METHOD("get_flag_y","flag"),&Generic6DOFJoint::get_flag_y); + + ClassDB::bind_method(D_METHOD("set_flag_z","flag","value"),&Generic6DOFJoint::set_flag_z); + ClassDB::bind_method(D_METHOD("get_flag_z","flag"),&Generic6DOFJoint::get_flag_z); + + + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"linear_limit_x/enabled"),"set_flag_x","get_flag_x",FLAG_ENABLE_LINEAR_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_x/upper_distance"),"set_param_x","get_param_x",PARAM_LINEAR_UPPER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_x/lower_distance"),"set_param_x","get_param_x",PARAM_LINEAR_LOWER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_x/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_x","get_param_x",PARAM_LINEAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_x/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_x","get_param_x",PARAM_LINEAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_x/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_x","get_param_x",PARAM_LINEAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_limit_x/enabled"),"set_flag_x","get_flag_x",FLAG_ENABLE_ANGULAR_LIMIT); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_x/upper_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),"_set_angular_hi_limit_x","_get_angular_hi_limit_x"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_x/lower_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),"_set_angular_lo_limit_x","_get_angular_lo_limit_x"); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_x/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_x","get_param_x",PARAM_ANGULAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_x/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_x","get_param_x",PARAM_ANGULAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_x/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_x","get_param_x",PARAM_ANGULAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_x/force_limit"),"set_param_x","get_param_x",PARAM_ANGULAR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_x/erp"),"set_param_x","get_param_x",PARAM_ANGULAR_ERP); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_motor_x/enabled"),"set_flag_x","get_flag_x",FLAG_ENABLE_MOTOR); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_x/target_velocity"),"set_param_x","get_param_x",PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_x/force_limit"),"set_param_x","get_param_x",PARAM_ANGULAR_MOTOR_FORCE_LIMIT); + + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"linear_limit_y/enabled"),"set_flag_y","get_flag_y",FLAG_ENABLE_LINEAR_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_y/upper_distance"),"set_param_y","get_param_y",PARAM_LINEAR_UPPER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_y/lower_distance"),"set_param_y","get_param_y",PARAM_LINEAR_LOWER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_y/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_y","get_param_y",PARAM_LINEAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_y/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_y","get_param_y",PARAM_LINEAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_y/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_y","get_param_y",PARAM_LINEAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_limit_y/enabled"),"set_flag_y","get_flag_y",FLAG_ENABLE_ANGULAR_LIMIT); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_y/upper_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),"_set_angular_hi_limit_y","_get_angular_hi_limit_y"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_y/lower_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),"_set_angular_lo_limit_y","_get_angular_lo_limit_y"); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_y/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_y","get_param_y",PARAM_ANGULAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_y/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_y","get_param_y",PARAM_ANGULAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_y/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_y","get_param_y",PARAM_ANGULAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_y/force_limit"),"set_param_y","get_param_y",PARAM_ANGULAR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_y/erp"),"set_param_y","get_param_y",PARAM_ANGULAR_ERP); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_motor_y/enabled"),"set_flag_y","get_flag_y",FLAG_ENABLE_MOTOR); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_y/target_velocity"),"set_param_y","get_param_y",PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_y/force_limit"),"set_param_y","get_param_y",PARAM_ANGULAR_MOTOR_FORCE_LIMIT); + + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"linear_limit_z/enabled"),"set_flag_z","get_flag_z",FLAG_ENABLE_LINEAR_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_z/upper_distance"),"set_param_z","get_param_z",PARAM_LINEAR_UPPER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_z/lower_distance"),"set_param_z","get_param_z",PARAM_LINEAR_LOWER_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_z/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_z","get_param_z",PARAM_LINEAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_z/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_z","get_param_z",PARAM_LINEAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"linear_limit_z/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_z","get_param_z",PARAM_LINEAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_limit_z/enabled"),"set_flag_z","get_flag_z",FLAG_ENABLE_ANGULAR_LIMIT); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_z/upper_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),"_set_angular_hi_limit_z","_get_angular_hi_limit_z"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"angular_limit_z/lower_angle",PROPERTY_HINT_RANGE,"-180,180,0.01"),"_set_angular_lo_limit_z","_get_angular_lo_limit_z"); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_z/softness",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_z","get_param_z",PARAM_ANGULAR_LIMIT_SOFTNESS); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_z/restitution",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_z","get_param_z",PARAM_ANGULAR_RESTITUTION); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_z/damping",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_param_z","get_param_z",PARAM_ANGULAR_DAMPING); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_z/force_limit"),"set_param_z","get_param_z",PARAM_ANGULAR_FORCE_LIMIT); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_limit_z/erp"),"set_param_z","get_param_z",PARAM_ANGULAR_ERP); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"angular_motor_z/enabled"),"set_flag_z","get_flag_z",FLAG_ENABLE_MOTOR); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_z/target_velocity"),"set_param_z","get_param_z",PARAM_ANGULAR_MOTOR_TARGET_VELOCITY); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"angular_motor_z/force_limit"),"set_param_z","get_param_z",PARAM_ANGULAR_MOTOR_FORCE_LIMIT); BIND_CONSTANT( PARAM_LINEAR_LOWER_LIMIT); @@ -1171,22 +1171,22 @@ RID PhysicsJoint::_get_visual_instance_rid() const { void PhysicsJoint::_bind_methods() { - ClassDB::bind_method(_MD("_get_visual_instance_rid"),&PhysicsJoint::_get_visual_instance_rid); - ClassDB::bind_method(_MD("set_body_A","path"),&PhysicsJoint::set_body_A); - ClassDB::bind_method(_MD("set_body_B"),&PhysicsJoint::set_body_B); - ClassDB::bind_method(_MD("get_body_A","path"),&PhysicsJoint::get_body_A); - ClassDB::bind_method(_MD("get_body_B"),&PhysicsJoint::get_body_B); + ClassDB::bind_method(D_METHOD("_get_visual_instance_rid"),&PhysicsJoint::_get_visual_instance_rid); + ClassDB::bind_method(D_METHOD("set_body_A","path"),&PhysicsJoint::set_body_A); + ClassDB::bind_method(D_METHOD("set_body_B"),&PhysicsJoint::set_body_B); + ClassDB::bind_method(D_METHOD("get_body_A","path"),&PhysicsJoint::get_body_A); + ClassDB::bind_method(D_METHOD("get_body_B"),&PhysicsJoint::get_body_B); - ClassDB::bind_method(_MD("set_active","active"),&PhysicsJoint::set_active); - ClassDB::bind_method(_MD("is_active"),&PhysicsJoint::is_active); + ClassDB::bind_method(D_METHOD("set_active","active"),&PhysicsJoint::set_active); + ClassDB::bind_method(D_METHOD("is_active"),&PhysicsJoint::is_active); - ClassDB::bind_method(_MD("set_disable_collision","disable"),&PhysicsJoint::set_disable_collision); - ClassDB::bind_method(_MD("has_disable_collision"),&PhysicsJoint::has_disable_collision); + ClassDB::bind_method(D_METHOD("set_disable_collision","disable"),&PhysicsJoint::set_disable_collision); + ClassDB::bind_method(D_METHOD("has_disable_collision"),&PhysicsJoint::has_disable_collision); ClassDB::bind_method("reconnect",&PhysicsJoint::reconnect); - ClassDB::bind_method(_MD("get_rid"),&PhysicsJoint::get_rid); + ClassDB::bind_method(D_METHOD("get_rid"),&PhysicsJoint::get_rid); } diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp index 054b61a4ed..19f1261238 100644 --- a/scene/3d/portal.cpp +++ b/scene/3d/portal.cpp @@ -29,7 +29,7 @@ #include "portal.h" #include "servers/visual_server.h" #include "scene/resources/surface_tool.h" -#include "globals.h" +#include "global_config.h" bool Portal::_set(const StringName& p_name, const Variant& p_value) { @@ -197,20 +197,20 @@ Color Portal::get_disabled_color() const { void Portal::_bind_methods() { - ClassDB::bind_method(_MD("set_shape","points"),&Portal::set_shape); - ClassDB::bind_method(_MD("get_shape"),&Portal::get_shape); + ClassDB::bind_method(D_METHOD("set_shape","points"),&Portal::set_shape); + ClassDB::bind_method(D_METHOD("get_shape"),&Portal::get_shape); - ClassDB::bind_method(_MD("set_enabled","enable"),&Portal::set_enabled); - ClassDB::bind_method(_MD("is_enabled"),&Portal::is_enabled); + ClassDB::bind_method(D_METHOD("set_enabled","enable"),&Portal::set_enabled); + ClassDB::bind_method(D_METHOD("is_enabled"),&Portal::is_enabled); - ClassDB::bind_method(_MD("set_disable_distance","distance"),&Portal::set_disable_distance); - ClassDB::bind_method(_MD("get_disable_distance"),&Portal::get_disable_distance); + ClassDB::bind_method(D_METHOD("set_disable_distance","distance"),&Portal::set_disable_distance); + ClassDB::bind_method(D_METHOD("get_disable_distance"),&Portal::get_disable_distance); - ClassDB::bind_method(_MD("set_disabled_color","color"),&Portal::set_disabled_color); - ClassDB::bind_method(_MD("get_disabled_color"),&Portal::get_disabled_color); + ClassDB::bind_method(D_METHOD("set_disabled_color","color"),&Portal::set_disabled_color); + ClassDB::bind_method(D_METHOD("get_disabled_color"),&Portal::get_disabled_color); - ClassDB::bind_method(_MD("set_connect_range","range"),&Portal::set_connect_range); - ClassDB::bind_method(_MD("get_connect_range"),&Portal::get_connect_range); + ClassDB::bind_method(D_METHOD("set_connect_range","range"),&Portal::set_connect_range); + ClassDB::bind_method(D_METHOD("get_connect_range"),&Portal::get_connect_range); } diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp index 9f4b5c7a03..f0dc8cb2ed 100644 --- a/scene/3d/proximity_group.cpp +++ b/scene/3d/proximity_group.cpp @@ -171,14 +171,14 @@ Vector3 ProximityGroup::get_grid_radius() const { void ProximityGroup::_bind_methods() { - ClassDB::bind_method(_MD("set_group_name","name"), &ProximityGroup::set_group_name); - ClassDB::bind_method(_MD("broadcast","name", "parameters"), &ProximityGroup::broadcast); - ClassDB::bind_method(_MD("set_dispatch_mode","mode"), &ProximityGroup::set_dispatch_mode); - ClassDB::bind_method(_MD("_proximity_group_broadcast","name","params"), &ProximityGroup::_proximity_group_broadcast); - ClassDB::bind_method(_MD("set_grid_radius","radius"), &ProximityGroup::set_grid_radius); - ClassDB::bind_method(_MD("get_grid_radius"), &ProximityGroup::get_grid_radius); - - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "grid_radius"), _SCS("set_grid_radius"), _SCS("get_grid_radius")); + ClassDB::bind_method(D_METHOD("set_group_name","name"), &ProximityGroup::set_group_name); + ClassDB::bind_method(D_METHOD("broadcast","name", "parameters"), &ProximityGroup::broadcast); + ClassDB::bind_method(D_METHOD("set_dispatch_mode","mode"), &ProximityGroup::set_dispatch_mode); + ClassDB::bind_method(D_METHOD("_proximity_group_broadcast","name","params"), &ProximityGroup::_proximity_group_broadcast); + ClassDB::bind_method(D_METHOD("set_grid_radius","radius"), &ProximityGroup::set_grid_radius); + ClassDB::bind_method(D_METHOD("get_grid_radius"), &ProximityGroup::get_grid_radius); + + ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "grid_radius"), "set_grid_radius", "get_grid_radius"); ADD_SIGNAL( MethodInfo("broadcast", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::ARRAY, "parameters")) ); }; diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp index d1cef0e851..e740769bd4 100644 --- a/scene/3d/quad.cpp +++ b/scene/3d/quad.cpp @@ -199,22 +199,22 @@ Rect3 Quad::get_aabb() const { void Quad::_bind_methods(){ - ClassDB::bind_method(_MD("set_axis","axis"),&Quad::set_axis); - ClassDB::bind_method(_MD("get_axis"),&Quad::get_axis); + ClassDB::bind_method(D_METHOD("set_axis","axis"),&Quad::set_axis); + ClassDB::bind_method(D_METHOD("get_axis"),&Quad::get_axis); - ClassDB::bind_method(_MD("set_size","size"),&Quad::set_size); - ClassDB::bind_method(_MD("get_size"),&Quad::get_size); + ClassDB::bind_method(D_METHOD("set_size","size"),&Quad::set_size); + ClassDB::bind_method(D_METHOD("get_size"),&Quad::get_size); - ClassDB::bind_method(_MD("set_centered","centered"),&Quad::set_centered); - ClassDB::bind_method(_MD("is_centered"),&Quad::is_centered); + ClassDB::bind_method(D_METHOD("set_centered","centered"),&Quad::set_centered); + ClassDB::bind_method(D_METHOD("is_centered"),&Quad::is_centered); - ClassDB::bind_method(_MD("set_offset","offset"),&Quad::set_offset); - ClassDB::bind_method(_MD("get_offset"),&Quad::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","offset"),&Quad::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&Quad::get_offset); - ADD_PROPERTY( PropertyInfo( Variant::INT, "axis", PROPERTY_HINT_ENUM,"X,Y,Z" ), _SCS("set_axis"), _SCS("get_axis")); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "size" ), _SCS("set_size"), _SCS("get_size")); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "offset" ), _SCS("set_offset"), _SCS("get_offset")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "centered" ), _SCS("set_centered"), _SCS("is_centered")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "axis", PROPERTY_HINT_ENUM,"X,Y,Z" ), "set_axis", "get_axis"); + ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "size" ), "set_size", "get_size"); + ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "offset" ), "set_offset", "get_offset"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "centered" ), "set_centered", "is_centered"); } diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 8216d7295f..6be8b89441 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -210,38 +210,38 @@ void RayCast::clear_exceptions(){ void RayCast::_bind_methods() { - ClassDB::bind_method(_MD("set_enabled","enabled"),&RayCast::set_enabled); - ClassDB::bind_method(_MD("is_enabled"),&RayCast::is_enabled); + ClassDB::bind_method(D_METHOD("set_enabled","enabled"),&RayCast::set_enabled); + ClassDB::bind_method(D_METHOD("is_enabled"),&RayCast::is_enabled); - ClassDB::bind_method(_MD("set_cast_to","local_point"),&RayCast::set_cast_to); - ClassDB::bind_method(_MD("get_cast_to"),&RayCast::get_cast_to); + ClassDB::bind_method(D_METHOD("set_cast_to","local_point"),&RayCast::set_cast_to); + ClassDB::bind_method(D_METHOD("get_cast_to"),&RayCast::get_cast_to); - ClassDB::bind_method(_MD("is_colliding"),&RayCast::is_colliding); - ClassDB::bind_method(_MD("force_raycast_update"),&RayCast::force_raycast_update); + ClassDB::bind_method(D_METHOD("is_colliding"),&RayCast::is_colliding); + ClassDB::bind_method(D_METHOD("force_raycast_update"),&RayCast::force_raycast_update); - ClassDB::bind_method(_MD("get_collider"),&RayCast::get_collider); - ClassDB::bind_method(_MD("get_collider_shape"),&RayCast::get_collider_shape); - ClassDB::bind_method(_MD("get_collision_point"),&RayCast::get_collision_point); - ClassDB::bind_method(_MD("get_collision_normal"),&RayCast::get_collision_normal); + ClassDB::bind_method(D_METHOD("get_collider"),&RayCast::get_collider); + ClassDB::bind_method(D_METHOD("get_collider_shape"),&RayCast::get_collider_shape); + ClassDB::bind_method(D_METHOD("get_collision_point"),&RayCast::get_collision_point); + ClassDB::bind_method(D_METHOD("get_collision_normal"),&RayCast::get_collision_normal); - ClassDB::bind_method(_MD("add_exception_rid","rid"),&RayCast::add_exception_rid); - ClassDB::bind_method(_MD("add_exception","node"),&RayCast::add_exception); + ClassDB::bind_method(D_METHOD("add_exception_rid","rid"),&RayCast::add_exception_rid); + ClassDB::bind_method(D_METHOD("add_exception","node"),&RayCast::add_exception); - ClassDB::bind_method(_MD("remove_exception_rid","rid"),&RayCast::remove_exception_rid); - ClassDB::bind_method(_MD("remove_exception","node"),&RayCast::remove_exception); + ClassDB::bind_method(D_METHOD("remove_exception_rid","rid"),&RayCast::remove_exception_rid); + ClassDB::bind_method(D_METHOD("remove_exception","node"),&RayCast::remove_exception); - ClassDB::bind_method(_MD("clear_exceptions"),&RayCast::clear_exceptions); + ClassDB::bind_method(D_METHOD("clear_exceptions"),&RayCast::clear_exceptions); - ClassDB::bind_method(_MD("set_layer_mask","mask"),&RayCast::set_layer_mask); - ClassDB::bind_method(_MD("get_layer_mask"),&RayCast::get_layer_mask); + ClassDB::bind_method(D_METHOD("set_layer_mask","mask"),&RayCast::set_layer_mask); + ClassDB::bind_method(D_METHOD("get_layer_mask"),&RayCast::get_layer_mask); - ClassDB::bind_method(_MD("set_type_mask","mask"),&RayCast::set_type_mask); - ClassDB::bind_method(_MD("get_type_mask"),&RayCast::get_type_mask); + ClassDB::bind_method(D_METHOD("set_type_mask","mask"),&RayCast::set_type_mask); + ClassDB::bind_method(D_METHOD("get_type_mask"),&RayCast::get_type_mask); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3,"cast_to"),_SCS("set_cast_to"),_SCS("get_cast_to")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"layer_mask",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"type_mask",PROPERTY_HINT_FLAGS,"Static,Kinematic,Rigid,Character,Area"),_SCS("set_type_mask"),_SCS("get_type_mask")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"enabled"),"set_enabled","is_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3,"cast_to"),"set_cast_to","get_cast_to"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"layer_mask",PROPERTY_HINT_LAYERS_3D_PHYSICS),"set_layer_mask","get_layer_mask"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"type_mask",PROPERTY_HINT_FLAGS,"Static,Kinematic,Rigid,Character,Area"),"set_type_mask","get_type_mask"); } RayCast::RayCast() { diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp index d9592d9484..db18e70ae1 100644 --- a/scene/3d/reflection_probe.cpp +++ b/scene/3d/reflection_probe.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* reflection_probe.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "reflection_probe.h" @@ -185,57 +213,57 @@ void ReflectionProbe::_validate_property(PropertyInfo& property) const { void ReflectionProbe::_bind_methods() { - ClassDB::bind_method(_MD("set_intensity","intensity"),&ReflectionProbe::set_intensity); - ClassDB::bind_method(_MD("get_intensity"),&ReflectionProbe::get_intensity); + ClassDB::bind_method(D_METHOD("set_intensity","intensity"),&ReflectionProbe::set_intensity); + ClassDB::bind_method(D_METHOD("get_intensity"),&ReflectionProbe::get_intensity); - ClassDB::bind_method(_MD("set_interior_ambient","ambient"),&ReflectionProbe::set_interior_ambient); - ClassDB::bind_method(_MD("get_interior_ambient"),&ReflectionProbe::get_interior_ambient); + ClassDB::bind_method(D_METHOD("set_interior_ambient","ambient"),&ReflectionProbe::set_interior_ambient); + ClassDB::bind_method(D_METHOD("get_interior_ambient"),&ReflectionProbe::get_interior_ambient); - ClassDB::bind_method(_MD("set_interior_ambient_energy","ambient_energy"),&ReflectionProbe::set_interior_ambient_energy); - ClassDB::bind_method(_MD("get_interior_ambient_energy"),&ReflectionProbe::get_interior_ambient_energy); + ClassDB::bind_method(D_METHOD("set_interior_ambient_energy","ambient_energy"),&ReflectionProbe::set_interior_ambient_energy); + ClassDB::bind_method(D_METHOD("get_interior_ambient_energy"),&ReflectionProbe::get_interior_ambient_energy); - ClassDB::bind_method(_MD("set_interior_ambient_probe_contribution","ambient_probe_contribution"),&ReflectionProbe::set_interior_ambient_probe_contribution); - ClassDB::bind_method(_MD("get_interior_ambient_probe_contribution"),&ReflectionProbe::get_interior_ambient_probe_contribution); + ClassDB::bind_method(D_METHOD("set_interior_ambient_probe_contribution","ambient_probe_contribution"),&ReflectionProbe::set_interior_ambient_probe_contribution); + ClassDB::bind_method(D_METHOD("get_interior_ambient_probe_contribution"),&ReflectionProbe::get_interior_ambient_probe_contribution); - ClassDB::bind_method(_MD("set_max_distance","max_distance"),&ReflectionProbe::set_max_distance); - ClassDB::bind_method(_MD("get_max_distance"),&ReflectionProbe::get_max_distance); + ClassDB::bind_method(D_METHOD("set_max_distance","max_distance"),&ReflectionProbe::set_max_distance); + ClassDB::bind_method(D_METHOD("get_max_distance"),&ReflectionProbe::get_max_distance); - ClassDB::bind_method(_MD("set_extents","extents"),&ReflectionProbe::set_extents); - ClassDB::bind_method(_MD("get_extents"),&ReflectionProbe::get_extents); + ClassDB::bind_method(D_METHOD("set_extents","extents"),&ReflectionProbe::set_extents); + ClassDB::bind_method(D_METHOD("get_extents"),&ReflectionProbe::get_extents); - ClassDB::bind_method(_MD("set_origin_offset","origin_offset"),&ReflectionProbe::set_origin_offset); - ClassDB::bind_method(_MD("get_origin_offset"),&ReflectionProbe::get_origin_offset); + ClassDB::bind_method(D_METHOD("set_origin_offset","origin_offset"),&ReflectionProbe::set_origin_offset); + ClassDB::bind_method(D_METHOD("get_origin_offset"),&ReflectionProbe::get_origin_offset); - ClassDB::bind_method(_MD("set_as_interior","enable"),&ReflectionProbe::set_as_interior); - ClassDB::bind_method(_MD("is_set_as_interior"),&ReflectionProbe::is_set_as_interior); + ClassDB::bind_method(D_METHOD("set_as_interior","enable"),&ReflectionProbe::set_as_interior); + ClassDB::bind_method(D_METHOD("is_set_as_interior"),&ReflectionProbe::is_set_as_interior); - ClassDB::bind_method(_MD("set_enable_box_projection","enable"),&ReflectionProbe::set_enable_box_projection); - ClassDB::bind_method(_MD("is_box_projection_enabled"),&ReflectionProbe::is_box_projection_enabled); + ClassDB::bind_method(D_METHOD("set_enable_box_projection","enable"),&ReflectionProbe::set_enable_box_projection); + ClassDB::bind_method(D_METHOD("is_box_projection_enabled"),&ReflectionProbe::is_box_projection_enabled); - ClassDB::bind_method(_MD("set_enable_shadows","enable"),&ReflectionProbe::set_enable_shadows); - ClassDB::bind_method(_MD("are_shadows_enabled"),&ReflectionProbe::are_shadows_enabled); + ClassDB::bind_method(D_METHOD("set_enable_shadows","enable"),&ReflectionProbe::set_enable_shadows); + ClassDB::bind_method(D_METHOD("are_shadows_enabled"),&ReflectionProbe::are_shadows_enabled); - ClassDB::bind_method(_MD("set_cull_mask","layers"),&ReflectionProbe::set_cull_mask); - ClassDB::bind_method(_MD("get_cull_mask"),&ReflectionProbe::get_cull_mask); + ClassDB::bind_method(D_METHOD("set_cull_mask","layers"),&ReflectionProbe::set_cull_mask); + ClassDB::bind_method(D_METHOD("get_cull_mask"),&ReflectionProbe::get_cull_mask); - ClassDB::bind_method(_MD("set_update_mode","mode"),&ReflectionProbe::set_update_mode); - ClassDB::bind_method(_MD("get_update_mode"),&ReflectionProbe::get_update_mode); + ClassDB::bind_method(D_METHOD("set_update_mode","mode"),&ReflectionProbe::set_update_mode); + ClassDB::bind_method(D_METHOD("get_update_mode"),&ReflectionProbe::get_update_mode); - ADD_PROPERTY( PropertyInfo(Variant::INT,"update_mode",PROPERTY_HINT_ENUM,"Once,Always"),_SCS("set_update_mode"),_SCS("get_update_mode")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"intensity",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_intensity"),_SCS("get_intensity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"max_distance",PROPERTY_HINT_RANGE,"0,16384,0.1"),_SCS("set_max_distance"),_SCS("get_max_distance")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"extents"),_SCS("set_extents"),_SCS("get_extents")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"origin_offset"),_SCS("set_origin_offset"),_SCS("get_origin_offset")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"box_projection"),_SCS("set_enable_box_projection"),_SCS("is_box_projection_enabled")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enable_shadows"),_SCS("set_enable_shadows"),_SCS("are_shadows_enabled")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"cull_mask",PROPERTY_HINT_LAYERS_3D_RENDER),_SCS("set_cull_mask"),_SCS("get_cull_mask")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"update_mode",PROPERTY_HINT_ENUM,"Once,Always"),"set_update_mode","get_update_mode"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"intensity",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_intensity","get_intensity"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"max_distance",PROPERTY_HINT_RANGE,"0,16384,0.1"),"set_max_distance","get_max_distance"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"extents"),"set_extents","get_extents"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"origin_offset"),"set_origin_offset","get_origin_offset"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"box_projection"),"set_enable_box_projection","is_box_projection_enabled"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enable_shadows"),"set_enable_shadows","are_shadows_enabled"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"cull_mask",PROPERTY_HINT_LAYERS_3D_RENDER),"set_cull_mask","get_cull_mask"); ADD_GROUP("Interior","interior_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"interior_enable"),_SCS("set_as_interior"),_SCS("is_set_as_interior")); - ADD_PROPERTY( PropertyInfo(Variant::COLOR,"interior_ambient_color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("set_interior_ambient"),_SCS("get_interior_ambient")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"interior_ambient_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_interior_ambient_energy"),_SCS("get_interior_ambient_energy")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"interior_ambient_contrib",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_interior_ambient_probe_contribution"),_SCS("get_interior_ambient_probe_contribution")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"interior_enable"),"set_as_interior","is_set_as_interior"); + ADD_PROPERTY( PropertyInfo(Variant::COLOR,"interior_ambient_color",PROPERTY_HINT_COLOR_NO_ALPHA),"set_interior_ambient","get_interior_ambient"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"interior_ambient_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),"set_interior_ambient_energy","get_interior_ambient_energy"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"interior_ambient_contrib",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_interior_ambient_probe_contribution","get_interior_ambient_probe_contribution"); BIND_CONSTANT( UPDATE_ONCE ); diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h index 410f590431..cfda186d87 100644 --- a/scene/3d/reflection_probe.h +++ b/scene/3d/reflection_probe.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* reflection_probe.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 REFLECTIONPROBE_H #define REFLECTIONPROBE_H diff --git a/scene/3d/remote_transform.cpp b/scene/3d/remote_transform.cpp index b91d90ae8e..21ec65f5e0 100644 --- a/scene/3d/remote_transform.cpp +++ b/scene/3d/remote_transform.cpp @@ -118,10 +118,10 @@ String RemoteTransform::get_configuration_warning() const { void RemoteTransform::_bind_methods() { - ClassDB::bind_method(_MD("set_remote_node","path"),&RemoteTransform::set_remote_node); - ClassDB::bind_method(_MD("get_remote_node"),&RemoteTransform::get_remote_node); + ClassDB::bind_method(D_METHOD("set_remote_node","path"),&RemoteTransform::set_remote_node); + ClassDB::bind_method(D_METHOD("get_remote_node"),&RemoteTransform::get_remote_node); - ADD_PROPERTY( PropertyInfo(Variant::NODE_PATH,"remote_path"),_SCS("set_remote_node"),_SCS("get_remote_node")); + ADD_PROPERTY( PropertyInfo(Variant::NODE_PATH,"remote_path"),"set_remote_node","get_remote_node"); } RemoteTransform::RemoteTransform() { diff --git a/scene/3d/remote_transform.h b/scene/3d/remote_transform.h index e7aa95ad6e..6bc4763e2d 100644 --- a/scene/3d/remote_transform.h +++ b/scene/3d/remote_transform.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* remote_transform.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 REMOTETRANSFORM_H #define REMOTETRANSFORM_H diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp index a2e1a48781..b363c05ef7 100644 --- a/scene/3d/room_instance.cpp +++ b/scene/3d/room_instance.cpp @@ -31,7 +31,7 @@ #include "servers/visual_server.h" #include "geometry.h" -#include "globals.h" +#include "global_config.h" #include "scene/resources/surface_tool.h" @@ -161,11 +161,11 @@ void Room::_bounds_changed() { void Room::_bind_methods() { - ClassDB::bind_method(_MD("set_room","room:Room"),&Room::set_room ); - ClassDB::bind_method(_MD("get_room:Room"),&Room::get_room ); + ClassDB::bind_method(D_METHOD("set_room","room:Room"),&Room::set_room ); + ClassDB::bind_method(D_METHOD("get_room:Room"),&Room::get_room ); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "room/room", PROPERTY_HINT_RESOURCE_TYPE, "Area" ), _SCS("set_room"), _SCS("get_room") ); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "room/room", PROPERTY_HINT_RESOURCE_TYPE, "Area" ), "set_room", "get_room") ; } diff --git a/scene/3d/scenario_fx.cpp b/scene/3d/scenario_fx.cpp index bda7d43570..145242ba7c 100644 --- a/scene/3d/scenario_fx.cpp +++ b/scene/3d/scenario_fx.cpp @@ -99,9 +99,9 @@ String WorldEnvironment::get_configuration_warning() const { void WorldEnvironment::_bind_methods() { - ClassDB::bind_method(_MD("set_environment","env:Environment"),&WorldEnvironment::set_environment); - ClassDB::bind_method(_MD("get_environment:Environment"),&WorldEnvironment::get_environment); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"environment",PROPERTY_HINT_RESOURCE_TYPE,"Environment"),_SCS("set_environment"),_SCS("get_environment")); + ClassDB::bind_method(D_METHOD("set_environment","env:Environment"),&WorldEnvironment::set_environment); + ClassDB::bind_method(D_METHOD("get_environment:Environment"),&WorldEnvironment::get_environment); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"environment",PROPERTY_HINT_RESOURCE_TYPE,"Environment"),"set_environment","get_environment"); } diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index f2e339604e..04e82ba914 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -31,7 +31,7 @@ #include "message_queue.h" #include "scene/resources/surface_tool.h" -#include "core/globals.h" +#include "core/global_config.h" bool Skeleton::_set(const StringName& p_path, const Variant& p_value) { @@ -530,39 +530,39 @@ void Skeleton::_bind_methods() { - ClassDB::bind_method(_MD("add_bone","name"),&Skeleton::add_bone); - ClassDB::bind_method(_MD("find_bone","name"),&Skeleton::find_bone); - ClassDB::bind_method(_MD("get_bone_name","bone_idx"),&Skeleton::get_bone_name); + ClassDB::bind_method(D_METHOD("add_bone","name"),&Skeleton::add_bone); + ClassDB::bind_method(D_METHOD("find_bone","name"),&Skeleton::find_bone); + ClassDB::bind_method(D_METHOD("get_bone_name","bone_idx"),&Skeleton::get_bone_name); - ClassDB::bind_method(_MD("get_bone_parent","bone_idx"),&Skeleton::get_bone_parent); - ClassDB::bind_method(_MD("set_bone_parent","bone_idx","parent_idx"),&Skeleton::set_bone_parent); + ClassDB::bind_method(D_METHOD("get_bone_parent","bone_idx"),&Skeleton::get_bone_parent); + ClassDB::bind_method(D_METHOD("set_bone_parent","bone_idx","parent_idx"),&Skeleton::set_bone_parent); - ClassDB::bind_method(_MD("get_bone_count"),&Skeleton::get_bone_count); + ClassDB::bind_method(D_METHOD("get_bone_count"),&Skeleton::get_bone_count); - ClassDB::bind_method(_MD("unparent_bone_and_rest","bone_idx"),&Skeleton::unparent_bone_and_rest); + ClassDB::bind_method(D_METHOD("unparent_bone_and_rest","bone_idx"),&Skeleton::unparent_bone_and_rest); - ClassDB::bind_method(_MD("get_bone_rest","bone_idx"),&Skeleton::get_bone_rest); - ClassDB::bind_method(_MD("set_bone_rest","bone_idx","rest"),&Skeleton::set_bone_rest); + ClassDB::bind_method(D_METHOD("get_bone_rest","bone_idx"),&Skeleton::get_bone_rest); + ClassDB::bind_method(D_METHOD("set_bone_rest","bone_idx","rest"),&Skeleton::set_bone_rest); - ClassDB::bind_method(_MD("set_bone_disable_rest","bone_idx","disable"),&Skeleton::set_bone_disable_rest); - ClassDB::bind_method(_MD("is_bone_rest_disabled","bone_idx"),&Skeleton::is_bone_rest_disabled); + ClassDB::bind_method(D_METHOD("set_bone_disable_rest","bone_idx","disable"),&Skeleton::set_bone_disable_rest); + ClassDB::bind_method(D_METHOD("is_bone_rest_disabled","bone_idx"),&Skeleton::is_bone_rest_disabled); - ClassDB::bind_method(_MD("bind_child_node_to_bone","bone_idx","node:Node"),&Skeleton::bind_child_node_to_bone); - ClassDB::bind_method(_MD("unbind_child_node_from_bone","bone_idx","node:Node"),&Skeleton::unbind_child_node_from_bone); - ClassDB::bind_method(_MD("get_bound_child_nodes_to_bone","bone_idx"),&Skeleton::_get_bound_child_nodes_to_bone); + ClassDB::bind_method(D_METHOD("bind_child_node_to_bone","bone_idx","node:Node"),&Skeleton::bind_child_node_to_bone); + ClassDB::bind_method(D_METHOD("unbind_child_node_from_bone","bone_idx","node:Node"),&Skeleton::unbind_child_node_from_bone); + ClassDB::bind_method(D_METHOD("get_bound_child_nodes_to_bone","bone_idx"),&Skeleton::_get_bound_child_nodes_to_bone); - ClassDB::bind_method(_MD("clear_bones"),&Skeleton::clear_bones); + ClassDB::bind_method(D_METHOD("clear_bones"),&Skeleton::clear_bones); - ClassDB::bind_method(_MD("get_bone_pose","bone_idx"),&Skeleton::get_bone_pose); - ClassDB::bind_method(_MD("set_bone_pose","bone_idx","pose"),&Skeleton::set_bone_pose); + ClassDB::bind_method(D_METHOD("get_bone_pose","bone_idx"),&Skeleton::get_bone_pose); + ClassDB::bind_method(D_METHOD("set_bone_pose","bone_idx","pose"),&Skeleton::set_bone_pose); - ClassDB::bind_method(_MD("set_bone_global_pose","bone_idx","pose"),&Skeleton::set_bone_global_pose); - ClassDB::bind_method(_MD("get_bone_global_pose","bone_idx"),&Skeleton::get_bone_global_pose); + ClassDB::bind_method(D_METHOD("set_bone_global_pose","bone_idx","pose"),&Skeleton::set_bone_global_pose); + ClassDB::bind_method(D_METHOD("get_bone_global_pose","bone_idx"),&Skeleton::get_bone_global_pose); - ClassDB::bind_method(_MD("get_bone_custom_pose","bone_idx"),&Skeleton::get_bone_custom_pose); - ClassDB::bind_method(_MD("set_bone_custom_pose","bone_idx","custom_pose"),&Skeleton::set_bone_custom_pose); + ClassDB::bind_method(D_METHOD("get_bone_custom_pose","bone_idx"),&Skeleton::get_bone_custom_pose); + ClassDB::bind_method(D_METHOD("set_bone_custom_pose","bone_idx","custom_pose"),&Skeleton::set_bone_custom_pose); - ClassDB::bind_method(_MD("get_bone_transform","bone_idx"),&Skeleton::get_bone_transform); + ClassDB::bind_method(D_METHOD("get_bone_transform","bone_idx"),&Skeleton::get_bone_transform); BIND_CONSTANT( NOTIFICATION_UPDATE_SKELETON ); } diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 69706a6039..58a6a24567 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -742,50 +742,50 @@ bool Spatial::is_local_transform_notification_enabled() const { void Spatial::_bind_methods() { - ClassDB::bind_method(_MD("set_transform","local"), &Spatial::set_transform); - ClassDB::bind_method(_MD("get_transform"), &Spatial::get_transform); - ClassDB::bind_method(_MD("set_translation","translation"), &Spatial::set_translation); - ClassDB::bind_method(_MD("get_translation"), &Spatial::get_translation); - ClassDB::bind_method(_MD("set_rotation","rotation_rad"), &Spatial::set_rotation); - ClassDB::bind_method(_MD("get_rotation"), &Spatial::get_rotation); - ClassDB::bind_method(_MD("set_rotation_deg","rotation_deg"), &Spatial::set_rotation_in_degrees); - ClassDB::bind_method(_MD("get_rotation_deg"), &Spatial::get_rotation_in_degrees); - ClassDB::bind_method(_MD("set_scale","scale"), &Spatial::set_scale); - ClassDB::bind_method(_MD("get_scale"), &Spatial::get_scale); - ClassDB::bind_method(_MD("set_global_transform","global"), &Spatial::set_global_transform); - ClassDB::bind_method(_MD("get_global_transform"), &Spatial::get_global_transform); - ClassDB::bind_method(_MD("get_parent_spatial"), &Spatial::get_parent_spatial); - ClassDB::bind_method(_MD("set_ignore_transform_notification","enabled"), &Spatial::set_ignore_transform_notification); - ClassDB::bind_method(_MD("set_as_toplevel","enable"), &Spatial::set_as_toplevel); - ClassDB::bind_method(_MD("is_set_as_toplevel"), &Spatial::is_set_as_toplevel); - ClassDB::bind_method(_MD("get_world:World"), &Spatial::get_world); + ClassDB::bind_method(D_METHOD("set_transform","local"), &Spatial::set_transform); + ClassDB::bind_method(D_METHOD("get_transform"), &Spatial::get_transform); + ClassDB::bind_method(D_METHOD("set_translation","translation"), &Spatial::set_translation); + ClassDB::bind_method(D_METHOD("get_translation"), &Spatial::get_translation); + ClassDB::bind_method(D_METHOD("set_rotation","rotation_rad"), &Spatial::set_rotation); + ClassDB::bind_method(D_METHOD("get_rotation"), &Spatial::get_rotation); + ClassDB::bind_method(D_METHOD("set_rotation_deg","rotation_deg"), &Spatial::set_rotation_in_degrees); + ClassDB::bind_method(D_METHOD("get_rotation_deg"), &Spatial::get_rotation_in_degrees); + ClassDB::bind_method(D_METHOD("set_scale","scale"), &Spatial::set_scale); + ClassDB::bind_method(D_METHOD("get_scale"), &Spatial::get_scale); + ClassDB::bind_method(D_METHOD("set_global_transform","global"), &Spatial::set_global_transform); + ClassDB::bind_method(D_METHOD("get_global_transform"), &Spatial::get_global_transform); + ClassDB::bind_method(D_METHOD("get_parent_spatial"), &Spatial::get_parent_spatial); + ClassDB::bind_method(D_METHOD("set_ignore_transform_notification","enabled"), &Spatial::set_ignore_transform_notification); + ClassDB::bind_method(D_METHOD("set_as_toplevel","enable"), &Spatial::set_as_toplevel); + ClassDB::bind_method(D_METHOD("is_set_as_toplevel"), &Spatial::is_set_as_toplevel); + ClassDB::bind_method(D_METHOD("get_world:World"), &Spatial::get_world); // TODO: Obsolete those two methods (old name) properly (GH-4397) - ClassDB::bind_method(_MD("_set_rotation_deg","rotation_deg"), &Spatial::_set_rotation_deg); - ClassDB::bind_method(_MD("_get_rotation_deg"), &Spatial::_get_rotation_deg); + ClassDB::bind_method(D_METHOD("_set_rotation_deg","rotation_deg"), &Spatial::_set_rotation_deg); + ClassDB::bind_method(D_METHOD("_get_rotation_deg"), &Spatial::_get_rotation_deg); #ifdef TOOLS_ENABLED - ClassDB::bind_method(_MD("_update_gizmo"), &Spatial::_update_gizmo); - ClassDB::bind_method(_MD("_set_import_transform"), &Spatial::set_import_transform); - ClassDB::bind_method(_MD("_get_import_transform"), &Spatial::get_import_transform); - ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"_import_transform",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_import_transform"),_SCS("_get_import_transform")); + ClassDB::bind_method(D_METHOD("_update_gizmo"), &Spatial::_update_gizmo); + ClassDB::bind_method(D_METHOD("_set_import_transform"), &Spatial::set_import_transform); + ClassDB::bind_method(D_METHOD("_get_import_transform"), &Spatial::get_import_transform); + ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"_import_transform",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_import_transform","_get_import_transform"); #endif - ClassDB::bind_method(_MD("update_gizmo"), &Spatial::update_gizmo); - ClassDB::bind_method(_MD("set_gizmo","gizmo:SpatialGizmo"), &Spatial::set_gizmo); - ClassDB::bind_method(_MD("get_gizmo:SpatialGizmo"), &Spatial::get_gizmo); + ClassDB::bind_method(D_METHOD("update_gizmo"), &Spatial::update_gizmo); + ClassDB::bind_method(D_METHOD("set_gizmo","gizmo:SpatialGizmo"), &Spatial::set_gizmo); + ClassDB::bind_method(D_METHOD("get_gizmo:SpatialGizmo"), &Spatial::get_gizmo); - ClassDB::bind_method(_MD("set_visible"), &Spatial::set_visible); - ClassDB::bind_method(_MD("is_visible"), &Spatial::is_visible); - ClassDB::bind_method(_MD("is_visible_in_tree"), &Spatial::is_visible_in_tree); - ClassDB::bind_method(_MD("show"), &Spatial::show); - ClassDB::bind_method(_MD("hide"), &Spatial::hide); + ClassDB::bind_method(D_METHOD("set_visible"), &Spatial::set_visible); + ClassDB::bind_method(D_METHOD("is_visible"), &Spatial::is_visible); + ClassDB::bind_method(D_METHOD("is_visible_in_tree"), &Spatial::is_visible_in_tree); + ClassDB::bind_method(D_METHOD("show"), &Spatial::show); + ClassDB::bind_method(D_METHOD("hide"), &Spatial::hide); - ClassDB::bind_method(_MD("set_notify_local_transform","enable"), &Spatial::set_notify_local_transform); - ClassDB::bind_method(_MD("is_local_transform_notification_enabled"), &Spatial::is_local_transform_notification_enabled); + ClassDB::bind_method(D_METHOD("set_notify_local_transform","enable"), &Spatial::set_notify_local_transform); + ClassDB::bind_method(D_METHOD("is_local_transform_notification_enabled"), &Spatial::is_local_transform_notification_enabled); - ClassDB::bind_method(_MD("set_notify_transform","enable"), &Spatial::set_notify_transform); - ClassDB::bind_method(_MD("is_transform_notification_enabled"), &Spatial::is_transform_notification_enabled); + ClassDB::bind_method(D_METHOD("set_notify_transform","enable"), &Spatial::set_notify_transform); + ClassDB::bind_method(D_METHOD("is_transform_notification_enabled"), &Spatial::is_transform_notification_enabled); void rotate(const Vector3& p_normal,float p_radians); void rotate_x(float p_radians); @@ -796,35 +796,35 @@ void Spatial::_bind_methods() { void global_rotate(const Vector3& p_normal,float p_radians); void global_translate(const Vector3& p_offset); - ClassDB::bind_method( _MD("rotate","normal","radians"),&Spatial::rotate ); - ClassDB::bind_method( _MD("global_rotate","normal","radians"),&Spatial::global_rotate ); - ClassDB::bind_method( _MD("rotate_x","radians"),&Spatial::rotate_x ); - ClassDB::bind_method( _MD("rotate_y","radians"),&Spatial::rotate_y ); - ClassDB::bind_method( _MD("rotate_z","radians"),&Spatial::rotate_z ); - ClassDB::bind_method( _MD("translate","offset"),&Spatial::translate ); - ClassDB::bind_method( _MD("global_translate","offset"),&Spatial::global_translate ); - ClassDB::bind_method( _MD("orthonormalize"),&Spatial::orthonormalize ); - ClassDB::bind_method( _MD("set_identity"),&Spatial::set_identity ); + ClassDB::bind_method( D_METHOD("rotate","normal","radians"),&Spatial::rotate ); + ClassDB::bind_method( D_METHOD("global_rotate","normal","radians"),&Spatial::global_rotate ); + ClassDB::bind_method( D_METHOD("rotate_x","radians"),&Spatial::rotate_x ); + ClassDB::bind_method( D_METHOD("rotate_y","radians"),&Spatial::rotate_y ); + ClassDB::bind_method( D_METHOD("rotate_z","radians"),&Spatial::rotate_z ); + ClassDB::bind_method( D_METHOD("translate","offset"),&Spatial::translate ); + ClassDB::bind_method( D_METHOD("global_translate","offset"),&Spatial::global_translate ); + ClassDB::bind_method( D_METHOD("orthonormalize"),&Spatial::orthonormalize ); + ClassDB::bind_method( D_METHOD("set_identity"),&Spatial::set_identity ); - ClassDB::bind_method( _MD("look_at","target","up"),&Spatial::look_at ); - ClassDB::bind_method( _MD("look_at_from_pos","pos","target","up"),&Spatial::look_at_from_pos ); + ClassDB::bind_method( D_METHOD("look_at","target","up"),&Spatial::look_at ); + ClassDB::bind_method( D_METHOD("look_at_from_pos","pos","target","up"),&Spatial::look_at_from_pos ); BIND_CONSTANT( NOTIFICATION_TRANSFORM_CHANGED ); BIND_CONSTANT( NOTIFICATION_ENTER_WORLD ); BIND_CONSTANT( NOTIFICATION_EXIT_WORLD ); BIND_CONSTANT( NOTIFICATION_VISIBILITY_CHANGED ); - //ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"transform/global",PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR ), _SCS("set_global_transform"), _SCS("get_global_transform") ); + //ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"transform/global",PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR ), "set_global_transform", "get_global_transform") ; ADD_GROUP("Transform",""); - ADD_PROPERTYNZ( PropertyInfo(Variant::TRANSFORM,"transform",PROPERTY_HINT_NONE,""), _SCS("set_transform"), _SCS("get_transform") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::TRANSFORM,"global_transform",PROPERTY_HINT_NONE,"",0), _SCS("set_global_transform"), _SCS("get_global_transform") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"translation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), _SCS("set_translation"), _SCS("get_translation") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"rotation_deg",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), _SCS("set_rotation_deg"), _SCS("get_rotation_deg") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"rotation",PROPERTY_HINT_NONE,"",0), _SCS("set_rotation"), _SCS("get_rotation") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"scale",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), _SCS("set_scale"), _SCS("get_scale") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::TRANSFORM,"transform",PROPERTY_HINT_NONE,""), "set_transform", "get_transform") ; + ADD_PROPERTYNZ( PropertyInfo(Variant::TRANSFORM,"global_transform",PROPERTY_HINT_NONE,"",0), "set_global_transform", "get_global_transform") ; + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"translation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), "set_translation", "get_translation") ; + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"rotation_deg",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), "set_rotation_deg", "get_rotation_deg") ; + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"rotation",PROPERTY_HINT_NONE,"",0), "set_rotation", "get_rotation") ; + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"scale",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), "set_scale", "get_scale") ; ADD_GROUP("Visibility",""); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"visible"), _SCS("set_visible"), _SCS("is_visible") ); - //ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"transform/local"), _SCS("set_transform"), _SCS("get_transform") ); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"visible"), "set_visible", "is_visible") ; + //ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"transform/local"), "set_transform", "get_transform") ; ADD_SIGNAL( MethodInfo("visibility_changed" ) ); diff --git a/scene/3d/spatial_indexer.cpp b/scene/3d/spatial_indexer.cpp index 0cc6d1abd0..6d6c272c25 100644 --- a/scene/3d/spatial_indexer.cpp +++ b/scene/3d/spatial_indexer.cpp @@ -112,7 +112,7 @@ void SpatialIndexer::_update_pairs() { void SpatialIndexer::_bind_methods() { - ClassDB::bind_method(_MD("_update_pairs"),&SpatialIndexer::_update_pairs); + ClassDB::bind_method(D_METHOD("_update_pairs"),&SpatialIndexer::_update_pairs); } diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 479fe1fed9..5adb7050f8 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -246,55 +246,55 @@ SpriteBase3D::AlphaCutMode SpriteBase3D::get_alpha_cut_mode() const{ void SpriteBase3D::_bind_methods() { - ClassDB::bind_method(_MD("set_centered","centered"),&SpriteBase3D::set_centered); - ClassDB::bind_method(_MD("is_centered"),&SpriteBase3D::is_centered); + ClassDB::bind_method(D_METHOD("set_centered","centered"),&SpriteBase3D::set_centered); + ClassDB::bind_method(D_METHOD("is_centered"),&SpriteBase3D::is_centered); - ClassDB::bind_method(_MD("set_offset","offset"),&SpriteBase3D::set_offset); - ClassDB::bind_method(_MD("get_offset"),&SpriteBase3D::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","offset"),&SpriteBase3D::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&SpriteBase3D::get_offset); - ClassDB::bind_method(_MD("set_flip_h","flip_h"),&SpriteBase3D::set_flip_h); - ClassDB::bind_method(_MD("is_flipped_h"),&SpriteBase3D::is_flipped_h); + ClassDB::bind_method(D_METHOD("set_flip_h","flip_h"),&SpriteBase3D::set_flip_h); + ClassDB::bind_method(D_METHOD("is_flipped_h"),&SpriteBase3D::is_flipped_h); - ClassDB::bind_method(_MD("set_flip_v","flip_v"),&SpriteBase3D::set_flip_v); - ClassDB::bind_method(_MD("is_flipped_v"),&SpriteBase3D::is_flipped_v); + ClassDB::bind_method(D_METHOD("set_flip_v","flip_v"),&SpriteBase3D::set_flip_v); + ClassDB::bind_method(D_METHOD("is_flipped_v"),&SpriteBase3D::is_flipped_v); - ClassDB::bind_method(_MD("set_modulate","modulate"),&SpriteBase3D::set_modulate); - ClassDB::bind_method(_MD("get_modulate"),&SpriteBase3D::get_modulate); + ClassDB::bind_method(D_METHOD("set_modulate","modulate"),&SpriteBase3D::set_modulate); + ClassDB::bind_method(D_METHOD("get_modulate"),&SpriteBase3D::get_modulate); - ClassDB::bind_method(_MD("set_opacity","opacity"),&SpriteBase3D::set_opacity); - ClassDB::bind_method(_MD("get_opacity"),&SpriteBase3D::get_opacity); + ClassDB::bind_method(D_METHOD("set_opacity","opacity"),&SpriteBase3D::set_opacity); + ClassDB::bind_method(D_METHOD("get_opacity"),&SpriteBase3D::get_opacity); - ClassDB::bind_method(_MD("set_pixel_size","pixel_size"),&SpriteBase3D::set_pixel_size); - ClassDB::bind_method(_MD("get_pixel_size"),&SpriteBase3D::get_pixel_size); + ClassDB::bind_method(D_METHOD("set_pixel_size","pixel_size"),&SpriteBase3D::set_pixel_size); + ClassDB::bind_method(D_METHOD("get_pixel_size"),&SpriteBase3D::get_pixel_size); - ClassDB::bind_method(_MD("set_axis","axis"),&SpriteBase3D::set_axis); - ClassDB::bind_method(_MD("get_axis"),&SpriteBase3D::get_axis); + ClassDB::bind_method(D_METHOD("set_axis","axis"),&SpriteBase3D::set_axis); + ClassDB::bind_method(D_METHOD("get_axis"),&SpriteBase3D::get_axis); - ClassDB::bind_method(_MD("set_draw_flag","flag","enabled"),&SpriteBase3D::set_draw_flag); - ClassDB::bind_method(_MD("get_draw_flag","flag"),&SpriteBase3D::get_draw_flag); + ClassDB::bind_method(D_METHOD("set_draw_flag","flag","enabled"),&SpriteBase3D::set_draw_flag); + ClassDB::bind_method(D_METHOD("get_draw_flag","flag"),&SpriteBase3D::get_draw_flag); - ClassDB::bind_method(_MD("set_alpha_cut_mode","mode"),&SpriteBase3D::set_alpha_cut_mode); - ClassDB::bind_method(_MD("get_alpha_cut_mode"),&SpriteBase3D::get_alpha_cut_mode); + ClassDB::bind_method(D_METHOD("set_alpha_cut_mode","mode"),&SpriteBase3D::set_alpha_cut_mode); + ClassDB::bind_method(D_METHOD("get_alpha_cut_mode"),&SpriteBase3D::get_alpha_cut_mode); - ClassDB::bind_method(_MD("get_item_rect"),&SpriteBase3D::get_item_rect); + ClassDB::bind_method(D_METHOD("get_item_rect"),&SpriteBase3D::get_item_rect); - ClassDB::bind_method(_MD("_queue_update"),&SpriteBase3D::_queue_update); - ClassDB::bind_method(_MD("_im_update"),&SpriteBase3D::_im_update); + ClassDB::bind_method(D_METHOD("_queue_update"),&SpriteBase3D::_queue_update); + ClassDB::bind_method(D_METHOD("_im_update"),&SpriteBase3D::_im_update); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "centered"), _SCS("set_centered"),_SCS("is_centered")); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "offset"), _SCS("set_offset"),_SCS("get_offset")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "flip_h"), _SCS("set_flip_h"),_SCS("is_flipped_h")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "flip_v"), _SCS("set_flip_v"),_SCS("is_flipped_v")); - ADD_PROPERTY( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "opacity",PROPERTY_HINT_RANGE,"0,1,0.01"), _SCS("set_opacity"),_SCS("get_opacity")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "pixel_size",PROPERTY_HINT_RANGE,"0.0001,128,0.0001"), _SCS("set_pixel_size"),_SCS("get_pixel_size")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "axis",PROPERTY_HINT_ENUM,"X-Axis,Y-Axis,Z-Axis"), _SCS("set_axis"),_SCS("get_axis")); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "centered"), "set_centered","is_centered"); + ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "offset"), "set_offset","get_offset"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "flip_h"), "set_flip_h","is_flipped_h"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "flip_v"), "set_flip_v","is_flipped_v"); + ADD_PROPERTY( PropertyInfo( Variant::COLOR, "modulate"), "set_modulate","get_modulate"); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "opacity",PROPERTY_HINT_RANGE,"0,1,0.01"), "set_opacity","get_opacity"); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "pixel_size",PROPERTY_HINT_RANGE,"0.0001,128,0.0001"), "set_pixel_size","get_pixel_size"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "axis",PROPERTY_HINT_ENUM,"X-Axis,Y-Axis,Z-Axis"), "set_axis","get_axis"); ADD_GROUP("Flags",""); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "transparent"), _SCS("set_draw_flag"),_SCS("get_draw_flag"),FLAG_TRANSPARENT); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "shaded"), _SCS("set_draw_flag"),_SCS("get_draw_flag"),FLAG_SHADED); - ADD_PROPERTY( PropertyInfo( Variant::INT, "alpha_cut",PROPERTY_HINT_ENUM,"Disabled,Discard,Opaque Pre-Pass"), _SCS("set_alpha_cut_mode"),_SCS("get_alpha_cut_mode")); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "transparent"), "set_draw_flag","get_draw_flag",FLAG_TRANSPARENT); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "shaded"), "set_draw_flag","get_draw_flag",FLAG_SHADED); + ADD_PROPERTY( PropertyInfo( Variant::INT, "alpha_cut",PROPERTY_HINT_ENUM,"Disabled,Discard,Opaque Pre-Pass"), "set_alpha_cut_mode","get_alpha_cut_mode"); BIND_CONSTANT( FLAG_TRANSPARENT ); @@ -601,30 +601,30 @@ void Sprite3D::_validate_property(PropertyInfo& property) const { void Sprite3D::_bind_methods() { - ClassDB::bind_method(_MD("set_texture","texture:Texture"),&Sprite3D::set_texture); - ClassDB::bind_method(_MD("get_texture:Texture"),&Sprite3D::get_texture); + ClassDB::bind_method(D_METHOD("set_texture","texture:Texture"),&Sprite3D::set_texture); + ClassDB::bind_method(D_METHOD("get_texture:Texture"),&Sprite3D::get_texture); - ClassDB::bind_method(_MD("set_region","enabled"),&Sprite3D::set_region); - ClassDB::bind_method(_MD("is_region"),&Sprite3D::is_region); + ClassDB::bind_method(D_METHOD("set_region","enabled"),&Sprite3D::set_region); + ClassDB::bind_method(D_METHOD("is_region"),&Sprite3D::is_region); - ClassDB::bind_method(_MD("set_region_rect","rect"),&Sprite3D::set_region_rect); - ClassDB::bind_method(_MD("get_region_rect"),&Sprite3D::get_region_rect); + ClassDB::bind_method(D_METHOD("set_region_rect","rect"),&Sprite3D::set_region_rect); + ClassDB::bind_method(D_METHOD("get_region_rect"),&Sprite3D::get_region_rect); - ClassDB::bind_method(_MD("set_frame","frame"),&Sprite3D::set_frame); - ClassDB::bind_method(_MD("get_frame"),&Sprite3D::get_frame); + ClassDB::bind_method(D_METHOD("set_frame","frame"),&Sprite3D::set_frame); + ClassDB::bind_method(D_METHOD("get_frame"),&Sprite3D::get_frame); - ClassDB::bind_method(_MD("set_vframes","vframes"),&Sprite3D::set_vframes); - ClassDB::bind_method(_MD("get_vframes"),&Sprite3D::get_vframes); + ClassDB::bind_method(D_METHOD("set_vframes","vframes"),&Sprite3D::set_vframes); + ClassDB::bind_method(D_METHOD("get_vframes"),&Sprite3D::get_vframes); - ClassDB::bind_method(_MD("set_hframes","hframes"),&Sprite3D::set_hframes); - ClassDB::bind_method(_MD("get_hframes"),&Sprite3D::get_hframes); + ClassDB::bind_method(D_METHOD("set_hframes","hframes"),&Sprite3D::set_hframes); + ClassDB::bind_method(D_METHOD("get_hframes"),&Sprite3D::get_hframes); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_texture"),_SCS("get_texture")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "vframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_vframes"),_SCS("get_vframes")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "hframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_hframes"),_SCS("get_hframes")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), _SCS("set_frame"),_SCS("get_frame")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "region"), _SCS("set_region"),_SCS("is_region")); - ADD_PROPERTY( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect")); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), "set_texture","get_texture"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "vframes",PROPERTY_HINT_RANGE,"1,16384,1"), "set_vframes","get_vframes"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "hframes",PROPERTY_HINT_RANGE,"1,16384,1"), "set_hframes","get_hframes"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), "set_frame","get_frame"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "region"), "set_region","is_region"); + ADD_PROPERTY( PropertyInfo( Variant::RECT2, "region_rect"), "set_region_rect","get_region_rect"); ADD_SIGNAL(MethodInfo("frame_changed")); @@ -764,13 +764,13 @@ void AnimatedSprite3D::_draw() { void AnimatedSprite3D::_bind_methods(){ - ClassDB::bind_method(_MD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite3D::set_sprite_frames); - ClassDB::bind_method(_MD("get_sprite_frames:Texture"),&AnimatedSprite3D::get_sprite_frames); - ClassDB::bind_method(_MD("set_frame","frame"),&AnimatedSprite3D::set_frame); - ClassDB::bind_method(_MD("get_frame"),&AnimatedSprite3D::get_frame); + ClassDB::bind_method(D_METHOD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite3D::set_sprite_frames); + ClassDB::bind_method(D_METHOD("get_sprite_frames:Texture"),&AnimatedSprite3D::get_sprite_frames); + ClassDB::bind_method(D_METHOD("set_frame","frame"),&AnimatedSprite3D::set_frame); + ClassDB::bind_method(D_METHOD("get_frame"),&AnimatedSprite3D::get_frame); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), _SCS("set_sprite_frames"),_SCS("get_sprite_frames")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), _SCS("set_frame"),_SCS("get_frame")); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), "set_sprite_frames","get_sprite_frames"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), "set_frame","get_frame"); ADD_SIGNAL(MethodInfo("frame_changed")); @@ -1312,31 +1312,31 @@ String AnimatedSprite3D::get_configuration_warning() const { void AnimatedSprite3D::_bind_methods() { - ClassDB::bind_method(_MD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite3D::set_sprite_frames); - ClassDB::bind_method(_MD("get_sprite_frames:SpriteFrames"),&AnimatedSprite3D::get_sprite_frames); + ClassDB::bind_method(D_METHOD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite3D::set_sprite_frames); + ClassDB::bind_method(D_METHOD("get_sprite_frames:SpriteFrames"),&AnimatedSprite3D::get_sprite_frames); - ClassDB::bind_method(_MD("set_animation","animation"),&AnimatedSprite3D::set_animation); - ClassDB::bind_method(_MD("get_animation"),&AnimatedSprite3D::get_animation); + ClassDB::bind_method(D_METHOD("set_animation","animation"),&AnimatedSprite3D::set_animation); + ClassDB::bind_method(D_METHOD("get_animation"),&AnimatedSprite3D::get_animation); - ClassDB::bind_method(_MD("_set_playing","playing"),&AnimatedSprite3D::_set_playing); - ClassDB::bind_method(_MD("_is_playing"),&AnimatedSprite3D::_is_playing); + ClassDB::bind_method(D_METHOD("_set_playing","playing"),&AnimatedSprite3D::_set_playing); + ClassDB::bind_method(D_METHOD("_is_playing"),&AnimatedSprite3D::_is_playing); - ClassDB::bind_method(_MD("play","anim"),&AnimatedSprite3D::play,DEFVAL(StringName())); - ClassDB::bind_method(_MD("stop"),&AnimatedSprite3D::stop); - ClassDB::bind_method(_MD("is_playing"),&AnimatedSprite3D::is_playing); + ClassDB::bind_method(D_METHOD("play","anim"),&AnimatedSprite3D::play,DEFVAL(StringName())); + ClassDB::bind_method(D_METHOD("stop"),&AnimatedSprite3D::stop); + ClassDB::bind_method(D_METHOD("is_playing"),&AnimatedSprite3D::is_playing); - ClassDB::bind_method(_MD("set_frame","frame"),&AnimatedSprite3D::set_frame); - ClassDB::bind_method(_MD("get_frame"),&AnimatedSprite3D::get_frame); + ClassDB::bind_method(D_METHOD("set_frame","frame"),&AnimatedSprite3D::set_frame); + ClassDB::bind_method(D_METHOD("get_frame"),&AnimatedSprite3D::get_frame); - ClassDB::bind_method(_MD("_res_changed"),&AnimatedSprite3D::_res_changed); + ClassDB::bind_method(D_METHOD("_res_changed"),&AnimatedSprite3D::_res_changed); ADD_SIGNAL(MethodInfo("frame_changed")); - ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "frames",PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), _SCS("set_sprite_frames"),_SCS("get_sprite_frames")); - ADD_PROPERTY( PropertyInfo( Variant::STRING, "animation"), _SCS("set_animation"),_SCS("get_animation")); - ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), _SCS("set_frame"),_SCS("get_frame")); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "playing"), _SCS("_set_playing"),_SCS("_is_playing")); + ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "frames",PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), "set_sprite_frames","get_sprite_frames"); + ADD_PROPERTY( PropertyInfo( Variant::STRING, "animation"), "set_animation","get_animation"); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), "set_frame","get_frame"); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "playing"), "_set_playing","_is_playing"); } diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index a3f05f719d..4b32c62d14 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -232,52 +232,52 @@ float VehicleWheel::get_friction_slip() const{ void VehicleWheel::_bind_methods() { - ClassDB::bind_method(_MD("set_radius","length"),&VehicleWheel::set_radius); - ClassDB::bind_method(_MD("get_radius"),&VehicleWheel::get_radius); + ClassDB::bind_method(D_METHOD("set_radius","length"),&VehicleWheel::set_radius); + ClassDB::bind_method(D_METHOD("get_radius"),&VehicleWheel::get_radius); - ClassDB::bind_method(_MD("set_suspension_rest_length","length"),&VehicleWheel::set_suspension_rest_length); - ClassDB::bind_method(_MD("get_suspension_rest_length"),&VehicleWheel::get_suspension_rest_length); + ClassDB::bind_method(D_METHOD("set_suspension_rest_length","length"),&VehicleWheel::set_suspension_rest_length); + ClassDB::bind_method(D_METHOD("get_suspension_rest_length"),&VehicleWheel::get_suspension_rest_length); - ClassDB::bind_method(_MD("set_suspension_travel","length"),&VehicleWheel::set_suspension_travel); - ClassDB::bind_method(_MD("get_suspension_travel"),&VehicleWheel::get_suspension_travel); + ClassDB::bind_method(D_METHOD("set_suspension_travel","length"),&VehicleWheel::set_suspension_travel); + ClassDB::bind_method(D_METHOD("get_suspension_travel"),&VehicleWheel::get_suspension_travel); - ClassDB::bind_method(_MD("set_suspension_stiffness","length"),&VehicleWheel::set_suspension_stiffness); - ClassDB::bind_method(_MD("get_suspension_stiffness"),&VehicleWheel::get_suspension_stiffness); + ClassDB::bind_method(D_METHOD("set_suspension_stiffness","length"),&VehicleWheel::set_suspension_stiffness); + ClassDB::bind_method(D_METHOD("get_suspension_stiffness"),&VehicleWheel::get_suspension_stiffness); - ClassDB::bind_method(_MD("set_suspension_max_force","length"),&VehicleWheel::set_suspension_max_force); - ClassDB::bind_method(_MD("get_suspension_max_force"),&VehicleWheel::get_suspension_max_force); + ClassDB::bind_method(D_METHOD("set_suspension_max_force","length"),&VehicleWheel::set_suspension_max_force); + ClassDB::bind_method(D_METHOD("get_suspension_max_force"),&VehicleWheel::get_suspension_max_force); - ClassDB::bind_method(_MD("set_damping_compression","length"),&VehicleWheel::set_damping_compression); - ClassDB::bind_method(_MD("get_damping_compression"),&VehicleWheel::get_damping_compression); + ClassDB::bind_method(D_METHOD("set_damping_compression","length"),&VehicleWheel::set_damping_compression); + ClassDB::bind_method(D_METHOD("get_damping_compression"),&VehicleWheel::get_damping_compression); - ClassDB::bind_method(_MD("set_damping_relaxation","length"),&VehicleWheel::set_damping_relaxation); - ClassDB::bind_method(_MD("get_damping_relaxation"),&VehicleWheel::get_damping_relaxation); + ClassDB::bind_method(D_METHOD("set_damping_relaxation","length"),&VehicleWheel::set_damping_relaxation); + ClassDB::bind_method(D_METHOD("get_damping_relaxation"),&VehicleWheel::get_damping_relaxation); - ClassDB::bind_method(_MD("set_use_as_traction","enable"),&VehicleWheel::set_use_as_traction); - ClassDB::bind_method(_MD("is_used_as_traction"),&VehicleWheel::is_used_as_traction); + ClassDB::bind_method(D_METHOD("set_use_as_traction","enable"),&VehicleWheel::set_use_as_traction); + ClassDB::bind_method(D_METHOD("is_used_as_traction"),&VehicleWheel::is_used_as_traction); - ClassDB::bind_method(_MD("set_use_as_steering","enable"),&VehicleWheel::set_use_as_steering); - ClassDB::bind_method(_MD("is_used_as_steering"),&VehicleWheel::is_used_as_steering); + ClassDB::bind_method(D_METHOD("set_use_as_steering","enable"),&VehicleWheel::set_use_as_steering); + ClassDB::bind_method(D_METHOD("is_used_as_steering"),&VehicleWheel::is_used_as_steering); - ClassDB::bind_method(_MD("set_friction_slip","length"),&VehicleWheel::set_friction_slip); - ClassDB::bind_method(_MD("get_friction_slip"),&VehicleWheel::get_friction_slip); + ClassDB::bind_method(D_METHOD("set_friction_slip","length"),&VehicleWheel::set_friction_slip); + ClassDB::bind_method(D_METHOD("get_friction_slip"),&VehicleWheel::get_friction_slip); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_as_traction"),_SCS("set_use_as_traction"),_SCS("is_used_as_traction")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_as_steering"),_SCS("set_use_as_steering"),_SCS("is_used_as_steering")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_as_traction"),"set_use_as_traction","is_used_as_traction"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_as_steering"),"set_use_as_steering","is_used_as_steering"); ADD_GROUP("Wheel","wheel_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel_radius"),_SCS("set_radius"),_SCS("get_radius")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel_rest_length"),_SCS("set_suspension_rest_length"),_SCS("get_suspension_rest_length")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel_friction_slip"),_SCS("set_friction_slip"),_SCS("get_friction_slip")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel_radius"),"set_radius","get_radius"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel_rest_length"),"set_suspension_rest_length","get_suspension_rest_length"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel_friction_slip"),"set_friction_slip","get_friction_slip"); ADD_GROUP("Suspension","suspension_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension_travel"),_SCS("set_suspension_travel"),_SCS("get_suspension_travel")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension_stiffness"),_SCS("set_suspension_stiffness"),_SCS("get_suspension_stiffness")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension_max_force"),_SCS("set_suspension_max_force"),_SCS("get_suspension_max_force")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension_travel"),"set_suspension_travel","get_suspension_travel"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension_stiffness"),"set_suspension_stiffness","get_suspension_stiffness"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension_max_force"),"set_suspension_max_force","get_suspension_max_force"); ADD_GROUP("Damping","damping_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"damping_compression"),_SCS("set_damping_compression"),_SCS("get_damping_compression")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"damping_relaxation"),_SCS("set_damping_relaxation"),_SCS("get_damping_relaxation")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"damping_compression"),"set_damping_compression","get_damping_compression"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"damping_relaxation"),"set_damping_relaxation","get_damping_relaxation"); } @@ -1026,32 +1026,32 @@ Vector3 VehicleBody::get_linear_velocity() const void VehicleBody::_bind_methods(){ - ClassDB::bind_method(_MD("set_mass","mass"),&VehicleBody::set_mass); - ClassDB::bind_method(_MD("get_mass"),&VehicleBody::get_mass); + ClassDB::bind_method(D_METHOD("set_mass","mass"),&VehicleBody::set_mass); + ClassDB::bind_method(D_METHOD("get_mass"),&VehicleBody::get_mass); - ClassDB::bind_method(_MD("set_friction","friction"),&VehicleBody::set_friction); - ClassDB::bind_method(_MD("get_friction"),&VehicleBody::get_friction); + ClassDB::bind_method(D_METHOD("set_friction","friction"),&VehicleBody::set_friction); + ClassDB::bind_method(D_METHOD("get_friction"),&VehicleBody::get_friction); - ClassDB::bind_method(_MD("set_engine_force","engine_force"),&VehicleBody::set_engine_force); - ClassDB::bind_method(_MD("get_engine_force"),&VehicleBody::get_engine_force); + ClassDB::bind_method(D_METHOD("set_engine_force","engine_force"),&VehicleBody::set_engine_force); + ClassDB::bind_method(D_METHOD("get_engine_force"),&VehicleBody::get_engine_force); - ClassDB::bind_method(_MD("set_brake","brake"),&VehicleBody::set_brake); - ClassDB::bind_method(_MD("get_brake"),&VehicleBody::get_brake); + ClassDB::bind_method(D_METHOD("set_brake","brake"),&VehicleBody::set_brake); + ClassDB::bind_method(D_METHOD("get_brake"),&VehicleBody::get_brake); - ClassDB::bind_method(_MD("set_steering","steering"),&VehicleBody::set_steering); - ClassDB::bind_method(_MD("get_steering"),&VehicleBody::get_steering); + ClassDB::bind_method(D_METHOD("set_steering","steering"),&VehicleBody::set_steering); + ClassDB::bind_method(D_METHOD("get_steering"),&VehicleBody::get_steering); - ClassDB::bind_method(_MD("get_linear_velocity"),&VehicleBody::get_linear_velocity); + ClassDB::bind_method(D_METHOD("get_linear_velocity"),&VehicleBody::get_linear_velocity); - ClassDB::bind_method(_MD("_direct_state_changed"),&VehicleBody::_direct_state_changed); + ClassDB::bind_method(D_METHOD("_direct_state_changed"),&VehicleBody::_direct_state_changed); ADD_GROUP("Motion",""); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"engine_force",PROPERTY_HINT_RANGE,"0.00,1024.0,0.01"),_SCS("set_engine_force"),_SCS("get_engine_force")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"brake",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_brake"),_SCS("get_brake")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"steering",PROPERTY_HINT_RANGE,"-180,180.0,0.01"),_SCS("set_steering"),_SCS("get_steering")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"engine_force",PROPERTY_HINT_RANGE,"0.00,1024.0,0.01"),"set_engine_force","get_engine_force"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"brake",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),"set_brake","get_brake"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"steering",PROPERTY_HINT_RANGE,"-180,180.0,0.01"),"set_steering","get_steering"); ADD_GROUP("Mass",""); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"mass",PROPERTY_HINT_RANGE,"0.01,65536,0.01"),_SCS("set_mass"),_SCS("get_mass")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0.01,1,0.01"),_SCS("set_friction"),_SCS("get_friction")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"mass",PROPERTY_HINT_RANGE,"0.01,65536,0.01"),"set_mass","get_mass"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0.01,1,0.01"),"set_friction","get_friction"); } diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index c7c083732e..0633846b5a 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -109,11 +109,11 @@ bool VisibilityNotifier::is_on_screen() const { void VisibilityNotifier::_bind_methods(){ - ClassDB::bind_method(_MD("set_aabb","rect"),&VisibilityNotifier::set_aabb); - ClassDB::bind_method(_MD("get_aabb"),&VisibilityNotifier::get_aabb); - ClassDB::bind_method(_MD("is_on_screen"),&VisibilityNotifier::is_on_screen); + ClassDB::bind_method(D_METHOD("set_aabb","rect"),&VisibilityNotifier::set_aabb); + ClassDB::bind_method(D_METHOD("get_aabb"),&VisibilityNotifier::get_aabb); + ClassDB::bind_method(D_METHOD("is_on_screen"),&VisibilityNotifier::is_on_screen); - ADD_PROPERTY( PropertyInfo(Variant::RECT3,"aabb"),_SCS("set_aabb"),_SCS("get_aabb")); + ADD_PROPERTY( PropertyInfo(Variant::RECT3,"aabb"),"set_aabb","get_aabb"); ADD_SIGNAL( MethodInfo("camera_entered",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera")) ); ADD_SIGNAL( MethodInfo("camera_exited",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera")) ); @@ -268,12 +268,12 @@ void VisibilityEnabler::_node_removed(Node* p_node) { void VisibilityEnabler::_bind_methods(){ - ClassDB::bind_method(_MD("set_enabler","enabler","enabled"),&VisibilityEnabler::set_enabler); - ClassDB::bind_method(_MD("is_enabler_enabled","enabler"),&VisibilityEnabler::is_enabler_enabled); - ClassDB::bind_method(_MD("_node_removed"),&VisibilityEnabler::_node_removed); + ClassDB::bind_method(D_METHOD("set_enabler","enabler","enabled"),&VisibilityEnabler::set_enabler); + ClassDB::bind_method(D_METHOD("is_enabler_enabled","enabler"),&VisibilityEnabler::is_enabler_enabled); + ClassDB::bind_method(D_METHOD("_node_removed"),&VisibilityEnabler::_node_removed); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_animations"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_ANIMATIONS ); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"freeze_bodies"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_FREEZE_BODIES); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_animations"),"set_enabler","is_enabler_enabled", ENABLER_PAUSE_ANIMATIONS ); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"freeze_bodies"),"set_enabler","is_enabler_enabled", ENABLER_FREEZE_BODIES); BIND_CONSTANT( ENABLER_FREEZE_BODIES ); BIND_CONSTANT( ENABLER_PAUSE_ANIMATIONS ); diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index ec37aa2bc4..bbcd54b36b 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -137,14 +137,14 @@ uint32_t VisualInstance::get_layer_mask() const { void VisualInstance::_bind_methods() { - ClassDB::bind_method(_MD("_get_visual_instance_rid"),&VisualInstance::_get_visual_instance_rid); - ClassDB::bind_method(_MD("set_base","base"), &VisualInstance::set_base); - ClassDB::bind_method(_MD("set_layer_mask","mask"), &VisualInstance::set_layer_mask); - ClassDB::bind_method(_MD("get_layer_mask"), &VisualInstance::get_layer_mask); + ClassDB::bind_method(D_METHOD("_get_visual_instance_rid"),&VisualInstance::_get_visual_instance_rid); + ClassDB::bind_method(D_METHOD("set_base","base"), &VisualInstance::set_base); + ClassDB::bind_method(D_METHOD("set_layer_mask","mask"), &VisualInstance::set_layer_mask); + ClassDB::bind_method(D_METHOD("get_layer_mask"), &VisualInstance::get_layer_mask); - ClassDB::bind_method(_MD("get_transformed_aabb"), &VisualInstance::get_transformed_aabb); + ClassDB::bind_method(D_METHOD("get_transformed_aabb"), &VisualInstance::get_transformed_aabb); - ADD_PROPERTY( PropertyInfo( Variant::INT, "layers",PROPERTY_HINT_LAYERS_3D_RENDER), _SCS("set_layer_mask"), _SCS("get_layer_mask")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "layers",PROPERTY_HINT_LAYERS_3D_RENDER), "set_layer_mask", "get_layer_mask"); } @@ -324,49 +324,49 @@ float GeometryInstance::get_extra_cull_margin() const{ void GeometryInstance::_bind_methods() { - ClassDB::bind_method(_MD("set_material_override","material"), &GeometryInstance::set_material_override); - ClassDB::bind_method(_MD("get_material_override"), &GeometryInstance::get_material_override); + ClassDB::bind_method(D_METHOD("set_material_override","material"), &GeometryInstance::set_material_override); + ClassDB::bind_method(D_METHOD("get_material_override"), &GeometryInstance::get_material_override); - ClassDB::bind_method(_MD("set_flag","flag","value"), &GeometryInstance::set_flag); - ClassDB::bind_method(_MD("get_flag","flag"), &GeometryInstance::get_flag); + ClassDB::bind_method(D_METHOD("set_flag","flag","value"), &GeometryInstance::set_flag); + ClassDB::bind_method(D_METHOD("get_flag","flag"), &GeometryInstance::get_flag); - ClassDB::bind_method(_MD("set_cast_shadows_setting", "shadow_casting_setting"), &GeometryInstance::set_cast_shadows_setting); - ClassDB::bind_method(_MD("get_cast_shadows_setting"), &GeometryInstance::get_cast_shadows_setting); + ClassDB::bind_method(D_METHOD("set_cast_shadows_setting", "shadow_casting_setting"), &GeometryInstance::set_cast_shadows_setting); + ClassDB::bind_method(D_METHOD("get_cast_shadows_setting"), &GeometryInstance::get_cast_shadows_setting); - ClassDB::bind_method(_MD("set_lod_max_hysteresis","mode"), &GeometryInstance::set_lod_max_hysteresis); - ClassDB::bind_method(_MD("get_lod_max_hysteresis"), &GeometryInstance::get_lod_max_hysteresis); + ClassDB::bind_method(D_METHOD("set_lod_max_hysteresis","mode"), &GeometryInstance::set_lod_max_hysteresis); + ClassDB::bind_method(D_METHOD("get_lod_max_hysteresis"), &GeometryInstance::get_lod_max_hysteresis); - ClassDB::bind_method(_MD("set_lod_max_distance","mode"), &GeometryInstance::set_lod_max_distance); - ClassDB::bind_method(_MD("get_lod_max_distance"), &GeometryInstance::get_lod_max_distance); + ClassDB::bind_method(D_METHOD("set_lod_max_distance","mode"), &GeometryInstance::set_lod_max_distance); + ClassDB::bind_method(D_METHOD("get_lod_max_distance"), &GeometryInstance::get_lod_max_distance); - ClassDB::bind_method(_MD("set_lod_min_hysteresis","mode"), &GeometryInstance::set_lod_min_hysteresis); - ClassDB::bind_method(_MD("get_lod_min_hysteresis"), &GeometryInstance::get_lod_min_hysteresis); + ClassDB::bind_method(D_METHOD("set_lod_min_hysteresis","mode"), &GeometryInstance::set_lod_min_hysteresis); + ClassDB::bind_method(D_METHOD("get_lod_min_hysteresis"), &GeometryInstance::get_lod_min_hysteresis); - ClassDB::bind_method(_MD("set_lod_min_distance","mode"), &GeometryInstance::set_lod_min_distance); - ClassDB::bind_method(_MD("get_lod_min_distance"), &GeometryInstance::get_lod_min_distance); + ClassDB::bind_method(D_METHOD("set_lod_min_distance","mode"), &GeometryInstance::set_lod_min_distance); + ClassDB::bind_method(D_METHOD("get_lod_min_distance"), &GeometryInstance::get_lod_min_distance); - ClassDB::bind_method(_MD("set_extra_cull_margin","margin"), &GeometryInstance::set_extra_cull_margin); - ClassDB::bind_method(_MD("get_extra_cull_margin"), &GeometryInstance::get_extra_cull_margin); + ClassDB::bind_method(D_METHOD("set_extra_cull_margin","margin"), &GeometryInstance::set_extra_cull_margin); + ClassDB::bind_method(D_METHOD("get_extra_cull_margin"), &GeometryInstance::get_extra_cull_margin); - ClassDB::bind_method(_MD("get_aabb"),&GeometryInstance::get_aabb); + ClassDB::bind_method(D_METHOD("get_aabb"),&GeometryInstance::get_aabb); ADD_GROUP("Geometry",""); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "material_override",PROPERTY_HINT_RESOURCE_TYPE,"Material"), _SCS("set_material_override"), _SCS("get_material_override")); - ADD_PROPERTY(PropertyInfo(Variant::INT, "cast_shadow", PROPERTY_HINT_ENUM, "Off,On,Double-Sided,Shadows Only"), _SCS("set_cast_shadows_setting"), _SCS("get_cast_shadows_setting")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "extra_cull_margin",PROPERTY_HINT_RANGE,"0,16384,0"), _SCS("set_extra_cull_margin"), _SCS("get_extra_cull_margin")); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_as_billboard"), _SCS("set_flag"), _SCS("get_flag"),FLAG_BILLBOARD); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_as_y_billboard"), _SCS("set_flag"), _SCS("get_flag"),FLAG_BILLBOARD_FIX_Y); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_depth_scale"), _SCS("set_flag"), _SCS("get_flag"),FLAG_DEPH_SCALE); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "visible_in_all_rooms"), _SCS("set_flag"), _SCS("get_flag"),FLAG_VISIBLE_IN_ALL_ROOMS); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_in_baked_light"), _SCS("set_flag"), _SCS("get_flag"),FLAG_USE_BAKED_LIGHT); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "material_override",PROPERTY_HINT_RESOURCE_TYPE,"Material"), "set_material_override", "get_material_override"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "cast_shadow", PROPERTY_HINT_ENUM, "Off,On,Double-Sided,Shadows Only"), "set_cast_shadows_setting", "get_cast_shadows_setting"); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "extra_cull_margin",PROPERTY_HINT_RANGE,"0,16384,0"), "set_extra_cull_margin", "get_extra_cull_margin"); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_as_billboard"), "set_flag", "get_flag",FLAG_BILLBOARD); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_as_y_billboard"), "set_flag", "get_flag",FLAG_BILLBOARD_FIX_Y); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_depth_scale"), "set_flag", "get_flag",FLAG_DEPH_SCALE); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "visible_in_all_rooms"), "set_flag", "get_flag",FLAG_VISIBLE_IN_ALL_ROOMS); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_in_baked_light"), "set_flag", "get_flag",FLAG_USE_BAKED_LIGHT); ADD_GROUP("LOD","lod_"); - ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_min_distance",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_lod_min_distance"), _SCS("get_lod_min_distance")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_min_hysteresis",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_lod_min_hysteresis"), _SCS("get_lod_min_hysteresis")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_max_distance",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_lod_max_distance"), _SCS("get_lod_max_distance")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_max_hysteresis",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_lod_max_hysteresis"), _SCS("get_lod_max_hysteresis")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_min_distance",PROPERTY_HINT_RANGE,"0,32768,0.01"), "set_lod_min_distance", "get_lod_min_distance"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_min_hysteresis",PROPERTY_HINT_RANGE,"0,32768,0.01"), "set_lod_min_hysteresis", "get_lod_min_hysteresis"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_max_distance",PROPERTY_HINT_RANGE,"0,32768,0.01"), "set_lod_max_distance", "get_lod_max_distance"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_max_hysteresis",PROPERTY_HINT_RANGE,"0,32768,0.01"), "set_lod_max_hysteresis", "get_lod_max_hysteresis"); //ADD_SIGNAL( MethodInfo("visibility_changed")); diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index bcbda5a781..960356d9cf 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -368,8 +368,8 @@ void AnimationCache::set_animation(const Ref<Animation>& p_animation) { void AnimationCache::_bind_methods() { - ClassDB::bind_method(_MD("_node_exit_tree"),&AnimationCache::_node_exit_tree); - ClassDB::bind_method(_MD("_animation_changed"),&AnimationCache::_animation_changed); + ClassDB::bind_method(D_METHOD("_node_exit_tree"),&AnimationCache::_node_exit_tree); + ClassDB::bind_method(D_METHOD("_animation_changed"),&AnimationCache::_animation_changed); } void AnimationCache::set_root(Node* p_root) { diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index e02b2b2b41..e9f1904fe9 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -588,35 +588,26 @@ void AnimationPlayer::_animation_process2(float p_delta) { Playback &c=playback; - float prev_blend=1.0; accum_pass++; - int pop_count=1; - int pop=0; // if >0, then amount of elements to pop from the back + _animation_process_data(c.current,p_delta,1.0f); - - for (List<Blend>::Element *E=c.blend.back();E;E=E->prev(),pop_count++) { + List<Blend>::Element *prev = NULL; + for (List<Blend>::Element *E=c.blend.back();E;E=prev) { Blend& b=E->get(); - _animation_process_data(b.data,p_delta,prev_blend); - - prev_blend=1.0-b.blend_left/b.blend_time; + float blend=b.blend_left/b.blend_time; + _animation_process_data(b.data,p_delta,blend); b.blend_left-=Math::absf(speed_scale*p_delta); + prev = E->prev(); if (b.blend_left<0) { - pop=pop_count; + c.blend.erase(E); } } - - while(pop--) { - - c.blend.pop_back(); - } - - - _animation_process_data(c.current,p_delta,prev_blend); + } @@ -1296,67 +1287,67 @@ void AnimationPlayer::get_argument_options(const StringName& p_function,int p_id void AnimationPlayer::_bind_methods() { - ClassDB::bind_method(_MD("_node_removed"),&AnimationPlayer::_node_removed); - ClassDB::bind_method(_MD("_animation_changed"),&AnimationPlayer::_animation_changed); + ClassDB::bind_method(D_METHOD("_node_removed"),&AnimationPlayer::_node_removed); + ClassDB::bind_method(D_METHOD("_animation_changed"),&AnimationPlayer::_animation_changed); - ClassDB::bind_method(_MD("add_animation","name","animation:Animation"),&AnimationPlayer::add_animation); - ClassDB::bind_method(_MD("remove_animation","name"),&AnimationPlayer::remove_animation); - ClassDB::bind_method(_MD("rename_animation","name","newname"),&AnimationPlayer::rename_animation); - ClassDB::bind_method(_MD("has_animation","name"),&AnimationPlayer::has_animation); - ClassDB::bind_method(_MD("get_animation:Animation","name"),&AnimationPlayer::get_animation); - ClassDB::bind_method(_MD("get_animation_list"),&AnimationPlayer::_get_animation_list); + ClassDB::bind_method(D_METHOD("add_animation","name","animation:Animation"),&AnimationPlayer::add_animation); + ClassDB::bind_method(D_METHOD("remove_animation","name"),&AnimationPlayer::remove_animation); + ClassDB::bind_method(D_METHOD("rename_animation","name","newname"),&AnimationPlayer::rename_animation); + ClassDB::bind_method(D_METHOD("has_animation","name"),&AnimationPlayer::has_animation); + ClassDB::bind_method(D_METHOD("get_animation:Animation","name"),&AnimationPlayer::get_animation); + ClassDB::bind_method(D_METHOD("get_animation_list"),&AnimationPlayer::_get_animation_list); - ClassDB::bind_method(_MD("animation_set_next", "anim_from", "anim_to"), &AnimationPlayer::animation_set_next); - ClassDB::bind_method(_MD("animation_get_next", "anim_from"), &AnimationPlayer::animation_get_next); + ClassDB::bind_method(D_METHOD("animation_set_next", "anim_from", "anim_to"), &AnimationPlayer::animation_set_next); + ClassDB::bind_method(D_METHOD("animation_get_next", "anim_from"), &AnimationPlayer::animation_get_next); - ClassDB::bind_method(_MD("set_blend_time","anim_from","anim_to","sec"),&AnimationPlayer::set_blend_time); - ClassDB::bind_method(_MD("get_blend_time","anim_from","anim_to"),&AnimationPlayer::get_blend_time); + ClassDB::bind_method(D_METHOD("set_blend_time","anim_from","anim_to","sec"),&AnimationPlayer::set_blend_time); + ClassDB::bind_method(D_METHOD("get_blend_time","anim_from","anim_to"),&AnimationPlayer::get_blend_time); - ClassDB::bind_method(_MD("set_default_blend_time","sec"),&AnimationPlayer::set_default_blend_time); - ClassDB::bind_method(_MD("get_default_blend_time"),&AnimationPlayer::get_default_blend_time); + ClassDB::bind_method(D_METHOD("set_default_blend_time","sec"),&AnimationPlayer::set_default_blend_time); + ClassDB::bind_method(D_METHOD("get_default_blend_time"),&AnimationPlayer::get_default_blend_time); - ClassDB::bind_method(_MD("play","name","custom_blend","custom_speed","from_end"),&AnimationPlayer::play,DEFVAL(""),DEFVAL(-1),DEFVAL(1.0),DEFVAL(false)); - ClassDB::bind_method(_MD("play_backwards","name","custom_blend"),&AnimationPlayer::play_backwards,DEFVAL(""),DEFVAL(-1)); - ClassDB::bind_method(_MD("stop","reset"),&AnimationPlayer::stop,DEFVAL(true)); - ClassDB::bind_method(_MD("stop_all"),&AnimationPlayer::stop_all); - ClassDB::bind_method(_MD("is_playing"),&AnimationPlayer::is_playing); - ClassDB::bind_method(_MD("set_current_animation","anim"),&AnimationPlayer::set_current_animation); - ClassDB::bind_method(_MD("get_current_animation"),&AnimationPlayer::get_current_animation); - ClassDB::bind_method(_MD("queue","name"),&AnimationPlayer::queue); - ClassDB::bind_method(_MD("clear_queue"),&AnimationPlayer::clear_queue); + ClassDB::bind_method(D_METHOD("play","name","custom_blend","custom_speed","from_end"),&AnimationPlayer::play,DEFVAL(""),DEFVAL(-1),DEFVAL(1.0),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("play_backwards","name","custom_blend"),&AnimationPlayer::play_backwards,DEFVAL(""),DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("stop","reset"),&AnimationPlayer::stop,DEFVAL(true)); + ClassDB::bind_method(D_METHOD("stop_all"),&AnimationPlayer::stop_all); + ClassDB::bind_method(D_METHOD("is_playing"),&AnimationPlayer::is_playing); + ClassDB::bind_method(D_METHOD("set_current_animation","anim"),&AnimationPlayer::set_current_animation); + ClassDB::bind_method(D_METHOD("get_current_animation"),&AnimationPlayer::get_current_animation); + ClassDB::bind_method(D_METHOD("queue","name"),&AnimationPlayer::queue); + ClassDB::bind_method(D_METHOD("clear_queue"),&AnimationPlayer::clear_queue); - ClassDB::bind_method(_MD("set_active","active"),&AnimationPlayer::set_active); - ClassDB::bind_method(_MD("is_active"),&AnimationPlayer::is_active); + ClassDB::bind_method(D_METHOD("set_active","active"),&AnimationPlayer::set_active); + ClassDB::bind_method(D_METHOD("is_active"),&AnimationPlayer::is_active); - ClassDB::bind_method(_MD("set_speed_scale","speed"),&AnimationPlayer::set_speed_scale); - ClassDB::bind_method(_MD("get_speed_scale"),&AnimationPlayer::get_speed_scale); + ClassDB::bind_method(D_METHOD("set_speed_scale","speed"),&AnimationPlayer::set_speed_scale); + ClassDB::bind_method(D_METHOD("get_speed_scale"),&AnimationPlayer::get_speed_scale); - ClassDB::bind_method(_MD("set_autoplay","name"),&AnimationPlayer::set_autoplay); - ClassDB::bind_method(_MD("get_autoplay"),&AnimationPlayer::get_autoplay); + ClassDB::bind_method(D_METHOD("set_autoplay","name"),&AnimationPlayer::set_autoplay); + ClassDB::bind_method(D_METHOD("get_autoplay"),&AnimationPlayer::get_autoplay); - ClassDB::bind_method(_MD("set_root","path"),&AnimationPlayer::set_root); - ClassDB::bind_method(_MD("get_root"),&AnimationPlayer::get_root); + ClassDB::bind_method(D_METHOD("set_root","path"),&AnimationPlayer::set_root); + ClassDB::bind_method(D_METHOD("get_root"),&AnimationPlayer::get_root); - ClassDB::bind_method(_MD("seek","pos_sec","update"),&AnimationPlayer::seek,DEFVAL(false)); - ClassDB::bind_method(_MD("get_pos"),&AnimationPlayer::get_current_animation_pos); + ClassDB::bind_method(D_METHOD("seek","pos_sec","update"),&AnimationPlayer::seek,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_pos"),&AnimationPlayer::get_current_animation_pos); - ClassDB::bind_method(_MD("find_animation","animation:Animation"),&AnimationPlayer::find_animation); + ClassDB::bind_method(D_METHOD("find_animation","animation:Animation"),&AnimationPlayer::find_animation); - ClassDB::bind_method(_MD("clear_caches"),&AnimationPlayer::clear_caches); + ClassDB::bind_method(D_METHOD("clear_caches"),&AnimationPlayer::clear_caches); - ClassDB::bind_method(_MD("set_animation_process_mode","mode"),&AnimationPlayer::set_animation_process_mode); - ClassDB::bind_method(_MD("get_animation_process_mode"),&AnimationPlayer::get_animation_process_mode); + ClassDB::bind_method(D_METHOD("set_animation_process_mode","mode"),&AnimationPlayer::set_animation_process_mode); + ClassDB::bind_method(D_METHOD("get_animation_process_mode"),&AnimationPlayer::get_animation_process_mode); - ClassDB::bind_method(_MD("get_current_animation_pos"),&AnimationPlayer::get_current_animation_pos); - ClassDB::bind_method(_MD("get_current_animation_length"),&AnimationPlayer::get_current_animation_length); + ClassDB::bind_method(D_METHOD("get_current_animation_pos"),&AnimationPlayer::get_current_animation_pos); + ClassDB::bind_method(D_METHOD("get_current_animation_length"),&AnimationPlayer::get_current_animation_length); - ClassDB::bind_method(_MD("advance","delta"),&AnimationPlayer::advance); + ClassDB::bind_method(D_METHOD("advance","delta"),&AnimationPlayer::advance); ADD_GROUP("Playback","playback_"); - ADD_PROPERTY( PropertyInfo( Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_animation_process_mode"), _SCS("get_animation_process_mode")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "playback_default_blend_time", PROPERTY_HINT_RANGE, "0,4096,0.01"), _SCS("set_default_blend_time"), _SCS("get_default_blend_time")); - ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "root_node"), _SCS("set_root"), _SCS("get_root")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), "set_animation_process_mode", "get_animation_process_mode"); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "playback_default_blend_time", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_default_blend_time", "get_default_blend_time"); + ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "root_node"), "set_root", "get_root"); ADD_SIGNAL( MethodInfo("animation_finished", PropertyInfo(Variant::STRING,"name")) ); ADD_SIGNAL( MethodInfo("animation_changed", PropertyInfo(Variant::STRING,"old_name"), PropertyInfo(Variant::STRING,"new_name")) ); diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index a3347dadcf..d7e98ddd2b 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -711,7 +711,7 @@ float AnimationTreePlayer::_process_node(const StringName& p_node,AnimationNode else rem = _process_node(tsn->inputs[0].node,r_prev_anim,p_time*tsn->scale,false,p_fallback_weight,p_weights); if (tsn->scale == 0) - return INFINITY; + return Math_INF; else return rem / tsn->scale; @@ -1828,106 +1828,106 @@ Error AnimationTreePlayer::node_rename(const StringName& p_node,const StringName void AnimationTreePlayer::_bind_methods() { - ClassDB::bind_method(_MD("add_node","type","id"),&AnimationTreePlayer::add_node); + ClassDB::bind_method(D_METHOD("add_node","type","id"),&AnimationTreePlayer::add_node); - ClassDB::bind_method(_MD("node_exists","node"),&AnimationTreePlayer::node_exists); - ClassDB::bind_method(_MD("node_rename","node","new_name"),&AnimationTreePlayer::node_rename); + ClassDB::bind_method(D_METHOD("node_exists","node"),&AnimationTreePlayer::node_exists); + ClassDB::bind_method(D_METHOD("node_rename","node","new_name"),&AnimationTreePlayer::node_rename); - ClassDB::bind_method(_MD("node_get_type","id"),&AnimationTreePlayer::node_get_type); - ClassDB::bind_method(_MD("node_get_input_count","id"),&AnimationTreePlayer::node_get_input_count); - ClassDB::bind_method(_MD("node_get_input_source","id","idx"),&AnimationTreePlayer::node_get_input_source); + ClassDB::bind_method(D_METHOD("node_get_type","id"),&AnimationTreePlayer::node_get_type); + ClassDB::bind_method(D_METHOD("node_get_input_count","id"),&AnimationTreePlayer::node_get_input_count); + ClassDB::bind_method(D_METHOD("node_get_input_source","id","idx"),&AnimationTreePlayer::node_get_input_source); - ClassDB::bind_method(_MD("animation_node_set_animation","id","animation:Animation"),&AnimationTreePlayer::animation_node_set_animation); - ClassDB::bind_method(_MD("animation_node_get_animation:Animation","id"),&AnimationTreePlayer::animation_node_get_animation); + ClassDB::bind_method(D_METHOD("animation_node_set_animation","id","animation:Animation"),&AnimationTreePlayer::animation_node_set_animation); + ClassDB::bind_method(D_METHOD("animation_node_get_animation:Animation","id"),&AnimationTreePlayer::animation_node_get_animation); - ClassDB::bind_method(_MD("animation_node_set_master_animation","id","source"),&AnimationTreePlayer::animation_node_set_master_animation); - ClassDB::bind_method(_MD("animation_node_get_master_animation","id"),&AnimationTreePlayer::animation_node_get_master_animation); - ClassDB::bind_method(_MD("animation_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::animation_node_set_filter_path); + ClassDB::bind_method(D_METHOD("animation_node_set_master_animation","id","source"),&AnimationTreePlayer::animation_node_set_master_animation); + ClassDB::bind_method(D_METHOD("animation_node_get_master_animation","id"),&AnimationTreePlayer::animation_node_get_master_animation); + ClassDB::bind_method(D_METHOD("animation_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::animation_node_set_filter_path); - ClassDB::bind_method(_MD("oneshot_node_set_fadein_time","id","time_sec"),&AnimationTreePlayer::oneshot_node_set_fadein_time); - ClassDB::bind_method(_MD("oneshot_node_get_fadein_time","id"),&AnimationTreePlayer::oneshot_node_get_fadein_time); + ClassDB::bind_method(D_METHOD("oneshot_node_set_fadein_time","id","time_sec"),&AnimationTreePlayer::oneshot_node_set_fadein_time); + ClassDB::bind_method(D_METHOD("oneshot_node_get_fadein_time","id"),&AnimationTreePlayer::oneshot_node_get_fadein_time); - ClassDB::bind_method(_MD("oneshot_node_set_fadeout_time","id","time_sec"),&AnimationTreePlayer::oneshot_node_set_fadeout_time); - ClassDB::bind_method(_MD("oneshot_node_get_fadeout_time","id"),&AnimationTreePlayer::oneshot_node_get_fadeout_time); + ClassDB::bind_method(D_METHOD("oneshot_node_set_fadeout_time","id","time_sec"),&AnimationTreePlayer::oneshot_node_set_fadeout_time); + ClassDB::bind_method(D_METHOD("oneshot_node_get_fadeout_time","id"),&AnimationTreePlayer::oneshot_node_get_fadeout_time); - ClassDB::bind_method(_MD("oneshot_node_set_autorestart","id","enable"),&AnimationTreePlayer::oneshot_node_set_autorestart); - ClassDB::bind_method(_MD("oneshot_node_set_autorestart_delay","id","delay_sec"),&AnimationTreePlayer::oneshot_node_set_autorestart_delay); - ClassDB::bind_method(_MD("oneshot_node_set_autorestart_random_delay","id","rand_sec"),&AnimationTreePlayer::oneshot_node_set_autorestart_random_delay); + ClassDB::bind_method(D_METHOD("oneshot_node_set_autorestart","id","enable"),&AnimationTreePlayer::oneshot_node_set_autorestart); + ClassDB::bind_method(D_METHOD("oneshot_node_set_autorestart_delay","id","delay_sec"),&AnimationTreePlayer::oneshot_node_set_autorestart_delay); + ClassDB::bind_method(D_METHOD("oneshot_node_set_autorestart_random_delay","id","rand_sec"),&AnimationTreePlayer::oneshot_node_set_autorestart_random_delay); - ClassDB::bind_method(_MD("oneshot_node_has_autorestart","id"),&AnimationTreePlayer::oneshot_node_has_autorestart); - ClassDB::bind_method(_MD("oneshot_node_get_autorestart_delay","id"),&AnimationTreePlayer::oneshot_node_get_autorestart_delay); - ClassDB::bind_method(_MD("oneshot_node_get_autorestart_random_delay","id"),&AnimationTreePlayer::oneshot_node_get_autorestart_random_delay); + ClassDB::bind_method(D_METHOD("oneshot_node_has_autorestart","id"),&AnimationTreePlayer::oneshot_node_has_autorestart); + ClassDB::bind_method(D_METHOD("oneshot_node_get_autorestart_delay","id"),&AnimationTreePlayer::oneshot_node_get_autorestart_delay); + ClassDB::bind_method(D_METHOD("oneshot_node_get_autorestart_random_delay","id"),&AnimationTreePlayer::oneshot_node_get_autorestart_random_delay); - ClassDB::bind_method(_MD("oneshot_node_start","id"),&AnimationTreePlayer::oneshot_node_start); - ClassDB::bind_method(_MD("oneshot_node_stop","id"),&AnimationTreePlayer::oneshot_node_stop); - ClassDB::bind_method(_MD("oneshot_node_is_active","id"),&AnimationTreePlayer::oneshot_node_is_active); - ClassDB::bind_method(_MD("oneshot_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::oneshot_node_set_filter_path); + ClassDB::bind_method(D_METHOD("oneshot_node_start","id"),&AnimationTreePlayer::oneshot_node_start); + ClassDB::bind_method(D_METHOD("oneshot_node_stop","id"),&AnimationTreePlayer::oneshot_node_stop); + ClassDB::bind_method(D_METHOD("oneshot_node_is_active","id"),&AnimationTreePlayer::oneshot_node_is_active); + ClassDB::bind_method(D_METHOD("oneshot_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::oneshot_node_set_filter_path); - ClassDB::bind_method(_MD("mix_node_set_amount","id","ratio"),&AnimationTreePlayer::mix_node_set_amount); - ClassDB::bind_method(_MD("mix_node_get_amount","id"),&AnimationTreePlayer::mix_node_get_amount); + ClassDB::bind_method(D_METHOD("mix_node_set_amount","id","ratio"),&AnimationTreePlayer::mix_node_set_amount); + ClassDB::bind_method(D_METHOD("mix_node_get_amount","id"),&AnimationTreePlayer::mix_node_get_amount); - ClassDB::bind_method(_MD("blend2_node_set_amount","id","blend"),&AnimationTreePlayer::blend2_node_set_amount); - ClassDB::bind_method(_MD("blend2_node_get_amount","id"),&AnimationTreePlayer::blend2_node_get_amount); - ClassDB::bind_method(_MD("blend2_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::blend2_node_set_filter_path); + ClassDB::bind_method(D_METHOD("blend2_node_set_amount","id","blend"),&AnimationTreePlayer::blend2_node_set_amount); + ClassDB::bind_method(D_METHOD("blend2_node_get_amount","id"),&AnimationTreePlayer::blend2_node_get_amount); + ClassDB::bind_method(D_METHOD("blend2_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::blend2_node_set_filter_path); - ClassDB::bind_method(_MD("blend3_node_set_amount","id","blend"),&AnimationTreePlayer::blend3_node_set_amount); - ClassDB::bind_method(_MD("blend3_node_get_amount","id"),&AnimationTreePlayer::blend3_node_get_amount); + ClassDB::bind_method(D_METHOD("blend3_node_set_amount","id","blend"),&AnimationTreePlayer::blend3_node_set_amount); + ClassDB::bind_method(D_METHOD("blend3_node_get_amount","id"),&AnimationTreePlayer::blend3_node_get_amount); - ClassDB::bind_method(_MD("blend4_node_set_amount","id","blend"),&AnimationTreePlayer::blend4_node_set_amount); - ClassDB::bind_method(_MD("blend4_node_get_amount","id"),&AnimationTreePlayer::blend4_node_get_amount); + ClassDB::bind_method(D_METHOD("blend4_node_set_amount","id","blend"),&AnimationTreePlayer::blend4_node_set_amount); + ClassDB::bind_method(D_METHOD("blend4_node_get_amount","id"),&AnimationTreePlayer::blend4_node_get_amount); - ClassDB::bind_method(_MD("timescale_node_set_scale","id","scale"),&AnimationTreePlayer::timescale_node_set_scale); - ClassDB::bind_method(_MD("timescale_node_get_scale","id"),&AnimationTreePlayer::timescale_node_get_scale); + ClassDB::bind_method(D_METHOD("timescale_node_set_scale","id","scale"),&AnimationTreePlayer::timescale_node_set_scale); + ClassDB::bind_method(D_METHOD("timescale_node_get_scale","id"),&AnimationTreePlayer::timescale_node_get_scale); - ClassDB::bind_method(_MD("timeseek_node_seek","id","pos_sec"),&AnimationTreePlayer::timeseek_node_seek); + ClassDB::bind_method(D_METHOD("timeseek_node_seek","id","pos_sec"),&AnimationTreePlayer::timeseek_node_seek); - ClassDB::bind_method(_MD("transition_node_set_input_count","id","count"),&AnimationTreePlayer::transition_node_set_input_count); - ClassDB::bind_method(_MD("transition_node_get_input_count","id"),&AnimationTreePlayer::transition_node_get_input_count); - ClassDB::bind_method(_MD("transition_node_delete_input","id","input_idx"),&AnimationTreePlayer::transition_node_delete_input); + ClassDB::bind_method(D_METHOD("transition_node_set_input_count","id","count"),&AnimationTreePlayer::transition_node_set_input_count); + ClassDB::bind_method(D_METHOD("transition_node_get_input_count","id"),&AnimationTreePlayer::transition_node_get_input_count); + ClassDB::bind_method(D_METHOD("transition_node_delete_input","id","input_idx"),&AnimationTreePlayer::transition_node_delete_input); - ClassDB::bind_method(_MD("transition_node_set_input_auto_advance","id","input_idx","enable"),&AnimationTreePlayer::transition_node_set_input_auto_advance); - ClassDB::bind_method(_MD("transition_node_has_input_auto_advance","id","input_idx"),&AnimationTreePlayer::transition_node_has_input_auto_advance); + ClassDB::bind_method(D_METHOD("transition_node_set_input_auto_advance","id","input_idx","enable"),&AnimationTreePlayer::transition_node_set_input_auto_advance); + ClassDB::bind_method(D_METHOD("transition_node_has_input_auto_advance","id","input_idx"),&AnimationTreePlayer::transition_node_has_input_auto_advance); - ClassDB::bind_method(_MD("transition_node_set_xfade_time","id","time_sec"),&AnimationTreePlayer::transition_node_set_xfade_time); - ClassDB::bind_method(_MD("transition_node_get_xfade_time","id"),&AnimationTreePlayer::transition_node_get_xfade_time); + ClassDB::bind_method(D_METHOD("transition_node_set_xfade_time","id","time_sec"),&AnimationTreePlayer::transition_node_set_xfade_time); + ClassDB::bind_method(D_METHOD("transition_node_get_xfade_time","id"),&AnimationTreePlayer::transition_node_get_xfade_time); - ClassDB::bind_method(_MD("transition_node_set_current","id","input_idx"),&AnimationTreePlayer::transition_node_set_current); - ClassDB::bind_method(_MD("transition_node_get_current","id"),&AnimationTreePlayer::transition_node_get_current); + ClassDB::bind_method(D_METHOD("transition_node_set_current","id","input_idx"),&AnimationTreePlayer::transition_node_set_current); + ClassDB::bind_method(D_METHOD("transition_node_get_current","id"),&AnimationTreePlayer::transition_node_get_current); - ClassDB::bind_method(_MD("node_set_pos","id","screen_pos"),&AnimationTreePlayer::node_set_pos); - ClassDB::bind_method(_MD("node_get_pos","id"),&AnimationTreePlayer::node_get_pos); + ClassDB::bind_method(D_METHOD("node_set_pos","id","screen_pos"),&AnimationTreePlayer::node_set_pos); + ClassDB::bind_method(D_METHOD("node_get_pos","id"),&AnimationTreePlayer::node_get_pos); - ClassDB::bind_method(_MD("remove_node","id"),&AnimationTreePlayer::remove_node); - ClassDB::bind_method(_MD("connect_nodes","id","dst_id","dst_input_idx"),&AnimationTreePlayer::connect_nodes); - ClassDB::bind_method(_MD("are_nodes_connected","id","dst_id","dst_input_idx"),&AnimationTreePlayer::are_nodes_connected); - ClassDB::bind_method(_MD("disconnect_nodes","id","dst_input_idx"),&AnimationTreePlayer::disconnect_nodes); + ClassDB::bind_method(D_METHOD("remove_node","id"),&AnimationTreePlayer::remove_node); + ClassDB::bind_method(D_METHOD("connect_nodes","id","dst_id","dst_input_idx"),&AnimationTreePlayer::connect_nodes); + ClassDB::bind_method(D_METHOD("are_nodes_connected","id","dst_id","dst_input_idx"),&AnimationTreePlayer::are_nodes_connected); + ClassDB::bind_method(D_METHOD("disconnect_nodes","id","dst_input_idx"),&AnimationTreePlayer::disconnect_nodes); - ClassDB::bind_method(_MD("set_active","enabled"),&AnimationTreePlayer::set_active); - ClassDB::bind_method(_MD("is_active"),&AnimationTreePlayer::is_active); + ClassDB::bind_method(D_METHOD("set_active","enabled"),&AnimationTreePlayer::set_active); + ClassDB::bind_method(D_METHOD("is_active"),&AnimationTreePlayer::is_active); - ClassDB::bind_method(_MD("set_base_path","path"),&AnimationTreePlayer::set_base_path); - ClassDB::bind_method(_MD("get_base_path"),&AnimationTreePlayer::get_base_path); + ClassDB::bind_method(D_METHOD("set_base_path","path"),&AnimationTreePlayer::set_base_path); + ClassDB::bind_method(D_METHOD("get_base_path"),&AnimationTreePlayer::get_base_path); - ClassDB::bind_method(_MD("set_master_player","nodepath"),&AnimationTreePlayer::set_master_player); - ClassDB::bind_method(_MD("get_master_player"),&AnimationTreePlayer::get_master_player); + ClassDB::bind_method(D_METHOD("set_master_player","nodepath"),&AnimationTreePlayer::set_master_player); + ClassDB::bind_method(D_METHOD("get_master_player"),&AnimationTreePlayer::get_master_player); - ClassDB::bind_method(_MD("get_node_list"),&AnimationTreePlayer::_get_node_list); + ClassDB::bind_method(D_METHOD("get_node_list"),&AnimationTreePlayer::_get_node_list); - ClassDB::bind_method(_MD("set_animation_process_mode","mode"),&AnimationTreePlayer::set_animation_process_mode); - ClassDB::bind_method(_MD("get_animation_process_mode"),&AnimationTreePlayer::get_animation_process_mode); + ClassDB::bind_method(D_METHOD("set_animation_process_mode","mode"),&AnimationTreePlayer::set_animation_process_mode); + ClassDB::bind_method(D_METHOD("get_animation_process_mode"),&AnimationTreePlayer::get_animation_process_mode); - ClassDB::bind_method(_MD("advance", "delta"), &AnimationTreePlayer::advance); + ClassDB::bind_method(D_METHOD("advance", "delta"), &AnimationTreePlayer::advance); - ClassDB::bind_method(_MD("reset"),&AnimationTreePlayer::reset); + ClassDB::bind_method(D_METHOD("reset"),&AnimationTreePlayer::reset); - ClassDB::bind_method(_MD("recompute_caches"),&AnimationTreePlayer::recompute_caches); + ClassDB::bind_method(D_METHOD("recompute_caches"),&AnimationTreePlayer::recompute_caches); ADD_GROUP("Playback","playback_"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_animation_process_mode"), _SCS("get_animation_process_mode")); + ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), "set_animation_process_mode", "get_animation_process_mode"); BIND_CONSTANT( NODE_OUTPUT ); BIND_CONSTANT( NODE_ANIMATION ); diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 0916119db3..c422e765b5 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -186,46 +186,46 @@ void Tween::_notification(int p_what) { void Tween::_bind_methods() { - ClassDB::bind_method(_MD("is_active"),&Tween::is_active ); - ClassDB::bind_method(_MD("set_active","active"),&Tween::set_active ); - - ClassDB::bind_method(_MD("is_repeat"),&Tween::is_repeat ); - ClassDB::bind_method(_MD("set_repeat","repeat"),&Tween::set_repeat ); - - ClassDB::bind_method(_MD("set_speed_scale","speed"),&Tween::set_speed_scale); - ClassDB::bind_method(_MD("get_speed_scale"),&Tween::get_speed_scale); - - ClassDB::bind_method(_MD("set_tween_process_mode","mode"),&Tween::set_tween_process_mode); - ClassDB::bind_method(_MD("get_tween_process_mode"),&Tween::get_tween_process_mode); - - ClassDB::bind_method(_MD("start"),&Tween::start ); - ClassDB::bind_method(_MD("reset","object","key"),&Tween::reset, DEFVAL("") ); - ClassDB::bind_method(_MD("reset_all"),&Tween::reset_all ); - ClassDB::bind_method(_MD("stop","object","key"),&Tween::stop, DEFVAL("") ); - ClassDB::bind_method(_MD("stop_all"),&Tween::stop_all ); - ClassDB::bind_method(_MD("resume","object","key"),&Tween::resume, DEFVAL("") ); - ClassDB::bind_method(_MD("resume_all"),&Tween::resume_all ); - ClassDB::bind_method(_MD("remove","object","key"),&Tween::remove, DEFVAL("") ); - ClassDB::bind_method(_MD("_remove","object","key","first_only"),&Tween::_remove ); - ClassDB::bind_method(_MD("remove_all"),&Tween::remove_all ); - ClassDB::bind_method(_MD("seek","time"),&Tween::seek ); - ClassDB::bind_method(_MD("tell"),&Tween::tell ); - ClassDB::bind_method(_MD("get_runtime"),&Tween::get_runtime ); - - ClassDB::bind_method(_MD("interpolate_property","object","property","initial_val","final_val","duration","trans_type","ease_type","delay"),&Tween::interpolate_property, DEFVAL(0) ); - ClassDB::bind_method(_MD("interpolate_method","object","method","initial_val","final_val","duration","trans_type","ease_type","delay"),&Tween::interpolate_method, DEFVAL(0) ); - ClassDB::bind_method(_MD("interpolate_callback","object","duration","callback","arg1", "arg2","arg3","arg4","arg5"),&Tween::interpolate_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) ); - ClassDB::bind_method(_MD("interpolate_deferred_callback","object","duration","callback","arg1","arg2","arg3","arg4","arg5"),&Tween::interpolate_deferred_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) ); - ClassDB::bind_method(_MD("follow_property","object","property","initial_val","target","target_property","duration","trans_type","ease_type","delay"),&Tween::follow_property, DEFVAL(0) ); - ClassDB::bind_method(_MD("follow_method","object","method","initial_val","target","target_method","duration","trans_type","ease_type","delay"),&Tween::follow_method, DEFVAL(0) ); - ClassDB::bind_method(_MD("targeting_property","object","property","initial","initial_val","final_val","duration","trans_type","ease_type","delay"),&Tween::targeting_property, DEFVAL(0) ); - ClassDB::bind_method(_MD("targeting_method","object","method","initial","initial_method","final_val","duration","trans_type","ease_type","delay"),&Tween::targeting_method, DEFVAL(0) ); + ClassDB::bind_method(D_METHOD("is_active"),&Tween::is_active ); + ClassDB::bind_method(D_METHOD("set_active","active"),&Tween::set_active ); + + ClassDB::bind_method(D_METHOD("is_repeat"),&Tween::is_repeat ); + ClassDB::bind_method(D_METHOD("set_repeat","repeat"),&Tween::set_repeat ); + + ClassDB::bind_method(D_METHOD("set_speed_scale","speed"),&Tween::set_speed_scale); + ClassDB::bind_method(D_METHOD("get_speed_scale"),&Tween::get_speed_scale); + + ClassDB::bind_method(D_METHOD("set_tween_process_mode","mode"),&Tween::set_tween_process_mode); + ClassDB::bind_method(D_METHOD("get_tween_process_mode"),&Tween::get_tween_process_mode); + + ClassDB::bind_method(D_METHOD("start"),&Tween::start ); + ClassDB::bind_method(D_METHOD("reset","object","key"),&Tween::reset, DEFVAL("") ); + ClassDB::bind_method(D_METHOD("reset_all"),&Tween::reset_all ); + ClassDB::bind_method(D_METHOD("stop","object","key"),&Tween::stop, DEFVAL("") ); + ClassDB::bind_method(D_METHOD("stop_all"),&Tween::stop_all ); + ClassDB::bind_method(D_METHOD("resume","object","key"),&Tween::resume, DEFVAL("") ); + ClassDB::bind_method(D_METHOD("resume_all"),&Tween::resume_all ); + ClassDB::bind_method(D_METHOD("remove","object","key"),&Tween::remove, DEFVAL("") ); + ClassDB::bind_method(D_METHOD("_remove","object","key","first_only"),&Tween::_remove ); + ClassDB::bind_method(D_METHOD("remove_all"),&Tween::remove_all ); + ClassDB::bind_method(D_METHOD("seek","time"),&Tween::seek ); + ClassDB::bind_method(D_METHOD("tell"),&Tween::tell ); + ClassDB::bind_method(D_METHOD("get_runtime"),&Tween::get_runtime ); + + ClassDB::bind_method(D_METHOD("interpolate_property","object","property","initial_val","final_val","duration","trans_type","ease_type","delay"),&Tween::interpolate_property, DEFVAL(0) ); + ClassDB::bind_method(D_METHOD("interpolate_method","object","method","initial_val","final_val","duration","trans_type","ease_type","delay"),&Tween::interpolate_method, DEFVAL(0) ); + ClassDB::bind_method(D_METHOD("interpolate_callback","object","duration","callback","arg1", "arg2","arg3","arg4","arg5"),&Tween::interpolate_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) ); + ClassDB::bind_method(D_METHOD("interpolate_deferred_callback","object","duration","callback","arg1","arg2","arg3","arg4","arg5"),&Tween::interpolate_deferred_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) ); + ClassDB::bind_method(D_METHOD("follow_property","object","property","initial_val","target","target_property","duration","trans_type","ease_type","delay"),&Tween::follow_property, DEFVAL(0) ); + ClassDB::bind_method(D_METHOD("follow_method","object","method","initial_val","target","target_method","duration","trans_type","ease_type","delay"),&Tween::follow_method, DEFVAL(0) ); + ClassDB::bind_method(D_METHOD("targeting_property","object","property","initial","initial_val","final_val","duration","trans_type","ease_type","delay"),&Tween::targeting_property, DEFVAL(0) ); + ClassDB::bind_method(D_METHOD("targeting_method","object","method","initial","initial_method","final_val","duration","trans_type","ease_type","delay"),&Tween::targeting_method, DEFVAL(0) ); ADD_SIGNAL( MethodInfo("tween_started", PropertyInfo( Variant::OBJECT,"object"), PropertyInfo( Variant::STRING,"key")) ); ADD_SIGNAL( MethodInfo("tween_step", PropertyInfo( Variant::OBJECT,"object"), PropertyInfo( Variant::STRING,"key"), PropertyInfo( Variant::REAL,"elapsed"), PropertyInfo( Variant::OBJECT,"value")) ); ADD_SIGNAL( MethodInfo("tween_completed", PropertyInfo( Variant::OBJECT,"object"), PropertyInfo( Variant::STRING,"key")) ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_tween_process_mode"), _SCS("get_tween_process_mode")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), "set_tween_process_mode", "get_tween_process_mode"); BIND_CONSTANT(TWEEN_PROCESS_FIXED); BIND_CONSTANT(TWEEN_PROCESS_IDLE); @@ -405,9 +405,9 @@ Variant Tween::_run_equation(InterpolateData& p_data) { case Variant::TRANSFORM2D: { - Basis i = initial_val; - Basis d = delta_val; - Basis r; + Transform2D i = initial_val; + Transform2D d = delta_val; + Transform2D r; APPLY_EQUATION(elements[0][0]); APPLY_EQUATION(elements[0][1]); diff --git a/scene/animation/tween_interpolaters.cpp b/scene/animation/tween_interpolaters.cpp index 5ba9673014..25a27252f5 100644 --- a/scene/animation/tween_interpolaters.cpp +++ b/scene/animation/tween_interpolaters.cpp @@ -262,7 +262,8 @@ namespace cubic { static real_t out(real_t t, real_t b, real_t c, real_t d) { - return c * ((t = t / d - 1) * t * t + 1) + b; + t = t / d - 1; + return c * (t * t * t + 1) + b; } static real_t in_out(real_t t, real_t b, real_t c, real_t d) diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp index 9fd005e6fb..97eaea70b1 100644 --- a/scene/audio/audio_player.cpp +++ b/scene/audio/audio_player.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_player.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_player.h" @@ -243,40 +271,40 @@ void AudioPlayer::_bus_layout_changed() { void AudioPlayer::_bind_methods() { - ClassDB::bind_method(_MD("set_stream","stream:AudioStream"),&AudioPlayer::set_stream); - ClassDB::bind_method(_MD("get_stream"),&AudioPlayer::get_stream); + ClassDB::bind_method(D_METHOD("set_stream","stream:AudioStream"),&AudioPlayer::set_stream); + ClassDB::bind_method(D_METHOD("get_stream"),&AudioPlayer::get_stream); - ClassDB::bind_method(_MD("set_volume_db","volume_db"),&AudioPlayer::set_volume_db); - ClassDB::bind_method(_MD("get_volume_db"),&AudioPlayer::get_volume_db); + ClassDB::bind_method(D_METHOD("set_volume_db","volume_db"),&AudioPlayer::set_volume_db); + ClassDB::bind_method(D_METHOD("get_volume_db"),&AudioPlayer::get_volume_db); - ClassDB::bind_method(_MD("play","from_pos"),&AudioPlayer::play,DEFVAL(0.0)); - ClassDB::bind_method(_MD("seek","to_pos"),&AudioPlayer::seek); - ClassDB::bind_method(_MD("stop"),&AudioPlayer::stop); + ClassDB::bind_method(D_METHOD("play","from_pos"),&AudioPlayer::play,DEFVAL(0.0)); + ClassDB::bind_method(D_METHOD("seek","to_pos"),&AudioPlayer::seek); + ClassDB::bind_method(D_METHOD("stop"),&AudioPlayer::stop); - ClassDB::bind_method(_MD("is_playing"),&AudioPlayer::is_playing); - ClassDB::bind_method(_MD("get_pos"),&AudioPlayer::get_pos); + ClassDB::bind_method(D_METHOD("is_playing"),&AudioPlayer::is_playing); + ClassDB::bind_method(D_METHOD("get_pos"),&AudioPlayer::get_pos); - ClassDB::bind_method(_MD("set_bus","bus"),&AudioPlayer::set_bus); - ClassDB::bind_method(_MD("get_bus"),&AudioPlayer::get_bus); + ClassDB::bind_method(D_METHOD("set_bus","bus"),&AudioPlayer::set_bus); + ClassDB::bind_method(D_METHOD("get_bus"),&AudioPlayer::get_bus); - ClassDB::bind_method(_MD("set_autoplay","enable"),&AudioPlayer::set_autoplay); - ClassDB::bind_method(_MD("is_autoplay_enabled"),&AudioPlayer::is_autoplay_enabled); + ClassDB::bind_method(D_METHOD("set_autoplay","enable"),&AudioPlayer::set_autoplay); + ClassDB::bind_method(D_METHOD("is_autoplay_enabled"),&AudioPlayer::is_autoplay_enabled); - ClassDB::bind_method(_MD("set_mix_target","mix_target"),&AudioPlayer::set_mix_target); - ClassDB::bind_method(_MD("get_mix_target"),&AudioPlayer::get_mix_target); + ClassDB::bind_method(D_METHOD("set_mix_target","mix_target"),&AudioPlayer::set_mix_target); + ClassDB::bind_method(D_METHOD("get_mix_target"),&AudioPlayer::get_mix_target); - ClassDB::bind_method(_MD("_set_playing","enable"),&AudioPlayer::_set_playing); - ClassDB::bind_method(_MD("_is_active"),&AudioPlayer::_is_active); + ClassDB::bind_method(D_METHOD("_set_playing","enable"),&AudioPlayer::_set_playing); + ClassDB::bind_method(D_METHOD("_is_active"),&AudioPlayer::_is_active); - ClassDB::bind_method(_MD("_bus_layout_changed"),&AudioPlayer::_bus_layout_changed); + ClassDB::bind_method(D_METHOD("_bus_layout_changed"),&AudioPlayer::_bus_layout_changed); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"stream",PROPERTY_HINT_RESOURCE_TYPE,"AudioStream"),_SCS("set_stream"),_SCS("get_stream") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"volume_db",PROPERTY_HINT_RANGE,"-80,24"),_SCS("set_volume_db"),_SCS("get_volume_db") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"playing",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR),_SCS("_set_playing"),_SCS("_is_active" )); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"autoplay"),_SCS("set_autoplay"),_SCS("is_autoplay_enabled") ); - ADD_PROPERTY( PropertyInfo(Variant::INT,"mix_target",PROPERTY_HINT_ENUM,"Stereo,Surround,Center"),_SCS("set_mix_target"),_SCS("get_mix_target")); - ADD_PROPERTY( PropertyInfo(Variant::STRING,"bus",PROPERTY_HINT_ENUM,""),_SCS("set_bus"),_SCS("get_bus")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"stream",PROPERTY_HINT_RESOURCE_TYPE,"AudioStream"),"set_stream","get_stream") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"volume_db",PROPERTY_HINT_RANGE,"-80,24"),"set_volume_db","get_volume_db") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"playing",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR),"_set_playing","_is_active" ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"autoplay"),"set_autoplay","is_autoplay_enabled") ; + ADD_PROPERTY( PropertyInfo(Variant::INT,"mix_target",PROPERTY_HINT_ENUM,"Stereo,Surround,Center"),"set_mix_target","get_mix_target"); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"bus",PROPERTY_HINT_ENUM,""),"set_bus","get_bus"); } diff --git a/scene/audio/audio_player.h b/scene/audio/audio_player.h index 249e5d0381..6e34dfce19 100644 --- a/scene/audio/audio_player.h +++ b/scene/audio/audio_player.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_player.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOPLAYER_H #define AUDIOPLAYER_H diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 0b40983ddf..79b607e2e6 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -505,26 +505,26 @@ Ref<ButtonGroup> BaseButton::get_button_group() const { void BaseButton::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&BaseButton::_gui_input); - ClassDB::bind_method(_MD("_unhandled_input"),&BaseButton::_unhandled_input); - ClassDB::bind_method(_MD("set_pressed","pressed"),&BaseButton::set_pressed); - ClassDB::bind_method(_MD("is_pressed"),&BaseButton::is_pressed); - ClassDB::bind_method(_MD("is_hovered"),&BaseButton::is_hovered); - ClassDB::bind_method(_MD("set_toggle_mode","enabled"),&BaseButton::set_toggle_mode); - ClassDB::bind_method(_MD("is_toggle_mode"),&BaseButton::is_toggle_mode); - ClassDB::bind_method(_MD("set_disabled","disabled"),&BaseButton::set_disabled); - ClassDB::bind_method(_MD("is_disabled"),&BaseButton::is_disabled); - ClassDB::bind_method(_MD("set_action_mode","mode"),&BaseButton::set_action_mode); - ClassDB::bind_method(_MD("get_action_mode"),&BaseButton::get_action_mode); - ClassDB::bind_method(_MD("get_draw_mode"),&BaseButton::get_draw_mode); - ClassDB::bind_method(_MD("set_enabled_focus_mode","mode"),&BaseButton::set_enabled_focus_mode); - ClassDB::bind_method(_MD("get_enabled_focus_mode"),&BaseButton::get_enabled_focus_mode); - - ClassDB::bind_method(_MD("set_shortcut","shortcut"),&BaseButton::set_shortcut); - ClassDB::bind_method(_MD("get_shortcut"),&BaseButton::get_shortcut); - - ClassDB::bind_method(_MD("set_button_group","button_group"),&BaseButton::set_button_group); - ClassDB::bind_method(_MD("get_button_group"),&BaseButton::get_button_group); + ClassDB::bind_method(D_METHOD("_gui_input"),&BaseButton::_gui_input); + ClassDB::bind_method(D_METHOD("_unhandled_input"),&BaseButton::_unhandled_input); + ClassDB::bind_method(D_METHOD("set_pressed","pressed"),&BaseButton::set_pressed); + ClassDB::bind_method(D_METHOD("is_pressed"),&BaseButton::is_pressed); + ClassDB::bind_method(D_METHOD("is_hovered"),&BaseButton::is_hovered); + ClassDB::bind_method(D_METHOD("set_toggle_mode","enabled"),&BaseButton::set_toggle_mode); + ClassDB::bind_method(D_METHOD("is_toggle_mode"),&BaseButton::is_toggle_mode); + ClassDB::bind_method(D_METHOD("set_disabled","disabled"),&BaseButton::set_disabled); + ClassDB::bind_method(D_METHOD("is_disabled"),&BaseButton::is_disabled); + ClassDB::bind_method(D_METHOD("set_action_mode","mode"),&BaseButton::set_action_mode); + ClassDB::bind_method(D_METHOD("get_action_mode"),&BaseButton::get_action_mode); + ClassDB::bind_method(D_METHOD("get_draw_mode"),&BaseButton::get_draw_mode); + ClassDB::bind_method(D_METHOD("set_enabled_focus_mode","mode"),&BaseButton::set_enabled_focus_mode); + ClassDB::bind_method(D_METHOD("get_enabled_focus_mode"),&BaseButton::get_enabled_focus_mode); + + ClassDB::bind_method(D_METHOD("set_shortcut","shortcut"),&BaseButton::set_shortcut); + ClassDB::bind_method(D_METHOD("get_shortcut"),&BaseButton::get_shortcut); + + ClassDB::bind_method(D_METHOD("set_button_group","button_group"),&BaseButton::set_button_group); + ClassDB::bind_method(D_METHOD("get_button_group"),&BaseButton::get_button_group); BIND_VMETHOD(MethodInfo("_pressed")); BIND_VMETHOD(MethodInfo("_toggled",PropertyInfo(Variant::BOOL,"pressed"))); @@ -533,13 +533,13 @@ void BaseButton::_bind_methods() { ADD_SIGNAL( MethodInfo("button_up") ); ADD_SIGNAL( MethodInfo("button_down") ); ADD_SIGNAL( MethodInfo("toggled", PropertyInfo( Variant::BOOL,"pressed") ) ); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "disabled"), _SCS("set_disabled"), _SCS("is_disabled")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "toggle_mode"), _SCS("set_toggle_mode"), _SCS("is_toggle_mode")); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "is_pressed"), _SCS("set_pressed"), _SCS("is_pressed")); - ADD_PROPERTYNO( PropertyInfo( Variant::INT, "action_mode",PROPERTY_HINT_ENUM,"Button Press,Button Release"), _SCS("set_action_mode"), _SCS("get_action_mode")); - ADD_PROPERTY( PropertyInfo( Variant::INT,"enabled_focus_mode", PROPERTY_HINT_ENUM, "None,Click,All" ), _SCS("set_enabled_focus_mode"), _SCS("get_enabled_focus_mode") ); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "shortcut",PROPERTY_HINT_RESOURCE_TYPE,"ShortCut"), _SCS("set_shortcut"), _SCS("get_shortcut")); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "group",PROPERTY_HINT_RESOURCE_TYPE,"ButtonGroup"), _SCS("set_button_group"), _SCS("get_button_group")); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "toggle_mode"), "set_toggle_mode", "is_toggle_mode"); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "is_pressed"), "set_pressed", "is_pressed"); + ADD_PROPERTYNO( PropertyInfo( Variant::INT, "action_mode",PROPERTY_HINT_ENUM,"Button Press,Button Release"), "set_action_mode", "get_action_mode"); + ADD_PROPERTY( PropertyInfo( Variant::INT,"enabled_focus_mode", PROPERTY_HINT_ENUM, "None,Click,All" ), "set_enabled_focus_mode", "get_enabled_focus_mode") ; + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "shortcut",PROPERTY_HINT_RESOURCE_TYPE,"ShortCut"), "set_shortcut", "get_shortcut"); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "group",PROPERTY_HINT_RESOURCE_TYPE,"ButtonGroup"), "set_button_group", "get_button_group"); BIND_CONSTANT( DRAW_NORMAL ); @@ -598,7 +598,7 @@ BaseButton* ButtonGroup::get_pressed_button() { void ButtonGroup::_bind_methods() { - ClassDB::bind_method(_MD("get_pressed_button:BaseButton"),&ButtonGroup::get_pressed_button); + ClassDB::bind_method(D_METHOD("get_pressed_button:BaseButton"),&ButtonGroup::get_pressed_button); } ButtonGroup::ButtonGroup() { diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp index 9c5ddb3e7c..1f6e0392d8 100644 --- a/scene/gui/box_container.cpp +++ b/scene/gui/box_container.cpp @@ -302,15 +302,15 @@ BoxContainer::BoxContainer(bool p_vertical) { void BoxContainer::_bind_methods() { - ClassDB::bind_method(_MD("add_spacer","begin"),&BoxContainer::add_spacer); - ClassDB::bind_method(_MD("get_alignment"),&BoxContainer::get_alignment); - ClassDB::bind_method(_MD("set_alignment","alignment"),&BoxContainer::set_alignment); + ClassDB::bind_method(D_METHOD("add_spacer","begin"),&BoxContainer::add_spacer); + ClassDB::bind_method(D_METHOD("get_alignment"),&BoxContainer::get_alignment); + ClassDB::bind_method(D_METHOD("set_alignment","alignment"),&BoxContainer::set_alignment); BIND_CONSTANT( ALIGN_BEGIN ); BIND_CONSTANT( ALIGN_CENTER ); BIND_CONSTANT( ALIGN_END ); - ADD_PROPERTY( PropertyInfo(Variant::INT,"alignment", PROPERTY_HINT_ENUM, "Begin,Center,End"), _SCS("set_alignment"),_SCS("get_alignment") ); + ADD_PROPERTY( PropertyInfo(Variant::INT,"alignment", PROPERTY_HINT_ENUM, "Begin,Center,End"), "set_alignment","get_alignment") ; } diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 2d1d437668..de2ccfb0b5 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -228,26 +228,26 @@ Button::TextAlign Button::get_text_align() const { void Button::_bind_methods() { - ClassDB::bind_method(_MD("set_text","text"),&Button::set_text); - ClassDB::bind_method(_MD("get_text"),&Button::get_text); - ClassDB::bind_method(_MD("set_button_icon","texture:Texture"),&Button::set_icon); - ClassDB::bind_method(_MD("get_button_icon:Texture"),&Button::get_icon); - ClassDB::bind_method(_MD("set_flat","enabled"),&Button::set_flat); - ClassDB::bind_method(_MD("set_clip_text","enabled"),&Button::set_clip_text); - ClassDB::bind_method(_MD("get_clip_text"),&Button::get_clip_text); - ClassDB::bind_method(_MD("set_text_align","align"),&Button::set_text_align); - ClassDB::bind_method(_MD("get_text_align"),&Button::get_text_align); - ClassDB::bind_method(_MD("is_flat"),&Button::is_flat); + ClassDB::bind_method(D_METHOD("set_text","text"),&Button::set_text); + ClassDB::bind_method(D_METHOD("get_text"),&Button::get_text); + ClassDB::bind_method(D_METHOD("set_button_icon","texture:Texture"),&Button::set_icon); + ClassDB::bind_method(D_METHOD("get_button_icon:Texture"),&Button::get_icon); + ClassDB::bind_method(D_METHOD("set_flat","enabled"),&Button::set_flat); + ClassDB::bind_method(D_METHOD("set_clip_text","enabled"),&Button::set_clip_text); + ClassDB::bind_method(D_METHOD("get_clip_text"),&Button::get_clip_text); + ClassDB::bind_method(D_METHOD("set_text_align","align"),&Button::set_text_align); + ClassDB::bind_method(D_METHOD("get_text_align"),&Button::get_text_align); + ClassDB::bind_method(D_METHOD("is_flat"),&Button::is_flat); BIND_CONSTANT( ALIGN_LEFT ); BIND_CONSTANT( ALIGN_CENTER ); BIND_CONSTANT( ALIGN_RIGHT ); - ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "text", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT_INTL ), _SCS("set_text"),_SCS("get_text") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture" ), _SCS("set_button_icon"),_SCS("get_button_icon") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "flat" ), _SCS("set_flat"),_SCS("is_flat") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "clip_text" ), _SCS("set_clip_text"),_SCS("get_clip_text") ); - ADD_PROPERTYNO( PropertyInfo( Variant::INT, "align",PROPERTY_HINT_ENUM,"Left,Center,Right" ), _SCS("set_text_align"),_SCS("get_text_align") ); + ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "text", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT_INTL ), "set_text","get_text") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture" ), "set_button_icon","get_button_icon") ; + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "flat" ), "set_flat","is_flat") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "clip_text" ), "set_clip_text","get_clip_text") ; + ADD_PROPERTYNO( PropertyInfo( Variant::INT, "align",PROPERTY_HINT_ENUM,"Left,Center,Right" ), "set_text_align","get_text_align") ; } diff --git a/scene/gui/button_array.cpp b/scene/gui/button_array.cpp index 3d7c0e2825..2fd5f0df83 100644 --- a/scene/gui/button_array.cpp +++ b/scene/gui/button_array.cpp @@ -58,9 +58,10 @@ bool ButtonArray::_set(const StringName& p_name, const Variant& p_value) { int idx=what.to_int(); ERR_FAIL_INDEX_V(idx,buttons.size(),false); String f = n.get_slicec('/',2); - if (f=="text") + if (f=="text") { buttons[idx].text=p_value; - else if (f=="tooltip") + buttons[idx].xl_text=XL_MESSAGE(p_value); + } else if (f=="tooltip") buttons[idx].tooltip=p_value; else if (f=="icon") buttons[idx].icon=p_value; @@ -146,7 +147,7 @@ Size2 ButtonArray::get_minimum_size() const { Ref<Font> f = i==selected ? font_selected : font_normal; Size2 ms; - ms = f->get_string_size(buttons[i].text); + ms = f->get_string_size(buttons[i].xl_text); if (buttons[i].icon.is_valid()) { Size2 bs = buttons[i].icon->get_size(); @@ -275,7 +276,7 @@ void ButtonArray::_notification(int p_what) { c=color_normal; } - Size2 ssize = f->get_string_size(buttons[i].text); + Size2 ssize = f->get_string_size(buttons[i].xl_text); if (buttons[i].icon.is_valid()) { ssize.x+=buttons[i].icon->get_width(); @@ -287,7 +288,7 @@ void ButtonArray::_notification(int p_what) { text_ofs.x+=buttons[i].icon->get_width()+icon_sep; } - draw_string(f,text_ofs+r.pos,buttons[i].text,c); + draw_string(f,text_ofs+r.pos,buttons[i].xl_text,c); buttons[i]._pos_cache=ofs; buttons[i]._size_cache=s; @@ -404,6 +405,7 @@ void ButtonArray::add_button(const String& p_text,const String& p_tooltip) { Button button; button.text=p_text; + button.xl_text=XL_MESSAGE(p_text); button.tooltip=p_tooltip; buttons.push_back(button); update(); @@ -418,6 +420,7 @@ void ButtonArray::add_icon_button(const Ref<Texture>& p_icon,const String& p_tex Button button; button.text=p_text; + button.xl_text=XL_MESSAGE(p_text); button.icon=p_icon; button.tooltip=p_tooltip; buttons.push_back(button); @@ -432,6 +435,7 @@ void ButtonArray::set_button_text(int p_button, const String& p_text) { ERR_FAIL_INDEX(p_button,buttons.size()); buttons[p_button].text=p_text; + buttons[p_button].xl_text=XL_MESSAGE(p_text); update(); minimum_size_changed(); @@ -527,24 +531,24 @@ void ButtonArray::get_translatable_strings(List<String> *p_strings) const { void ButtonArray::_bind_methods() { - ClassDB::bind_method(_MD("add_button","text","tooltip"),&ButtonArray::add_button,DEFVAL("")); - ClassDB::bind_method(_MD("add_icon_button","icon:Texture","text","tooltip"),&ButtonArray::add_icon_button,DEFVAL(""),DEFVAL("")); - ClassDB::bind_method(_MD("set_button_text","button_idx","text"),&ButtonArray::set_button_text); - ClassDB::bind_method(_MD("set_button_tooltip","button_idx","text"),&ButtonArray::set_button_tooltip); - ClassDB::bind_method(_MD("set_button_icon","button_idx","icon:Texture"),&ButtonArray::set_button_icon); - ClassDB::bind_method(_MD("get_button_text","button_idx"),&ButtonArray::get_button_text); - ClassDB::bind_method(_MD("get_button_tooltip","button_idx"),&ButtonArray::get_button_tooltip); - ClassDB::bind_method(_MD("get_button_icon:Texture","button_idx"),&ButtonArray::get_button_icon); - ClassDB::bind_method(_MD("get_button_count"),&ButtonArray::get_button_count); - ClassDB::bind_method(_MD("set_flat","enabled"),&ButtonArray::set_flat); - ClassDB::bind_method(_MD("is_flat"),&ButtonArray::is_flat); - ClassDB::bind_method(_MD("get_selected"),&ButtonArray::get_selected); - ClassDB::bind_method(_MD("get_hovered"),&ButtonArray::get_hovered); - ClassDB::bind_method(_MD("set_selected","button_idx"),&ButtonArray::set_selected); - ClassDB::bind_method(_MD("erase_button","button_idx"),&ButtonArray::erase_button); - ClassDB::bind_method(_MD("clear"),&ButtonArray::clear); - - ClassDB::bind_method(_MD("_gui_input"),&ButtonArray::_gui_input); + ClassDB::bind_method(D_METHOD("add_button","text","tooltip"),&ButtonArray::add_button,DEFVAL("")); + ClassDB::bind_method(D_METHOD("add_icon_button","icon:Texture","text","tooltip"),&ButtonArray::add_icon_button,DEFVAL(""),DEFVAL("")); + ClassDB::bind_method(D_METHOD("set_button_text","button_idx","text"),&ButtonArray::set_button_text); + ClassDB::bind_method(D_METHOD("set_button_tooltip","button_idx","text"),&ButtonArray::set_button_tooltip); + ClassDB::bind_method(D_METHOD("set_button_icon","button_idx","icon:Texture"),&ButtonArray::set_button_icon); + ClassDB::bind_method(D_METHOD("get_button_text","button_idx"),&ButtonArray::get_button_text); + ClassDB::bind_method(D_METHOD("get_button_tooltip","button_idx"),&ButtonArray::get_button_tooltip); + ClassDB::bind_method(D_METHOD("get_button_icon:Texture","button_idx"),&ButtonArray::get_button_icon); + ClassDB::bind_method(D_METHOD("get_button_count"),&ButtonArray::get_button_count); + ClassDB::bind_method(D_METHOD("set_flat","enabled"),&ButtonArray::set_flat); + ClassDB::bind_method(D_METHOD("is_flat"),&ButtonArray::is_flat); + ClassDB::bind_method(D_METHOD("get_selected"),&ButtonArray::get_selected); + ClassDB::bind_method(D_METHOD("get_hovered"),&ButtonArray::get_hovered); + ClassDB::bind_method(D_METHOD("set_selected","button_idx"),&ButtonArray::set_selected); + ClassDB::bind_method(D_METHOD("erase_button","button_idx"),&ButtonArray::erase_button); + ClassDB::bind_method(D_METHOD("clear"),&ButtonArray::clear); + + ClassDB::bind_method(D_METHOD("_gui_input"),&ButtonArray::_gui_input); BIND_CONSTANT( ALIGN_BEGIN ); BIND_CONSTANT( ALIGN_CENTER ); @@ -552,7 +556,7 @@ void ButtonArray::_bind_methods() { BIND_CONSTANT( ALIGN_FILL ); BIND_CONSTANT( ALIGN_EXPAND_FILL ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "flat" ), _SCS("set_flat"),_SCS("is_flat") ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "flat" ), "set_flat","is_flat") ; ADD_SIGNAL( MethodInfo("button_selected",PropertyInfo(Variant::INT,"button_idx"))); diff --git a/scene/gui/button_array.h b/scene/gui/button_array.h index 37533695c9..4865ef0373 100644 --- a/scene/gui/button_array.h +++ b/scene/gui/button_array.h @@ -50,6 +50,7 @@ private: struct Button { String text; + String xl_text; String tooltip; Ref<Texture> icon; mutable int _ms_cache; diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp index 01a3f633c3..21c1559b8f 100644 --- a/scene/gui/button_group.cpp +++ b/scene/gui/button_group.cpp @@ -151,12 +151,12 @@ int ButtonGroup::get_pressed_button_index() const { void ButtonGroup::_bind_methods() { - ClassDB::bind_method(_MD("get_pressed_button:BaseButton"),&ButtonGroup::get_pressed_button); - ClassDB::bind_method(_MD("get_pressed_button_index"),&ButtonGroup::get_pressed_button_index); - ClassDB::bind_method(_MD("get_focused_button:BaseButton"),&ButtonGroup::get_focused_button); - ClassDB::bind_method(_MD("get_button_list"),&ButtonGroup::_get_button_list); - ClassDB::bind_method(_MD("_pressed"),&ButtonGroup::_pressed); - ClassDB::bind_method(_MD("set_pressed_button","button:BaseButton"),&ButtonGroup::_pressed); + ClassDB::bind_method(D_METHOD("get_pressed_button:BaseButton"),&ButtonGroup::get_pressed_button); + ClassDB::bind_method(D_METHOD("get_pressed_button_index"),&ButtonGroup::get_pressed_button_index); + ClassDB::bind_method(D_METHOD("get_focused_button:BaseButton"),&ButtonGroup::get_focused_button); + ClassDB::bind_method(D_METHOD("get_button_list"),&ButtonGroup::_get_button_list); + ClassDB::bind_method(D_METHOD("_pressed"),&ButtonGroup::_pressed); + ClassDB::bind_method(D_METHOD("set_pressed_button","button:BaseButton"),&ButtonGroup::_pressed); ADD_SIGNAL( MethodInfo("button_selected",PropertyInfo(Variant::OBJECT,"button",PROPERTY_HINT_RESOURCE_TYPE,"BaseButton"))); } diff --git a/scene/gui/center_container.cpp b/scene/gui/center_container.cpp index 4d4abb6484..c1c04ced84 100644 --- a/scene/gui/center_container.cpp +++ b/scene/gui/center_container.cpp @@ -92,10 +92,10 @@ void CenterContainer::_notification(int p_what) { void CenterContainer::_bind_methods() { - ClassDB::bind_method(_MD("set_use_top_left","enable"),&CenterContainer::set_use_top_left); - ClassDB::bind_method(_MD("is_using_top_left"),&CenterContainer::is_using_top_left); + ClassDB::bind_method(D_METHOD("set_use_top_left","enable"),&CenterContainer::set_use_top_left); + ClassDB::bind_method(D_METHOD("is_using_top_left"),&CenterContainer::is_using_top_left); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"use_top_left"),_SCS("set_use_top_left"),_SCS("is_using_top_left")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"use_top_left"),"set_use_top_left","is_using_top_left"); } CenterContainer::CenterContainer() { diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index da2fb1bc91..d9da583bf5 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -451,24 +451,24 @@ void ColorPicker::_screen_pick_pressed() void ColorPicker::_bind_methods() { - ClassDB::bind_method(_MD("set_pick_color","color"),&ColorPicker::set_pick_color); - ClassDB::bind_method(_MD("get_pick_color"),&ColorPicker::get_pick_color); - ClassDB::bind_method(_MD("set_raw_mode","mode"),&ColorPicker::set_raw_mode); - ClassDB::bind_method(_MD("is_raw_mode"),&ColorPicker::is_raw_mode); - ClassDB::bind_method(_MD("set_edit_alpha","show"),&ColorPicker::set_edit_alpha); - ClassDB::bind_method(_MD("is_editing_alpha"),&ColorPicker::is_editing_alpha); - ClassDB::bind_method(_MD("add_preset"), &ColorPicker::add_preset); - ClassDB::bind_method(_MD("_value_changed"),&ColorPicker::_value_changed); - ClassDB::bind_method(_MD("_html_entered"),&ColorPicker::_html_entered); - ClassDB::bind_method(_MD("_text_type_toggled"),&ColorPicker::_text_type_toggled); - ClassDB::bind_method(_MD("_add_preset_pressed"), &ColorPicker::_add_preset_pressed); - ClassDB::bind_method(_MD("_screen_pick_pressed"), &ColorPicker::_screen_pick_pressed); - ClassDB::bind_method(_MD("_sample_draw"),&ColorPicker::_sample_draw); - ClassDB::bind_method(_MD("_hsv_draw"),&ColorPicker::_hsv_draw); - ClassDB::bind_method(_MD("_uv_input"),&ColorPicker::_uv_input); - ClassDB::bind_method(_MD("_w_input"),&ColorPicker::_w_input); - ClassDB::bind_method(_MD("_preset_input"),&ColorPicker::_preset_input); - ClassDB::bind_method(_MD("_screen_input"),&ColorPicker::_screen_input); + ClassDB::bind_method(D_METHOD("set_pick_color","color"),&ColorPicker::set_pick_color); + ClassDB::bind_method(D_METHOD("get_pick_color"),&ColorPicker::get_pick_color); + ClassDB::bind_method(D_METHOD("set_raw_mode","mode"),&ColorPicker::set_raw_mode); + ClassDB::bind_method(D_METHOD("is_raw_mode"),&ColorPicker::is_raw_mode); + ClassDB::bind_method(D_METHOD("set_edit_alpha","show"),&ColorPicker::set_edit_alpha); + ClassDB::bind_method(D_METHOD("is_editing_alpha"),&ColorPicker::is_editing_alpha); + ClassDB::bind_method(D_METHOD("add_preset"), &ColorPicker::add_preset); + ClassDB::bind_method(D_METHOD("_value_changed"),&ColorPicker::_value_changed); + ClassDB::bind_method(D_METHOD("_html_entered"),&ColorPicker::_html_entered); + ClassDB::bind_method(D_METHOD("_text_type_toggled"),&ColorPicker::_text_type_toggled); + ClassDB::bind_method(D_METHOD("_add_preset_pressed"), &ColorPicker::_add_preset_pressed); + ClassDB::bind_method(D_METHOD("_screen_pick_pressed"), &ColorPicker::_screen_pick_pressed); + ClassDB::bind_method(D_METHOD("_sample_draw"),&ColorPicker::_sample_draw); + ClassDB::bind_method(D_METHOD("_hsv_draw"),&ColorPicker::_hsv_draw); + ClassDB::bind_method(D_METHOD("_uv_input"),&ColorPicker::_uv_input); + ClassDB::bind_method(D_METHOD("_w_input"),&ColorPicker::_w_input); + ClassDB::bind_method(D_METHOD("_preset_input"),&ColorPicker::_preset_input); + ClassDB::bind_method(D_METHOD("_screen_input"),&ColorPicker::_screen_input); ADD_SIGNAL( MethodInfo("color_changed",PropertyInfo(Variant::COLOR,"color"))); } @@ -665,16 +665,16 @@ ColorPicker *ColorPickerButton::get_picker() { void ColorPickerButton::_bind_methods(){ - ClassDB::bind_method(_MD("set_pick_color","color"),&ColorPickerButton::set_pick_color); - ClassDB::bind_method(_MD("get_pick_color"),&ColorPickerButton::get_pick_color); - ClassDB::bind_method(_MD("get_picker:ColorPicker"),&ColorPickerButton::get_picker); - ClassDB::bind_method(_MD("set_edit_alpha","show"),&ColorPickerButton::set_edit_alpha); - ClassDB::bind_method(_MD("is_editing_alpha"),&ColorPickerButton::is_editing_alpha); - ClassDB::bind_method(_MD("_color_changed"),&ColorPickerButton::_color_changed); + ClassDB::bind_method(D_METHOD("set_pick_color","color"),&ColorPickerButton::set_pick_color); + ClassDB::bind_method(D_METHOD("get_pick_color"),&ColorPickerButton::get_pick_color); + ClassDB::bind_method(D_METHOD("get_picker:ColorPicker"),&ColorPickerButton::get_picker); + ClassDB::bind_method(D_METHOD("set_edit_alpha","show"),&ColorPickerButton::set_edit_alpha); + ClassDB::bind_method(D_METHOD("is_editing_alpha"),&ColorPickerButton::is_editing_alpha); + ClassDB::bind_method(D_METHOD("_color_changed"),&ColorPickerButton::_color_changed); ADD_SIGNAL( MethodInfo("color_changed",PropertyInfo(Variant::COLOR,"color"))); - ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_pick_color"),_SCS("get_pick_color") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"edit_alpha"),_SCS("set_edit_alpha"),_SCS("is_editing_alpha") ); + ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),"set_pick_color","get_pick_color") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"edit_alpha"),"set_edit_alpha","is_editing_alpha") ; } diff --git a/scene/gui/color_ramp_edit.cpp b/scene/gui/color_ramp_edit.cpp index 5d5d6c31a2..81bc5ca9bb 100644 --- a/scene/gui/color_ramp_edit.cpp +++ b/scene/gui/color_ramp_edit.cpp @@ -446,7 +446,7 @@ Vector<ColorRamp::Point>& ColorRampEdit::get_points() { } void ColorRampEdit::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&ColorRampEdit::_gui_input); - ClassDB::bind_method(_MD("_color_changed"),&ColorRampEdit::_color_changed); + ClassDB::bind_method(D_METHOD("_gui_input"),&ColorRampEdit::_gui_input); + ClassDB::bind_method(D_METHOD("_color_changed"),&ColorRampEdit::_color_changed); ADD_SIGNAL(MethodInfo("ramp_changed")); } diff --git a/scene/gui/color_rect.cpp b/scene/gui/color_rect.cpp index 99797aa9c1..d72dffcae3 100644 --- a/scene/gui/color_rect.cpp +++ b/scene/gui/color_rect.cpp @@ -49,10 +49,10 @@ void ColorRect::_notification(int p_what) { void ColorRect::_bind_methods() { - ClassDB::bind_method(_MD("set_frame_color","color"),&ColorRect::set_frame_color); - ClassDB::bind_method(_MD("get_frame_color"),&ColorRect::get_frame_color); + ClassDB::bind_method(D_METHOD("set_frame_color","color"),&ColorRect::set_frame_color); + ClassDB::bind_method(D_METHOD("get_frame_color"),&ColorRect::get_frame_color); - ADD_PROPERTY(PropertyInfo(Variant::COLOR,"color"),_SCS("set_frame_color"),_SCS("get_frame_color") ); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"color"),"set_frame_color","get_frame_color") ; } ColorRect::ColorRect() { diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index de5f35933c..655c6e1bbf 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -156,11 +156,11 @@ void Container::_notification(int p_what) { void Container::_bind_methods() { - ClassDB::bind_method(_MD("_sort_children"),&Container::_sort_children); - ClassDB::bind_method(_MD("_child_minsize_changed"),&Container::_child_minsize_changed); + ClassDB::bind_method(D_METHOD("_sort_children"),&Container::_sort_children); + ClassDB::bind_method(D_METHOD("_child_minsize_changed"),&Container::_child_minsize_changed); - ClassDB::bind_method(_MD("queue_sort"),&Container::queue_sort); - ClassDB::bind_method(_MD("fit_child_in_rect","child:Control","rect"),&Container::fit_child_in_rect); + ClassDB::bind_method(D_METHOD("queue_sort"),&Container::queue_sort); + ClassDB::bind_method(D_METHOD("fit_child_in_rect","child:Control","rect"),&Container::fit_child_in_rect); BIND_CONSTANT( NOTIFICATION_SORT_CHILDREN ); ADD_SIGNAL(MethodInfo("sort_children")); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index e012874f5b..496b1e03cf 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -30,7 +30,7 @@ #include "servers/visual_server.h" #include "scene/main/viewport.h" #include "scene/main/canvas_layer.h" -#include "globals.h" +#include "global_config.h" #include "print_string.h" #include "os/keyboard.h" @@ -40,7 +40,7 @@ #include "scene/gui/panel.h" #include "scene/gui/label.h" #ifdef TOOLS_ENABLED -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #endif #include <stdio.h> @@ -2421,8 +2421,6 @@ void Control::get_argument_options(const StringName& p_function,int p_idx,List<S Theme::get_default()->get_font_list(get_class(),&sn); } else if (pf=="add_constant_override" || pf=="has_constant" || pf=="has_constant_override" || pf=="get_constant") { Theme::get_default()->get_constant_list(get_class(),&sn); - } else if (pf=="add_color_override" || pf=="has_color" || pf=="has_color_override" || pf=="get_color") { - Theme::get_default()->get_color_list(get_class(),&sn); } sn.sort_custom<StringName::AlphCompare>(); @@ -2448,125 +2446,125 @@ bool Control::is_clipping_contents() { void Control::_bind_methods() { - //ClassDB::bind_method(_MD("_window_resize_event"),&Control::_window_resize_event); - ClassDB::bind_method(_MD("_size_changed"),&Control::_size_changed); - ClassDB::bind_method(_MD("_update_minimum_size"),&Control::_update_minimum_size); - - ClassDB::bind_method(_MD("accept_event"),&Control::accept_event); - ClassDB::bind_method(_MD("get_minimum_size"),&Control::get_minimum_size); - ClassDB::bind_method(_MD("get_combined_minimum_size"),&Control::get_combined_minimum_size); - ClassDB::bind_method(_MD("set_anchor","margin","anchor_mode","keep_margin"),&Control::set_anchor,DEFVAL(false)); - ClassDB::bind_method(_MD("_set_anchor","margin","anchor_mode"),&Control::_set_anchor); - ClassDB::bind_method(_MD("get_anchor","margin"),&Control::get_anchor); - ClassDB::bind_method(_MD("set_margin","margin","offset"),&Control::set_margin); - ClassDB::bind_method(_MD("set_anchor_and_margin","margin","anchor_mode","offset"),&Control::set_anchor_and_margin); - ClassDB::bind_method(_MD("set_begin","pos"),&Control::set_begin); - ClassDB::bind_method(_MD("set_end","pos"),&Control::set_end); - ClassDB::bind_method(_MD("set_pos","pos"),&Control::set_pos); - ClassDB::bind_method(_MD("set_size","size"),&Control::set_size); - ClassDB::bind_method(_MD("set_custom_minimum_size","size"),&Control::set_custom_minimum_size); - ClassDB::bind_method(_MD("set_global_pos","pos"),&Control::set_global_pos); - ClassDB::bind_method(_MD("set_rotation","radians"),&Control::set_rotation); - ClassDB::bind_method(_MD("set_rotation_deg","degrees"),&Control::set_rotation_deg); + //ClassDB::bind_method(D_METHOD("_window_resize_event"),&Control::_window_resize_event); + ClassDB::bind_method(D_METHOD("_size_changed"),&Control::_size_changed); + ClassDB::bind_method(D_METHOD("_update_minimum_size"),&Control::_update_minimum_size); + + ClassDB::bind_method(D_METHOD("accept_event"),&Control::accept_event); + ClassDB::bind_method(D_METHOD("get_minimum_size"),&Control::get_minimum_size); + ClassDB::bind_method(D_METHOD("get_combined_minimum_size"),&Control::get_combined_minimum_size); + ClassDB::bind_method(D_METHOD("set_anchor","margin","anchor_mode","keep_margin"),&Control::set_anchor,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("_set_anchor","margin","anchor_mode"),&Control::_set_anchor); + ClassDB::bind_method(D_METHOD("get_anchor","margin"),&Control::get_anchor); + ClassDB::bind_method(D_METHOD("set_margin","margin","offset"),&Control::set_margin); + ClassDB::bind_method(D_METHOD("set_anchor_and_margin","margin","anchor_mode","offset"),&Control::set_anchor_and_margin); + ClassDB::bind_method(D_METHOD("set_begin","pos"),&Control::set_begin); + ClassDB::bind_method(D_METHOD("set_end","pos"),&Control::set_end); + ClassDB::bind_method(D_METHOD("set_pos","pos"),&Control::set_pos); + ClassDB::bind_method(D_METHOD("set_size","size"),&Control::set_size); + ClassDB::bind_method(D_METHOD("set_custom_minimum_size","size"),&Control::set_custom_minimum_size); + ClassDB::bind_method(D_METHOD("set_global_pos","pos"),&Control::set_global_pos); + ClassDB::bind_method(D_METHOD("set_rotation","radians"),&Control::set_rotation); + ClassDB::bind_method(D_METHOD("set_rotation_deg","degrees"),&Control::set_rotation_deg); // TODO: Obsolete this method (old name) properly (GH-4397) - ClassDB::bind_method(_MD("_set_rotation_deg","degrees"),&Control::_set_rotation_deg); - ClassDB::bind_method(_MD("set_scale","scale"),&Control::set_scale); - ClassDB::bind_method(_MD("get_margin","margin"),&Control::get_margin); - ClassDB::bind_method(_MD("get_begin"),&Control::get_begin); - ClassDB::bind_method(_MD("get_end"),&Control::get_end); - ClassDB::bind_method(_MD("get_pos"),&Control::get_pos); - ClassDB::bind_method(_MD("get_size"),&Control::get_size); - ClassDB::bind_method(_MD("get_rotation"),&Control::get_rotation); - ClassDB::bind_method(_MD("get_rotation_deg"),&Control::get_rotation_deg); + ClassDB::bind_method(D_METHOD("_set_rotation_deg","degrees"),&Control::_set_rotation_deg); + ClassDB::bind_method(D_METHOD("set_scale","scale"),&Control::set_scale); + ClassDB::bind_method(D_METHOD("get_margin","margin"),&Control::get_margin); + ClassDB::bind_method(D_METHOD("get_begin"),&Control::get_begin); + ClassDB::bind_method(D_METHOD("get_end"),&Control::get_end); + ClassDB::bind_method(D_METHOD("get_pos"),&Control::get_pos); + ClassDB::bind_method(D_METHOD("get_size"),&Control::get_size); + ClassDB::bind_method(D_METHOD("get_rotation"),&Control::get_rotation); + ClassDB::bind_method(D_METHOD("get_rotation_deg"),&Control::get_rotation_deg); // TODO: Obsolete this method (old name) properly (GH-4397) - ClassDB::bind_method(_MD("_get_rotation_deg"),&Control::_get_rotation_deg); - ClassDB::bind_method(_MD("get_scale"),&Control::get_scale); - ClassDB::bind_method(_MD("get_custom_minimum_size"),&Control::get_custom_minimum_size); - ClassDB::bind_method(_MD("get_parent_area_size"),&Control::get_size); - ClassDB::bind_method(_MD("get_global_pos"),&Control::get_global_pos); - ClassDB::bind_method(_MD("get_rect"),&Control::get_rect); - ClassDB::bind_method(_MD("get_global_rect"),&Control::get_global_rect); - ClassDB::bind_method(_MD("set_area_as_parent_rect","margin"),&Control::set_area_as_parent_rect,DEFVAL(0)); - ClassDB::bind_method(_MD("show_modal","exclusive"),&Control::show_modal,DEFVAL(false)); - ClassDB::bind_method(_MD("set_focus_mode","mode"),&Control::set_focus_mode); - ClassDB::bind_method(_MD("get_focus_mode"),&Control::get_focus_mode); - ClassDB::bind_method(_MD("has_focus"),&Control::has_focus); - ClassDB::bind_method(_MD("grab_focus"),&Control::grab_focus); - ClassDB::bind_method(_MD("release_focus"),&Control::release_focus); - ClassDB::bind_method(_MD("get_focus_owner:Control"),&Control::get_focus_owner); + ClassDB::bind_method(D_METHOD("_get_rotation_deg"),&Control::_get_rotation_deg); + ClassDB::bind_method(D_METHOD("get_scale"),&Control::get_scale); + ClassDB::bind_method(D_METHOD("get_custom_minimum_size"),&Control::get_custom_minimum_size); + ClassDB::bind_method(D_METHOD("get_parent_area_size"),&Control::get_size); + ClassDB::bind_method(D_METHOD("get_global_pos"),&Control::get_global_pos); + ClassDB::bind_method(D_METHOD("get_rect"),&Control::get_rect); + ClassDB::bind_method(D_METHOD("get_global_rect"),&Control::get_global_rect); + ClassDB::bind_method(D_METHOD("set_area_as_parent_rect","margin"),&Control::set_area_as_parent_rect,DEFVAL(0)); + ClassDB::bind_method(D_METHOD("show_modal","exclusive"),&Control::show_modal,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("set_focus_mode","mode"),&Control::set_focus_mode); + ClassDB::bind_method(D_METHOD("get_focus_mode"),&Control::get_focus_mode); + ClassDB::bind_method(D_METHOD("has_focus"),&Control::has_focus); + ClassDB::bind_method(D_METHOD("grab_focus"),&Control::grab_focus); + ClassDB::bind_method(D_METHOD("release_focus"),&Control::release_focus); + ClassDB::bind_method(D_METHOD("get_focus_owner:Control"),&Control::get_focus_owner); - ClassDB::bind_method(_MD("set_h_size_flags","flags"),&Control::set_h_size_flags); - ClassDB::bind_method(_MD("get_h_size_flags"),&Control::get_h_size_flags); + ClassDB::bind_method(D_METHOD("set_h_size_flags","flags"),&Control::set_h_size_flags); + ClassDB::bind_method(D_METHOD("get_h_size_flags"),&Control::get_h_size_flags); - ClassDB::bind_method(_MD("set_stretch_ratio","ratio"),&Control::set_stretch_ratio); - ClassDB::bind_method(_MD("get_stretch_ratio"),&Control::get_stretch_ratio); + ClassDB::bind_method(D_METHOD("set_stretch_ratio","ratio"),&Control::set_stretch_ratio); + ClassDB::bind_method(D_METHOD("get_stretch_ratio"),&Control::get_stretch_ratio); - ClassDB::bind_method(_MD("set_v_size_flags","flags"),&Control::set_v_size_flags); - ClassDB::bind_method(_MD("get_v_size_flags"),&Control::get_v_size_flags); + ClassDB::bind_method(D_METHOD("set_v_size_flags","flags"),&Control::set_v_size_flags); + ClassDB::bind_method(D_METHOD("get_v_size_flags"),&Control::get_v_size_flags); - ClassDB::bind_method(_MD("set_theme","theme:Theme"),&Control::set_theme); - ClassDB::bind_method(_MD("get_theme:Theme"),&Control::get_theme); + ClassDB::bind_method(D_METHOD("set_theme","theme:Theme"),&Control::set_theme); + ClassDB::bind_method(D_METHOD("get_theme:Theme"),&Control::get_theme); - ClassDB::bind_method(_MD("add_icon_override","name","texture:Texture"),&Control::add_icon_override); - ClassDB::bind_method(_MD("add_shader_override","name","shader:Shader"),&Control::add_shader_override); - ClassDB::bind_method(_MD("add_style_override","name","stylebox:StyleBox"),&Control::add_style_override); - ClassDB::bind_method(_MD("add_font_override","name","font:Font"),&Control::add_font_override); - ClassDB::bind_method(_MD("add_color_override","name","color"),&Control::add_color_override); - ClassDB::bind_method(_MD("add_constant_override","name","constant"),&Control::add_constant_override); + ClassDB::bind_method(D_METHOD("add_icon_override","name","texture:Texture"),&Control::add_icon_override); + ClassDB::bind_method(D_METHOD("add_shader_override","name","shader:Shader"),&Control::add_shader_override); + ClassDB::bind_method(D_METHOD("add_style_override","name","stylebox:StyleBox"),&Control::add_style_override); + ClassDB::bind_method(D_METHOD("add_font_override","name","font:Font"),&Control::add_font_override); + ClassDB::bind_method(D_METHOD("add_color_override","name","color"),&Control::add_color_override); + ClassDB::bind_method(D_METHOD("add_constant_override","name","constant"),&Control::add_constant_override); - ClassDB::bind_method(_MD("get_icon:Texture","name","type"),&Control::get_icon,DEFVAL("")); - ClassDB::bind_method(_MD("get_stylebox:StyleBox","name","type"),&Control::get_stylebox,DEFVAL("")); - ClassDB::bind_method(_MD("get_font:Font","name","type"),&Control::get_font,DEFVAL("")); - ClassDB::bind_method(_MD("get_color","name","type"),&Control::get_color,DEFVAL("")); - ClassDB::bind_method(_MD("get_constant","name","type"),&Control::get_constant,DEFVAL("")); + ClassDB::bind_method(D_METHOD("get_icon:Texture","name","type"),&Control::get_icon,DEFVAL("")); + ClassDB::bind_method(D_METHOD("get_stylebox:StyleBox","name","type"),&Control::get_stylebox,DEFVAL("")); + ClassDB::bind_method(D_METHOD("get_font:Font","name","type"),&Control::get_font,DEFVAL("")); + ClassDB::bind_method(D_METHOD("get_color","name","type"),&Control::get_color,DEFVAL("")); + ClassDB::bind_method(D_METHOD("get_constant","name","type"),&Control::get_constant,DEFVAL("")); - ClassDB::bind_method(_MD("has_icon_override", "name"), &Control::has_icon_override); - ClassDB::bind_method(_MD("has_stylebox_override", "name"), &Control::has_stylebox_override); - ClassDB::bind_method(_MD("has_font_override", "name"), &Control::has_font_override); - ClassDB::bind_method(_MD("has_color_override", "name"), &Control::has_color_override); - ClassDB::bind_method(_MD("has_constant_override", "name"), &Control::has_constant_override); + ClassDB::bind_method(D_METHOD("has_icon_override", "name"), &Control::has_icon_override); + ClassDB::bind_method(D_METHOD("has_stylebox_override", "name"), &Control::has_stylebox_override); + ClassDB::bind_method(D_METHOD("has_font_override", "name"), &Control::has_font_override); + ClassDB::bind_method(D_METHOD("has_color_override", "name"), &Control::has_color_override); + ClassDB::bind_method(D_METHOD("has_constant_override", "name"), &Control::has_constant_override); - ClassDB::bind_method(_MD("has_icon", "name", "type"), &Control::has_icon, DEFVAL("")); - ClassDB::bind_method(_MD("has_stylebox", "name", "type"), &Control::has_stylebox, DEFVAL("")); - ClassDB::bind_method(_MD("has_font", "name", "type"), &Control::has_font, DEFVAL("")); - ClassDB::bind_method(_MD("has_color", "name", "type"), &Control::has_color, DEFVAL("")); - ClassDB::bind_method(_MD("has_constant", "name", "type"), &Control::has_constant, DEFVAL("")); + ClassDB::bind_method(D_METHOD("has_icon", "name", "type"), &Control::has_icon, DEFVAL("")); + ClassDB::bind_method(D_METHOD("has_stylebox", "name", "type"), &Control::has_stylebox, DEFVAL("")); + ClassDB::bind_method(D_METHOD("has_font", "name", "type"), &Control::has_font, DEFVAL("")); + ClassDB::bind_method(D_METHOD("has_color", "name", "type"), &Control::has_color, DEFVAL("")); + ClassDB::bind_method(D_METHOD("has_constant", "name", "type"), &Control::has_constant, DEFVAL("")); - ClassDB::bind_method(_MD("get_parent_control:Control"),&Control::get_parent_control); + ClassDB::bind_method(D_METHOD("get_parent_control:Control"),&Control::get_parent_control); - ClassDB::bind_method(_MD("set_tooltip","tooltip"),&Control::set_tooltip); - ClassDB::bind_method(_MD("get_tooltip","atpos"),&Control::get_tooltip,DEFVAL(Point2())); - ClassDB::bind_method(_MD("_get_tooltip"),&Control::_get_tooltip); + ClassDB::bind_method(D_METHOD("set_tooltip","tooltip"),&Control::set_tooltip); + ClassDB::bind_method(D_METHOD("get_tooltip","atpos"),&Control::get_tooltip,DEFVAL(Point2())); + ClassDB::bind_method(D_METHOD("_get_tooltip"),&Control::_get_tooltip); - ClassDB::bind_method(_MD("set_default_cursor_shape","shape"),&Control::set_default_cursor_shape); - ClassDB::bind_method(_MD("get_default_cursor_shape"),&Control::get_default_cursor_shape); - ClassDB::bind_method(_MD("get_cursor_shape","pos"),&Control::get_cursor_shape,DEFVAL(Point2())); + ClassDB::bind_method(D_METHOD("set_default_cursor_shape","shape"),&Control::set_default_cursor_shape); + ClassDB::bind_method(D_METHOD("get_default_cursor_shape"),&Control::get_default_cursor_shape); + ClassDB::bind_method(D_METHOD("get_cursor_shape","pos"),&Control::get_cursor_shape,DEFVAL(Point2())); - ClassDB::bind_method(_MD("set_focus_neighbour","margin","neighbour"),&Control::set_focus_neighbour); - ClassDB::bind_method(_MD("get_focus_neighbour","margin"),&Control::get_focus_neighbour); + ClassDB::bind_method(D_METHOD("set_focus_neighbour","margin","neighbour"),&Control::set_focus_neighbour); + ClassDB::bind_method(D_METHOD("get_focus_neighbour","margin"),&Control::get_focus_neighbour); - ClassDB::bind_method(_MD("force_drag","data","preview"),&Control::force_drag); + ClassDB::bind_method(D_METHOD("force_drag","data","preview"),&Control::force_drag); - ClassDB::bind_method(_MD("set_mouse_filter","filter"),&Control::set_mouse_filter); - ClassDB::bind_method(_MD("get_mouse_filter"),&Control::get_mouse_filter); + ClassDB::bind_method(D_METHOD("set_mouse_filter","filter"),&Control::set_mouse_filter); + ClassDB::bind_method(D_METHOD("get_mouse_filter"),&Control::get_mouse_filter); - ClassDB::bind_method(_MD("set_clip_contents","enable"),&Control::set_clip_contents); - ClassDB::bind_method(_MD("is_clipping_contents"),&Control::is_clipping_contents); + ClassDB::bind_method(D_METHOD("set_clip_contents","enable"),&Control::set_clip_contents); + ClassDB::bind_method(D_METHOD("is_clipping_contents"),&Control::is_clipping_contents); - ClassDB::bind_method(_MD("grab_click_focus"),&Control::grab_click_focus); + ClassDB::bind_method(D_METHOD("grab_click_focus"),&Control::grab_click_focus); - ClassDB::bind_method(_MD("set_drag_forwarding","target:Control"),&Control::set_drag_forwarding); - ClassDB::bind_method(_MD("set_drag_preview","control:Control"),&Control::set_drag_preview); + ClassDB::bind_method(D_METHOD("set_drag_forwarding","target:Control"),&Control::set_drag_forwarding); + ClassDB::bind_method(D_METHOD("set_drag_preview","control:Control"),&Control::set_drag_preview); - ClassDB::bind_method(_MD("warp_mouse","to_pos"),&Control::warp_mouse); + ClassDB::bind_method(D_METHOD("warp_mouse","to_pos"),&Control::warp_mouse); - ClassDB::bind_method(_MD("minimum_size_changed"), &Control::minimum_size_changed); + ClassDB::bind_method(D_METHOD("minimum_size_changed"), &Control::minimum_size_changed); - ClassDB::bind_method(_MD("_theme_changed"), &Control::_theme_changed); + ClassDB::bind_method(D_METHOD("_theme_changed"), &Control::_theme_changed); - ClassDB::bind_method(_MD("_font_changed"), &Control::_font_changed); + ClassDB::bind_method(D_METHOD("_font_changed"), &Control::_font_changed); BIND_VMETHOD(MethodInfo("_gui_input",PropertyInfo(Variant::INPUT_EVENT,"event"))); BIND_VMETHOD(MethodInfo(Variant::VECTOR2,"get_minimum_size")); @@ -2575,44 +2573,44 @@ void Control::_bind_methods() { BIND_VMETHOD(MethodInfo("drop_data",PropertyInfo(Variant::VECTOR2,"pos"),PropertyInfo(Variant::NIL,"data"))); ADD_GROUP("Anchor","anchor_"); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_left", PROPERTY_HINT_ENUM, "Begin,End,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_LEFT ); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_top", PROPERTY_HINT_ENUM, "Begin,End,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_TOP ); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_right", PROPERTY_HINT_ENUM, "Begin,End,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_RIGHT ); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_bottom", PROPERTY_HINT_ENUM, "Begin,End,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_BOTTOM ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_left", PROPERTY_HINT_ENUM, "Begin,End,Center"), "_set_anchor","get_anchor", MARGIN_LEFT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_top", PROPERTY_HINT_ENUM, "Begin,End,Center"), "_set_anchor","get_anchor", MARGIN_TOP ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_right", PROPERTY_HINT_ENUM, "Begin,End,Center"), "_set_anchor","get_anchor", MARGIN_RIGHT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_bottom", PROPERTY_HINT_ENUM, "Begin,End,Center"), "_set_anchor","get_anchor", MARGIN_BOTTOM ); ADD_GROUP("Margin","margin_"); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_left", PROPERTY_HINT_RANGE, "-4096,4096"), _SCS("set_margin"),_SCS("get_margin"),MARGIN_LEFT ); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_top", PROPERTY_HINT_RANGE, "-4096,4096"), _SCS("set_margin"),_SCS("get_margin"),MARGIN_TOP ); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_right", PROPERTY_HINT_RANGE, "-4096,4096"), _SCS("set_margin"),_SCS("get_margin"),MARGIN_RIGHT ); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_bottom", PROPERTY_HINT_RANGE, "-4096,4096"), _SCS("set_margin"),_SCS("get_margin"),MARGIN_BOTTOM ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_left", PROPERTY_HINT_RANGE, "-4096,4096"), "set_margin","get_margin",MARGIN_LEFT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_top", PROPERTY_HINT_RANGE, "-4096,4096"), "set_margin","get_margin",MARGIN_TOP ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_right", PROPERTY_HINT_RANGE, "-4096,4096"), "set_margin","get_margin",MARGIN_RIGHT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_bottom", PROPERTY_HINT_RANGE, "-4096,4096"), "set_margin","get_margin",MARGIN_BOTTOM ); ADD_GROUP("Rect","rect_"); - ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect_pos", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_EDITOR), _SCS("set_pos"),_SCS("get_pos") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect_size", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_EDITOR), _SCS("set_size"),_SCS("get_size") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect_min_size"), _SCS("set_custom_minimum_size"),_SCS("get_custom_minimum_size") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"rect_rotation",PROPERTY_HINT_RANGE,"-1080,1080,0.01"), _SCS("set_rotation_deg"),_SCS("get_rotation_deg") ); - ADD_PROPERTYNO( PropertyInfo(Variant::VECTOR2,"rect_scale"), _SCS("set_scale"),_SCS("get_scale") ); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"rect_clip_content"), _SCS("set_clip_contents"),_SCS("is_clipping_contents") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect_pos", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_EDITOR), "set_pos","get_pos") ; + ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect_size", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_EDITOR), "set_size","get_size") ; + ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect_min_size"), "set_custom_minimum_size","get_custom_minimum_size") ; + ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"rect_rotation",PROPERTY_HINT_RANGE,"-1080,1080,0.01"), "set_rotation_deg","get_rotation_deg") ; + ADD_PROPERTYNO( PropertyInfo(Variant::VECTOR2,"rect_scale"), "set_scale","get_scale") ; + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"rect_clip_content"), "set_clip_contents","is_clipping_contents") ; ADD_GROUP("Hint","hint_"); - ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"hint_tooltip", PROPERTY_HINT_MULTILINE_TEXT), _SCS("set_tooltip"),_SCS("_get_tooltip") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"hint_tooltip", PROPERTY_HINT_MULTILINE_TEXT), "set_tooltip","_get_tooltip") ; ADD_GROUP("Focus","focus_"); - ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_left" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_LEFT ); - ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_top" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_TOP ); - ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_right" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_RIGHT ); - ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_bottom" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_BOTTOM ); + ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_left" ), "set_focus_neighbour","get_focus_neighbour",MARGIN_LEFT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_top" ), "set_focus_neighbour","get_focus_neighbour",MARGIN_TOP ); + ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_right" ), "set_focus_neighbour","get_focus_neighbour",MARGIN_RIGHT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_bottom" ), "set_focus_neighbour","get_focus_neighbour",MARGIN_BOTTOM ); ADD_GROUP("Mouse","mouse_"); - ADD_PROPERTY( PropertyInfo(Variant::INT,"mouse_filter",PROPERTY_HINT_ENUM,"Stop,Pass,Ignore"), _SCS("set_mouse_filter"),_SCS("get_mouse_filter") ); + ADD_PROPERTY( PropertyInfo(Variant::INT,"mouse_filter",PROPERTY_HINT_ENUM,"Stop,Pass,Ignore"), "set_mouse_filter","get_mouse_filter") ; ADD_GROUP("Size Flags","size_flags_"); - ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags_horizontal", PROPERTY_HINT_FLAGS, "Fill,Expand"), _SCS("set_h_size_flags"),_SCS("get_h_size_flags") ); - ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags_vertical", PROPERTY_HINT_FLAGS, "Fill,Expand"), _SCS("set_v_size_flags"),_SCS("get_v_size_flags") ); - ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "1,128,0.01"), _SCS("set_stretch_ratio"),_SCS("get_stretch_ratio") ); + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags_horizontal", PROPERTY_HINT_FLAGS, "Fill,Expand"), "set_h_size_flags","get_h_size_flags") ; + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags_vertical", PROPERTY_HINT_FLAGS, "Fill,Expand"), "set_v_size_flags","get_v_size_flags") ; + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "1,128,0.01"), "set_stretch_ratio","get_stretch_ratio") ; ADD_GROUP("Theme",""); - ADD_PROPERTYNZ( PropertyInfo(Variant::OBJECT,"theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), _SCS("set_theme"),_SCS("get_theme") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::OBJECT,"theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), "set_theme","get_theme") ; ADD_GROUP("",""); BIND_CONSTANT( ANCHOR_BEGIN ); diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index cc6fe7cae8..6d06f8c59c 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -33,76 +33,173 @@ void WindowDialog::_post_popup() { - dragging=false; //just in case + drag_type = DRAG_NONE; // just in case +} + +void WindowDialog::_fix_size() { + + // Perhaps this should be called when the viewport resizes aswell or windows go out of bounds... + + // Ensure the whole window is visible. + Point2i pos = get_global_pos(); + Size2i size = get_size(); + Size2i viewport_size = get_viewport_rect().size; + + // Windows require additional padding to keep the window chrome visible. + Ref<StyleBox> panel = get_stylebox("panel", "WindowDialog"); + float top = panel->get_margin(MARGIN_TOP); + float left = panel->get_margin(MARGIN_LEFT); + float bottom = panel->get_margin(MARGIN_BOTTOM); + float right = panel->get_margin(MARGIN_RIGHT); + + pos.x = MAX(left, MIN(pos.x, viewport_size.x - size.x - right)); + pos.y = MAX(top, MIN(pos.y, viewport_size.y - size.y - bottom)); + set_global_pos(pos); + + // Also resize the window to fit if a resize should be possible at all. + if (resizable) { + size.x = MIN(size.x, viewport_size.x - left - right); + size.y = MIN(size.y, viewport_size.y - top - bottom); + set_size(size); + } } bool WindowDialog::has_point(const Point2& p_point) const { + Rect2 r(Point2(), get_size()); - int extra = get_constant("titlebar_height","WindowDialog"); - Rect2 r( Point2(), get_size() ); - r.pos.y-=extra; - r.size.y+=extra; - return r.has_point(p_point); + // Enlarge upwards for title bar. + int titlebar_height = get_constant("titlebar_height", "WindowDialog"); + r.pos.y -= titlebar_height; + r.size.y += titlebar_height; + // Inflate by the resizable border thickness. + if (resizable) { + int scaleborder_size = get_constant("scaleborder_size", "WindowDialog"); + r.pos.x -= scaleborder_size; + r.size.width += scaleborder_size * 2; + r.pos.y -= scaleborder_size; + r.size.height += scaleborder_size * 2; + } + + return r.has_point(p_point); } void WindowDialog::_gui_input(const InputEvent& p_event) { - if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_LEFT) { - - if (p_event.mouse_button.pressed && p_event.mouse_button.y < 0) - dragging=true; - else if (dragging && !p_event.mouse_button.pressed) - dragging=false; + if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index == BUTTON_LEFT) { + + if (p_event.mouse_button.pressed) { + // Begin a possible dragging operation. + drag_type = _drag_hit_test(Point2(p_event.mouse_button.x, p_event.mouse_button.y)); + if (drag_type != DRAG_NONE) + drag_offset = get_global_mouse_pos() - get_pos(); + drag_offset_far = get_pos() + get_size() - get_global_mouse_pos(); + } else if (drag_type != DRAG_NONE && !p_event.mouse_button.pressed) { + // End a dragging operation. + drag_type = DRAG_NONE; + } } - - if (p_event.type == InputEvent::MOUSE_MOTION && dragging) { - - Point2 rel( p_event.mouse_motion.relative_x, p_event.mouse_motion.relative_y ); - Point2 pos = get_pos(); - - pos+=rel; - - if (pos.y<0) - pos.y=0; - - set_pos(pos); + if (p_event.type == InputEvent::MOUSE_MOTION) { + + if (drag_type == DRAG_NONE) { + // Update the cursor while moving along the borders. + CursorShape cursor = CURSOR_ARROW; + if (resizable) { + int preview_drag_type = _drag_hit_test(Point2(p_event.mouse_button.x, p_event.mouse_button.y)); + switch (preview_drag_type) { + case DRAG_RESIZE_TOP: + case DRAG_RESIZE_BOTTOM: + cursor = CURSOR_VSIZE; + break; + case DRAG_RESIZE_LEFT: + case DRAG_RESIZE_RIGHT: + cursor = CURSOR_HSIZE; + break; + case DRAG_RESIZE_TOP + DRAG_RESIZE_LEFT: + case DRAG_RESIZE_BOTTOM + DRAG_RESIZE_RIGHT: + cursor = CURSOR_FDIAGSIZE; + break; + case DRAG_RESIZE_TOP + DRAG_RESIZE_RIGHT: + case DRAG_RESIZE_BOTTOM + DRAG_RESIZE_LEFT: + cursor = CURSOR_BDIAGSIZE; + break; + } + } + if (get_cursor_shape() != cursor) + set_default_cursor_shape(cursor); + } else { + // Update while in a dragging operation. + Point2 global_pos = get_global_mouse_pos(); + global_pos.y = MAX(global_pos.y, 0); // Ensure title bar stays visible. + + Rect2 rect = get_rect(); + Size2 min_size = get_minimum_size(); + + if (drag_type == DRAG_MOVE) { + rect.pos = global_pos - drag_offset; + } else { + if (drag_type & DRAG_RESIZE_TOP) { + int bottom = rect.pos.y + rect.size.height; + int max_y = bottom - min_size.height; + rect.pos.y = MIN(global_pos.y - drag_offset.y, max_y); + rect.size.height = bottom - rect.pos.y; + } else if (drag_type & DRAG_RESIZE_BOTTOM) { + rect.size.height = global_pos.y - rect.pos.y + drag_offset_far.y; + } + if (drag_type & DRAG_RESIZE_LEFT) { + int right = rect.pos.x + rect.size.width; + int max_x = right - min_size.width; + rect.pos.x = MIN(global_pos.x - drag_offset.x, max_x); + rect.size.width = right - rect.pos.x; + } else if (drag_type & DRAG_RESIZE_RIGHT) { + rect.size.width = global_pos.x - rect.pos.x + drag_offset_far.x; + } + } + + set_size(rect.size); + set_pos(rect.pos); + } } } void WindowDialog::_notification(int p_what) { - switch(p_what) { - + switch (p_what) { case NOTIFICATION_DRAW: { - RID ci = get_canvas_item(); - Size2 s = get_size(); - Ref<StyleBox> st = get_stylebox("panel","WindowDialog"); - st->draw(ci,Rect2(Point2(),s)); - int th = get_constant("title_height","WindowDialog"); - Color tc = get_color("title_color","WindowDialog"); - Ref<Font> font = get_font("title_font","WindowDialog"); - int ofs = (s.width-font->get_string_size(title).width)/2; - //int ofs = st->get_margin(MARGIN_LEFT); - draw_string(font,Point2(ofs,-th+font->get_ascent()),title,tc,s.width - st->get_minimum_size().width); + RID canvas = get_canvas_item(); + Size2 size = get_size(); + + Ref<StyleBox> panel = get_stylebox("panel", "WindowDialog"); + panel->draw(canvas, Rect2(Point2(), size)); + int title_height = get_constant("title_height", "WindowDialog"); + Color title_color = get_color("title_color", "WindowDialog"); + Ref<Font> font = get_font("title_font", "WindowDialog"); + int ofs = (size.width - font->get_string_size(title).width) / 2; + draw_string(font, Point2(ofs, -title_height + font->get_ascent()), title, title_color, size.width - panel->get_minimum_size().width); } break; + case NOTIFICATION_THEME_CHANGED: case NOTIFICATION_ENTER_TREE: { + close_button->set_normal_texture(get_icon("close", "WindowDialog")); + close_button->set_pressed_texture(get_icon("close", "WindowDialog")); + close_button->set_hover_texture(get_icon("close_hilite", "WindowDialog")); + close_button->set_anchor(MARGIN_LEFT, ANCHOR_END); + close_button->set_begin(Point2(get_constant("close_h_ofs", "WindowDialog"), -get_constant("close_v_ofs", "WindowDialog"))); + } break; - close_button->set_normal_texture( get_icon("close","WindowDialog")); - close_button->set_pressed_texture( get_icon("close","WindowDialog")); - close_button->set_hover_texture( get_icon("close_hilite","WindowDialog")); - close_button->set_anchor(MARGIN_LEFT,ANCHOR_END); - close_button->set_begin( Point2( get_constant("close_h_ofs","WindowDialog"), -get_constant("close_v_ofs","WindowDialog") )); - + case NOTIFICATION_MOUSE_EXIT: { + // Reset the mouse cursor when leaving the resizable window border. + if (resizable && !drag_type) { + if (get_default_cursor_shape() != CURSOR_ARROW) + set_default_cursor_shape(CURSOR_ARROW); + } } break; } - } void WindowDialog::_closed() { @@ -111,11 +208,48 @@ void WindowDialog::_closed() { hide(); } +int WindowDialog::_drag_hit_test(const Point2& pos) const { + int drag_type = DRAG_NONE; + + if (resizable) { + int titlebar_height = get_constant("titlebar_height", "WindowDialog"); + int scaleborder_size = get_constant("scaleborder_size", "WindowDialog"); + + Rect2 rect = get_rect(); + + if (pos.y < (-titlebar_height + scaleborder_size)) + drag_type = DRAG_RESIZE_TOP; + else if (pos.y >= (rect.size.height - scaleborder_size)) + drag_type = DRAG_RESIZE_BOTTOM; + if (pos.x < scaleborder_size) + drag_type |= DRAG_RESIZE_LEFT; + else if (pos.x >= (rect.size.width - scaleborder_size)) + drag_type |= DRAG_RESIZE_RIGHT; + } + + if (drag_type == DRAG_NONE && pos.y < 0) + drag_type = DRAG_MOVE; + + return drag_type; +} + void WindowDialog::set_title(const String& p_title) { title=XL_MESSAGE(p_title); update(); } +String WindowDialog::get_title() const { + + return title; +} + +void WindowDialog::set_resizable(bool p_resizable) { + resizable = p_resizable; +} +bool WindowDialog::get_resizable() const { + return resizable; +} + Size2 WindowDialog::get_minimum_size() const { @@ -127,11 +261,6 @@ Size2 WindowDialog::get_minimum_size() const { } -String WindowDialog::get_title() const { - - return title; -} - TextureButton *WindowDialog::get_close_button() { @@ -141,22 +270,26 @@ TextureButton *WindowDialog::get_close_button() { void WindowDialog::_bind_methods() { - ClassDB::bind_method( _MD("_gui_input"),&WindowDialog::_gui_input); - ClassDB::bind_method( _MD("set_title","title"),&WindowDialog::set_title); - ClassDB::bind_method( _MD("get_title"),&WindowDialog::get_title); - ClassDB::bind_method( _MD("_closed"),&WindowDialog::_closed); - ClassDB::bind_method( _MD("get_close_button:TextureButton"),&WindowDialog::get_close_button); + ClassDB::bind_method( D_METHOD("_gui_input"),&WindowDialog::_gui_input); + ClassDB::bind_method( D_METHOD("set_title","title"),&WindowDialog::set_title); + ClassDB::bind_method( D_METHOD("get_title"),&WindowDialog::get_title); + ClassDB::bind_method( D_METHOD("set_resizable","resizable"),&WindowDialog::set_resizable); + ClassDB::bind_method( D_METHOD("get_resizable"), &WindowDialog::get_resizable); + ClassDB::bind_method( D_METHOD("_closed"),&WindowDialog::_closed); + ClassDB::bind_method( D_METHOD("get_close_button:TextureButton"),&WindowDialog::get_close_button); - ADD_PROPERTY( PropertyInfo(Variant::STRING,"window_title",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT_INTL),_SCS("set_title"),_SCS("get_title")); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"window_title",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT_INTL),"set_title","get_title"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"resizable",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT_INTL),"set_resizable","get_resizable"); } WindowDialog::WindowDialog() { //title="Hello!"; - dragging=false; - close_button = memnew( TextureButton ); + drag_type = DRAG_NONE; + resizable = false; + close_button = memnew(TextureButton); add_child(close_button); - close_button->connect("pressed",this,"_closed"); + close_button->connect("pressed", this, "_closed"); } @@ -186,7 +319,7 @@ PopupDialog::~PopupDialog() { } -// +// AcceptDialog void AcceptDialog::_post_popup() { @@ -201,7 +334,7 @@ void AcceptDialog::_notification(int p_what) { if (p_what==NOTIFICATION_MODAL_CLOSE) { cancel_pressed(); - } if (p_what==NOTIFICATION_RESIZED) { + } else if (p_what==NOTIFICATION_RESIZED) { _update_child_rects(); } @@ -272,7 +405,7 @@ void AcceptDialog::_update_child_rects() { if (!c) continue; - if (c==hbc || c==label || c==get_close_button()) + if (c==hbc || c==label || c==get_close_button() || c->is_set_as_toplevel()) continue; c->set_pos(cpos); @@ -299,7 +432,7 @@ Size2 AcceptDialog::get_minimum_size() const { if (!c) continue; - if (c==hbc || c==label || c==const_cast<AcceptDialog*>(this)->get_close_button()) + if (c==hbc || c==label || c==const_cast<AcceptDialog*>(this)->get_close_button() || c->is_set_as_toplevel()) continue; Size2 cminsize = c->get_combined_minimum_size(); @@ -361,25 +494,25 @@ Button* AcceptDialog::add_cancel(const String &p_cancel) { void AcceptDialog::_bind_methods() { - ClassDB::bind_method(_MD("_ok"),&AcceptDialog::_ok_pressed); - ClassDB::bind_method(_MD("get_ok"),&AcceptDialog::get_ok); - ClassDB::bind_method(_MD("get_label"),&AcceptDialog::get_label); - ClassDB::bind_method(_MD("set_hide_on_ok","enabled"),&AcceptDialog::set_hide_on_ok); - ClassDB::bind_method(_MD("get_hide_on_ok"),&AcceptDialog::get_hide_on_ok); - ClassDB::bind_method(_MD("add_button:Button","text","right","action"),&AcceptDialog::add_button,DEFVAL(false),DEFVAL("")); - ClassDB::bind_method(_MD("add_cancel:Button","name"),&AcceptDialog::add_cancel); - ClassDB::bind_method(_MD("_builtin_text_entered"),&AcceptDialog::_builtin_text_entered); - ClassDB::bind_method(_MD("register_text_enter:LineEdit","line_edit"),&AcceptDialog::register_text_enter); - ClassDB::bind_method(_MD("_custom_action"),&AcceptDialog::_custom_action); - ClassDB::bind_method(_MD("set_text","text"),&AcceptDialog::set_text); - ClassDB::bind_method(_MD("get_text"),&AcceptDialog::get_text); + ClassDB::bind_method(D_METHOD("_ok"),&AcceptDialog::_ok_pressed); + ClassDB::bind_method(D_METHOD("get_ok"),&AcceptDialog::get_ok); + ClassDB::bind_method(D_METHOD("get_label"),&AcceptDialog::get_label); + ClassDB::bind_method(D_METHOD("set_hide_on_ok","enabled"),&AcceptDialog::set_hide_on_ok); + ClassDB::bind_method(D_METHOD("get_hide_on_ok"),&AcceptDialog::get_hide_on_ok); + ClassDB::bind_method(D_METHOD("add_button:Button","text","right","action"),&AcceptDialog::add_button,DEFVAL(false),DEFVAL("")); + ClassDB::bind_method(D_METHOD("add_cancel:Button","name"),&AcceptDialog::add_cancel); + ClassDB::bind_method(D_METHOD("_builtin_text_entered"),&AcceptDialog::_builtin_text_entered); + ClassDB::bind_method(D_METHOD("register_text_enter:LineEdit","line_edit"),&AcceptDialog::register_text_enter); + ClassDB::bind_method(D_METHOD("_custom_action"),&AcceptDialog::_custom_action); + ClassDB::bind_method(D_METHOD("set_text","text"),&AcceptDialog::set_text); + ClassDB::bind_method(D_METHOD("get_text"),&AcceptDialog::get_text); ADD_SIGNAL( MethodInfo("confirmed") ); ADD_SIGNAL( MethodInfo("custom_action",PropertyInfo(Variant::STRING,"action")) ); ADD_GROUP("Dialog","dialog"); - ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"dialog_text",PROPERTY_HINT_MULTILINE_TEXT,"",PROPERTY_USAGE_DEFAULT_INTL),_SCS("set_text"),_SCS("get_text")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "dialog_hide_on_ok"),_SCS("set_hide_on_ok"),_SCS("get_hide_on_ok") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"dialog_text",PROPERTY_HINT_MULTILINE_TEXT,"",PROPERTY_USAGE_DEFAULT_INTL),"set_text","get_text"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "dialog_hide_on_ok"),"set_hide_on_ok","get_hide_on_ok") ; } @@ -429,7 +562,7 @@ AcceptDialog::~AcceptDialog() void ConfirmationDialog::_bind_methods() { - ClassDB::bind_method(_MD("get_cancel:Button"),&ConfirmationDialog::get_cancel); + ClassDB::bind_method(D_METHOD("get_cancel:Button"),&ConfirmationDialog::get_cancel); } Button *ConfirmationDialog::get_cancel() { diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index 6650c5eb5d..dd75b76c8e 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -44,15 +44,29 @@ class WindowDialog : public Popup { GDCLASS(WindowDialog,Popup); + enum DRAG_TYPE { + DRAG_NONE = 0, + DRAG_MOVE = 1, + DRAG_RESIZE_TOP = 1 << 1, + DRAG_RESIZE_RIGHT = 1 << 2, + DRAG_RESIZE_BOTTOM = 1 << 3, + DRAG_RESIZE_LEFT = 1 << 4 + }; + TextureButton *close_button; String title; - bool dragging; + int drag_type; + Point2 drag_offset; + Point2 drag_offset_far; + bool resizable; void _gui_input(const InputEvent& p_event); void _closed(); + int _drag_hit_test(const Point2& pos) const; + protected: virtual void _post_popup(); - + virtual void _fix_size(); virtual void _close_pressed() {} virtual bool has_point(const Point2& p_point) const; void _notification(int p_what); @@ -63,6 +77,8 @@ public: void set_title(const String& p_title); String get_title() const; + void set_resizable(bool p_resizable); + bool get_resizable() const; Size2 get_minimum_size() const; diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 393f14bee2..357a70a25b 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -686,41 +686,41 @@ bool FileDialog::default_show_hidden_files=false; void FileDialog::_bind_methods() { - ClassDB::bind_method(_MD("_unhandled_input"),&FileDialog::_unhandled_input); - - ClassDB::bind_method(_MD("_tree_selected"),&FileDialog::_tree_selected); - ClassDB::bind_method(_MD("_tree_db_selected"),&FileDialog::_tree_dc_selected); - ClassDB::bind_method(_MD("_dir_entered"),&FileDialog::_dir_entered); - ClassDB::bind_method(_MD("_file_entered"),&FileDialog::_file_entered); - ClassDB::bind_method(_MD("_action_pressed"),&FileDialog::_action_pressed); - ClassDB::bind_method(_MD("_cancel_pressed"),&FileDialog::_cancel_pressed); - ClassDB::bind_method(_MD("_filter_selected"),&FileDialog::_filter_selected); - ClassDB::bind_method(_MD("_save_confirm_pressed"),&FileDialog::_save_confirm_pressed); - - ClassDB::bind_method(_MD("clear_filters"),&FileDialog::clear_filters); - ClassDB::bind_method(_MD("add_filter","filter"),&FileDialog::add_filter); - ClassDB::bind_method(_MD("set_filters","filters"),&FileDialog::set_filters); - ClassDB::bind_method(_MD("get_filters"),&FileDialog::get_filters); - ClassDB::bind_method(_MD("get_current_dir"),&FileDialog::get_current_dir); - ClassDB::bind_method(_MD("get_current_file"),&FileDialog::get_current_file); - ClassDB::bind_method(_MD("get_current_path"),&FileDialog::get_current_path); - ClassDB::bind_method(_MD("set_current_dir","dir"),&FileDialog::set_current_dir); - ClassDB::bind_method(_MD("set_current_file","file"),&FileDialog::set_current_file); - ClassDB::bind_method(_MD("set_current_path","path"),&FileDialog::set_current_path); - ClassDB::bind_method(_MD("set_mode","mode"),&FileDialog::set_mode); - ClassDB::bind_method(_MD("get_mode"),&FileDialog::get_mode); - ClassDB::bind_method(_MD("get_vbox:VBoxContainer"),&FileDialog::get_vbox); - ClassDB::bind_method(_MD("set_access","access"),&FileDialog::set_access); - ClassDB::bind_method(_MD("get_access"),&FileDialog::get_access); - ClassDB::bind_method(_MD("set_show_hidden_files","show"),&FileDialog::set_show_hidden_files); - ClassDB::bind_method(_MD("is_showing_hidden_files"),&FileDialog::is_showing_hidden_files); - ClassDB::bind_method(_MD("_select_drive"),&FileDialog::_select_drive); - ClassDB::bind_method(_MD("_make_dir"),&FileDialog::_make_dir); - ClassDB::bind_method(_MD("_make_dir_confirm"),&FileDialog::_make_dir_confirm); - ClassDB::bind_method(_MD("_update_file_list"),&FileDialog::update_file_list); - ClassDB::bind_method(_MD("_update_dir"),&FileDialog::update_dir); - - ClassDB::bind_method(_MD("invalidate"),&FileDialog::invalidate); + ClassDB::bind_method(D_METHOD("_unhandled_input"),&FileDialog::_unhandled_input); + + ClassDB::bind_method(D_METHOD("_tree_selected"),&FileDialog::_tree_selected); + ClassDB::bind_method(D_METHOD("_tree_db_selected"),&FileDialog::_tree_dc_selected); + ClassDB::bind_method(D_METHOD("_dir_entered"),&FileDialog::_dir_entered); + ClassDB::bind_method(D_METHOD("_file_entered"),&FileDialog::_file_entered); + ClassDB::bind_method(D_METHOD("_action_pressed"),&FileDialog::_action_pressed); + ClassDB::bind_method(D_METHOD("_cancel_pressed"),&FileDialog::_cancel_pressed); + ClassDB::bind_method(D_METHOD("_filter_selected"),&FileDialog::_filter_selected); + ClassDB::bind_method(D_METHOD("_save_confirm_pressed"),&FileDialog::_save_confirm_pressed); + + ClassDB::bind_method(D_METHOD("clear_filters"),&FileDialog::clear_filters); + ClassDB::bind_method(D_METHOD("add_filter","filter"),&FileDialog::add_filter); + ClassDB::bind_method(D_METHOD("set_filters","filters"),&FileDialog::set_filters); + ClassDB::bind_method(D_METHOD("get_filters"),&FileDialog::get_filters); + ClassDB::bind_method(D_METHOD("get_current_dir"),&FileDialog::get_current_dir); + ClassDB::bind_method(D_METHOD("get_current_file"),&FileDialog::get_current_file); + ClassDB::bind_method(D_METHOD("get_current_path"),&FileDialog::get_current_path); + ClassDB::bind_method(D_METHOD("set_current_dir","dir"),&FileDialog::set_current_dir); + ClassDB::bind_method(D_METHOD("set_current_file","file"),&FileDialog::set_current_file); + ClassDB::bind_method(D_METHOD("set_current_path","path"),&FileDialog::set_current_path); + ClassDB::bind_method(D_METHOD("set_mode","mode"),&FileDialog::set_mode); + ClassDB::bind_method(D_METHOD("get_mode"),&FileDialog::get_mode); + ClassDB::bind_method(D_METHOD("get_vbox:VBoxContainer"),&FileDialog::get_vbox); + ClassDB::bind_method(D_METHOD("set_access","access"),&FileDialog::set_access); + ClassDB::bind_method(D_METHOD("get_access"),&FileDialog::get_access); + ClassDB::bind_method(D_METHOD("set_show_hidden_files","show"),&FileDialog::set_show_hidden_files); + ClassDB::bind_method(D_METHOD("is_showing_hidden_files"),&FileDialog::is_showing_hidden_files); + ClassDB::bind_method(D_METHOD("_select_drive"),&FileDialog::_select_drive); + ClassDB::bind_method(D_METHOD("_make_dir"),&FileDialog::_make_dir); + ClassDB::bind_method(D_METHOD("_make_dir_confirm"),&FileDialog::_make_dir_confirm); + ClassDB::bind_method(D_METHOD("_update_file_list"),&FileDialog::update_file_list); + ClassDB::bind_method(D_METHOD("_update_dir"),&FileDialog::update_dir); + + ClassDB::bind_method(D_METHOD("invalidate"),&FileDialog::invalidate); ADD_SIGNAL(MethodInfo("file_selected",PropertyInfo( Variant::STRING,"path"))); ADD_SIGNAL(MethodInfo("files_selected",PropertyInfo( Variant::POOL_STRING_ARRAY,"paths"))); @@ -737,10 +737,10 @@ void FileDialog::_bind_methods() { BIND_CONSTANT( ACCESS_USERDATA ); BIND_CONSTANT( ACCESS_FILESYSTEM ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Open one,Open many,Open folder,Open any,Save"),_SCS("set_mode"),_SCS("get_mode") ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"),_SCS("set_access"),_SCS("get_access") ); - ADD_PROPERTY( PropertyInfo(Variant::POOL_STRING_ARRAY, "filters"),_SCS("set_filters"),_SCS("get_filters") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "show_hidden_files"),_SCS("set_show_hidden_files"),_SCS("is_showing_hidden_files") ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Open one,Open many,Open folder,Open any,Save"),"set_mode","get_mode") ; + ADD_PROPERTY( PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"),"set_access","get_access") ; + ADD_PROPERTY( PropertyInfo(Variant::POOL_STRING_ARRAY, "filters"),"set_filters","get_filters") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "show_hidden_files"),"set_show_hidden_files","is_showing_hidden_files") ; } @@ -868,11 +868,11 @@ FileDialog::~FileDialog() { void LineEditFileChooser::_bind_methods() { - ClassDB::bind_method(_MD("_browse"),&LineEditFileChooser::_browse); - ClassDB::bind_method(_MD("_chosen"),&LineEditFileChooser::_chosen); - ClassDB::bind_method(_MD("get_button:Button"),&LineEditFileChooser::get_button); - ClassDB::bind_method(_MD("get_line_edit:LineEdit"),&LineEditFileChooser::get_line_edit); - ClassDB::bind_method(_MD("get_file_dialog:FileDialog"),&LineEditFileChooser::get_file_dialog); + ClassDB::bind_method(D_METHOD("_browse"),&LineEditFileChooser::_browse); + ClassDB::bind_method(D_METHOD("_chosen"),&LineEditFileChooser::_chosen); + ClassDB::bind_method(D_METHOD("get_button:Button"),&LineEditFileChooser::get_button); + ClassDB::bind_method(D_METHOD("get_line_edit:LineEdit"),&LineEditFileChooser::get_line_edit); + ClassDB::bind_method(D_METHOD("get_file_dialog:FileDialog"),&LineEditFileChooser::get_file_dialog); } diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index ba1ab1afa8..a6954a2c77 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -1201,44 +1201,44 @@ void GraphEdit::_snap_value_changed(double) { void GraphEdit::_bind_methods() { - ClassDB::bind_method(_MD("connect_node:Error","from","from_port","to","to_port"),&GraphEdit::connect_node); - ClassDB::bind_method(_MD("is_node_connected","from","from_port","to","to_port"),&GraphEdit::is_node_connected); - ClassDB::bind_method(_MD("disconnect_node","from","from_port","to","to_port"),&GraphEdit::disconnect_node); - ClassDB::bind_method(_MD("get_connection_list"),&GraphEdit::_get_connection_list); - ClassDB::bind_method(_MD("get_scroll_ofs"),&GraphEdit::get_scroll_ofs); - ClassDB::bind_method(_MD("set_scroll_ofs","ofs"),&GraphEdit::set_scroll_ofs); + ClassDB::bind_method(D_METHOD("connect_node:Error","from","from_port","to","to_port"),&GraphEdit::connect_node); + ClassDB::bind_method(D_METHOD("is_node_connected","from","from_port","to","to_port"),&GraphEdit::is_node_connected); + ClassDB::bind_method(D_METHOD("disconnect_node","from","from_port","to","to_port"),&GraphEdit::disconnect_node); + ClassDB::bind_method(D_METHOD("get_connection_list"),&GraphEdit::_get_connection_list); + ClassDB::bind_method(D_METHOD("get_scroll_ofs"),&GraphEdit::get_scroll_ofs); + ClassDB::bind_method(D_METHOD("set_scroll_ofs","ofs"),&GraphEdit::set_scroll_ofs); - ClassDB::bind_method(_MD("set_zoom","p_zoom"),&GraphEdit::set_zoom); - ClassDB::bind_method(_MD("get_zoom"),&GraphEdit::get_zoom); + ClassDB::bind_method(D_METHOD("set_zoom","p_zoom"),&GraphEdit::set_zoom); + ClassDB::bind_method(D_METHOD("get_zoom"),&GraphEdit::get_zoom); - ClassDB::bind_method(_MD("set_snap","pixels"),&GraphEdit::set_snap); - ClassDB::bind_method(_MD("get_snap"),&GraphEdit::get_snap); + ClassDB::bind_method(D_METHOD("set_snap","pixels"),&GraphEdit::set_snap); + ClassDB::bind_method(D_METHOD("get_snap"),&GraphEdit::get_snap); - ClassDB::bind_method(_MD("set_use_snap","enable"),&GraphEdit::set_use_snap); - ClassDB::bind_method(_MD("is_using_snap"),&GraphEdit::is_using_snap); + ClassDB::bind_method(D_METHOD("set_use_snap","enable"),&GraphEdit::set_use_snap); + ClassDB::bind_method(D_METHOD("is_using_snap"),&GraphEdit::is_using_snap); - ClassDB::bind_method(_MD("set_right_disconnects","enable"),&GraphEdit::set_right_disconnects); - ClassDB::bind_method(_MD("is_right_disconnects_enabled"),&GraphEdit::is_right_disconnects_enabled); + ClassDB::bind_method(D_METHOD("set_right_disconnects","enable"),&GraphEdit::set_right_disconnects); + ClassDB::bind_method(D_METHOD("is_right_disconnects_enabled"),&GraphEdit::is_right_disconnects_enabled); - ClassDB::bind_method(_MD("_graph_node_moved"),&GraphEdit::_graph_node_moved); - ClassDB::bind_method(_MD("_graph_node_raised"),&GraphEdit::_graph_node_raised); + ClassDB::bind_method(D_METHOD("_graph_node_moved"),&GraphEdit::_graph_node_moved); + ClassDB::bind_method(D_METHOD("_graph_node_raised"),&GraphEdit::_graph_node_raised); - ClassDB::bind_method(_MD("_top_layer_input"),&GraphEdit::_top_layer_input); - ClassDB::bind_method(_MD("_top_layer_draw"),&GraphEdit::_top_layer_draw); - ClassDB::bind_method(_MD("_scroll_moved"),&GraphEdit::_scroll_moved); - ClassDB::bind_method(_MD("_zoom_minus"),&GraphEdit::_zoom_minus); - ClassDB::bind_method(_MD("_zoom_reset"),&GraphEdit::_zoom_reset); - ClassDB::bind_method(_MD("_zoom_plus"),&GraphEdit::_zoom_plus); - ClassDB::bind_method(_MD("_snap_toggled"),&GraphEdit::_snap_toggled); - ClassDB::bind_method(_MD("_snap_value_changed"),&GraphEdit::_snap_value_changed); + ClassDB::bind_method(D_METHOD("_top_layer_input"),&GraphEdit::_top_layer_input); + ClassDB::bind_method(D_METHOD("_top_layer_draw"),&GraphEdit::_top_layer_draw); + ClassDB::bind_method(D_METHOD("_scroll_moved"),&GraphEdit::_scroll_moved); + ClassDB::bind_method(D_METHOD("_zoom_minus"),&GraphEdit::_zoom_minus); + ClassDB::bind_method(D_METHOD("_zoom_reset"),&GraphEdit::_zoom_reset); + ClassDB::bind_method(D_METHOD("_zoom_plus"),&GraphEdit::_zoom_plus); + ClassDB::bind_method(D_METHOD("_snap_toggled"),&GraphEdit::_snap_toggled); + ClassDB::bind_method(D_METHOD("_snap_value_changed"),&GraphEdit::_snap_value_changed); - ClassDB::bind_method(_MD("_gui_input"),&GraphEdit::_gui_input); - ClassDB::bind_method(_MD("_update_scroll_offset"),&GraphEdit::_update_scroll_offset); - ClassDB::bind_method(_MD("_connections_layer_draw"),&GraphEdit::_connections_layer_draw); + ClassDB::bind_method(D_METHOD("_gui_input"),&GraphEdit::_gui_input); + ClassDB::bind_method(D_METHOD("_update_scroll_offset"),&GraphEdit::_update_scroll_offset); + ClassDB::bind_method(D_METHOD("_connections_layer_draw"),&GraphEdit::_connections_layer_draw); - ClassDB::bind_method(_MD("set_selected","node"),&GraphEdit::set_selected); + ClassDB::bind_method(D_METHOD("set_selected","node"),&GraphEdit::set_selected); ADD_SIGNAL(MethodInfo("connection_request",PropertyInfo(Variant::STRING,"from"),PropertyInfo(Variant::INT,"from_slot"),PropertyInfo(Variant::STRING,"to"),PropertyInfo(Variant::INT,"to_slot"))); ADD_SIGNAL(MethodInfo("disconnection_request",PropertyInfo(Variant::STRING,"from"),PropertyInfo(Variant::INT,"from_slot"),PropertyInfo(Variant::STRING,"to"),PropertyInfo(Variant::INT,"to_slot"))); diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index aa8c875f40..58d3f42483 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -712,51 +712,51 @@ bool GraphNode::is_resizeable() const{ void GraphNode::_bind_methods() { - ClassDB::bind_method(_MD("set_title","title"),&GraphNode::set_title); - ClassDB::bind_method(_MD("get_title"),&GraphNode::get_title); - ClassDB::bind_method(_MD("_gui_input"),&GraphNode::_gui_input); - - ClassDB::bind_method(_MD("set_slot","idx","enable_left","type_left","color_left","enable_right","type_right","color_right","custom_left","custom_right"),&GraphNode::set_slot,DEFVAL(Ref<Texture>()),DEFVAL(Ref<Texture>())); - ClassDB::bind_method(_MD("clear_slot","idx"),&GraphNode::clear_slot); - ClassDB::bind_method(_MD("clear_all_slots","idx"),&GraphNode::clear_all_slots); - ClassDB::bind_method(_MD("is_slot_enabled_left","idx"),&GraphNode::is_slot_enabled_left); - ClassDB::bind_method(_MD("get_slot_type_left","idx"),&GraphNode::get_slot_type_left); - ClassDB::bind_method(_MD("get_slot_color_left","idx"),&GraphNode::get_slot_color_left); - ClassDB::bind_method(_MD("is_slot_enabled_right","idx"),&GraphNode::is_slot_enabled_right); - ClassDB::bind_method(_MD("get_slot_type_right","idx"),&GraphNode::get_slot_type_right); - ClassDB::bind_method(_MD("get_slot_color_right","idx"),&GraphNode::get_slot_color_right); - - ClassDB::bind_method(_MD("set_offset","offset"),&GraphNode::set_offset); - ClassDB::bind_method(_MD("get_offset"),&GraphNode::get_offset); - - ClassDB::bind_method(_MD("set_comment","comment"),&GraphNode::set_comment); - ClassDB::bind_method(_MD("is_comment"),&GraphNode::is_comment); - - ClassDB::bind_method(_MD("set_resizeable","resizeable"),&GraphNode::set_resizeable); - ClassDB::bind_method(_MD("is_resizeable"),&GraphNode::is_resizeable); - - ClassDB::bind_method(_MD("set_selected","selected"),&GraphNode::set_selected); - ClassDB::bind_method(_MD("is_selected"),&GraphNode::is_selected); - - ClassDB::bind_method(_MD("get_connection_output_count"),&GraphNode::get_connection_output_count); - ClassDB::bind_method(_MD("get_connection_input_count"),&GraphNode::get_connection_input_count); - - ClassDB::bind_method(_MD("get_connection_output_pos","idx"),&GraphNode::get_connection_output_pos); - ClassDB::bind_method(_MD("get_connection_output_type","idx"),&GraphNode::get_connection_output_type); - ClassDB::bind_method(_MD("get_connection_output_color","idx"),&GraphNode::get_connection_output_color); - ClassDB::bind_method(_MD("get_connection_input_pos","idx"),&GraphNode::get_connection_input_pos); - ClassDB::bind_method(_MD("get_connection_input_type","idx"),&GraphNode::get_connection_input_type); - ClassDB::bind_method(_MD("get_connection_input_color","idx"),&GraphNode::get_connection_input_color); - - ClassDB::bind_method(_MD("set_show_close_button","show"),&GraphNode::set_show_close_button); - ClassDB::bind_method(_MD("is_close_button_visible"),&GraphNode::is_close_button_visible); - - ClassDB::bind_method(_MD("set_overlay","overlay"),&GraphNode::set_overlay); - ClassDB::bind_method(_MD("get_overlay"),&GraphNode::get_overlay); - - ADD_PROPERTY( PropertyInfo(Variant::STRING,"title"),_SCS("set_title"),_SCS("get_title")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"show_close"),_SCS("set_show_close_button"),_SCS("is_close_button_visible")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"resizeable"),_SCS("set_resizeable"),_SCS("is_resizeable")); + ClassDB::bind_method(D_METHOD("set_title","title"),&GraphNode::set_title); + ClassDB::bind_method(D_METHOD("get_title"),&GraphNode::get_title); + ClassDB::bind_method(D_METHOD("_gui_input"),&GraphNode::_gui_input); + + ClassDB::bind_method(D_METHOD("set_slot","idx","enable_left","type_left","color_left","enable_right","type_right","color_right","custom_left","custom_right"),&GraphNode::set_slot,DEFVAL(Ref<Texture>()),DEFVAL(Ref<Texture>())); + ClassDB::bind_method(D_METHOD("clear_slot","idx"),&GraphNode::clear_slot); + ClassDB::bind_method(D_METHOD("clear_all_slots","idx"),&GraphNode::clear_all_slots); + ClassDB::bind_method(D_METHOD("is_slot_enabled_left","idx"),&GraphNode::is_slot_enabled_left); + ClassDB::bind_method(D_METHOD("get_slot_type_left","idx"),&GraphNode::get_slot_type_left); + ClassDB::bind_method(D_METHOD("get_slot_color_left","idx"),&GraphNode::get_slot_color_left); + ClassDB::bind_method(D_METHOD("is_slot_enabled_right","idx"),&GraphNode::is_slot_enabled_right); + ClassDB::bind_method(D_METHOD("get_slot_type_right","idx"),&GraphNode::get_slot_type_right); + ClassDB::bind_method(D_METHOD("get_slot_color_right","idx"),&GraphNode::get_slot_color_right); + + ClassDB::bind_method(D_METHOD("set_offset","offset"),&GraphNode::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&GraphNode::get_offset); + + ClassDB::bind_method(D_METHOD("set_comment","comment"),&GraphNode::set_comment); + ClassDB::bind_method(D_METHOD("is_comment"),&GraphNode::is_comment); + + ClassDB::bind_method(D_METHOD("set_resizeable","resizeable"),&GraphNode::set_resizeable); + ClassDB::bind_method(D_METHOD("is_resizeable"),&GraphNode::is_resizeable); + + ClassDB::bind_method(D_METHOD("set_selected","selected"),&GraphNode::set_selected); + ClassDB::bind_method(D_METHOD("is_selected"),&GraphNode::is_selected); + + ClassDB::bind_method(D_METHOD("get_connection_output_count"),&GraphNode::get_connection_output_count); + ClassDB::bind_method(D_METHOD("get_connection_input_count"),&GraphNode::get_connection_input_count); + + ClassDB::bind_method(D_METHOD("get_connection_output_pos","idx"),&GraphNode::get_connection_output_pos); + ClassDB::bind_method(D_METHOD("get_connection_output_type","idx"),&GraphNode::get_connection_output_type); + ClassDB::bind_method(D_METHOD("get_connection_output_color","idx"),&GraphNode::get_connection_output_color); + ClassDB::bind_method(D_METHOD("get_connection_input_pos","idx"),&GraphNode::get_connection_input_pos); + ClassDB::bind_method(D_METHOD("get_connection_input_type","idx"),&GraphNode::get_connection_input_type); + ClassDB::bind_method(D_METHOD("get_connection_input_color","idx"),&GraphNode::get_connection_input_color); + + ClassDB::bind_method(D_METHOD("set_show_close_button","show"),&GraphNode::set_show_close_button); + ClassDB::bind_method(D_METHOD("is_close_button_visible"),&GraphNode::is_close_button_visible); + + ClassDB::bind_method(D_METHOD("set_overlay","overlay"),&GraphNode::set_overlay); + ClassDB::bind_method(D_METHOD("get_overlay"),&GraphNode::get_overlay); + + ADD_PROPERTY( PropertyInfo(Variant::STRING,"title"),"set_title","get_title"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"show_close"),"set_show_close_button","is_close_button_visible"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"resizeable"),"set_resizeable","is_resizeable"); ADD_SIGNAL(MethodInfo("offset_changed")); ADD_SIGNAL(MethodInfo("dragged",PropertyInfo(Variant::VECTOR2,"from"),PropertyInfo(Variant::VECTOR2,"to"))); diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index 597169ca83..ee1d642110 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -170,10 +170,10 @@ int GridContainer::get_columns() const{ void GridContainer::_bind_methods(){ - ClassDB::bind_method(_MD("set_columns","columns"),&GridContainer::set_columns); - ClassDB::bind_method(_MD("get_columns"),&GridContainer::get_columns); + ClassDB::bind_method(D_METHOD("set_columns","columns"),&GridContainer::set_columns); + ClassDB::bind_method(D_METHOD("get_columns"),&GridContainer::get_columns); - ADD_PROPERTY( PropertyInfo(Variant::INT,"columns",PROPERTY_HINT_RANGE,"1,1024,1"),_SCS("set_columns"),_SCS("get_columns")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"columns",PROPERTY_HINT_RANGE,"1,1024,1"),"set_columns","get_columns"); } Size2 GridContainer::get_minimum_size() const { diff --git a/scene/gui/input_action.cpp b/scene/gui/input_action.cpp index 77026dfdb1..afdffd9a53 100644 --- a/scene/gui/input_action.cpp +++ b/scene/gui/input_action.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* input_action.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "input_action.h" #include "os/keyboard.h" @@ -109,15 +137,15 @@ bool ShortCut::is_valid() const { void ShortCut::_bind_methods() { - ClassDB::bind_method(_MD("set_shortcut","event"),&ShortCut::set_shortcut); - ClassDB::bind_method(_MD("get_shortcut"),&ShortCut::get_shortcut); + ClassDB::bind_method(D_METHOD("set_shortcut","event"),&ShortCut::set_shortcut); + ClassDB::bind_method(D_METHOD("get_shortcut"),&ShortCut::get_shortcut); - ClassDB::bind_method(_MD("is_valid"),&ShortCut::is_valid); + ClassDB::bind_method(D_METHOD("is_valid"),&ShortCut::is_valid); - ClassDB::bind_method(_MD("is_shortcut","event"),&ShortCut::is_shortcut); - ClassDB::bind_method(_MD("get_as_text"),&ShortCut::get_as_text); + ClassDB::bind_method(D_METHOD("is_shortcut","event"),&ShortCut::is_shortcut); + ClassDB::bind_method(D_METHOD("get_as_text"),&ShortCut::get_as_text); - ADD_PROPERTY(PropertyInfo(Variant::INPUT_EVENT,"shortcut"),_SCS("set_shortcut"),_SCS("get_shortcut")); + ADD_PROPERTY(PropertyInfo(Variant::INPUT_EVENT,"shortcut"),"set_shortcut","get_shortcut"); } ShortCut::ShortCut(){ diff --git a/scene/gui/input_action.h b/scene/gui/input_action.h index a83b3a70cd..3cdbc755ef 100644 --- a/scene/gui/input_action.h +++ b/scene/gui/input_action.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* input_action.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 INPUTACTION_H #define INPUTACTION_H diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index a42ef08bf3..91bd16ee0b 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "item_list.h" #include "os/os.h" -#include "globals.h" +#include "global_config.h" void ItemList::add_item(const String& p_item,const Ref<Texture>& p_texture,bool p_selectable) { @@ -314,7 +314,7 @@ void ItemList::move_item(int p_item,int p_to_pos) { if (current<0) { //do none - } if (p_item==current) { + } else if (p_item==current) { current=p_to_pos; } else if (p_to_pos>p_item && current>p_item && current<p_to_pos) { current--; @@ -1204,6 +1204,22 @@ int ItemList::get_item_at_pos(const Point2& p_pos, bool p_exact) const { return closest; } +bool ItemList::is_pos_at_end_of_items(const Point2& p_pos) const { + + if (items.empty()) + return true; + + Vector2 pos=p_pos; + Ref<StyleBox> bg = get_stylebox("bg"); + pos-=bg->get_offset(); + pos.y+=scroll_bar->get_value(); + + Rect2 endrect = items[items.size()-1].rect_cache; + return (pos.y > endrect.pos.y + endrect.size.y); + +} + + String ItemList::get_tooltip(const Point2& p_pos) const { int closest = get_item_at_pos(p_pos); @@ -1284,83 +1300,83 @@ Vector<int> ItemList::get_selected_items() { void ItemList::_bind_methods(){ - ClassDB::bind_method(_MD("add_item","text","icon:Texture","selectable"),&ItemList::add_item,DEFVAL(Variant()),DEFVAL(true)); - ClassDB::bind_method(_MD("add_icon_item","icon:Texture","selectable"),&ItemList::add_icon_item,DEFVAL(true)); + ClassDB::bind_method(D_METHOD("add_item","text","icon:Texture","selectable"),&ItemList::add_item,DEFVAL(Variant()),DEFVAL(true)); + ClassDB::bind_method(D_METHOD("add_icon_item","icon:Texture","selectable"),&ItemList::add_icon_item,DEFVAL(true)); - ClassDB::bind_method(_MD("set_item_text","idx","text"),&ItemList::set_item_text); - ClassDB::bind_method(_MD("get_item_text","idx"),&ItemList::get_item_text); + ClassDB::bind_method(D_METHOD("set_item_text","idx","text"),&ItemList::set_item_text); + ClassDB::bind_method(D_METHOD("get_item_text","idx"),&ItemList::get_item_text); - ClassDB::bind_method(_MD("set_item_icon","idx","icon:Texture"),&ItemList::set_item_icon); - ClassDB::bind_method(_MD("get_item_icon:Texture","idx"),&ItemList::get_item_icon); + ClassDB::bind_method(D_METHOD("set_item_icon","idx","icon:Texture"),&ItemList::set_item_icon); + ClassDB::bind_method(D_METHOD("get_item_icon:Texture","idx"),&ItemList::get_item_icon); - ClassDB::bind_method(_MD("set_item_icon_region","idx","rect"),&ItemList::set_item_icon_region); - ClassDB::bind_method(_MD("get_item_icon_region","idx"),&ItemList::get_item_icon_region); + ClassDB::bind_method(D_METHOD("set_item_icon_region","idx","rect"),&ItemList::set_item_icon_region); + ClassDB::bind_method(D_METHOD("get_item_icon_region","idx"),&ItemList::get_item_icon_region); - ClassDB::bind_method(_MD("set_item_selectable","idx","selectable"),&ItemList::set_item_selectable); - ClassDB::bind_method(_MD("is_item_selectable","idx"),&ItemList::is_item_selectable); + ClassDB::bind_method(D_METHOD("set_item_selectable","idx","selectable"),&ItemList::set_item_selectable); + ClassDB::bind_method(D_METHOD("is_item_selectable","idx"),&ItemList::is_item_selectable); - ClassDB::bind_method(_MD("set_item_disabled","idx","disabled"),&ItemList::set_item_disabled); - ClassDB::bind_method(_MD("is_item_disabled","idx"),&ItemList::is_item_disabled); + ClassDB::bind_method(D_METHOD("set_item_disabled","idx","disabled"),&ItemList::set_item_disabled); + ClassDB::bind_method(D_METHOD("is_item_disabled","idx"),&ItemList::is_item_disabled); - ClassDB::bind_method(_MD("set_item_metadata","idx","metadata"),&ItemList::set_item_metadata); - ClassDB::bind_method(_MD("get_item_metadata","idx"),&ItemList::get_item_metadata); + ClassDB::bind_method(D_METHOD("set_item_metadata","idx","metadata"),&ItemList::set_item_metadata); + ClassDB::bind_method(D_METHOD("get_item_metadata","idx"),&ItemList::get_item_metadata); - ClassDB::bind_method(_MD("set_item_custom_bg_color","idx","custom_bg_color"),&ItemList::set_item_custom_bg_color); - ClassDB::bind_method(_MD("get_item_custom_bg_color","idx"),&ItemList::get_item_custom_bg_color); + ClassDB::bind_method(D_METHOD("set_item_custom_bg_color","idx","custom_bg_color"),&ItemList::set_item_custom_bg_color); + ClassDB::bind_method(D_METHOD("get_item_custom_bg_color","idx"),&ItemList::get_item_custom_bg_color); - ClassDB::bind_method(_MD("set_item_tooltip_enabled","idx","enable"),&ItemList::set_item_tooltip_enabled); - ClassDB::bind_method(_MD("is_item_tooltip_enabled","idx"),&ItemList::is_item_tooltip_enabled); + ClassDB::bind_method(D_METHOD("set_item_tooltip_enabled","idx","enable"),&ItemList::set_item_tooltip_enabled); + ClassDB::bind_method(D_METHOD("is_item_tooltip_enabled","idx"),&ItemList::is_item_tooltip_enabled); - ClassDB::bind_method(_MD("set_item_tooltip","idx","tooltip"),&ItemList::set_item_tooltip); - ClassDB::bind_method(_MD("get_item_tooltip","idx"),&ItemList::get_item_tooltip); + ClassDB::bind_method(D_METHOD("set_item_tooltip","idx","tooltip"),&ItemList::set_item_tooltip); + ClassDB::bind_method(D_METHOD("get_item_tooltip","idx"),&ItemList::get_item_tooltip); - ClassDB::bind_method(_MD("select","idx","single"),&ItemList::select,DEFVAL(true)); - ClassDB::bind_method(_MD("unselect","idx"),&ItemList::unselect); - ClassDB::bind_method(_MD("is_selected","idx"),&ItemList::is_selected); - ClassDB::bind_method(_MD("get_selected_items"),&ItemList::get_selected_items); + ClassDB::bind_method(D_METHOD("select","idx","single"),&ItemList::select,DEFVAL(true)); + ClassDB::bind_method(D_METHOD("unselect","idx"),&ItemList::unselect); + ClassDB::bind_method(D_METHOD("is_selected","idx"),&ItemList::is_selected); + ClassDB::bind_method(D_METHOD("get_selected_items"),&ItemList::get_selected_items); - ClassDB::bind_method(_MD("get_item_count"),&ItemList::get_item_count); - ClassDB::bind_method(_MD("remove_item","idx"),&ItemList::remove_item); + ClassDB::bind_method(D_METHOD("get_item_count"),&ItemList::get_item_count); + ClassDB::bind_method(D_METHOD("remove_item","idx"),&ItemList::remove_item); - ClassDB::bind_method(_MD("clear"),&ItemList::clear); - ClassDB::bind_method(_MD("sort_items_by_text"),&ItemList::sort_items_by_text); + ClassDB::bind_method(D_METHOD("clear"),&ItemList::clear); + ClassDB::bind_method(D_METHOD("sort_items_by_text"),&ItemList::sort_items_by_text); - ClassDB::bind_method(_MD("set_fixed_column_width","width"),&ItemList::set_fixed_column_width); - ClassDB::bind_method(_MD("get_fixed_column_width"),&ItemList::get_fixed_column_width); + ClassDB::bind_method(D_METHOD("set_fixed_column_width","width"),&ItemList::set_fixed_column_width); + ClassDB::bind_method(D_METHOD("get_fixed_column_width"),&ItemList::get_fixed_column_width); - ClassDB::bind_method(_MD("set_same_column_width","enable"),&ItemList::set_same_column_width); - ClassDB::bind_method(_MD("is_same_column_width"),&ItemList::is_same_column_width); + ClassDB::bind_method(D_METHOD("set_same_column_width","enable"),&ItemList::set_same_column_width); + ClassDB::bind_method(D_METHOD("is_same_column_width"),&ItemList::is_same_column_width); - ClassDB::bind_method(_MD("set_max_text_lines","lines"),&ItemList::set_max_text_lines); - ClassDB::bind_method(_MD("get_max_text_lines"),&ItemList::get_max_text_lines); + ClassDB::bind_method(D_METHOD("set_max_text_lines","lines"),&ItemList::set_max_text_lines); + ClassDB::bind_method(D_METHOD("get_max_text_lines"),&ItemList::get_max_text_lines); - ClassDB::bind_method(_MD("set_max_columns","amount"),&ItemList::set_max_columns); - ClassDB::bind_method(_MD("get_max_columns"),&ItemList::get_max_columns); + ClassDB::bind_method(D_METHOD("set_max_columns","amount"),&ItemList::set_max_columns); + ClassDB::bind_method(D_METHOD("get_max_columns"),&ItemList::get_max_columns); - ClassDB::bind_method(_MD("set_select_mode","mode"),&ItemList::set_select_mode); - ClassDB::bind_method(_MD("get_select_mode"),&ItemList::get_select_mode); + ClassDB::bind_method(D_METHOD("set_select_mode","mode"),&ItemList::set_select_mode); + ClassDB::bind_method(D_METHOD("get_select_mode"),&ItemList::get_select_mode); - ClassDB::bind_method(_MD("set_icon_mode","mode"),&ItemList::set_icon_mode); - ClassDB::bind_method(_MD("get_icon_mode"),&ItemList::get_icon_mode); + ClassDB::bind_method(D_METHOD("set_icon_mode","mode"),&ItemList::set_icon_mode); + ClassDB::bind_method(D_METHOD("get_icon_mode"),&ItemList::get_icon_mode); - ClassDB::bind_method(_MD("set_fixed_icon_size","size"),&ItemList::set_fixed_icon_size); - ClassDB::bind_method(_MD("get_fixed_icon_size"),&ItemList::get_fixed_icon_size); + ClassDB::bind_method(D_METHOD("set_fixed_icon_size","size"),&ItemList::set_fixed_icon_size); + ClassDB::bind_method(D_METHOD("get_fixed_icon_size"),&ItemList::get_fixed_icon_size); - ClassDB::bind_method(_MD("set_icon_scale","scale"),&ItemList::set_icon_scale); - ClassDB::bind_method(_MD("get_icon_scale"),&ItemList::get_icon_scale); + ClassDB::bind_method(D_METHOD("set_icon_scale","scale"),&ItemList::set_icon_scale); + ClassDB::bind_method(D_METHOD("get_icon_scale"),&ItemList::get_icon_scale); - ClassDB::bind_method(_MD("set_allow_rmb_select","allow"),&ItemList::set_allow_rmb_select); - ClassDB::bind_method(_MD("get_allow_rmb_select"),&ItemList::get_allow_rmb_select); + ClassDB::bind_method(D_METHOD("set_allow_rmb_select","allow"),&ItemList::set_allow_rmb_select); + ClassDB::bind_method(D_METHOD("get_allow_rmb_select"),&ItemList::get_allow_rmb_select); - ClassDB::bind_method(_MD("get_item_at_pos","pos","exact"),&ItemList::get_item_at_pos,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_item_at_pos","pos","exact"),&ItemList::get_item_at_pos,DEFVAL(false)); - ClassDB::bind_method(_MD("ensure_current_is_visible"),&ItemList::ensure_current_is_visible); + ClassDB::bind_method(D_METHOD("ensure_current_is_visible"),&ItemList::ensure_current_is_visible); - ClassDB::bind_method(_MD("get_v_scroll"),&ItemList::get_v_scroll); + ClassDB::bind_method(D_METHOD("get_v_scroll"),&ItemList::get_v_scroll); - ClassDB::bind_method(_MD("_scroll_changed"),&ItemList::_scroll_changed); - ClassDB::bind_method(_MD("_gui_input"),&ItemList::_gui_input); + ClassDB::bind_method(D_METHOD("_scroll_changed"),&ItemList::_scroll_changed); + ClassDB::bind_method(D_METHOD("_gui_input"),&ItemList::_gui_input); BIND_CONSTANT( ICON_MODE_TOP ); BIND_CONSTANT( ICON_MODE_LEFT ); diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h index f4a864c782..35ffb1be9c 100644 --- a/scene/gui/item_list.h +++ b/scene/gui/item_list.h @@ -191,6 +191,7 @@ public: virtual String get_tooltip(const Point2& p_pos) const; int get_item_at_pos(const Point2& p_pos,bool p_exact=false) const; + bool is_pos_at_end_of_items(const Point2& p_pos) const; void set_icon_scale(real_t p_scale); real_t get_icon_scale() const; diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index d32b4c6de4..915eaa2f45 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "label.h" #include "print_string.h" -#include "globals.h" +#include "global_config.h" #include "translation.h" @@ -648,30 +648,30 @@ int Label::get_total_character_count() const { void Label::_bind_methods() { - ClassDB::bind_method(_MD("set_align","align"),&Label::set_align); - ClassDB::bind_method(_MD("get_align"),&Label::get_align); - ClassDB::bind_method(_MD("set_valign","valign"),&Label::set_valign); - ClassDB::bind_method(_MD("get_valign"),&Label::get_valign); - ClassDB::bind_method(_MD("set_text","text"),&Label::set_text); - ClassDB::bind_method(_MD("get_text"),&Label::get_text); - ClassDB::bind_method(_MD("set_autowrap","enable"),&Label::set_autowrap); - ClassDB::bind_method(_MD("has_autowrap"),&Label::has_autowrap); - ClassDB::bind_method(_MD("set_clip_text","enable"),&Label::set_clip_text); - ClassDB::bind_method(_MD("is_clipping_text"),&Label::is_clipping_text); - ClassDB::bind_method(_MD("set_uppercase","enable"),&Label::set_uppercase); - ClassDB::bind_method(_MD("is_uppercase"),&Label::is_uppercase); - ClassDB::bind_method(_MD("get_line_height"),&Label::get_line_height); - ClassDB::bind_method(_MD("get_line_count"),&Label::get_line_count); - ClassDB::bind_method(_MD("get_visible_line_count"),&Label::get_visible_line_count); - ClassDB::bind_method(_MD("get_total_character_count"),&Label::get_total_character_count); - ClassDB::bind_method(_MD("set_visible_characters","amount"),&Label::set_visible_characters); - ClassDB::bind_method(_MD("get_visible_characters"),&Label::get_visible_characters); - ClassDB::bind_method(_MD("set_percent_visible","percent_visible"),&Label::set_percent_visible); - ClassDB::bind_method(_MD("get_percent_visible"),&Label::get_percent_visible); - ClassDB::bind_method(_MD("set_lines_skipped","lines_skipped"),&Label::set_lines_skipped); - ClassDB::bind_method(_MD("get_lines_skipped"),&Label::get_lines_skipped); - ClassDB::bind_method(_MD("set_max_lines_visible","lines_visible"),&Label::set_max_lines_visible); - ClassDB::bind_method(_MD("get_max_lines_visible"),&Label::get_max_lines_visible); + ClassDB::bind_method(D_METHOD("set_align","align"),&Label::set_align); + ClassDB::bind_method(D_METHOD("get_align"),&Label::get_align); + ClassDB::bind_method(D_METHOD("set_valign","valign"),&Label::set_valign); + ClassDB::bind_method(D_METHOD("get_valign"),&Label::get_valign); + ClassDB::bind_method(D_METHOD("set_text","text"),&Label::set_text); + ClassDB::bind_method(D_METHOD("get_text"),&Label::get_text); + ClassDB::bind_method(D_METHOD("set_autowrap","enable"),&Label::set_autowrap); + ClassDB::bind_method(D_METHOD("has_autowrap"),&Label::has_autowrap); + ClassDB::bind_method(D_METHOD("set_clip_text","enable"),&Label::set_clip_text); + ClassDB::bind_method(D_METHOD("is_clipping_text"),&Label::is_clipping_text); + ClassDB::bind_method(D_METHOD("set_uppercase","enable"),&Label::set_uppercase); + ClassDB::bind_method(D_METHOD("is_uppercase"),&Label::is_uppercase); + ClassDB::bind_method(D_METHOD("get_line_height"),&Label::get_line_height); + ClassDB::bind_method(D_METHOD("get_line_count"),&Label::get_line_count); + ClassDB::bind_method(D_METHOD("get_visible_line_count"),&Label::get_visible_line_count); + ClassDB::bind_method(D_METHOD("get_total_character_count"),&Label::get_total_character_count); + ClassDB::bind_method(D_METHOD("set_visible_characters","amount"),&Label::set_visible_characters); + ClassDB::bind_method(D_METHOD("get_visible_characters"),&Label::get_visible_characters); + ClassDB::bind_method(D_METHOD("set_percent_visible","percent_visible"),&Label::set_percent_visible); + ClassDB::bind_method(D_METHOD("get_percent_visible"),&Label::get_percent_visible); + ClassDB::bind_method(D_METHOD("set_lines_skipped","lines_skipped"),&Label::set_lines_skipped); + ClassDB::bind_method(D_METHOD("get_lines_skipped"),&Label::get_lines_skipped); + ClassDB::bind_method(D_METHOD("set_max_lines_visible","lines_visible"),&Label::set_max_lines_visible); + ClassDB::bind_method(D_METHOD("get_max_lines_visible"),&Label::get_max_lines_visible); BIND_CONSTANT( ALIGN_LEFT ); BIND_CONSTANT( ALIGN_CENTER ); @@ -683,15 +683,15 @@ void Label::_bind_methods() { BIND_CONSTANT( VALIGN_BOTTOM ); BIND_CONSTANT( VALIGN_FILL ); - ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "text",PROPERTY_HINT_MULTILINE_TEXT,"",PROPERTY_USAGE_DEFAULT_INTL), _SCS("set_text"),_SCS("get_text") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "align", PROPERTY_HINT_ENUM,"Left,Center,Right,Fill" ),_SCS("set_align"),_SCS("get_align") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "valign", PROPERTY_HINT_ENUM,"Top,Center,Bottom,Fill" ),_SCS("set_valign"),_SCS("get_valign") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "autowrap"),_SCS("set_autowrap"),_SCS("has_autowrap") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "clip_text"),_SCS("set_clip_text"),_SCS("is_clipping_text") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "uppercase"),_SCS("set_uppercase"),_SCS("is_uppercase") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "percent_visible", PROPERTY_HINT_RANGE,"0,1,0.001"),_SCS("set_percent_visible"),_SCS("get_percent_visible") ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "lines_skipped", PROPERTY_HINT_RANGE,"0,999,1"),_SCS("set_lines_skipped"),_SCS("get_lines_skipped") ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "max_lines_visible", PROPERTY_HINT_RANGE,"-1,999,1"),_SCS("set_max_lines_visible"),_SCS("get_max_lines_visible") ); + ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "text",PROPERTY_HINT_MULTILINE_TEXT,"",PROPERTY_USAGE_DEFAULT_INTL), "set_text","get_text") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "align", PROPERTY_HINT_ENUM,"Left,Center,Right,Fill" ),"set_align","get_align") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "valign", PROPERTY_HINT_ENUM,"Top,Center,Bottom,Fill" ),"set_valign","get_valign") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "autowrap"),"set_autowrap","has_autowrap") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "clip_text"),"set_clip_text","is_clipping_text") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "uppercase"),"set_uppercase","is_uppercase") ; + ADD_PROPERTY( PropertyInfo( Variant::REAL, "percent_visible", PROPERTY_HINT_RANGE,"0,1,0.001"),"set_percent_visible","get_percent_visible") ; + ADD_PROPERTY( PropertyInfo( Variant::INT, "lines_skipped", PROPERTY_HINT_RANGE,"0,999,1"),"set_lines_skipped","get_lines_skipped") ; + ADD_PROPERTY( PropertyInfo( Variant::INT, "max_lines_visible", PROPERTY_HINT_RANGE,"-1,999,1"),"set_max_lines_visible","get_max_lines_visible") ; } diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index fe242ee708..7f61cf80ec 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -33,7 +33,7 @@ #include "label.h" #include "translation.h" #ifdef TOOLS_ENABLED -#include "tools/editor/editor_settings.h" +#include "editor/editor_settings.h" #endif static bool _is_text_char(CharType c) { @@ -1256,42 +1256,42 @@ void LineEdit::_text_changed() { void LineEdit::_bind_methods() { - ClassDB::bind_method(_MD("_toggle_draw_caret"),&LineEdit::_toggle_draw_caret); + ClassDB::bind_method(D_METHOD("_toggle_draw_caret"),&LineEdit::_toggle_draw_caret); #ifdef TOOLS_ENABLED ClassDB::bind_method("_editor_settings_changed",&LineEdit::_editor_settings_changed); #endif - ClassDB::bind_method(_MD("set_align", "align"), &LineEdit::set_align); - ClassDB::bind_method(_MD("get_align"), &LineEdit::get_align); - - ClassDB::bind_method(_MD("_gui_input"),&LineEdit::_gui_input); - ClassDB::bind_method(_MD("clear"),&LineEdit::clear); - ClassDB::bind_method(_MD("select_all"),&LineEdit::select_all); - ClassDB::bind_method(_MD("set_text","text"),&LineEdit::set_text); - ClassDB::bind_method(_MD("get_text"),&LineEdit::get_text); - ClassDB::bind_method(_MD("set_placeholder","text"),&LineEdit::set_placeholder); - ClassDB::bind_method(_MD("get_placeholder"),&LineEdit::get_placeholder); - ClassDB::bind_method(_MD("set_placeholder_alpha","alpha"),&LineEdit::set_placeholder_alpha); - ClassDB::bind_method(_MD("get_placeholder_alpha"),&LineEdit::get_placeholder_alpha); - ClassDB::bind_method(_MD("set_cursor_pos","pos"),&LineEdit::set_cursor_pos); - ClassDB::bind_method(_MD("get_cursor_pos"),&LineEdit::get_cursor_pos); - ClassDB::bind_method(_MD("set_expand_to_text_length","enabled"),&LineEdit::set_expand_to_text_length); - ClassDB::bind_method(_MD("get_expand_to_text_length"),&LineEdit::get_expand_to_text_length); - ClassDB::bind_method(_MD("cursor_set_blink_enabled", "enabled"),&LineEdit::cursor_set_blink_enabled); - ClassDB::bind_method(_MD("cursor_get_blink_enabled"),&LineEdit::cursor_get_blink_enabled); - ClassDB::bind_method(_MD("cursor_set_blink_speed", "blink_speed"),&LineEdit::cursor_set_blink_speed); - ClassDB::bind_method(_MD("cursor_get_blink_speed"),&LineEdit::cursor_get_blink_speed); - ClassDB::bind_method(_MD("set_max_length","chars"),&LineEdit::set_max_length); - ClassDB::bind_method(_MD("get_max_length"),&LineEdit::get_max_length); - ClassDB::bind_method(_MD("append_at_cursor","text"),&LineEdit::append_at_cursor); - ClassDB::bind_method(_MD("set_editable","enabled"),&LineEdit::set_editable); - ClassDB::bind_method(_MD("is_editable"),&LineEdit::is_editable); - ClassDB::bind_method(_MD("set_secret","enabled"),&LineEdit::set_secret); - ClassDB::bind_method(_MD("is_secret"),&LineEdit::is_secret); - ClassDB::bind_method(_MD("select","from","to"),&LineEdit::select,DEFVAL(0),DEFVAL(-1)); - ClassDB::bind_method(_MD("menu_option","option"),&LineEdit::menu_option); - ClassDB::bind_method(_MD("get_menu:PopupMenu"),&LineEdit::get_menu); + ClassDB::bind_method(D_METHOD("set_align", "align"), &LineEdit::set_align); + ClassDB::bind_method(D_METHOD("get_align"), &LineEdit::get_align); + + ClassDB::bind_method(D_METHOD("_gui_input"),&LineEdit::_gui_input); + ClassDB::bind_method(D_METHOD("clear"),&LineEdit::clear); + ClassDB::bind_method(D_METHOD("select_all"),&LineEdit::select_all); + ClassDB::bind_method(D_METHOD("set_text","text"),&LineEdit::set_text); + ClassDB::bind_method(D_METHOD("get_text"),&LineEdit::get_text); + ClassDB::bind_method(D_METHOD("set_placeholder","text"),&LineEdit::set_placeholder); + ClassDB::bind_method(D_METHOD("get_placeholder"),&LineEdit::get_placeholder); + ClassDB::bind_method(D_METHOD("set_placeholder_alpha","alpha"),&LineEdit::set_placeholder_alpha); + ClassDB::bind_method(D_METHOD("get_placeholder_alpha"),&LineEdit::get_placeholder_alpha); + ClassDB::bind_method(D_METHOD("set_cursor_pos","pos"),&LineEdit::set_cursor_pos); + ClassDB::bind_method(D_METHOD("get_cursor_pos"),&LineEdit::get_cursor_pos); + ClassDB::bind_method(D_METHOD("set_expand_to_text_length","enabled"),&LineEdit::set_expand_to_text_length); + ClassDB::bind_method(D_METHOD("get_expand_to_text_length"),&LineEdit::get_expand_to_text_length); + ClassDB::bind_method(D_METHOD("cursor_set_blink_enabled", "enabled"),&LineEdit::cursor_set_blink_enabled); + ClassDB::bind_method(D_METHOD("cursor_get_blink_enabled"),&LineEdit::cursor_get_blink_enabled); + ClassDB::bind_method(D_METHOD("cursor_set_blink_speed", "blink_speed"),&LineEdit::cursor_set_blink_speed); + ClassDB::bind_method(D_METHOD("cursor_get_blink_speed"),&LineEdit::cursor_get_blink_speed); + ClassDB::bind_method(D_METHOD("set_max_length","chars"),&LineEdit::set_max_length); + ClassDB::bind_method(D_METHOD("get_max_length"),&LineEdit::get_max_length); + ClassDB::bind_method(D_METHOD("append_at_cursor","text"),&LineEdit::append_at_cursor); + ClassDB::bind_method(D_METHOD("set_editable","enabled"),&LineEdit::set_editable); + ClassDB::bind_method(D_METHOD("is_editable"),&LineEdit::is_editable); + ClassDB::bind_method(D_METHOD("set_secret","enabled"),&LineEdit::set_secret); + ClassDB::bind_method(D_METHOD("is_secret"),&LineEdit::is_secret); + ClassDB::bind_method(D_METHOD("select","from","to"),&LineEdit::select,DEFVAL(0),DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("menu_option","option"),&LineEdit::menu_option); + ClassDB::bind_method(D_METHOD("get_menu:PopupMenu"),&LineEdit::get_menu); ADD_SIGNAL( MethodInfo("text_changed", PropertyInfo( Variant::STRING, "text" )) ); ADD_SIGNAL( MethodInfo("text_entered", PropertyInfo( Variant::STRING, "text" )) ); @@ -1309,19 +1309,19 @@ void LineEdit::_bind_methods() { BIND_CONSTANT( MENU_UNDO ); BIND_CONSTANT( MENU_MAX ); - ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "text" ), _SCS("set_text"),_SCS("get_text") ); - ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "align", PROPERTY_HINT_ENUM, "Left,Center,Right,Fill"), _SCS("set_align"), _SCS("get_align")); - ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "max_length" ), _SCS("set_max_length"),_SCS("get_max_length") ); - ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "editable" ), _SCS("set_editable"),_SCS("is_editable") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "secret" ), _SCS("set_secret"),_SCS("is_secret") ); - ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "expand_to_len" ), _SCS("set_expand_to_text_length"),_SCS("get_expand_to_text_length") ); - ADD_PROPERTY( PropertyInfo( Variant::INT,"focus_mode", PROPERTY_HINT_ENUM, "None,Click,All" ), _SCS("set_focus_mode"), _SCS("get_focus_mode") ); + ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "text" ), "set_text","get_text") ; + ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "align", PROPERTY_HINT_ENUM, "Left,Center,Right,Fill"), "set_align", "get_align"); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "max_length" ), "set_max_length","get_max_length") ; + ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "editable" ), "set_editable","is_editable") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "secret" ), "set_secret","is_secret") ; + ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "expand_to_len" ), "set_expand_to_text_length","get_expand_to_text_length") ; + ADD_PROPERTY( PropertyInfo( Variant::INT,"focus_mode", PROPERTY_HINT_ENUM, "None,Click,All" ), "set_focus_mode", "get_focus_mode") ; ADD_GROUP("Placeholder","placeholder_"); - ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "placeholder_text" ), _SCS("set_placeholder"),_SCS("get_placeholder") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::REAL, "placeholder_alpha",PROPERTY_HINT_RANGE,"0,1,0.001" ), _SCS("set_placeholder_alpha"),_SCS("get_placeholder_alpha") ); + ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "placeholder_text" ), "set_placeholder","get_placeholder") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::REAL, "placeholder_alpha",PROPERTY_HINT_RANGE,"0,1,0.001" ), "set_placeholder_alpha","get_placeholder_alpha") ; ADD_GROUP("Caret","caret_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled")); - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_blink"), "cursor_set_blink_enabled", "cursor_get_blink_enabled"); + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), "cursor_set_blink_speed","cursor_get_blink_speed") ; } LineEdit::LineEdit() { diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp index 5b791064a8..7ea88f35f3 100644 --- a/scene/gui/link_button.cpp +++ b/scene/gui/link_button.cpp @@ -130,19 +130,19 @@ void LinkButton::_notification(int p_what) { void LinkButton::_bind_methods() { - ClassDB::bind_method(_MD("set_text","text"),&LinkButton::set_text); - ClassDB::bind_method(_MD("get_text"),&LinkButton::get_text); + ClassDB::bind_method(D_METHOD("set_text","text"),&LinkButton::set_text); + ClassDB::bind_method(D_METHOD("get_text"),&LinkButton::get_text); - ClassDB::bind_method(_MD("set_underline_mode","underline_mode"),&LinkButton::set_underline_mode); - ClassDB::bind_method(_MD("get_underline_mode"),&LinkButton::get_underline_mode); + ClassDB::bind_method(D_METHOD("set_underline_mode","underline_mode"),&LinkButton::set_underline_mode); + ClassDB::bind_method(D_METHOD("get_underline_mode"),&LinkButton::get_underline_mode); BIND_CONSTANT( UNDERLINE_MODE_ALWAYS ); BIND_CONSTANT( UNDERLINE_MODE_ON_HOVER ); BIND_CONSTANT( UNDERLINE_MODE_NEVER ); - ADD_PROPERTYNZ(PropertyInfo(Variant::STRING,"text"), _SCS("set_text"), _SCS("get_text")); - ADD_PROPERTYNZ(PropertyInfo(Variant::INT,"underline",PROPERTY_HINT_ENUM,"Always,On Hover,Never"), _SCS("set_underline_mode"), _SCS("get_underline_mode")); + ADD_PROPERTYNZ(PropertyInfo(Variant::STRING,"text"), "set_text", "get_text"); + ADD_PROPERTYNZ(PropertyInfo(Variant::INT,"underline",PROPERTY_HINT_ENUM,"Always,On Hover,Never"), "set_underline_mode", "get_underline_mode"); } diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index 4a366c55c6..f15b864b95 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -98,12 +98,12 @@ void MenuButton::_set_items(const Array& p_items) { void MenuButton::_bind_methods() { - ClassDB::bind_method(_MD("get_popup:PopupMenu"),&MenuButton::get_popup); - ClassDB::bind_method(_MD("_unhandled_key_input"),&MenuButton::_unhandled_key_input); - ClassDB::bind_method(_MD("_set_items"),&MenuButton::_set_items); - ClassDB::bind_method(_MD("_get_items"),&MenuButton::_get_items); + ClassDB::bind_method(D_METHOD("get_popup:PopupMenu"),&MenuButton::get_popup); + ClassDB::bind_method(D_METHOD("_unhandled_key_input"),&MenuButton::_unhandled_key_input); + ClassDB::bind_method(D_METHOD("_set_items"),&MenuButton::_set_items); + ClassDB::bind_method(D_METHOD("_get_items"),&MenuButton::_get_items); - ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_items"),_SCS("_get_items") ); + ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_items","_get_items") ; ADD_SIGNAL( MethodInfo("about_to_show") ); } diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 1b5b21ae92..9ead79b491 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -287,35 +287,35 @@ void OptionButton::get_translatable_strings(List<String> *p_strings) const { void OptionButton::_bind_methods() { - ClassDB::bind_method(_MD("_selected"),&OptionButton::_selected); - - ClassDB::bind_method(_MD("add_item","label","id"),&OptionButton::add_item,DEFVAL(-1)); - ClassDB::bind_method(_MD("add_icon_item","texture:Texture","label","id"),&OptionButton::add_icon_item); - ClassDB::bind_method(_MD("set_item_text","idx","text"),&OptionButton::set_item_text); - ClassDB::bind_method(_MD("set_item_icon","idx","texture:Texture"),&OptionButton::set_item_icon); - ClassDB::bind_method(_MD("set_item_disabled","idx","disabled"),&OptionButton::set_item_disabled); - ClassDB::bind_method(_MD("set_item_ID","idx","id"),&OptionButton::set_item_ID); - ClassDB::bind_method(_MD("set_item_metadata","idx","metadata"),&OptionButton::set_item_metadata); - ClassDB::bind_method(_MD("get_item_text","idx"),&OptionButton::get_item_text); - ClassDB::bind_method(_MD("get_item_icon:Texture","idx"),&OptionButton::get_item_icon); - ClassDB::bind_method(_MD("get_item_ID","idx"),&OptionButton::get_item_ID); - ClassDB::bind_method(_MD("get_item_metadata","idx"),&OptionButton::get_item_metadata); - ClassDB::bind_method(_MD("is_item_disabled","idx"),&OptionButton::is_item_disabled); - ClassDB::bind_method(_MD("get_item_count"),&OptionButton::get_item_count); - ClassDB::bind_method(_MD("add_separator"),&OptionButton::add_separator); - ClassDB::bind_method(_MD("clear"),&OptionButton::clear); - ClassDB::bind_method(_MD("select","idx"),&OptionButton::select); - ClassDB::bind_method(_MD("get_selected"),&OptionButton::get_selected); - ClassDB::bind_method(_MD("get_selected_ID"),&OptionButton::get_selected_ID); - ClassDB::bind_method(_MD("get_selected_metadata"),&OptionButton::get_selected_metadata); - ClassDB::bind_method(_MD("remove_item","idx"),&OptionButton::remove_item); - ClassDB::bind_method(_MD("_select_int"),&OptionButton::_select_int); - - ClassDB::bind_method(_MD("_set_items"),&OptionButton::_set_items); - ClassDB::bind_method(_MD("_get_items"),&OptionButton::_get_items); - - ADD_PROPERTY( PropertyInfo(Variant::INT,"selected"), _SCS("_select_int"),_SCS("get_selected") ); - ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_items"),_SCS("_get_items") ); + ClassDB::bind_method(D_METHOD("_selected"),&OptionButton::_selected); + + ClassDB::bind_method(D_METHOD("add_item","label","id"),&OptionButton::add_item,DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("add_icon_item","texture:Texture","label","id"),&OptionButton::add_icon_item); + ClassDB::bind_method(D_METHOD("set_item_text","idx","text"),&OptionButton::set_item_text); + ClassDB::bind_method(D_METHOD("set_item_icon","idx","texture:Texture"),&OptionButton::set_item_icon); + ClassDB::bind_method(D_METHOD("set_item_disabled","idx","disabled"),&OptionButton::set_item_disabled); + ClassDB::bind_method(D_METHOD("set_item_ID","idx","id"),&OptionButton::set_item_ID); + ClassDB::bind_method(D_METHOD("set_item_metadata","idx","metadata"),&OptionButton::set_item_metadata); + ClassDB::bind_method(D_METHOD("get_item_text","idx"),&OptionButton::get_item_text); + ClassDB::bind_method(D_METHOD("get_item_icon:Texture","idx"),&OptionButton::get_item_icon); + ClassDB::bind_method(D_METHOD("get_item_ID","idx"),&OptionButton::get_item_ID); + ClassDB::bind_method(D_METHOD("get_item_metadata","idx"),&OptionButton::get_item_metadata); + ClassDB::bind_method(D_METHOD("is_item_disabled","idx"),&OptionButton::is_item_disabled); + ClassDB::bind_method(D_METHOD("get_item_count"),&OptionButton::get_item_count); + ClassDB::bind_method(D_METHOD("add_separator"),&OptionButton::add_separator); + ClassDB::bind_method(D_METHOD("clear"),&OptionButton::clear); + ClassDB::bind_method(D_METHOD("select","idx"),&OptionButton::select); + ClassDB::bind_method(D_METHOD("get_selected"),&OptionButton::get_selected); + ClassDB::bind_method(D_METHOD("get_selected_ID"),&OptionButton::get_selected_ID); + ClassDB::bind_method(D_METHOD("get_selected_metadata"),&OptionButton::get_selected_metadata); + ClassDB::bind_method(D_METHOD("remove_item","idx"),&OptionButton::remove_item); + ClassDB::bind_method(D_METHOD("_select_int"),&OptionButton::_select_int); + + ClassDB::bind_method(D_METHOD("_set_items"),&OptionButton::_set_items); + ClassDB::bind_method(D_METHOD("_get_items"),&OptionButton::_get_items); + + ADD_PROPERTY( PropertyInfo(Variant::INT,"selected"), "_select_int","get_selected") ; + ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_items","_get_items") ; ADD_SIGNAL( MethodInfo("item_selected", PropertyInfo( Variant::INT,"ID") ) ); } diff --git a/scene/gui/patch_9_rect.cpp b/scene/gui/patch_9_rect.cpp index 4e1856778e..6fb35f72e5 100644 --- a/scene/gui/patch_9_rect.cpp +++ b/scene/gui/patch_9_rect.cpp @@ -68,26 +68,26 @@ Size2 NinePatchRect::get_minimum_size() const { void NinePatchRect::_bind_methods() { - ClassDB::bind_method(_MD("set_texture","texture"), & NinePatchRect::set_texture ); - ClassDB::bind_method(_MD("get_texture"), & NinePatchRect::get_texture ); - ClassDB::bind_method(_MD("set_patch_margin","margin","value"), & NinePatchRect::set_patch_margin ); - ClassDB::bind_method(_MD("get_patch_margin","margin"), & NinePatchRect::get_patch_margin ); - ClassDB::bind_method(_MD("set_region_rect","rect"),&NinePatchRect::set_region_rect); - ClassDB::bind_method(_MD("get_region_rect"),&NinePatchRect::get_region_rect); - ClassDB::bind_method(_MD("set_draw_center","draw_center"), & NinePatchRect::set_draw_center ); - ClassDB::bind_method(_MD("get_draw_center"), & NinePatchRect::get_draw_center ); + ClassDB::bind_method(D_METHOD("set_texture","texture"), & NinePatchRect::set_texture ); + ClassDB::bind_method(D_METHOD("get_texture"), & NinePatchRect::get_texture ); + ClassDB::bind_method(D_METHOD("set_patch_margin","margin","value"), & NinePatchRect::set_patch_margin ); + ClassDB::bind_method(D_METHOD("get_patch_margin","margin"), & NinePatchRect::get_patch_margin ); + ClassDB::bind_method(D_METHOD("set_region_rect","rect"),&NinePatchRect::set_region_rect); + ClassDB::bind_method(D_METHOD("get_region_rect"),&NinePatchRect::get_region_rect); + ClassDB::bind_method(D_METHOD("set_draw_center","draw_center"), & NinePatchRect::set_draw_center ); + ClassDB::bind_method(D_METHOD("get_draw_center"), & NinePatchRect::get_draw_center ); ADD_SIGNAL(MethodInfo("texture_changed")); - ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), _SCS("set_texture"),_SCS("get_texture") ); - ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "draw_center"), _SCS("set_draw_center"),_SCS("get_draw_center") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect")); + ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture","get_texture") ; + ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "draw_center"), "set_draw_center","get_draw_center") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), "set_region_rect","get_region_rect"); ADD_GROUP("Patch Margin","patch_margin_"); - ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_left",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_LEFT ); - ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_top",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_TOP ); - ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_right",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_RIGHT ); - ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_bottom",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_BOTTOM ); + ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_left",PROPERTY_HINT_RANGE,"0,16384,1"), "set_patch_margin","get_patch_margin",MARGIN_LEFT ); + ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_top",PROPERTY_HINT_RANGE,"0,16384,1"), "set_patch_margin","get_patch_margin",MARGIN_TOP ); + ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_right",PROPERTY_HINT_RANGE,"0,16384,1"), "set_patch_margin","get_patch_margin",MARGIN_RIGHT ); + ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_bottom",PROPERTY_HINT_RANGE,"0,16384,1"), "set_patch_margin","get_patch_margin",MARGIN_BOTTOM ); } diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 3f0f76f184..1f0daa99ba 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -226,12 +226,16 @@ void Popup::popup_centered_ratio(float p_screen_ratio) { } -void Popup::popup() { +void Popup::popup(const Rect2& bounds) { emit_signal("about_to_show"); show_modal(exclusive); - + // Fit the popup into the optionally provided bounds. + if (!bounds.has_no_area()) { + set_pos(bounds.pos); + set_size(bounds.size); + } _fix_size(); Control *focusable = find_next_valid_focus(); @@ -257,16 +261,16 @@ bool Popup::is_exclusive() const { void Popup::_bind_methods() { - ClassDB::bind_method(_MD("popup_centered","size"),&Popup::popup_centered,DEFVAL(Size2())); - ClassDB::bind_method(_MD("popup_centered_ratio","ratio"),&Popup::popup_centered_ratio,DEFVAL(0.75)); - ClassDB::bind_method(_MD("popup_centered_minsize","minsize"),&Popup::popup_centered_minsize,DEFVAL(Size2())); - ClassDB::bind_method(_MD("popup"),&Popup::popup); - ClassDB::bind_method(_MD("set_exclusive","enable"),&Popup::set_exclusive); - ClassDB::bind_method(_MD("is_exclusive"),&Popup::is_exclusive); + ClassDB::bind_method(D_METHOD("popup_centered","size"),&Popup::popup_centered,DEFVAL(Size2())); + ClassDB::bind_method(D_METHOD("popup_centered_ratio","ratio"),&Popup::popup_centered_ratio,DEFVAL(0.75)); + ClassDB::bind_method(D_METHOD("popup_centered_minsize","minsize"),&Popup::popup_centered_minsize,DEFVAL(Size2())); + ClassDB::bind_method(D_METHOD("popup","bounds"),&Popup::popup,DEFVAL(Rect2())); + ClassDB::bind_method(D_METHOD("set_exclusive","enable"),&Popup::set_exclusive); + ClassDB::bind_method(D_METHOD("is_exclusive"),&Popup::is_exclusive); ADD_SIGNAL( MethodInfo("about_to_show") ); ADD_SIGNAL( MethodInfo("popup_hide") ); ADD_GROUP("Popup","popup_"); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "popup_exclusive"), _SCS("set_exclusive"),_SCS("is_exclusive") ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "popup_exclusive"), "set_exclusive","is_exclusive") ; BIND_CONSTANT(NOTIFICATION_POST_POPUP); BIND_CONSTANT(NOTIFICATION_POPUP_HIDE); diff --git a/scene/gui/popup.h b/scene/gui/popup.h index 17ae4a938a..4e4c8b0292 100644 --- a/scene/gui/popup.h +++ b/scene/gui/popup.h @@ -47,7 +47,7 @@ protected: void _gui_input(InputEvent p_event); void _notification(int p_what); - void _fix_size(); + virtual void _fix_size(); static void _bind_methods(); public: @@ -63,7 +63,7 @@ public: void popup_centered(const Size2& p_size=Size2()); void popup_centered_minsize(const Size2& p_minsize=Size2()); void set_as_minsize(); - virtual void popup(); + virtual void popup(const Rect2& p_bounds=Rect2()); virtual String get_configuration_warning() const; diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 65e7c3ab39..884cf0312a 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -1114,64 +1114,64 @@ void PopupMenu::clear_autohide_areas(){ void PopupMenu::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&PopupMenu::_gui_input); - ClassDB::bind_method(_MD("add_icon_item","texture","label","id","accel"),&PopupMenu::add_icon_item,DEFVAL(-1),DEFVAL(0)); - ClassDB::bind_method(_MD("add_item","label","id","accel"),&PopupMenu::add_item,DEFVAL(-1),DEFVAL(0)); - ClassDB::bind_method(_MD("add_icon_check_item","texture","label","id","accel"),&PopupMenu::add_icon_check_item,DEFVAL(-1),DEFVAL(0)); - ClassDB::bind_method(_MD("add_check_item","label","id","accel"),&PopupMenu::add_check_item,DEFVAL(-1),DEFVAL(0)); - ClassDB::bind_method(_MD("add_submenu_item","label","submenu","id"),&PopupMenu::add_submenu_item,DEFVAL(-1)); - - ClassDB::bind_method(_MD("add_icon_shortcut","texture","shortcut:ShortCut","id","global"),&PopupMenu::add_icon_shortcut,DEFVAL(-1),DEFVAL(false)); - ClassDB::bind_method(_MD("add_shortcut","shortcut:ShortCut","id","global"),&PopupMenu::add_shortcut,DEFVAL(-1),DEFVAL(false)); - ClassDB::bind_method(_MD("add_icon_check_shortcut","texture","shortcut:ShortCut","id","global"),&PopupMenu::add_icon_check_shortcut,DEFVAL(-1),DEFVAL(false)); - ClassDB::bind_method(_MD("add_check_shortcut","shortcut:ShortCut","id","global"),&PopupMenu::add_check_shortcut,DEFVAL(-1),DEFVAL(false)); - - ClassDB::bind_method(_MD("set_item_text","idx","text"),&PopupMenu::set_item_text); - ClassDB::bind_method(_MD("set_item_icon","idx","icon"),&PopupMenu::set_item_icon); - ClassDB::bind_method(_MD("set_item_checked","idx","checked"),&PopupMenu::set_item_checked); - ClassDB::bind_method(_MD("set_item_ID","idx","id"),&PopupMenu::set_item_ID); - ClassDB::bind_method(_MD("set_item_accelerator","idx","accel"),&PopupMenu::set_item_accelerator); - ClassDB::bind_method(_MD("set_item_metadata","idx","metadata"),&PopupMenu::set_item_metadata); - ClassDB::bind_method(_MD("set_item_disabled","idx","disabled"),&PopupMenu::set_item_disabled); - ClassDB::bind_method(_MD("set_item_submenu","idx","submenu"),&PopupMenu::set_item_submenu); - ClassDB::bind_method(_MD("set_item_as_separator","idx","enable"),&PopupMenu::set_item_as_separator); - ClassDB::bind_method(_MD("set_item_as_checkable","idx","enable"),&PopupMenu::set_item_as_checkable); - ClassDB::bind_method(_MD("set_item_tooltip","idx","tooltip"),&PopupMenu::set_item_tooltip); - ClassDB::bind_method(_MD("set_item_shortcut","idx","shortcut:ShortCut","global"),&PopupMenu::set_item_shortcut,DEFVAL(false)); - - ClassDB::bind_method(_MD("toggle_item_checked","idx"), &PopupMenu::toggle_item_checked); - - ClassDB::bind_method(_MD("get_item_text","idx"),&PopupMenu::get_item_text); - ClassDB::bind_method(_MD("get_item_icon","idx"),&PopupMenu::get_item_icon); - ClassDB::bind_method(_MD("is_item_checked","idx"),&PopupMenu::is_item_checked); - ClassDB::bind_method(_MD("get_item_ID","idx"),&PopupMenu::get_item_ID); - ClassDB::bind_method(_MD("get_item_index","id"),&PopupMenu::get_item_index); - ClassDB::bind_method(_MD("get_item_accelerator","idx"),&PopupMenu::get_item_accelerator); - ClassDB::bind_method(_MD("get_item_metadata","idx"),&PopupMenu::get_item_metadata); - ClassDB::bind_method(_MD("is_item_disabled","idx"),&PopupMenu::is_item_disabled); - ClassDB::bind_method(_MD("get_item_submenu","idx"),&PopupMenu::get_item_submenu); - ClassDB::bind_method(_MD("is_item_separator","idx"),&PopupMenu::is_item_separator); - ClassDB::bind_method(_MD("is_item_checkable","idx"),&PopupMenu::is_item_checkable); - ClassDB::bind_method(_MD("get_item_tooltip","idx"),&PopupMenu::get_item_tooltip); - ClassDB::bind_method(_MD("get_item_shortcut:ShortCut","idx"),&PopupMenu::get_item_shortcut); - - ClassDB::bind_method(_MD("get_item_count"),&PopupMenu::get_item_count); - - ClassDB::bind_method(_MD("remove_item","idx"),&PopupMenu::remove_item); - - ClassDB::bind_method(_MD("add_separator"),&PopupMenu::add_separator); - ClassDB::bind_method(_MD("clear"),&PopupMenu::clear); - - ClassDB::bind_method(_MD("_set_items"),&PopupMenu::_set_items); - ClassDB::bind_method(_MD("_get_items"),&PopupMenu::_get_items); - - ClassDB::bind_method(_MD("set_hide_on_item_selection","enable"),&PopupMenu::set_hide_on_item_selection); - ClassDB::bind_method(_MD("is_hide_on_item_selection"),&PopupMenu::is_hide_on_item_selection); - - ClassDB::bind_method(_MD("_submenu_timeout"),&PopupMenu::_submenu_timeout); - - ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_items"),_SCS("_get_items") ); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL, "hide_on_item_selection" ), _SCS("set_hide_on_item_selection"), _SCS("is_hide_on_item_selection") ); + ClassDB::bind_method(D_METHOD("_gui_input"),&PopupMenu::_gui_input); + ClassDB::bind_method(D_METHOD("add_icon_item","texture","label","id","accel"),&PopupMenu::add_icon_item,DEFVAL(-1),DEFVAL(0)); + ClassDB::bind_method(D_METHOD("add_item","label","id","accel"),&PopupMenu::add_item,DEFVAL(-1),DEFVAL(0)); + ClassDB::bind_method(D_METHOD("add_icon_check_item","texture","label","id","accel"),&PopupMenu::add_icon_check_item,DEFVAL(-1),DEFVAL(0)); + ClassDB::bind_method(D_METHOD("add_check_item","label","id","accel"),&PopupMenu::add_check_item,DEFVAL(-1),DEFVAL(0)); + ClassDB::bind_method(D_METHOD("add_submenu_item","label","submenu","id"),&PopupMenu::add_submenu_item,DEFVAL(-1)); + + ClassDB::bind_method(D_METHOD("add_icon_shortcut","texture","shortcut:ShortCut","id","global"),&PopupMenu::add_icon_shortcut,DEFVAL(-1),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("add_shortcut","shortcut:ShortCut","id","global"),&PopupMenu::add_shortcut,DEFVAL(-1),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("add_icon_check_shortcut","texture","shortcut:ShortCut","id","global"),&PopupMenu::add_icon_check_shortcut,DEFVAL(-1),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("add_check_shortcut","shortcut:ShortCut","id","global"),&PopupMenu::add_check_shortcut,DEFVAL(-1),DEFVAL(false)); + + ClassDB::bind_method(D_METHOD("set_item_text","idx","text"),&PopupMenu::set_item_text); + ClassDB::bind_method(D_METHOD("set_item_icon","idx","icon"),&PopupMenu::set_item_icon); + ClassDB::bind_method(D_METHOD("set_item_checked","idx","checked"),&PopupMenu::set_item_checked); + ClassDB::bind_method(D_METHOD("set_item_ID","idx","id"),&PopupMenu::set_item_ID); + ClassDB::bind_method(D_METHOD("set_item_accelerator","idx","accel"),&PopupMenu::set_item_accelerator); + ClassDB::bind_method(D_METHOD("set_item_metadata","idx","metadata"),&PopupMenu::set_item_metadata); + ClassDB::bind_method(D_METHOD("set_item_disabled","idx","disabled"),&PopupMenu::set_item_disabled); + ClassDB::bind_method(D_METHOD("set_item_submenu","idx","submenu"),&PopupMenu::set_item_submenu); + ClassDB::bind_method(D_METHOD("set_item_as_separator","idx","enable"),&PopupMenu::set_item_as_separator); + ClassDB::bind_method(D_METHOD("set_item_as_checkable","idx","enable"),&PopupMenu::set_item_as_checkable); + ClassDB::bind_method(D_METHOD("set_item_tooltip","idx","tooltip"),&PopupMenu::set_item_tooltip); + ClassDB::bind_method(D_METHOD("set_item_shortcut","idx","shortcut:ShortCut","global"),&PopupMenu::set_item_shortcut,DEFVAL(false)); + + ClassDB::bind_method(D_METHOD("toggle_item_checked","idx"), &PopupMenu::toggle_item_checked); + + ClassDB::bind_method(D_METHOD("get_item_text","idx"),&PopupMenu::get_item_text); + ClassDB::bind_method(D_METHOD("get_item_icon","idx"),&PopupMenu::get_item_icon); + ClassDB::bind_method(D_METHOD("is_item_checked","idx"),&PopupMenu::is_item_checked); + ClassDB::bind_method(D_METHOD("get_item_ID","idx"),&PopupMenu::get_item_ID); + ClassDB::bind_method(D_METHOD("get_item_index","id"),&PopupMenu::get_item_index); + ClassDB::bind_method(D_METHOD("get_item_accelerator","idx"),&PopupMenu::get_item_accelerator); + ClassDB::bind_method(D_METHOD("get_item_metadata","idx"),&PopupMenu::get_item_metadata); + ClassDB::bind_method(D_METHOD("is_item_disabled","idx"),&PopupMenu::is_item_disabled); + ClassDB::bind_method(D_METHOD("get_item_submenu","idx"),&PopupMenu::get_item_submenu); + ClassDB::bind_method(D_METHOD("is_item_separator","idx"),&PopupMenu::is_item_separator); + ClassDB::bind_method(D_METHOD("is_item_checkable","idx"),&PopupMenu::is_item_checkable); + ClassDB::bind_method(D_METHOD("get_item_tooltip","idx"),&PopupMenu::get_item_tooltip); + ClassDB::bind_method(D_METHOD("get_item_shortcut:ShortCut","idx"),&PopupMenu::get_item_shortcut); + + ClassDB::bind_method(D_METHOD("get_item_count"),&PopupMenu::get_item_count); + + ClassDB::bind_method(D_METHOD("remove_item","idx"),&PopupMenu::remove_item); + + ClassDB::bind_method(D_METHOD("add_separator"),&PopupMenu::add_separator); + ClassDB::bind_method(D_METHOD("clear"),&PopupMenu::clear); + + ClassDB::bind_method(D_METHOD("_set_items"),&PopupMenu::_set_items); + ClassDB::bind_method(D_METHOD("_get_items"),&PopupMenu::_get_items); + + ClassDB::bind_method(D_METHOD("set_hide_on_item_selection","enable"),&PopupMenu::set_hide_on_item_selection); + ClassDB::bind_method(D_METHOD("is_hide_on_item_selection"),&PopupMenu::is_hide_on_item_selection); + + ClassDB::bind_method(D_METHOD("_submenu_timeout"),&PopupMenu::_submenu_timeout); + + ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_items","_get_items") ; + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL, "hide_on_item_selection" ), "set_hide_on_item_selection", "is_hide_on_item_selection") ; ADD_SIGNAL( MethodInfo("id_pressed", PropertyInfo( Variant::INT,"ID") ) ); ADD_SIGNAL( MethodInfo("index_pressed", PropertyInfo( Variant::INT,"index") ) ); diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index 0f99d4f19e..61776d3ae6 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -82,10 +82,10 @@ bool ProgressBar::is_percent_visible() const{ void ProgressBar::_bind_methods() { - ClassDB::bind_method(_MD("set_percent_visible","visible"),&ProgressBar::set_percent_visible); - ClassDB::bind_method(_MD("is_percent_visible"),&ProgressBar::is_percent_visible); + ClassDB::bind_method(D_METHOD("set_percent_visible","visible"),&ProgressBar::set_percent_visible); + ClassDB::bind_method(D_METHOD("is_percent_visible"),&ProgressBar::is_percent_visible); ADD_GROUP("Percent","percent_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"percent_visible"),_SCS("set_percent_visible"),_SCS("is_percent_visible")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"percent_visible"),"set_percent_visible","is_percent_visible"); } ProgressBar::ProgressBar() { diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index 5ecafccaca..f434aff08d 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -222,36 +222,36 @@ void Range::_unref_shared() { void Range::_bind_methods() { - ClassDB::bind_method(_MD("get_value"),&Range::get_value); - ClassDB::bind_method(_MD("get_min"),&Range::get_min); - ClassDB::bind_method(_MD("get_max"),&Range::get_max); - ClassDB::bind_method(_MD("get_step"),&Range::get_step); - ClassDB::bind_method(_MD("get_page"),&Range::get_page); - ClassDB::bind_method(_MD("get_as_ratio"),&Range::get_as_ratio); - ClassDB::bind_method(_MD("set_value","value"),&Range::set_value); - ClassDB::bind_method(_MD("set_min","minimum"),&Range::set_min); - ClassDB::bind_method(_MD("set_max","maximum"),&Range::set_max); - ClassDB::bind_method(_MD("set_step","step"),&Range::set_step); - ClassDB::bind_method(_MD("set_page","pagesize"),&Range::set_page); - ClassDB::bind_method(_MD("set_as_ratio","value"),&Range::set_as_ratio); - ClassDB::bind_method(_MD("set_use_rounded_values","enabled"),&Range::set_use_rounded_values); - ClassDB::bind_method(_MD("is_using_rounded_values"),&Range::is_using_rounded_values); - ClassDB::bind_method(_MD("set_exp_ratio","enabled"),&Range::set_exp_ratio); - ClassDB::bind_method(_MD("is_ratio_exp"),&Range::is_ratio_exp); - - ClassDB::bind_method(_MD("share","with"),&Range::_share); - ClassDB::bind_method(_MD("unshare"),&Range::unshare); + ClassDB::bind_method(D_METHOD("get_value"),&Range::get_value); + ClassDB::bind_method(D_METHOD("get_min"),&Range::get_min); + ClassDB::bind_method(D_METHOD("get_max"),&Range::get_max); + ClassDB::bind_method(D_METHOD("get_step"),&Range::get_step); + ClassDB::bind_method(D_METHOD("get_page"),&Range::get_page); + ClassDB::bind_method(D_METHOD("get_as_ratio"),&Range::get_as_ratio); + ClassDB::bind_method(D_METHOD("set_value","value"),&Range::set_value); + ClassDB::bind_method(D_METHOD("set_min","minimum"),&Range::set_min); + ClassDB::bind_method(D_METHOD("set_max","maximum"),&Range::set_max); + ClassDB::bind_method(D_METHOD("set_step","step"),&Range::set_step); + ClassDB::bind_method(D_METHOD("set_page","pagesize"),&Range::set_page); + ClassDB::bind_method(D_METHOD("set_as_ratio","value"),&Range::set_as_ratio); + ClassDB::bind_method(D_METHOD("set_use_rounded_values","enabled"),&Range::set_use_rounded_values); + ClassDB::bind_method(D_METHOD("is_using_rounded_values"),&Range::is_using_rounded_values); + ClassDB::bind_method(D_METHOD("set_exp_ratio","enabled"),&Range::set_exp_ratio); + ClassDB::bind_method(D_METHOD("is_ratio_exp"),&Range::is_ratio_exp); + + ClassDB::bind_method(D_METHOD("share","with"),&Range::_share); + ClassDB::bind_method(D_METHOD("unshare"),&Range::unshare); ADD_SIGNAL( MethodInfo("value_changed", PropertyInfo(Variant::REAL,"value"))); ADD_SIGNAL( MethodInfo("changed")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "min_value" ), _SCS("set_min"), _SCS("get_min") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "max_value" ), _SCS("set_max"), _SCS("get_max") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "step" ), _SCS("set_step"), _SCS("get_step") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "page" ), _SCS("set_page"), _SCS("get_page") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "value" ), _SCS("set_value"), _SCS("get_value") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "exp_edit" ), _SCS("set_exp_ratio"), _SCS("is_ratio_exp") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "rounded" ), _SCS("set_use_rounded_values"), _SCS("is_using_rounded_values") ); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "min_value" ), "set_min", "get_min") ; + ADD_PROPERTY( PropertyInfo( Variant::REAL, "max_value" ), "set_max", "get_max") ; + ADD_PROPERTY( PropertyInfo( Variant::REAL, "step" ), "set_step", "get_step") ; + ADD_PROPERTY( PropertyInfo( Variant::REAL, "page" ), "set_page", "get_page") ; + ADD_PROPERTY( PropertyInfo( Variant::REAL, "value" ), "set_value", "get_value") ; + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "exp_edit" ), "set_exp_ratio", "is_ratio_exp") ; + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "rounded" ), "set_use_rounded_values", "is_using_rounded_values") ; } diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 5fe5f47d1b..17ec71f4a4 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1214,6 +1214,28 @@ void RichTextLabel::_add_item(Item *p_item, bool p_enter, bool p_ensure_newline) } +void RichTextLabel::_remove_item(Item* p_item, const int p_line, const int p_subitem_line) { + + + int size = p_item->subitems.size(); + if (size == 0) { + p_item->parent->subitems.erase(p_item); + if (p_item->type == ITEM_NEWLINE) { + current_frame->lines.remove(p_line); + for (int i = p_subitem_line; i < current->subitems.size(); i++) { + if (current->subitems[i]->line > 0) + current->subitems[i]->line--; + } + } + } + else { + for (int i = 0; i < size; i++) { + _remove_item(p_item->subitems.front()->get(), p_line, p_subitem_line); + } + } + +} + void RichTextLabel::add_image(const Ref<Texture>& p_image) { if (current->type==ITEM_TABLE) @@ -1238,6 +1260,26 @@ void RichTextLabel::add_newline() { } +bool RichTextLabel::remove_line(const int p_line) { + + if (p_line >= current_frame->lines.size() || p_line < 0) + return false; + + int lines = p_line * 2; + + if (current->subitems[lines]->type != ITEM_NEWLINE) + _remove_item(current->subitems[lines], current->subitems[lines]->line, lines); + + _remove_item(current->subitems[lines], current->subitems[lines]->line, lines); + + if (p_line == 0) { + main->lines[0].from = main; + } + + main->first_invalid_line = 0; + return true; +} + void RichTextLabel::push_font(const Ref<Font>& p_font) { ERR_FAIL_COND(current->type==ITEM_TABLE); @@ -1900,63 +1942,64 @@ String RichTextLabel::get_text() { void RichTextLabel::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&RichTextLabel::_gui_input); - ClassDB::bind_method(_MD("_scroll_changed"),&RichTextLabel::_scroll_changed); - ClassDB::bind_method(_MD("get_text"),&RichTextLabel::get_text); - ClassDB::bind_method(_MD("add_text","text"),&RichTextLabel::add_text); - ClassDB::bind_method(_MD("add_image","image:Texture"),&RichTextLabel::add_image); - ClassDB::bind_method(_MD("newline"),&RichTextLabel::add_newline); - ClassDB::bind_method(_MD("push_font","font"),&RichTextLabel::push_font); - ClassDB::bind_method(_MD("push_color","color"),&RichTextLabel::push_color); - ClassDB::bind_method(_MD("push_align","align"),&RichTextLabel::push_align); - ClassDB::bind_method(_MD("push_indent","level"),&RichTextLabel::push_indent); - ClassDB::bind_method(_MD("push_list","type"),&RichTextLabel::push_list); - ClassDB::bind_method(_MD("push_meta","data"),&RichTextLabel::push_meta); - ClassDB::bind_method(_MD("push_underline"),&RichTextLabel::push_underline); - ClassDB::bind_method(_MD("push_table","columns"),&RichTextLabel::push_table); - ClassDB::bind_method(_MD("set_table_column_expand","column","expand","ratio"),&RichTextLabel::set_table_column_expand); - ClassDB::bind_method(_MD("push_cell"),&RichTextLabel::push_cell); - ClassDB::bind_method(_MD("pop"),&RichTextLabel::pop); + ClassDB::bind_method(D_METHOD("_gui_input"),&RichTextLabel::_gui_input); + ClassDB::bind_method(D_METHOD("_scroll_changed"),&RichTextLabel::_scroll_changed); + ClassDB::bind_method(D_METHOD("get_text"),&RichTextLabel::get_text); + ClassDB::bind_method(D_METHOD("add_text","text"),&RichTextLabel::add_text); + ClassDB::bind_method(D_METHOD("add_image","image:Texture"),&RichTextLabel::add_image); + ClassDB::bind_method(D_METHOD("newline"),&RichTextLabel::add_newline); + ClassDB::bind_method(D_METHOD("remove_line"),&RichTextLabel::remove_line); + ClassDB::bind_method(D_METHOD("push_font","font"),&RichTextLabel::push_font); + ClassDB::bind_method(D_METHOD("push_color","color"),&RichTextLabel::push_color); + ClassDB::bind_method(D_METHOD("push_align","align"),&RichTextLabel::push_align); + ClassDB::bind_method(D_METHOD("push_indent","level"),&RichTextLabel::push_indent); + ClassDB::bind_method(D_METHOD("push_list","type"),&RichTextLabel::push_list); + ClassDB::bind_method(D_METHOD("push_meta","data"),&RichTextLabel::push_meta); + ClassDB::bind_method(D_METHOD("push_underline"),&RichTextLabel::push_underline); + ClassDB::bind_method(D_METHOD("push_table","columns"),&RichTextLabel::push_table); + ClassDB::bind_method(D_METHOD("set_table_column_expand","column","expand","ratio"),&RichTextLabel::set_table_column_expand); + ClassDB::bind_method(D_METHOD("push_cell"),&RichTextLabel::push_cell); + ClassDB::bind_method(D_METHOD("pop"),&RichTextLabel::pop); - ClassDB::bind_method(_MD("clear"),&RichTextLabel::clear); + ClassDB::bind_method(D_METHOD("clear"),&RichTextLabel::clear); - ClassDB::bind_method(_MD("set_meta_underline","enable"),&RichTextLabel::set_meta_underline); - ClassDB::bind_method(_MD("is_meta_underlined"),&RichTextLabel::is_meta_underlined); + ClassDB::bind_method(D_METHOD("set_meta_underline","enable"),&RichTextLabel::set_meta_underline); + ClassDB::bind_method(D_METHOD("is_meta_underlined"),&RichTextLabel::is_meta_underlined); - ClassDB::bind_method(_MD("set_scroll_active","active"),&RichTextLabel::set_scroll_active); - ClassDB::bind_method(_MD("is_scroll_active"),&RichTextLabel::is_scroll_active); + ClassDB::bind_method(D_METHOD("set_scroll_active","active"),&RichTextLabel::set_scroll_active); + ClassDB::bind_method(D_METHOD("is_scroll_active"),&RichTextLabel::is_scroll_active); - ClassDB::bind_method(_MD("set_scroll_follow","follow"),&RichTextLabel::set_scroll_follow); - ClassDB::bind_method(_MD("is_scroll_following"),&RichTextLabel::is_scroll_following); + ClassDB::bind_method(D_METHOD("set_scroll_follow","follow"),&RichTextLabel::set_scroll_follow); + ClassDB::bind_method(D_METHOD("is_scroll_following"),&RichTextLabel::is_scroll_following); - ClassDB::bind_method(_MD("get_v_scroll"),&RichTextLabel::get_v_scroll); + ClassDB::bind_method(D_METHOD("get_v_scroll"),&RichTextLabel::get_v_scroll); - ClassDB::bind_method(_MD("scroll_to_line","line"),&RichTextLabel::scroll_to_line); + ClassDB::bind_method(D_METHOD("scroll_to_line","line"),&RichTextLabel::scroll_to_line); - ClassDB::bind_method(_MD("set_tab_size","spaces"),&RichTextLabel::set_tab_size); - ClassDB::bind_method(_MD("get_tab_size"),&RichTextLabel::get_tab_size); + ClassDB::bind_method(D_METHOD("set_tab_size","spaces"),&RichTextLabel::set_tab_size); + ClassDB::bind_method(D_METHOD("get_tab_size"),&RichTextLabel::get_tab_size); - ClassDB::bind_method(_MD("set_selection_enabled","enabled"),&RichTextLabel::set_selection_enabled); - ClassDB::bind_method(_MD("is_selection_enabled"),&RichTextLabel::is_selection_enabled); + ClassDB::bind_method(D_METHOD("set_selection_enabled","enabled"),&RichTextLabel::set_selection_enabled); + ClassDB::bind_method(D_METHOD("is_selection_enabled"),&RichTextLabel::is_selection_enabled); - ClassDB::bind_method(_MD("parse_bbcode", "bbcode"),&RichTextLabel::parse_bbcode); - ClassDB::bind_method(_MD("append_bbcode", "bbcode"),&RichTextLabel::append_bbcode); + ClassDB::bind_method(D_METHOD("parse_bbcode", "bbcode"),&RichTextLabel::parse_bbcode); + ClassDB::bind_method(D_METHOD("append_bbcode", "bbcode"),&RichTextLabel::append_bbcode); - ClassDB::bind_method(_MD("set_bbcode","text"),&RichTextLabel::set_bbcode); - ClassDB::bind_method(_MD("get_bbcode"),&RichTextLabel::get_bbcode); + ClassDB::bind_method(D_METHOD("set_bbcode","text"),&RichTextLabel::set_bbcode); + ClassDB::bind_method(D_METHOD("get_bbcode"),&RichTextLabel::get_bbcode); - ClassDB::bind_method(_MD("set_visible_characters","amount"),&RichTextLabel::set_visible_characters); - ClassDB::bind_method(_MD("get_visible_characters"),&RichTextLabel::get_visible_characters); + ClassDB::bind_method(D_METHOD("set_visible_characters","amount"),&RichTextLabel::set_visible_characters); + ClassDB::bind_method(D_METHOD("get_visible_characters"),&RichTextLabel::get_visible_characters); - ClassDB::bind_method(_MD("get_total_character_count"),&RichTextLabel::get_total_character_count); + ClassDB::bind_method(D_METHOD("get_total_character_count"),&RichTextLabel::get_total_character_count); - ClassDB::bind_method(_MD("set_use_bbcode","enable"),&RichTextLabel::set_use_bbcode); - ClassDB::bind_method(_MD("is_using_bbcode"),&RichTextLabel::is_using_bbcode); + ClassDB::bind_method(D_METHOD("set_use_bbcode","enable"),&RichTextLabel::set_use_bbcode); + ClassDB::bind_method(D_METHOD("is_using_bbcode"),&RichTextLabel::is_using_bbcode); ADD_GROUP("BBCode","bbcode_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"bbcode_enabled"),_SCS("set_use_bbcode"),_SCS("is_using_bbcode")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"bbcode_text",PROPERTY_HINT_MULTILINE_TEXT),_SCS("set_bbcode"),_SCS("get_bbcode")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"visible_characters",PROPERTY_HINT_RANGE,"-1,128000,1"),_SCS("set_visible_characters"),_SCS("get_visible_characters")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"bbcode_enabled"),"set_use_bbcode","is_using_bbcode"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"bbcode_text",PROPERTY_HINT_MULTILINE_TEXT),"set_bbcode","get_bbcode"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"visible_characters",PROPERTY_HINT_RANGE,"-1,128000,1"),"set_visible_characters","get_visible_characters"); ADD_SIGNAL( MethodInfo("meta_clicked",PropertyInfo(Variant::NIL,"meta"))); diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 39032185f8..3bdd2cd7e3 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -173,7 +173,7 @@ private: struct ItemNewline : public Item { - int line; + int line; // FIXME: Overriding base's line ? ItemNewline() { type=ITEM_NEWLINE; } }; @@ -217,6 +217,7 @@ private: void _validate_line_caches(ItemFrame *p_frame); void _add_item(Item *p_item, bool p_enter=false,bool p_ensure_newline=false); + void _remove_item(Item *p_item, const int p_line, const int p_subitem_line); @@ -284,6 +285,7 @@ public: void add_text(const String& p_text); void add_image(const Ref<Texture>& p_image); void add_newline(); + bool remove_line(const int p_line); void push_font(const Ref<Font>& p_font); void push_color(const Color& p_color); void push_underline(); diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index fc406ff0f5..b2ad74eaa8 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -814,13 +814,13 @@ bool ScrollBar::key(unsigned long p_unicode, unsigned long p_scan_code,bool b.pr void ScrollBar::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&ScrollBar::_gui_input); - ClassDB::bind_method(_MD("set_custom_step","step"),&ScrollBar::set_custom_step); - ClassDB::bind_method(_MD("get_custom_step"),&ScrollBar::get_custom_step); - ClassDB::bind_method(_MD("_drag_slave_input"),&ScrollBar::_drag_slave_input); - ClassDB::bind_method(_MD("_drag_slave_exit"),&ScrollBar::_drag_slave_exit); + ClassDB::bind_method(D_METHOD("_gui_input"),&ScrollBar::_gui_input); + ClassDB::bind_method(D_METHOD("set_custom_step","step"),&ScrollBar::set_custom_step); + ClassDB::bind_method(D_METHOD("get_custom_step"),&ScrollBar::get_custom_step); + ClassDB::bind_method(D_METHOD("_drag_slave_input"),&ScrollBar::_drag_slave_input); + ClassDB::bind_method(D_METHOD("_drag_slave_exit"),&ScrollBar::_drag_slave_exit); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"custom_step",PROPERTY_HINT_RANGE,"-1,4096"), _SCS("set_custom_step"),_SCS("get_custom_step")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"custom_step",PROPERTY_HINT_RANGE,"-1,4096"), "set_custom_step","get_custom_step"); } diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 46312933a7..2296c9742d 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -459,21 +459,21 @@ String ScrollContainer::get_configuration_warning() const { void ScrollContainer::_bind_methods() { - ClassDB::bind_method(_MD("_scroll_moved"),&ScrollContainer::_scroll_moved); - ClassDB::bind_method(_MD("_gui_input"),&ScrollContainer::_gui_input); - ClassDB::bind_method(_MD("set_enable_h_scroll","enable"),&ScrollContainer::set_enable_h_scroll); - ClassDB::bind_method(_MD("is_h_scroll_enabled"),&ScrollContainer::is_h_scroll_enabled); - ClassDB::bind_method(_MD("set_enable_v_scroll","enable"),&ScrollContainer::set_enable_v_scroll); - ClassDB::bind_method(_MD("is_v_scroll_enabled"),&ScrollContainer::is_v_scroll_enabled); - ClassDB::bind_method(_MD("_update_scrollbar_pos"),&ScrollContainer::_update_scrollbar_pos); - ClassDB::bind_method(_MD("set_h_scroll","val"),&ScrollContainer::set_h_scroll); - ClassDB::bind_method(_MD("get_h_scroll"),&ScrollContainer::get_h_scroll); - ClassDB::bind_method(_MD("set_v_scroll","val"),&ScrollContainer::set_v_scroll); - ClassDB::bind_method(_MD("get_v_scroll"),&ScrollContainer::get_v_scroll); + ClassDB::bind_method(D_METHOD("_scroll_moved"),&ScrollContainer::_scroll_moved); + ClassDB::bind_method(D_METHOD("_gui_input"),&ScrollContainer::_gui_input); + ClassDB::bind_method(D_METHOD("set_enable_h_scroll","enable"),&ScrollContainer::set_enable_h_scroll); + ClassDB::bind_method(D_METHOD("is_h_scroll_enabled"),&ScrollContainer::is_h_scroll_enabled); + ClassDB::bind_method(D_METHOD("set_enable_v_scroll","enable"),&ScrollContainer::set_enable_v_scroll); + ClassDB::bind_method(D_METHOD("is_v_scroll_enabled"),&ScrollContainer::is_v_scroll_enabled); + ClassDB::bind_method(D_METHOD("_update_scrollbar_pos"),&ScrollContainer::_update_scrollbar_pos); + ClassDB::bind_method(D_METHOD("set_h_scroll","val"),&ScrollContainer::set_h_scroll); + ClassDB::bind_method(D_METHOD("get_h_scroll"),&ScrollContainer::get_h_scroll); + ClassDB::bind_method(D_METHOD("set_v_scroll","val"),&ScrollContainer::set_v_scroll); + ClassDB::bind_method(D_METHOD("get_v_scroll"),&ScrollContainer::get_v_scroll); ADD_GROUP("Scroll","scroll_"); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "scroll_horizontal"), _SCS("set_enable_h_scroll"),_SCS("is_h_scroll_enabled")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "scroll_vertical"), _SCS("set_enable_v_scroll"),_SCS("is_v_scroll_enabled")); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "scroll_horizontal"), "set_enable_h_scroll","is_h_scroll_enabled"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "scroll_vertical"), "set_enable_v_scroll","is_v_scroll_enabled"); }; diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index ad6e8786d7..a6d6864b16 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -235,16 +235,16 @@ void Slider::set_ticks_on_borders(bool _tob){ void Slider::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&Slider::_gui_input); - ClassDB::bind_method(_MD("set_ticks","count"),&Slider::set_ticks); - ClassDB::bind_method(_MD("get_ticks"),&Slider::get_ticks); + ClassDB::bind_method(D_METHOD("_gui_input"),&Slider::_gui_input); + ClassDB::bind_method(D_METHOD("set_ticks","count"),&Slider::set_ticks); + ClassDB::bind_method(D_METHOD("get_ticks"),&Slider::get_ticks); - ClassDB::bind_method(_MD("get_ticks_on_borders"),&Slider::get_ticks_on_borders); - ClassDB::bind_method(_MD("set_ticks_on_borders","ticks_on_border"),&Slider::set_ticks_on_borders); + ClassDB::bind_method(D_METHOD("get_ticks_on_borders"),&Slider::get_ticks_on_borders); + ClassDB::bind_method(D_METHOD("set_ticks_on_borders","ticks_on_border"),&Slider::set_ticks_on_borders); - ADD_PROPERTY( PropertyInfo( Variant::INT, "tick_count", PROPERTY_HINT_RANGE,"0,4096,1"), _SCS("set_ticks"), _SCS("get_ticks") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "ticks_on_borders" ), _SCS("set_ticks_on_borders"), _SCS("get_ticks_on_borders") ); - ADD_PROPERTY( PropertyInfo( Variant::INT,"focus_mode", PROPERTY_HINT_ENUM, "None,Click,All" ), _SCS("set_focus_mode"), _SCS("get_focus_mode") ); + ADD_PROPERTY( PropertyInfo( Variant::INT, "tick_count", PROPERTY_HINT_RANGE,"0,4096,1"), "set_ticks", "get_ticks") ; + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "ticks_on_borders" ), "set_ticks_on_borders", "get_ticks_on_borders") ; + ADD_PROPERTY( PropertyInfo( Variant::INT,"focus_mode", PROPERTY_HINT_ENUM, "None,Click,All" ), "set_focus_mode", "get_focus_mode") ; } diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 8920f8f056..f2c04d2f76 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -100,8 +100,6 @@ void SpinBox::_gui_input(const InputEvent& p_event) { if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed) { const InputEventMouseButton &mb=p_event.mouse_button; - if (mb.doubleclick) - return; //ignore doubleclick bool up = mb.y < (get_size().height/2); @@ -253,24 +251,24 @@ bool SpinBox::is_editable() const { void SpinBox::_bind_methods() { - //ClassDB::bind_method(_MD("_value_changed"),&SpinBox::_value_changed); - ClassDB::bind_method(_MD("_gui_input"),&SpinBox::_gui_input); - ClassDB::bind_method(_MD("_text_entered"),&SpinBox::_text_entered); - ClassDB::bind_method(_MD("set_suffix","suffix"),&SpinBox::set_suffix); - ClassDB::bind_method(_MD("get_suffix"),&SpinBox::get_suffix); - ClassDB::bind_method(_MD("set_prefix","prefix"),&SpinBox::set_prefix); - ClassDB::bind_method(_MD("get_prefix"),&SpinBox::get_prefix); - ClassDB::bind_method(_MD("set_editable","editable"),&SpinBox::set_editable); - ClassDB::bind_method(_MD("is_editable"),&SpinBox::is_editable); - ClassDB::bind_method(_MD("_line_edit_focus_exit"),&SpinBox::_line_edit_focus_exit); - ClassDB::bind_method(_MD("get_line_edit"),&SpinBox::get_line_edit); - ClassDB::bind_method(_MD("_line_edit_input"),&SpinBox::_line_edit_input); - ClassDB::bind_method(_MD("_range_click_timeout"),&SpinBox::_range_click_timeout); - - - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"editable"),_SCS("set_editable"),_SCS("is_editable")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"prefix"),_SCS("set_prefix"),_SCS("get_prefix")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"suffix"),_SCS("set_suffix"),_SCS("get_suffix")); + //ClassDB::bind_method(D_METHOD("_value_changed"),&SpinBox::_value_changed); + ClassDB::bind_method(D_METHOD("_gui_input"),&SpinBox::_gui_input); + ClassDB::bind_method(D_METHOD("_text_entered"),&SpinBox::_text_entered); + ClassDB::bind_method(D_METHOD("set_suffix","suffix"),&SpinBox::set_suffix); + ClassDB::bind_method(D_METHOD("get_suffix"),&SpinBox::get_suffix); + ClassDB::bind_method(D_METHOD("set_prefix","prefix"),&SpinBox::set_prefix); + ClassDB::bind_method(D_METHOD("get_prefix"),&SpinBox::get_prefix); + ClassDB::bind_method(D_METHOD("set_editable","editable"),&SpinBox::set_editable); + ClassDB::bind_method(D_METHOD("is_editable"),&SpinBox::is_editable); + ClassDB::bind_method(D_METHOD("_line_edit_focus_exit"),&SpinBox::_line_edit_focus_exit); + ClassDB::bind_method(D_METHOD("get_line_edit"),&SpinBox::get_line_edit); + ClassDB::bind_method(D_METHOD("_line_edit_input"),&SpinBox::_line_edit_input); + ClassDB::bind_method(D_METHOD("_range_click_timeout"),&SpinBox::_range_click_timeout); + + + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"editable"),"set_editable","is_editable"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"prefix"),"set_prefix","get_prefix"); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"suffix"),"set_suffix","get_suffix"); } diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index a39ad2fe99..14ea96a4e6 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -422,21 +422,21 @@ bool SplitContainer::is_collapsed() const { void SplitContainer::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&SplitContainer::_gui_input); - ClassDB::bind_method(_MD("set_split_offset","offset"),&SplitContainer::set_split_offset); - ClassDB::bind_method(_MD("get_split_offset"),&SplitContainer::get_split_offset); + ClassDB::bind_method(D_METHOD("_gui_input"),&SplitContainer::_gui_input); + ClassDB::bind_method(D_METHOD("set_split_offset","offset"),&SplitContainer::set_split_offset); + ClassDB::bind_method(D_METHOD("get_split_offset"),&SplitContainer::get_split_offset); - ClassDB::bind_method(_MD("set_collapsed","collapsed"),&SplitContainer::set_collapsed); - ClassDB::bind_method(_MD("is_collapsed"),&SplitContainer::is_collapsed); + ClassDB::bind_method(D_METHOD("set_collapsed","collapsed"),&SplitContainer::set_collapsed); + ClassDB::bind_method(D_METHOD("is_collapsed"),&SplitContainer::is_collapsed); - ClassDB::bind_method(_MD("set_dragger_visibility","mode"),&SplitContainer::set_dragger_visibility); - ClassDB::bind_method(_MD("get_dragger_visibility"),&SplitContainer::get_dragger_visibility); + ClassDB::bind_method(D_METHOD("set_dragger_visibility","mode"),&SplitContainer::set_dragger_visibility); + ClassDB::bind_method(D_METHOD("get_dragger_visibility"),&SplitContainer::get_dragger_visibility); ADD_SIGNAL( MethodInfo("dragged",PropertyInfo(Variant::INT,"offset"))); - ADD_PROPERTY( PropertyInfo(Variant::INT,"split_offset"),_SCS("set_split_offset"),_SCS("get_split_offset")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collapsed"),_SCS("set_collapsed"),_SCS("is_collapsed")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"dragger_visibility",PROPERTY_HINT_ENUM,"Visible,Hidden,Hidden & Collapsed"),_SCS("set_dragger_visibility"),_SCS("get_dragger_visibility")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"split_offset"),"set_split_offset","get_split_offset"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collapsed"),"set_collapsed","is_collapsed"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"dragger_visibility",PROPERTY_HINT_ENUM,"Visible,Hidden,Hidden & Collapsed"),"set_dragger_visibility","get_dragger_visibility"); BIND_CONSTANT( DRAGGER_VISIBLE ); BIND_CONSTANT( DRAGGER_HIDDEN ); diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 11802ab0fb..fc25b68db9 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -31,368 +31,322 @@ #include "message_queue.h" - int TabContainer::_get_top_margin() const { + if (!tabs_visible) + return 0; + + // Respect the minimum tab height. Ref<StyleBox> tab_bg = get_stylebox("tab_bg"); Ref<StyleBox> tab_fg = get_stylebox("tab_fg"); - Ref<Font> font = get_font("font"); + Ref<StyleBox> tab_disabled = get_stylebox("tab_disabled"); - int h = MAX( tab_bg->get_minimum_size().height,tab_fg->get_minimum_size().height); + int tab_height = MAX(MAX(tab_bg->get_minimum_size().height, tab_fg->get_minimum_size().height), tab_disabled->get_minimum_size().height); - int ch = font->get_height(); - for(int i=0;i<get_child_count();i++) { + // Font height or higher icon wins. + Ref<Font> font = get_font("font"); + int content_height = font->get_height(); - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; - if (c->is_set_as_toplevel()) - continue; + Vector<Control*> tabs = _get_tabs(); + for (int i = 0; i < tabs.size(); i++) { + + Control *c = tabs[i]; if (!c->has_meta("_tab_icon")) continue; Ref<Texture> tex = c->get_meta("_tab_icon"); if (!tex.is_valid()) continue; - ch = MAX( ch, tex->get_size().height ); + content_height = MAX(content_height, tex->get_size().height); } - h+=ch; - - return h; - + return tab_height + content_height; } void TabContainer::_gui_input(const InputEvent& p_event) { - if (p_event.type==InputEvent::MOUSE_BUTTON && - p_event.mouse_button.pressed && - p_event.mouse_button.button_index==BUTTON_LEFT) { - - // clicks - Point2 pos( p_event.mouse_button.x, p_event.mouse_button.y ); + if (p_event.type == InputEvent::MOUSE_BUTTON + && p_event.mouse_button.pressed + && p_event.mouse_button.button_index == BUTTON_LEFT) { - int top_margin = _get_top_margin(); - if (pos.y>top_margin) - return; // no click (too far down) + Point2 pos(p_event.mouse_button.x, p_event.mouse_button.y); + Size2 size = get_size(); - if (pos.x<tabs_ofs_cache) - return; // no click (too far left) + // Click must be on tabs in the tab header area. + if (pos.x < tabs_ofs_cache || pos.y > _get_top_margin()) + return; - Ref<StyleBox> tab_bg = get_stylebox("tab_bg"); - Ref<StyleBox> tab_fg = get_stylebox("tab_fg"); - Ref<Font> font = get_font("font"); - Ref<Texture> incr = get_icon("increment"); - Ref<Texture> decr = get_icon("decrement"); + // Handle menu button. Ref<Texture> menu = get_icon("menu"); - Ref<Texture> menu_hl = get_icon("menu_hl"); - - if (popup && pos.x>get_size().width-menu->get_width()) { - - + if (popup && pos.x > size.width - menu->get_width()) { emit_signal("pre_popup_pressed"); - Vector2 pp_pos = get_global_pos(); - pp_pos.x+=get_size().width; - pp_pos.x-=popup->get_size().width; - pp_pos.y+=menu->get_height(); - popup->set_global_pos( pp_pos ); + Vector2 popup_pos = get_global_pos(); + popup_pos.x += size.width - popup->get_size().width; + popup_pos.y += menu->get_height(); + + popup->set_global_pos(popup_pos); popup->popup(); return; } - pos.x-=tabs_ofs_cache; - - int idx=0; - int found=-1; - bool rightroom=false; - - for(int i=0;i<get_child_count();i++) { - - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; - if (c->is_set_as_toplevel()) - continue; - - if (idx<tab_display_ofs) { - idx++; - continue; - } - - if (idx>last_tab_cache) { - rightroom=true; - break; - } - - String s = c->has_meta("_tab_name")?String(XL_MESSAGE(String(c->get_meta("_tab_name")))):String(c->get_name()); - int tab_width=font->get_string_size(s).width; - - if (c->has_meta("_tab_icon")) { - Ref<Texture> icon = c->get_meta("_tab_icon"); - if (icon.is_valid()) { - tab_width+=icon->get_width(); - if (s!="") - tab_width+=get_constant("hseparation"); - - } - } - if (idx==current) { - - tab_width+=tab_fg->get_minimum_size().width; - } else { - tab_width+=tab_bg->get_minimum_size().width; - } - - if (pos.x < tab_width) { - - found=idx; - break; - } - - pos.x-=tab_width; - idx++; - } + Vector<Control*> tabs = _get_tabs(); + // Handle navigation buttons. if (buttons_visible_cache) { - - if (p_event.mouse_button.x>get_size().width-incr->get_width()) { - if (rightroom) { - tab_display_ofs+=1; + Ref<Texture> increment = get_icon("increment"); + Ref<Texture> decrement = get_icon("decrement"); + if (pos.x > size.width - increment->get_width()) { + if (last_tab_cache < tabs.size() - 1) { + first_tab_cache += 1; update(); } - } else if (p_event.mouse_button.x>get_size().width-incr->get_width()-decr->get_width()) { - - if (tab_display_ofs>0) { - tab_display_ofs-=1; + return; + } else if (pos.x > size.width - increment->get_width() - decrement->get_width()) { + if (first_tab_cache > 0) { + first_tab_cache -= 1; update(); } - + return; } } - - if (found!=-1) { - - set_current_tab(found); + // Activate the clicked tab. + pos.x -= tabs_ofs_cache; + for (int i = first_tab_cache; i <= last_tab_cache; i++) { + int tab_width = _get_tab_width(i); + if (pos.x < tab_width) { + if (!get_tab_disabled(i)) { + set_current_tab(i); + } + break; + } + pos.x -= tab_width; } } - } void TabContainer::_notification(int p_what) { - - switch(p_what) { - + switch (p_what) { case NOTIFICATION_DRAW: { - RID ci = get_canvas_item(); - Ref<StyleBox> panel = get_stylebox("panel"); + RID canvas = get_canvas_item(); Size2 size = get_size(); + // Draw only the tab area if the header is hidden. + Ref<StyleBox> panel = get_stylebox("panel"); if (!tabs_visible) { - - panel->draw(ci, Rect2( 0, 0, size.width, size.height)); + panel->draw(canvas, Rect2(0, 0, size.width, size.height)); return; } - - + Vector<Control*> tabs = _get_tabs(); Ref<StyleBox> tab_bg = get_stylebox("tab_bg"); Ref<StyleBox> tab_fg = get_stylebox("tab_fg"); - Ref<Texture> incr = get_icon("increment"); - Ref<Texture> decr = get_icon("decrement"); + Ref<StyleBox> tab_disabled = get_stylebox("tab_disabled"); + Ref<Texture> increment = get_icon("increment"); + Ref<Texture> decrement = get_icon("decrement"); Ref<Texture> menu = get_icon("menu"); Ref<Texture> menu_hl = get_icon("menu_hl"); Ref<Font> font = get_font("font"); - Color color_fg = get_color("font_color_fg"); - Color color_bg = get_color("font_color_bg"); - + Color font_color_fg = get_color("font_color_fg"); + Color font_color_bg = get_color("font_color_bg"); + Color font_color_disabled = get_color("font_color_disabled"); int side_margin = get_constant("side_margin"); - int top_margin = _get_top_margin(); - - - Size2 top_size = Size2( size.width, top_margin ); - - - - int w=0; - int idx=0; - Vector<int> offsets; - Vector<Control*> controls; - int from=0; - int limit=get_size().width; - if (popup) { - top_size.width-=menu->get_width(); - limit-=menu->get_width(); - } - - bool notdone=false; - last_tab_cache=-1; - - for(int i=0;i<get_child_count();i++) { - - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; - if (c->is_set_as_toplevel()) - continue; - if (idx<tab_display_ofs) { - idx++; - from=idx; - continue; - } - - if (w>=get_size().width) { - buttons_visible_cache=true; - notdone=true; + int icon_text_distance = get_constant("hseparation"); + + // Find out start and width of the header area. + int header_x = side_margin; + int header_width = size.width - side_margin * 2; + int header_height = _get_top_margin(); + if (popup) + header_width -= menu->get_width(); + + // Check if all tabs would fit into the header area. + int all_tabs_width = 0; + for (int i = 0; i < tabs.size(); i++) { + int tab_width = _get_tab_width(i); + all_tabs_width += tab_width; + + if (all_tabs_width > header_width) { + // Not all tabs are visible at the same time - reserve space for navigation buttons. + buttons_visible_cache = true; + header_width -= decrement->get_width() + increment->get_width(); break; - } - - offsets.push_back(w); - controls.push_back(c); - - String s = c->has_meta("_tab_name")?String(XL_MESSAGE(String(c->get_meta("_tab_name")))):String(c->get_name()); - w+=font->get_string_size(s).width; - if (c->has_meta("_tab_icon")) { - Ref<Texture> icon = c->get_meta("_tab_icon"); - if (icon.is_valid()) { - w+=icon->get_width(); - if (s!="") - w+=get_constant("hseparation"); - - } - } - - if (idx==current) { - - w+=tab_fg->get_minimum_size().width; } else { - w+=tab_bg->get_minimum_size().width; + buttons_visible_cache = false; } - - if (idx<tab_display_ofs) { - - } - last_tab_cache=idx; - - idx++; + } + // With buttons, a right side margin does not need to be respected. + if (popup || buttons_visible_cache) { + header_width += side_margin; } + // Go through the visible tabs to find the width they occupy. + all_tabs_width = 0; + Vector<int> tab_widths; + for (int i = first_tab_cache; i < tabs.size(); i++) { + int tab_width = _get_tab_width(i); + if (all_tabs_width + tab_width > header_width && tab_widths.size() > 0) + break; + all_tabs_width += tab_width; + tab_widths.push_back(tab_width); + } - int ofs; - - switch(align) { - - case ALIGN_LEFT: ofs = side_margin; break; - case ALIGN_CENTER: ofs = (int(limit) - w)/2; break; - case ALIGN_RIGHT: ofs = int(limit) - w - side_margin; break; - }; - - tab_display_ofs=0; - - - tabs_ofs_cache=ofs; - idx=0; - - - - for(int i=0;i<controls.size();i++) { - - idx=i+from; - if (current>=from && current<from+controls.size()-1) { - //current is visible! draw it last. - if (i==controls.size()-1) { - idx=current; - } else if (idx>=current) { - idx+=1; - } - } - - Control *c = controls[idx-from]; - - String s = c->has_meta("_tab_name")?String(c->get_meta("_tab_name")):String(c->get_name()); - int w=font->get_string_size(s).width; - Ref<Texture> icon; - if (c->has_meta("_tab_icon")) { - icon = c->get_meta("_tab_icon"); - if (icon.is_valid()) { - - w+=icon->get_width(); - if (s!="") - w+=get_constant("hseparation"); - - } - } - - - Ref<StyleBox> sb; - Color col; - - if (idx==current) { + // Find the offset at which to draw tabs, according to the alignment. + switch (align) { + case ALIGN_LEFT: + tabs_ofs_cache = header_x; + break; + case ALIGN_CENTER: + tabs_ofs_cache = header_x + (header_width / 2) - (all_tabs_width / 2); + break; + case ALIGN_RIGHT: + tabs_ofs_cache = header_x + header_width - all_tabs_width; + break; + } - sb=tab_fg; - col=color_fg; + // Draw all visible tabs. + int x = 0; + for (int i = 0; i < tab_widths.size(); i++) { + Ref<StyleBox> tab_style; + Color font_color; + if (get_tab_disabled(i + first_tab_cache)) { + tab_style = tab_disabled; + font_color = font_color_disabled; + } else if (i + first_tab_cache == current) { + tab_style = tab_fg; + font_color = font_color_fg; } else { - sb=tab_bg; - col=color_bg; + tab_style = tab_bg; + font_color = font_color_bg; } - int lofs = ofs + offsets[idx-from]; + // Draw the tab background. + int tab_width = tab_widths[i]; + Rect2 tab_rect(tabs_ofs_cache + x, 0, tab_width, header_height); + tab_style->draw(canvas, tab_rect); - Size2i sb_ms = sb->get_minimum_size(); - Rect2 sb_rect = Rect2( lofs, 0, w+sb_ms.width, top_margin); + // Draw the tab contents. + Control *control = tabs[i + first_tab_cache]->cast_to<Control>(); + String text = control->has_meta("_tab_name") + ? String(XL_MESSAGE(String(control->get_meta("_tab_name")))) + : String(control->get_name()); + int x_content = tab_rect.pos.x + tab_style->get_margin(MARGIN_LEFT); + int top_margin = tab_style->get_margin(MARGIN_TOP); + int y_center = top_margin + (tab_rect.size.y - tab_style->get_minimum_size().y) / 2; - sb->draw(ci, sb_rect ); - - Point2i lpos = sb_rect.pos; - lpos.x+=sb->get_margin(MARGIN_LEFT); - if (icon.is_valid()) { - - icon->draw(ci, Point2i( lpos.x, sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-icon->get_height())/2 ) ); - if (s!="") - lpos.x+=icon->get_width()+get_constant("hseparation"); - + // Draw the tab icon. + if (control->has_meta("_tab_icon")) { + Ref<Texture> icon = control->get_meta("_tab_icon"); + if (icon.is_valid()) { + int y = y_center - (icon->get_height() / 2); + icon->draw(canvas, Point2i(x_content, y)); + if (text != "") + x_content += icon->get_width() + icon_text_distance; + } } - font->draw(ci, Point2i( lpos.x, sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-font->get_height())/2+font->get_ascent() ), s, col ); + // Draw the tab text. + Point2i text_pos(x_content, y_center - (font->get_height() / 2) + font->get_ascent()); + font->draw(canvas, text_pos, text, font_color); - idx++; + x += tab_width; + last_tab_cache = i + first_tab_cache; } + // Draw the popup menu. + x = get_size().width; + if (popup) { + x -= menu->get_width(); + if (mouse_x_cache > x) + menu_hl->draw(get_canvas_item(), Size2(x, 0)); + else + menu->draw(get_canvas_item(), Size2(x, 0)); + } + // Draw the navigation buttons. if (buttons_visible_cache) { + int y_center = header_height / 2; - int vofs = (top_margin-incr->get_height())/2; - decr->draw(ci,Point2(limit,vofs),Color(1,1,1,tab_display_ofs==0?0.5:1.0)); - incr->draw(ci,Point2(limit+incr->get_width(),vofs),Color(1,1,1,notdone?1.0:0.5)); - } + x -= increment->get_width(); + increment->draw(canvas, + Point2(x, y_center - (increment->get_height() / 2)), + Color(1, 1, 1, last_tab_cache < tabs.size() - 1 ? 1.0 : 0.5)); - if (popup) { - int from = get_size().width-menu->get_width(); - - if (mouse_x_cache > from) - menu_hl->draw(get_canvas_item(),Size2(from,0)); - else - menu->draw(get_canvas_item(),Size2(from,0)); + x -= decrement->get_width(); + decrement->draw(canvas, + Point2(x, y_center - (decrement->get_height() / 2)), + Color(1, 1, 1, first_tab_cache > 0 ? 1.0 : 0.5)); } - panel->draw(ci, Rect2( 0, top_size.height, size.width, size.height-top_size.height)); - + // Draw the tab area. + panel->draw(canvas, Rect2(0, header_height, size.width, size.height - header_height)); } break; case NOTIFICATION_THEME_CHANGED: { if (get_tab_count() > 0) { - call_deferred("set_current_tab",get_current_tab()); //wait until all changed theme + call_deferred("set_current_tab", get_current_tab()); //wait until all changed theme } } break; } } +int TabContainer::_get_tab_width(int p_index) const { + Control *control = _get_tabs()[p_index]->cast_to<Control>(); + if (!control || control->is_set_as_toplevel()) + return 0; + + // Get the width of the text displayed on the tab. + Ref<Font> font = get_font("font"); + String text = control->has_meta("_tab_name") + ? String(XL_MESSAGE(String(control->get_meta("_tab_name")))) + : String(control->get_name()); + int width = font->get_string_size(text).width; + + // Add space for a tab icon. + if (control->has_meta("_tab_icon")) { + Ref<Texture> icon = control->get_meta("_tab_icon"); + if (icon.is_valid()) { + width += icon->get_width(); + if (text != "") + width += get_constant("hseparation"); + } + } + + // Respect a minimum size. + Ref<StyleBox> tab_bg = get_stylebox("tab_bg"); + Ref<StyleBox> tab_fg = get_stylebox("tab_fg"); + Ref<StyleBox> tab_disabled = get_stylebox("tab_disabled"); + if (get_tab_disabled(p_index)) { + width += tab_disabled->get_minimum_size().width; + } else if (p_index == current) { + width += tab_fg->get_minimum_size().width; + } else { + width += tab_bg->get_minimum_size().width; + } + + return width; +} + +Vector<Control*> TabContainer::_get_tabs() const { + + Vector<Control*> controls; + for (int i = 0; i < get_child_count(); i++) { + + Control *control = get_child(i)->cast_to<Control>(); + if (!control || control->is_toplevel_control()) + continue; + + controls.push_back(control); + } + return controls; +} + void TabContainer::_child_renamed_callback() { update(); @@ -408,78 +362,73 @@ void TabContainer::add_child_notify(Node *p_child) { if (c->is_set_as_toplevel()) return; - bool first=false; + bool first = false; - if (get_tab_count()!=1) + if (get_tab_count() != 1) c->hide(); else { c->show(); //call_deferred("set_current_tab",0); - first=true; - current=0; + first = true; + current = 0; + previous = 0; } c->set_area_as_parent_rect(); if (tabs_visible) - c->set_margin(MARGIN_TOP,_get_top_margin()); + c->set_margin(MARGIN_TOP, _get_top_margin()); Ref<StyleBox> sb = get_stylebox("panel"); - for(int i=0;i<4;i++) - c->set_margin(Margin(i),c->get_margin(Margin(i))+sb->get_margin(Margin(i))); + for (int i = 0; i < 4; i++) + c->set_margin(Margin(i), c->get_margin(Margin(i)) + sb->get_margin(Margin(i))); update(); - p_child->connect("renamed", this,"_child_renamed_callback"); - if(first) - emit_signal("tab_changed",current); + p_child->connect("renamed", this, "_child_renamed_callback"); + if (first) + emit_signal("tab_changed", current); } int TabContainer::get_tab_count() const { - int count=0; - - for(int i=0;i<get_child_count();i++) { - - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; - count++; - } - - return count; + return _get_tabs().size(); } void TabContainer::set_current_tab(int p_current) { - ERR_FAIL_INDEX( p_current, get_tab_count() ); + ERR_FAIL_INDEX(p_current, get_tab_count()); - current=p_current; + int pending_previous = current; + current = p_current; - int idx=0; - - Ref<StyleBox> sb=get_stylebox("panel"); - for(int i=0;i<get_child_count();i++) { + Ref<StyleBox> sb = get_stylebox("panel"); + Vector<Control*> tabs = _get_tabs(); + for (int i = 0; i < tabs.size(); i++) { - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; - if (c->is_set_as_toplevel()) - continue; - if (idx==current) { + Control *c = tabs[i]; + if (i == current) { c->show(); c->set_area_as_parent_rect(); if (tabs_visible) - c->set_margin(MARGIN_TOP,_get_top_margin()); - for(int i=0;i<4;i++) - c->set_margin(Margin(i),c->get_margin(Margin(i))+sb->get_margin(Margin(i))); + c->set_margin(MARGIN_TOP, _get_top_margin()); + for (int i = 0; i < 4; i++) + c->set_margin(Margin(i), c->get_margin(Margin(i)) + sb->get_margin(Margin(i))); - } else + } + else c->hide(); - idx++; } _change_notify("current_tab"); - emit_signal("tab_changed",current); + + if (pending_previous == current) + emit_signal("tab_selected", current); + else { + previous = pending_previous; + emit_signal("tab_selected", current); + emit_signal("tab_changed", current); + } + update(); } @@ -488,47 +437,27 @@ int TabContainer::get_current_tab() const { return current; } -Control* TabContainer::get_tab_control(int p_idx) const { - - int idx=0; - - - for(int i=0;i<get_child_count();i++) { - - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; - if (c->is_set_as_toplevel()) - continue; - if (idx==p_idx) { - return c; - - } - idx++; - } - - return NULL; +int TabContainer::get_previous_tab() const { + + return previous; } -Control* TabContainer::get_current_tab_control() const { - int idx=0; - - - for(int i=0;i<get_child_count();i++) { +Control* TabContainer::get_tab_control(int p_idx) const { - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; - if (c->is_set_as_toplevel()) - continue; - if (idx==current) { - return c; + Vector<Control*> tabs = _get_tabs(); + if (p_idx >= 0 && p_idx < tabs.size()) + return tabs[p_idx]; + else + return NULL; +} - } - idx++; - } +Control* TabContainer::get_current_tab_control() const { - return NULL; + Vector<Control*> tabs = _get_tabs(); + if (current >= 0 && current < tabs.size()) + return tabs[current]; + else + return NULL; } void TabContainer::remove_child_notify(Node *p_child) { @@ -536,24 +465,24 @@ void TabContainer::remove_child_notify(Node *p_child) { Control::remove_child_notify(p_child); int tc = get_tab_count(); - if (current==tc-1) { + if (current == tc - 1) { current--; - if (current<0) - current=0; + if (current < 0) + current = 0; else { - call_deferred("set_current_tab",current); + call_deferred("set_current_tab", current); } } - p_child->disconnect("renamed", this,"_child_renamed_callback"); + p_child->disconnect("renamed", this, "_child_renamed_callback"); update(); } void TabContainer::set_tab_align(TabAlign p_align) { - ERR_FAIL_INDEX(p_align,3); - align=p_align; + ERR_FAIL_INDEX(p_align, 3); + align = p_align; update(); _change_notify("tab_align"); @@ -565,20 +494,19 @@ TabContainer::TabAlign TabContainer::get_tab_align() const { void TabContainer::set_tabs_visible(bool p_visibe) { - if (p_visibe==tabs_visible) + if (p_visibe == tabs_visible) return; - tabs_visible=p_visibe; + tabs_visible = p_visibe; - for(int i=0;i<get_child_count();i++) { + Vector<Control*> tabs = _get_tabs(); + for (int i = 0; i < tabs.size(); i++) { - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; + Control *c = tabs[i]; if (p_visibe) - c->set_margin(MARGIN_TOP,_get_top_margin()); + c->set_margin(MARGIN_TOP, _get_top_margin()); else - c->set_margin(MARGIN_TOP,0); + c->set_margin(MARGIN_TOP, 0); } update(); @@ -590,39 +518,24 @@ bool TabContainer::are_tabs_visible() const { } - Control *TabContainer::_get_tab(int p_idx) const { - int idx=0; - - for(int i=0;i<get_child_count();i++) { - - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; - if (c->is_set_as_toplevel()) - continue; - if (idx==p_idx) - return c; - idx++; - - } - return NULL; + return get_tab_control(p_idx); } -void TabContainer::set_tab_title(int p_tab,const String& p_title) { +void TabContainer::set_tab_title(int p_tab, const String& p_title) { Control *child = _get_tab(p_tab); ERR_FAIL_COND(!child); - child->set_meta("_tab_name",p_title); + child->set_meta("_tab_name", p_title); } -String TabContainer::get_tab_title(int p_tab) const{ +String TabContainer::get_tab_title(int p_tab) const { Control *child = _get_tab(p_tab); - ERR_FAIL_COND_V(!child,""); + ERR_FAIL_COND_V(!child, ""); if (child->has_meta("_tab_name")) return child->get_meta("_tab_name"); else @@ -630,80 +543,92 @@ String TabContainer::get_tab_title(int p_tab) const{ } -void TabContainer::set_tab_icon(int p_tab,const Ref<Texture>& p_icon){ +void TabContainer::set_tab_icon(int p_tab, const Ref<Texture>& p_icon) { Control *child = _get_tab(p_tab); ERR_FAIL_COND(!child); - child->set_meta("_tab_icon",p_icon); + child->set_meta("_tab_icon", p_icon); } -Ref<Texture> TabContainer::get_tab_icon(int p_tab) const{ +Ref<Texture> TabContainer::get_tab_icon(int p_tab) const { Control *child = _get_tab(p_tab); - ERR_FAIL_COND_V(!child,Ref<Texture>()); + ERR_FAIL_COND_V(!child, Ref<Texture>()); if (child->has_meta("_tab_icon")) return child->get_meta("_tab_icon"); else return Ref<Texture>(); } +void TabContainer::set_tab_disabled(int p_tab, bool p_enabled) { + + Control *child = _get_tab(p_tab); + ERR_FAIL_COND(!child); + child->set_meta("_tab_disabled", p_enabled); + update(); +} + +bool TabContainer::get_tab_disabled(int p_tab) const { + + Control *child = _get_tab(p_tab); + ERR_FAIL_COND_V(!child, false); + if (child->has_meta("_tab_disabled")) + return child->get_meta("_tab_disabled"); + else + return false; +} + void TabContainer::get_translatable_strings(List<String> *p_strings) const { - for(int i=0;i<get_child_count();i++) { + Vector<Control*> tabs = _get_tabs(); + for (int i = 0; i < tabs.size(); i++) { - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; - if (c->is_set_as_toplevel()) - continue; + Control *c = tabs[i]; if (!c->has_meta("_tab_name")) continue; String name = c->get_meta("_tab_name"); - if (name!="") + if (name != "") p_strings->push_back(name); } } - Size2 TabContainer::get_minimum_size() const { Size2 ms; - for(int i=0;i<get_child_count();i++) { + Vector<Control*> tabs = _get_tabs(); + for (int i = 0; i < tabs.size(); i++) { - Control *c = get_child(i)->cast_to<Control>(); - if (!c) - continue; - if (c->is_set_as_toplevel()) - continue; + Control *c = tabs[i]; if (!c->is_visible_in_tree()) continue; Size2 cms = c->get_combined_minimum_size(); - ms.x=MAX(ms.x,cms.x); - ms.y=MAX(ms.y,cms.y); + ms.x = MAX(ms.x, cms.x); + ms.y = MAX(ms.y, cms.y); } Ref<StyleBox> tab_bg = get_stylebox("tab_bg"); Ref<StyleBox> tab_fg = get_stylebox("tab_fg"); + Ref<StyleBox> tab_disabled = get_stylebox("tab_disabled"); Ref<Font> font = get_font("font"); - ms.y+=MAX(tab_bg->get_minimum_size().y,tab_fg->get_minimum_size().y); - ms.y+=font->get_height(); + ms.y += MAX(MAX(tab_bg->get_minimum_size().y, tab_fg->get_minimum_size().y), tab_disabled->get_minimum_size().y); + ms.y += font->get_height(); Ref<StyleBox> sb = get_stylebox("panel"); - ms+=sb->get_minimum_size(); + ms += sb->get_minimum_size(); return ms; } void TabContainer::set_popup(Node *p_popup) { ERR_FAIL_NULL(p_popup); - popup=p_popup->cast_to<Popup>(); + popup = p_popup->cast_to<Popup>(); update(); } @@ -711,46 +636,50 @@ Popup* TabContainer::get_popup() const { return popup; } - void TabContainer::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&TabContainer::_gui_input); - ClassDB::bind_method(_MD("get_tab_count"),&TabContainer::get_tab_count); - ClassDB::bind_method(_MD("set_current_tab","tab_idx"),&TabContainer::set_current_tab); - ClassDB::bind_method(_MD("get_current_tab"),&TabContainer::get_current_tab); - ClassDB::bind_method(_MD("get_current_tab_control:Control"),&TabContainer::get_current_tab_control); - ClassDB::bind_method(_MD("get_tab_control:Control","idx"),&TabContainer::get_tab_control); - ClassDB::bind_method(_MD("set_tab_align","align"),&TabContainer::set_tab_align); - ClassDB::bind_method(_MD("get_tab_align"),&TabContainer::get_tab_align); - ClassDB::bind_method(_MD("set_tabs_visible","visible"),&TabContainer::set_tabs_visible); - ClassDB::bind_method(_MD("are_tabs_visible"),&TabContainer::are_tabs_visible); - ClassDB::bind_method(_MD("set_tab_title","tab_idx","title"),&TabContainer::set_tab_title); - ClassDB::bind_method(_MD("get_tab_title","tab_idx"),&TabContainer::get_tab_title); - ClassDB::bind_method(_MD("set_tab_icon","tab_idx","icon:Texture"),&TabContainer::set_tab_icon); - ClassDB::bind_method(_MD("get_tab_icon:Texture","tab_idx"),&TabContainer::get_tab_icon); - ClassDB::bind_method(_MD("set_popup","popup:Popup"),&TabContainer::set_popup); - ClassDB::bind_method(_MD("get_popup:Popup"),&TabContainer::get_popup); - - ClassDB::bind_method(_MD("_child_renamed_callback"),&TabContainer::_child_renamed_callback); - - ADD_SIGNAL(MethodInfo("tab_changed",PropertyInfo(Variant::INT,"tab"))); + ClassDB::bind_method(D_METHOD("_gui_input"), &TabContainer::_gui_input); + ClassDB::bind_method(D_METHOD("get_tab_count"), &TabContainer::get_tab_count); + ClassDB::bind_method(D_METHOD("set_current_tab", "tab_idx"), &TabContainer::set_current_tab); + ClassDB::bind_method(D_METHOD("get_current_tab"), &TabContainer::get_current_tab); + ClassDB::bind_method(D_METHOD("get_previous_tab"), &TabContainer::get_previous_tab); + ClassDB::bind_method(D_METHOD("get_current_tab_control:Control"), &TabContainer::get_current_tab_control); + ClassDB::bind_method(D_METHOD("get_tab_control:Control", "idx"), &TabContainer::get_tab_control); + ClassDB::bind_method(D_METHOD("set_tab_align", "align"), &TabContainer::set_tab_align); + ClassDB::bind_method(D_METHOD("get_tab_align"), &TabContainer::get_tab_align); + ClassDB::bind_method(D_METHOD("set_tabs_visible", "visible"), &TabContainer::set_tabs_visible); + ClassDB::bind_method(D_METHOD("are_tabs_visible"), &TabContainer::are_tabs_visible); + ClassDB::bind_method(D_METHOD("set_tab_title", "tab_idx", "title"), &TabContainer::set_tab_title); + ClassDB::bind_method(D_METHOD("get_tab_title", "tab_idx"), &TabContainer::get_tab_title); + ClassDB::bind_method(D_METHOD("set_tab_icon", "tab_idx", "icon:Texture"), &TabContainer::set_tab_icon); + ClassDB::bind_method(D_METHOD("get_tab_icon:Texture", "tab_idx"), &TabContainer::get_tab_icon); + ClassDB::bind_method(D_METHOD("set_tab_disabled", "tab_idx", "disabled"), &TabContainer::set_tab_disabled); + ClassDB::bind_method(D_METHOD("get_tab_disabled", "tab_idx"), &TabContainer::get_tab_disabled); + ClassDB::bind_method(D_METHOD("set_popup", "popup:Popup"), &TabContainer::set_popup); + ClassDB::bind_method(D_METHOD("get_popup:Popup"), &TabContainer::get_popup); + + ClassDB::bind_method(D_METHOD("_child_renamed_callback"), &TabContainer::_child_renamed_callback); + + ADD_SIGNAL(MethodInfo("tab_changed", PropertyInfo(Variant::INT, "tab"))); + ADD_SIGNAL(MethodInfo("tab_selected", PropertyInfo(Variant::INT, "tab"))); ADD_SIGNAL(MethodInfo("pre_popup_pressed")); - ADD_PROPERTY( PropertyInfo(Variant::INT, "tab_align", PROPERTY_HINT_ENUM,"Left,Center,Right"), _SCS("set_tab_align"), _SCS("get_tab_align") ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "current_tab", PROPERTY_HINT_RANGE,"-1,4096,1",PROPERTY_USAGE_EDITOR), _SCS("set_current_tab"), _SCS("get_current_tab") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "tabs_visible"), _SCS("set_tabs_visible"), _SCS("are_tabs_visible") ); + ADD_PROPERTY(PropertyInfo(Variant::INT, "tab_align", PROPERTY_HINT_ENUM, "Left,Center,Right"), "set_tab_align", "get_tab_align"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "current_tab", PROPERTY_HINT_RANGE, "-1,4096,1", PROPERTY_USAGE_EDITOR), "set_current_tab", "get_current_tab"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "tabs_visible"), "set_tabs_visible", "are_tabs_visible"); } TabContainer::TabContainer() { - tab_display_ofs=0; - buttons_visible_cache=false; - tabs_ofs_cache=0; - current=0; - mouse_x_cache=0; - align=ALIGN_CENTER; - tabs_visible=true; - popup=NULL; - -} + first_tab_cache = 0; + buttons_visible_cache = false; + tabs_ofs_cache = 0; + current = 0; + previous = 0; + mouse_x_cache = 0; + align = ALIGN_CENTER; + tabs_visible = true; + popup = NULL; + +}
\ No newline at end of file diff --git a/scene/gui/tab_container.h b/scene/gui/tab_container.h index 8b6ca7704e..d5a2801bbe 100644 --- a/scene/gui/tab_container.h +++ b/scene/gui/tab_container.h @@ -46,10 +46,11 @@ public: private: int mouse_x_cache; - int tab_display_ofs; + int first_tab_cache; int tabs_ofs_cache; int last_tab_cache; int current; + int previous; bool tabs_visible; bool buttons_visible_cache; TabAlign align; @@ -57,6 +58,8 @@ private: int _get_top_margin() const; Popup *popup; + Vector<Control*> _get_tabs() const; + int _get_tab_width(int p_index) const; protected: @@ -83,9 +86,13 @@ public: void set_tab_icon(int p_tab,const Ref<Texture>& p_icon); Ref<Texture> get_tab_icon(int p_tab) const; + void set_tab_disabled(int p_tab, bool p_disabled); + bool get_tab_disabled(int p_tab) const; + int get_tab_count() const; void set_current_tab(int p_current); int get_current_tab() const; + int get_previous_tab() const; Control* get_tab_control(int p_idx) const; Control* get_current_tab_control() const; diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 98d3f6230d..4e07a495ed 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -34,9 +34,10 @@ Size2 Tabs::get_minimum_size() const { Ref<StyleBox> tab_bg = get_stylebox("tab_bg"); Ref<StyleBox> tab_fg = get_stylebox("tab_fg"); + Ref<StyleBox> tab_disabled = get_stylebox("tab_disabled"); Ref<Font> font = get_font("font"); - Size2 ms(0, MAX(tab_bg->get_minimum_size().height, tab_fg->get_minimum_size().height)+font->get_height()); + Size2 ms(0, MAX(MAX(tab_bg->get_minimum_size().height, tab_fg->get_minimum_size().height), tab_disabled->get_minimum_size().height)+font->get_height()); for(int i=0;i<tabs.size();i++) { @@ -49,7 +50,9 @@ Size2 Tabs::get_minimum_size() const { ms.width+=font->get_string_size(tabs[i].text).width; - if (current==i) + if (tabs[i].disabled) + ms.width += tab_disabled->get_minimum_size().width; + else if (current==i) ms.width+=tab_fg->get_minimum_size().width; else ms.width+=tab_bg->get_minimum_size().width; @@ -111,7 +114,7 @@ void Tabs::_gui_input(const InputEvent& p_event) { hover_buttons = i; break; } - else if (tabs[i].cb_rect.has_point(pos)) { + else if (!tabs[i].disabled && tabs[i].cb_rect.has_point(pos)) { cb_hover=i; rb_hover=-1; hover_buttons = i; @@ -206,7 +209,9 @@ void Tabs::_gui_input(const InputEvent& p_event) { } if (pos.x >=tabs[i].ofs_cache && pos.x<tabs[i].ofs_cache+tabs[i].size_cache) { - found=i; + if (!tabs[i].disabled) { + found = i; + } break; } } @@ -242,9 +247,11 @@ void Tabs::_notification(int p_what) { Ref<StyleBox> tab_bg = get_stylebox("tab_bg"); Ref<StyleBox> tab_fg = get_stylebox("tab_fg"); + Ref<StyleBox> tab_disabled = get_stylebox("tab_disabled"); Ref<Font> font = get_font("font"); Color color_fg = get_color("font_color_fg"); Color color_bg = get_color("font_color_bg"); + Color color_disabled = get_color("font_color_disabled"); Ref<Texture> close=get_icon("close"); int h = get_size().height; @@ -301,7 +308,10 @@ void Tabs::_notification(int p_what) { Ref<StyleBox> sb; Color col; - if (i==current) { + if (tabs[i].disabled) { + sb = tab_disabled; + col = color_disabled; + } else if (i == current) { sb=tab_fg; col=color_fg; } else { @@ -366,7 +376,7 @@ void Tabs::_notification(int p_what) { 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 (!tabs[i].disabled && cb_hover == i) { if (cb_pressing) get_stylebox("button_pressed")->draw(ci,cb_rect); else @@ -463,6 +473,18 @@ Ref<Texture> Tabs::get_tab_icon(int p_tab) const{ } +void Tabs::set_tab_disabled(int p_tab, bool p_disabled) { + + ERR_FAIL_INDEX(p_tab, tabs.size()); + tabs[p_tab].disabled = p_disabled; + update(); +} +bool Tabs::get_tab_disabled(int p_tab) const { + + ERR_FAIL_INDEX_V(p_tab, tabs.size(), false); + return tabs[p_tab].disabled; +} + void Tabs::set_tab_right_button(int p_tab,const Ref<Texture>& p_right_button){ ERR_FAIL_INDEX(p_tab,tabs.size()); @@ -484,6 +506,7 @@ void Tabs::add_tab(const String& p_str,const Ref<Texture>& p_icon) { Tab t; t.text=p_str; t.icon=p_icon; + t.disabled = false; tabs.push_back(t); @@ -534,6 +557,7 @@ int Tabs::get_tab_width(int p_idx) const { Ref<StyleBox> tab_bg = get_stylebox("tab_bg"); Ref<StyleBox> tab_fg = get_stylebox("tab_fg"); + Ref<StyleBox> tab_disabled = get_stylebox("tab_disabled"); Ref<Font> font = get_font("font"); @@ -549,7 +573,9 @@ int Tabs::get_tab_width(int p_idx) const { x+=font->get_string_size(tabs[p_idx].text).width; - if (current==p_idx) + if (tabs[p_idx].disabled) + x += tab_disabled->get_minimum_size().width; + else if (current==p_idx) x+=tab_fg->get_minimum_size().width; else x+=tab_bg->get_minimum_size().width; @@ -649,25 +675,27 @@ void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy) { void Tabs::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&Tabs::_gui_input); - ClassDB::bind_method(_MD("get_tab_count"),&Tabs::get_tab_count); - ClassDB::bind_method(_MD("set_current_tab","tab_idx"),&Tabs::set_current_tab); - ClassDB::bind_method(_MD("get_current_tab"),&Tabs::get_current_tab); - ClassDB::bind_method(_MD("set_tab_title","tab_idx","title"),&Tabs::set_tab_title); - ClassDB::bind_method(_MD("get_tab_title","tab_idx"),&Tabs::get_tab_title); - ClassDB::bind_method(_MD("set_tab_icon","tab_idx","icon:Texture"),&Tabs::set_tab_icon); - ClassDB::bind_method(_MD("get_tab_icon:Texture","tab_idx"),&Tabs::get_tab_icon); - ClassDB::bind_method(_MD("remove_tab","tab_idx"),&Tabs::remove_tab); - ClassDB::bind_method(_MD("add_tab","title","icon:Texture"),&Tabs::add_tab); - ClassDB::bind_method(_MD("set_tab_align","align"),&Tabs::set_tab_align); - ClassDB::bind_method(_MD("get_tab_align"),&Tabs::get_tab_align); - ClassDB::bind_method(_MD("ensure_tab_visible","idx"),&Tabs::ensure_tab_visible); + ClassDB::bind_method(D_METHOD("_gui_input"),&Tabs::_gui_input); + ClassDB::bind_method(D_METHOD("get_tab_count"),&Tabs::get_tab_count); + ClassDB::bind_method(D_METHOD("set_current_tab","tab_idx"),&Tabs::set_current_tab); + ClassDB::bind_method(D_METHOD("get_current_tab"),&Tabs::get_current_tab); + ClassDB::bind_method(D_METHOD("set_tab_title","tab_idx","title"),&Tabs::set_tab_title); + ClassDB::bind_method(D_METHOD("get_tab_title","tab_idx"),&Tabs::get_tab_title); + ClassDB::bind_method(D_METHOD("set_tab_icon","tab_idx","icon:Texture"),&Tabs::set_tab_icon); + ClassDB::bind_method(D_METHOD("get_tab_icon:Texture","tab_idx"),&Tabs::get_tab_icon); + ClassDB::bind_method(D_METHOD("set_tab_disabled", "tab_idx", "disabled"), &Tabs::set_tab_disabled); + ClassDB::bind_method(D_METHOD("get_tab_disabled", "tab_idx"), &Tabs::get_tab_disabled); + ClassDB::bind_method(D_METHOD("remove_tab","tab_idx"),&Tabs::remove_tab); + ClassDB::bind_method(D_METHOD("add_tab","title","icon:Texture"),&Tabs::add_tab); + ClassDB::bind_method(D_METHOD("set_tab_align","align"),&Tabs::set_tab_align); + ClassDB::bind_method(D_METHOD("get_tab_align"),&Tabs::get_tab_align); + ClassDB::bind_method(D_METHOD("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"))); ADD_SIGNAL(MethodInfo("tab_close",PropertyInfo(Variant::INT,"tab"))); - ADD_PROPERTY( PropertyInfo(Variant::INT, "current_tab", PROPERTY_HINT_RANGE,"-1,4096,1",PROPERTY_USAGE_EDITOR), _SCS("set_current_tab"), _SCS("get_current_tab") ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "current_tab", PROPERTY_HINT_RANGE,"-1,4096,1",PROPERTY_USAGE_EDITOR), "set_current_tab", "get_current_tab") ; BIND_CONSTANT( ALIGN_LEFT ); BIND_CONSTANT( ALIGN_CENTER ); diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h index 9ba32297dc..83dcce2613 100644 --- a/scene/gui/tabs.h +++ b/scene/gui/tabs.h @@ -57,6 +57,7 @@ private: String text; Ref<Texture> icon; int ofs_cache; + bool disabled; int size_cache; int x_cache; int x_size_cache; @@ -105,6 +106,9 @@ public: void set_tab_icon(int p_tab,const Ref<Texture>& p_icon); Ref<Texture> get_tab_icon(int p_tab) const; + + void set_tab_disabled(int p_tab, bool p_disabled); + bool get_tab_disabled(int p_tab) const; void set_tab_right_button(int p_tab,const Ref<Texture>& p_right_button); Ref<Texture> get_tab_right_button(int p_tab) const; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 6036b3f9df..f1b061c506 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -32,7 +32,7 @@ #include "os/input.h" #include "os/os.h" -#include "globals.h" +#include "global_config.h" #include "message_queue.h" #include "scene/main/viewport.h" @@ -2431,6 +2431,8 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) { if (k.mod.shift) _post_shift_selection(); + else if(k.mod.command || k.mod.control) + deselect(); } break; #else @@ -2440,25 +2442,30 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) { if (k.mod.shift) _pre_shift_selection(); - // compute whitespace symbols seq length - int current_line_whitespace_len = 0; - while(current_line_whitespace_len < text[cursor.line].length()) { - CharType c = text[cursor.line][current_line_whitespace_len]; - if(c != '\t' && c != ' ') - break; - current_line_whitespace_len++; - } - - if(cursor_get_column() == current_line_whitespace_len) + if (k.mod.command) { + cursor_set_line(0); cursor_set_column(0); - else - cursor_set_column(current_line_whitespace_len); + } + else { + // compute whitespace symbols seq length + int current_line_whitespace_len = 0; + while( current_line_whitespace_len < text[cursor.line].length() ) { + CharType c = text[cursor.line][current_line_whitespace_len]; + if( c != '\t' && c != ' ' ) + break; + current_line_whitespace_len++; + } - if (k.mod.command) - cursor_set_line(0); + if( cursor_get_column() == current_line_whitespace_len ) + cursor_set_column(0); + else + cursor_set_column(current_line_whitespace_len); + } if (k.mod.shift) _post_shift_selection(); + else if(k.mod.command || k.mod.control) + deselect(); _cancel_completion(); completion_hint=""; @@ -2481,6 +2488,8 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) { if (k.mod.shift) _post_shift_selection(); + else if(k.mod.command || k.mod.control) + deselect(); } break; #else @@ -2495,6 +2504,8 @@ void TextEdit::_gui_input(const InputEvent& p_gui_input) { if (k.mod.shift) _post_shift_selection(); + else if(k.mod.command || k.mod.control) + deselect(); _cancel_completion(); completion_hint=""; @@ -4256,7 +4267,7 @@ void TextEdit::_update_completion_candidates() { //no completion here //print_line("cancel!"); cancel=true; - } if (inquote && first_quote!=-1) { + } else if (inquote && first_quote!=-1) { s=l.substr(first_quote,cofs-first_quote); //print_line("s: 1"+s); @@ -4609,90 +4620,90 @@ PopupMenu *TextEdit::get_menu() const { void TextEdit::_bind_methods() { - ClassDB::bind_method(_MD("_gui_input"),&TextEdit::_gui_input); - ClassDB::bind_method(_MD("_scroll_moved"),&TextEdit::_scroll_moved); - ClassDB::bind_method(_MD("_cursor_changed_emit"),&TextEdit::_cursor_changed_emit); - ClassDB::bind_method(_MD("_text_changed_emit"),&TextEdit::_text_changed_emit); - ClassDB::bind_method(_MD("_push_current_op"),&TextEdit::_push_current_op); - ClassDB::bind_method(_MD("_click_selection_held"),&TextEdit::_click_selection_held); - ClassDB::bind_method(_MD("_toggle_draw_caret"),&TextEdit::_toggle_draw_caret); + ClassDB::bind_method(D_METHOD("_gui_input"),&TextEdit::_gui_input); + ClassDB::bind_method(D_METHOD("_scroll_moved"),&TextEdit::_scroll_moved); + ClassDB::bind_method(D_METHOD("_cursor_changed_emit"),&TextEdit::_cursor_changed_emit); + ClassDB::bind_method(D_METHOD("_text_changed_emit"),&TextEdit::_text_changed_emit); + ClassDB::bind_method(D_METHOD("_push_current_op"),&TextEdit::_push_current_op); + ClassDB::bind_method(D_METHOD("_click_selection_held"),&TextEdit::_click_selection_held); + ClassDB::bind_method(D_METHOD("_toggle_draw_caret"),&TextEdit::_toggle_draw_caret); BIND_CONSTANT( SEARCH_MATCH_CASE ); BIND_CONSTANT( SEARCH_WHOLE_WORDS ); BIND_CONSTANT( SEARCH_BACKWARDS ); /* - ClassDB::bind_method(_MD("delete_char"),&TextEdit::delete_char); - ClassDB::bind_method(_MD("delete_line"),&TextEdit::delete_line); + ClassDB::bind_method(D_METHOD("delete_char"),&TextEdit::delete_char); + ClassDB::bind_method(D_METHOD("delete_line"),&TextEdit::delete_line); */ - ClassDB::bind_method(_MD("set_text","text"),&TextEdit::set_text); - ClassDB::bind_method(_MD("insert_text_at_cursor","text"),&TextEdit::insert_text_at_cursor); + ClassDB::bind_method(D_METHOD("set_text","text"),&TextEdit::set_text); + ClassDB::bind_method(D_METHOD("insert_text_at_cursor","text"),&TextEdit::insert_text_at_cursor); - ClassDB::bind_method(_MD("get_line_count"),&TextEdit::get_line_count); - ClassDB::bind_method(_MD("get_text"),&TextEdit::get_text); - ClassDB::bind_method(_MD("get_line","line"),&TextEdit::get_line); + ClassDB::bind_method(D_METHOD("get_line_count"),&TextEdit::get_line_count); + ClassDB::bind_method(D_METHOD("get_text"),&TextEdit::get_text); + ClassDB::bind_method(D_METHOD("get_line","line"),&TextEdit::get_line); - ClassDB::bind_method(_MD("cursor_set_column","column","adjust_viewport"),&TextEdit::cursor_set_column,DEFVAL(false)); - ClassDB::bind_method(_MD("cursor_set_line","line","adjust_viewport"),&TextEdit::cursor_set_line,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("cursor_set_column","column","adjust_viewport"),&TextEdit::cursor_set_column,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("cursor_set_line","line","adjust_viewport"),&TextEdit::cursor_set_line,DEFVAL(false)); - ClassDB::bind_method(_MD("cursor_get_column"),&TextEdit::cursor_get_column); - ClassDB::bind_method(_MD("cursor_get_line"),&TextEdit::cursor_get_line); - ClassDB::bind_method(_MD("cursor_set_blink_enabled", "enable"),&TextEdit::cursor_set_blink_enabled); - ClassDB::bind_method(_MD("cursor_get_blink_enabled"),&TextEdit::cursor_get_blink_enabled); - ClassDB::bind_method(_MD("cursor_set_blink_speed", "blink_speed"),&TextEdit::cursor_set_blink_speed); - ClassDB::bind_method(_MD("cursor_get_blink_speed"),&TextEdit::cursor_get_blink_speed); - ClassDB::bind_method(_MD("cursor_set_block_mode", "enable"), &TextEdit::cursor_set_block_mode); - ClassDB::bind_method(_MD("cursor_is_block_mode"), &TextEdit::cursor_is_block_mode); + ClassDB::bind_method(D_METHOD("cursor_get_column"),&TextEdit::cursor_get_column); + ClassDB::bind_method(D_METHOD("cursor_get_line"),&TextEdit::cursor_get_line); + ClassDB::bind_method(D_METHOD("cursor_set_blink_enabled", "enable"),&TextEdit::cursor_set_blink_enabled); + ClassDB::bind_method(D_METHOD("cursor_get_blink_enabled"),&TextEdit::cursor_get_blink_enabled); + ClassDB::bind_method(D_METHOD("cursor_set_blink_speed", "blink_speed"),&TextEdit::cursor_set_blink_speed); + ClassDB::bind_method(D_METHOD("cursor_get_blink_speed"),&TextEdit::cursor_get_blink_speed); + ClassDB::bind_method(D_METHOD("cursor_set_block_mode", "enable"), &TextEdit::cursor_set_block_mode); + ClassDB::bind_method(D_METHOD("cursor_is_block_mode"), &TextEdit::cursor_is_block_mode); - ClassDB::bind_method(_MD("set_readonly","enable"),&TextEdit::set_readonly); - ClassDB::bind_method(_MD("set_wrap","enable"),&TextEdit::set_wrap); - ClassDB::bind_method(_MD("set_max_chars","amount"),&TextEdit::set_max_chars); + ClassDB::bind_method(D_METHOD("set_readonly","enable"),&TextEdit::set_readonly); + ClassDB::bind_method(D_METHOD("set_wrap","enable"),&TextEdit::set_wrap); + ClassDB::bind_method(D_METHOD("set_max_chars","amount"),&TextEdit::set_max_chars); - ClassDB::bind_method(_MD("cut"),&TextEdit::cut); - ClassDB::bind_method(_MD("copy"),&TextEdit::copy); - ClassDB::bind_method(_MD("paste"),&TextEdit::paste); - ClassDB::bind_method(_MD("select_all"),&TextEdit::select_all); - ClassDB::bind_method(_MD("select","from_line","from_column","to_line","to_column"),&TextEdit::select); + ClassDB::bind_method(D_METHOD("cut"),&TextEdit::cut); + ClassDB::bind_method(D_METHOD("copy"),&TextEdit::copy); + ClassDB::bind_method(D_METHOD("paste"),&TextEdit::paste); + ClassDB::bind_method(D_METHOD("select_all"),&TextEdit::select_all); + ClassDB::bind_method(D_METHOD("select","from_line","from_column","to_line","to_column"),&TextEdit::select); - ClassDB::bind_method(_MD("is_selection_active"),&TextEdit::is_selection_active); - ClassDB::bind_method(_MD("get_selection_from_line"),&TextEdit::get_selection_from_line); - ClassDB::bind_method(_MD("get_selection_from_column"),&TextEdit::get_selection_from_column); - ClassDB::bind_method(_MD("get_selection_to_line"),&TextEdit::get_selection_to_line); - ClassDB::bind_method(_MD("get_selection_to_column"),&TextEdit::get_selection_to_column); - ClassDB::bind_method(_MD("get_selection_text"),&TextEdit::get_selection_text); - ClassDB::bind_method(_MD("get_word_under_cursor"),&TextEdit::get_word_under_cursor); - ClassDB::bind_method(_MD("search","flags","from_line","from_column","to_line","to_column"),&TextEdit::_search_bind); + ClassDB::bind_method(D_METHOD("is_selection_active"),&TextEdit::is_selection_active); + ClassDB::bind_method(D_METHOD("get_selection_from_line"),&TextEdit::get_selection_from_line); + ClassDB::bind_method(D_METHOD("get_selection_from_column"),&TextEdit::get_selection_from_column); + ClassDB::bind_method(D_METHOD("get_selection_to_line"),&TextEdit::get_selection_to_line); + ClassDB::bind_method(D_METHOD("get_selection_to_column"),&TextEdit::get_selection_to_column); + ClassDB::bind_method(D_METHOD("get_selection_text"),&TextEdit::get_selection_text); + ClassDB::bind_method(D_METHOD("get_word_under_cursor"),&TextEdit::get_word_under_cursor); + ClassDB::bind_method(D_METHOD("search","flags","from_line","from_column","to_line","to_column"),&TextEdit::_search_bind); - ClassDB::bind_method(_MD("undo"),&TextEdit::undo); - ClassDB::bind_method(_MD("redo"),&TextEdit::redo); - ClassDB::bind_method(_MD("clear_undo_history"),&TextEdit::clear_undo_history); + ClassDB::bind_method(D_METHOD("undo"),&TextEdit::undo); + ClassDB::bind_method(D_METHOD("redo"),&TextEdit::redo); + ClassDB::bind_method(D_METHOD("clear_undo_history"),&TextEdit::clear_undo_history); - ClassDB::bind_method(_MD("set_show_line_numbers", "enable"), &TextEdit::set_show_line_numbers); - ClassDB::bind_method(_MD("is_show_line_numbers_enabled"), &TextEdit::is_show_line_numbers_enabled); + ClassDB::bind_method(D_METHOD("set_show_line_numbers", "enable"), &TextEdit::set_show_line_numbers); + ClassDB::bind_method(D_METHOD("is_show_line_numbers_enabled"), &TextEdit::is_show_line_numbers_enabled); - ClassDB::bind_method(_MD("set_highlight_all_occurrences", "enable"), &TextEdit::set_highlight_all_occurrences); - ClassDB::bind_method(_MD("is_highlight_all_occurrences_enabled"), &TextEdit::is_highlight_all_occurrences_enabled); + ClassDB::bind_method(D_METHOD("set_highlight_all_occurrences", "enable"), &TextEdit::set_highlight_all_occurrences); + ClassDB::bind_method(D_METHOD("is_highlight_all_occurrences_enabled"), &TextEdit::is_highlight_all_occurrences_enabled); - ClassDB::bind_method(_MD("set_syntax_coloring","enable"),&TextEdit::set_syntax_coloring); - ClassDB::bind_method(_MD("is_syntax_coloring_enabled"),&TextEdit::is_syntax_coloring_enabled); + ClassDB::bind_method(D_METHOD("set_syntax_coloring","enable"),&TextEdit::set_syntax_coloring); + ClassDB::bind_method(D_METHOD("is_syntax_coloring_enabled"),&TextEdit::is_syntax_coloring_enabled); - ClassDB::bind_method(_MD("add_keyword_color","keyword","color"),&TextEdit::add_keyword_color); - ClassDB::bind_method(_MD("add_color_region","begin_key","end_key","color","line_only"),&TextEdit::add_color_region,DEFVAL(false)); - ClassDB::bind_method(_MD("clear_colors"),&TextEdit::clear_colors); - ClassDB::bind_method(_MD("menu_option"),&TextEdit::menu_option); - ClassDB::bind_method(_MD("get_menu:PopupMenu"),&TextEdit::get_menu); + ClassDB::bind_method(D_METHOD("add_keyword_color","keyword","color"),&TextEdit::add_keyword_color); + ClassDB::bind_method(D_METHOD("add_color_region","begin_key","end_key","color","line_only"),&TextEdit::add_color_region,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("clear_colors"),&TextEdit::clear_colors); + ClassDB::bind_method(D_METHOD("menu_option"),&TextEdit::menu_option); + ClassDB::bind_method(D_METHOD("get_menu:PopupMenu"),&TextEdit::get_menu); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "syntax_highlighting"), _SCS("set_syntax_coloring"), _SCS("is_syntax_coloring_enabled")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_line_numbers"), _SCS("set_show_line_numbers"), _SCS("is_show_line_numbers_enabled")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_all_occurrences"), _SCS("set_highlight_all_occurrences"), _SCS("is_highlight_all_occurrences_enabled")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "syntax_highlighting"), "set_syntax_coloring", "is_syntax_coloring_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_line_numbers"), "set_show_line_numbers", "is_show_line_numbers_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_all_occurrences"), "set_highlight_all_occurrences", "is_highlight_all_occurrences_enabled"); ADD_GROUP("Caret","caret_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_block_mode"), _SCS("cursor_set_block_mode"), _SCS("cursor_is_block_mode")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled")); - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_block_mode"), "cursor_set_block_mode", "cursor_is_block_mode"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_blink"), "cursor_set_blink_enabled", "cursor_get_blink_enabled"); + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), "cursor_set_blink_speed","cursor_get_blink_speed") ; ADD_SIGNAL(MethodInfo("cursor_changed")); ADD_SIGNAL(MethodInfo("text_changed")); diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp index 03e37e9d9f..2f10de054a 100644 --- a/scene/gui/texture_button.cpp +++ b/scene/gui/texture_button.cpp @@ -28,40 +28,35 @@ /*************************************************************************/ #include "texture_button.h" - Size2 TextureButton::get_minimum_size() const { - Size2 rscale; - if (normal.is_null()) { - if (pressed.is_null()) { - if (hover.is_null()) - if (click_mask.is_null()) - rscale= Size2(); + Size2 rscale = Control::get_minimum_size(); + + if (!expand) { + if (normal.is_null()) { + if (pressed.is_null()) { + if (hover.is_null()) + if (click_mask.is_null()) + rscale= Size2(); + else + rscale= click_mask->get_size(); else - rscale= click_mask->get_size(); - else - rscale= hover->get_size(); - } else - rscale=pressed->get_size(); + rscale= hover->get_size(); + } else + rscale=pressed->get_size(); - } else - rscale= normal->get_size(); + } else + rscale= normal->get_size(); + } - return rscale*scale.abs(); + return rscale.abs(); } - bool TextureButton::has_point(const Point2& p_point) const { - if (scale[0] == 0 || scale[1] == 0) { - return false; - } - - Point2 ppos = p_point/scale.abs(); - if (click_mask.is_valid()) { - Point2i p =ppos; + Point2i p =p_point; if (p.x<0 || p.x>=click_mask->get_size().width || p.y<0 || p.y>=click_mask->get_size().height) return false; @@ -119,47 +114,107 @@ void TextureButton::_notification(int p_what) { } if (texdraw.is_valid()) { - Rect2 drect(Point2(),texdraw->get_size()*scale); - draw_texture_rect(texdraw,drect,false); - + Point2 ofs; + Size2 size = texdraw->get_size(); + Rect2 tex_regin = Rect2(Point2(), texdraw->get_size()); + bool tile = false; + if (expand) { + switch (stretch_mode) { + case STRETCH_KEEP: + size = texdraw->get_size(); + break; + case STRETCH_SCALE: + size = get_size(); + break; + case STRETCH_TILE: + size = get_size(); + tile = true; + break; + case STRETCH_KEEP_CENTERED: + ofs = (get_size() - texdraw->get_size())/2; + size = texdraw->get_size(); + break; + case STRETCH_KEEP_ASPECT_CENTERED: + case STRETCH_KEEP_ASPECT: { + Size2 _size=get_size(); + float tex_width = texdraw->get_width() * _size.height / texdraw->get_height(); + float tex_height = _size.height; + + if (tex_width > _size.width) { + tex_width = _size.width; + tex_height = texdraw->get_height() * tex_width / texdraw->get_width(); + } + + if (stretch_mode==STRETCH_KEEP_ASPECT_CENTERED) { + ofs.x = (_size.width - tex_width)/2; + ofs.y = (_size.height - tex_height)/2; + } + size.width = tex_width; + size.height = tex_height; + } break; + case STRETCH_KEEP_ASPECT_COVERED:{ + size = get_size(); + Size2 tex_size = texdraw->get_size(); + Size2 scaleSize(size.width/tex_size.width, size.height/tex_size.height); + float scale = scaleSize.width > scaleSize.height? scaleSize.width : scaleSize.height; + Size2 scaledTexSize = tex_size * scale; + Point2 ofs = ((scaledTexSize - size) / scale).abs() / 2.0f; + tex_regin = Rect2(ofs, size/scale); + } break; + } + } + if (tile) + draw_texture_rect(texdraw,Rect2(ofs,size),tile); + else + draw_texture_rect_region(texdraw, Rect2(ofs, size), tex_regin); } if (has_focus() && focused.is_valid()) { - Rect2 drect(Point2(),focused->get_size()*scale); + Rect2 drect(Point2(), get_size()); draw_texture_rect(focused,drect,false); }; - } break; } } void TextureButton::_bind_methods() { - ClassDB::bind_method(_MD("set_normal_texture","texture:Texture"),&TextureButton::set_normal_texture); - ClassDB::bind_method(_MD("set_pressed_texture","texture:Texture"),&TextureButton::set_pressed_texture); - ClassDB::bind_method(_MD("set_hover_texture","texture:Texture"),&TextureButton::set_hover_texture); - ClassDB::bind_method(_MD("set_disabled_texture","texture:Texture"),&TextureButton::set_disabled_texture); - ClassDB::bind_method(_MD("set_focused_texture","texture:Texture"),&TextureButton::set_focused_texture); - ClassDB::bind_method(_MD("set_click_mask","mask:BitMap"),&TextureButton::set_click_mask); - ClassDB::bind_method(_MD("set_texture_scale","scale"),&TextureButton::set_texture_scale); - - ClassDB::bind_method(_MD("get_normal_texture:Texture"),&TextureButton::get_normal_texture); - ClassDB::bind_method(_MD("get_pressed_texture:Texture"),&TextureButton::get_pressed_texture); - ClassDB::bind_method(_MD("get_hover_texture:Texture"),&TextureButton::get_hover_texture); - ClassDB::bind_method(_MD("get_disabled_texture:Texture"),&TextureButton::get_disabled_texture); - ClassDB::bind_method(_MD("get_focused_texture:Texture"),&TextureButton::get_focused_texture); - ClassDB::bind_method(_MD("get_click_mask:BitMap"),&TextureButton::get_click_mask); - ClassDB::bind_method(_MD("get_texture_scale"),&TextureButton::get_texture_scale); + ClassDB::bind_method(D_METHOD("set_normal_texture","texture:Texture"),&TextureButton::set_normal_texture); + ClassDB::bind_method(D_METHOD("set_pressed_texture","texture:Texture"),&TextureButton::set_pressed_texture); + ClassDB::bind_method(D_METHOD("set_hover_texture","texture:Texture"),&TextureButton::set_hover_texture); + ClassDB::bind_method(D_METHOD("set_disabled_texture","texture:Texture"),&TextureButton::set_disabled_texture); + ClassDB::bind_method(D_METHOD("set_focused_texture","texture:Texture"),&TextureButton::set_focused_texture); + ClassDB::bind_method(D_METHOD("set_click_mask","mask:BitMap"),&TextureButton::set_click_mask); + ClassDB::bind_method(D_METHOD("set_expand","p_expand"),&TextureButton::set_expand); + ClassDB::bind_method(D_METHOD("set_stretch_mode","p_mode"),&TextureButton::set_stretch_mode); + + ClassDB::bind_method(D_METHOD("get_normal_texture:Texture"),&TextureButton::get_normal_texture); + ClassDB::bind_method(D_METHOD("get_pressed_texture:Texture"),&TextureButton::get_pressed_texture); + ClassDB::bind_method(D_METHOD("get_hover_texture:Texture"),&TextureButton::get_hover_texture); + ClassDB::bind_method(D_METHOD("get_disabled_texture:Texture"),&TextureButton::get_disabled_texture); + ClassDB::bind_method(D_METHOD("get_focused_texture:Texture"),&TextureButton::get_focused_texture); + ClassDB::bind_method(D_METHOD("get_click_mask:BitMap"),&TextureButton::get_click_mask); + ClassDB::bind_method(D_METHOD("get_expand"),&TextureButton::get_expand); + ClassDB::bind_method(D_METHOD("get_stretch_mode"),&TextureButton::get_stretch_mode); ADD_GROUP("Textures","texture_"); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_normal_texture"), _SCS("get_normal_texture")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_pressed",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_pressed_texture"), _SCS("get_pressed_texture")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_hover",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_hover_texture"), _SCS("get_hover_texture")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_disabled",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_disabled_texture"), _SCS("get_disabled_texture")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_focused",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_focused_texture"), _SCS("get_focused_texture")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_click_mask",PROPERTY_HINT_RESOURCE_TYPE,"BitMap"), _SCS("set_click_mask"), _SCS("get_click_mask")) ; - ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2,"texture_scale",PROPERTY_HINT_RANGE,"0.01,1024,0.01"), _SCS("set_texture_scale"), _SCS("get_texture_scale")); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), "set_normal_texture", "get_normal_texture"); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_pressed",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), "set_pressed_texture", "get_pressed_texture"); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_hover",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), "set_hover_texture", "get_hover_texture"); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_disabled",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), "set_disabled_texture", "get_disabled_texture"); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_focused",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), "set_focused_texture", "get_focused_texture"); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_click_mask",PROPERTY_HINT_RESOURCE_TYPE,"BitMap"), "set_click_mask", "get_click_mask") ; + ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL,"expand",PROPERTY_HINT_RESOURCE_TYPE,"bool"), "set_expand", "get_expand") ; + ADD_PROPERTYNO(PropertyInfo(Variant::INT,"stretch_mode",PROPERTY_HINT_ENUM,"Scale,Tile,Keep,Keep Centered,Keep Aspect,Keep Aspect Centered,Keep Aspect Covered"), "set_stretch_mode", "get_stretch_mode"); + + BIND_CONSTANT(STRETCH_SCALE); + BIND_CONSTANT(STRETCH_TILE); + BIND_CONSTANT(STRETCH_KEEP); + BIND_CONSTANT(STRETCH_KEEP_CENTERED); + BIND_CONSTANT(STRETCH_KEEP_ASPECT); + BIND_CONSTANT(STRETCH_KEEP_ASPECT_CENTERED); + BIND_CONSTANT(STRETCH_KEEP_ASPECT_COVERED); } @@ -227,19 +282,26 @@ void TextureButton::set_focused_texture(const Ref<Texture>& p_focused) { focused = p_focused; }; -void TextureButton::set_texture_scale(Size2 p_scale) { +bool TextureButton::get_expand() const { + return expand; +} - scale=p_scale; +void TextureButton::set_expand(bool p_expand) { + expand = p_expand; minimum_size_changed(); update(); } -Size2 TextureButton::get_texture_scale() const{ +void TextureButton::set_stretch_mode(StretchMode p_mode) { + stretch_mode = p_mode; + update(); +} - return scale; +TextureButton::StretchMode TextureButton::get_stretch_mode() const { + return stretch_mode; } TextureButton::TextureButton() { - scale=Size2(1.0, 1.0); - + expand = false; + stretch_mode = STRETCH_SCALE; } diff --git a/scene/gui/texture_button.h b/scene/gui/texture_button.h index ef4d4d5b5b..64103860bf 100644 --- a/scene/gui/texture_button.h +++ b/scene/gui/texture_button.h @@ -35,18 +35,31 @@ class TextureButton : public BaseButton { GDCLASS( TextureButton, BaseButton ); +public: + enum StretchMode { + STRETCH_SCALE, + STRETCH_TILE, + STRETCH_KEEP, + STRETCH_KEEP_CENTERED, + STRETCH_KEEP_ASPECT, + STRETCH_KEEP_ASPECT_CENTERED, + STRETCH_KEEP_ASPECT_COVERED, + }; + +private: Ref<Texture> normal; Ref<Texture> pressed; Ref<Texture> hover; Ref<Texture> disabled; Ref<Texture> focused; Ref<BitMap> click_mask; - Size2 scale; + bool expand; + StretchMode stretch_mode; protected: - virtual bool has_point(const Point2& p_point) const; virtual Size2 get_minimum_size() const; + virtual bool has_point(const Point2& p_point) const; void _notification(int p_what); static void _bind_methods(); @@ -66,10 +79,15 @@ public: Ref<Texture> get_focused_texture() const; Ref<BitMap> get_click_mask() const; - void set_texture_scale(Size2 p_scale); - Size2 get_texture_scale() const; + bool get_expand() const; + void set_expand(bool p_expand); + + void set_stretch_mode(StretchMode stretch_mode); + StretchMode get_stretch_mode() const; TextureButton(); }; + +VARIANT_ENUM_CAST( TextureButton::StretchMode ); #endif // TEXTURE_BUTTON_H diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index 7d8373976b..3897647502 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -257,36 +257,36 @@ Point2 TextureProgress::get_radial_center_offset() void TextureProgress::_bind_methods() { - ClassDB::bind_method(_MD("set_under_texture","tex"),&TextureProgress::set_under_texture); - ClassDB::bind_method(_MD("get_under_texture"),&TextureProgress::get_under_texture); + ClassDB::bind_method(D_METHOD("set_under_texture","tex"),&TextureProgress::set_under_texture); + ClassDB::bind_method(D_METHOD("get_under_texture"),&TextureProgress::get_under_texture); - ClassDB::bind_method(_MD("set_progress_texture","tex"),&TextureProgress::set_progress_texture); - ClassDB::bind_method(_MD("get_progress_texture"),&TextureProgress::get_progress_texture); + ClassDB::bind_method(D_METHOD("set_progress_texture","tex"),&TextureProgress::set_progress_texture); + ClassDB::bind_method(D_METHOD("get_progress_texture"),&TextureProgress::get_progress_texture); - ClassDB::bind_method(_MD("set_over_texture","tex"),&TextureProgress::set_over_texture); - ClassDB::bind_method(_MD("get_over_texture"),&TextureProgress::get_over_texture); + ClassDB::bind_method(D_METHOD("set_over_texture","tex"),&TextureProgress::set_over_texture); + ClassDB::bind_method(D_METHOD("get_over_texture"),&TextureProgress::get_over_texture); - ClassDB::bind_method(_MD("set_fill_mode","mode"),&TextureProgress::set_fill_mode); - ClassDB::bind_method(_MD("get_fill_mode"), &TextureProgress::get_fill_mode); + ClassDB::bind_method(D_METHOD("set_fill_mode","mode"),&TextureProgress::set_fill_mode); + ClassDB::bind_method(D_METHOD("get_fill_mode"), &TextureProgress::get_fill_mode); - ClassDB::bind_method(_MD("set_radial_initial_angle","mode"),&TextureProgress::set_radial_initial_angle); - ClassDB::bind_method(_MD("get_radial_initial_angle"), &TextureProgress::get_radial_initial_angle); + ClassDB::bind_method(D_METHOD("set_radial_initial_angle","mode"),&TextureProgress::set_radial_initial_angle); + ClassDB::bind_method(D_METHOD("get_radial_initial_angle"), &TextureProgress::get_radial_initial_angle); - ClassDB::bind_method(_MD("set_radial_center_offset","mode"),&TextureProgress::set_radial_center_offset); - ClassDB::bind_method(_MD("get_radial_center_offset"), &TextureProgress::get_radial_center_offset); + ClassDB::bind_method(D_METHOD("set_radial_center_offset","mode"),&TextureProgress::set_radial_center_offset); + ClassDB::bind_method(D_METHOD("get_radial_center_offset"), &TextureProgress::get_radial_center_offset); - ClassDB::bind_method(_MD("set_fill_degrees","mode"),&TextureProgress::set_fill_degrees); - ClassDB::bind_method(_MD("get_fill_degrees"), &TextureProgress::get_fill_degrees); + ClassDB::bind_method(D_METHOD("set_fill_degrees","mode"),&TextureProgress::set_fill_degrees); + ClassDB::bind_method(D_METHOD("get_fill_degrees"), &TextureProgress::get_fill_degrees); ADD_GROUP("Textures","texture_"); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture_under",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_under_texture"),_SCS("get_under_texture")); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture_over",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_over_texture"),_SCS("get_over_texture")); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture_progress",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_progress_texture"),_SCS("get_progress_texture")); - ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"fill_mode",PROPERTY_HINT_ENUM,"Left to Right,Right to Left,Top to Bottom,Bottom to Top,Clockwise,Counter Clockwise"),_SCS("set_fill_mode"),_SCS("get_fill_mode")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture_under",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_under_texture","get_under_texture"); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture_over",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_over_texture","get_over_texture"); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture_progress",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_progress_texture","get_progress_texture"); + ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"fill_mode",PROPERTY_HINT_ENUM,"Left to Right,Right to Left,Top to Bottom,Bottom to Top,Clockwise,Counter Clockwise"),"set_fill_mode","get_fill_mode"); ADD_GROUP("Radial Fill","radial_"); - ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"radial_initial_angle",PROPERTY_HINT_RANGE,"0.0,360.0,0.1,slider"),_SCS("set_radial_initial_angle"),_SCS("get_radial_initial_angle")); - ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"radial_fill_degrees",PROPERTY_HINT_RANGE,"0.0,360.0,0.1,slider"),_SCS("set_fill_degrees"),_SCS("get_fill_degrees")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"radial_center_offset"),_SCS("set_radial_center_offset"),_SCS("get_radial_center_offset")); + ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"radial_initial_angle",PROPERTY_HINT_RANGE,"0.0,360.0,0.1,slider"),"set_radial_initial_angle","get_radial_initial_angle"); + ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"radial_fill_degrees",PROPERTY_HINT_RANGE,"0.0,360.0,0.1,slider"),"set_fill_degrees","get_fill_degrees"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"radial_center_offset"),"set_radial_center_offset","get_radial_center_offset"); BIND_CONSTANT( FILL_LEFT_TO_RIGHT ); BIND_CONSTANT( FILL_RIGHT_TO_LEFT ); diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp index 6a4b59c5ec..f2fe3eae12 100644 --- a/scene/gui/texture_rect.cpp +++ b/scene/gui/texture_rect.cpp @@ -79,7 +79,15 @@ void TextureRect::_notification(int p_what) { draw_texture_rect(texture,Rect2(ofs_x,ofs_y,tex_width,tex_height)); } break; - + case STRETCH_KEEP_ASPECT_COVERED: { + Size2 size = get_size(); + Size2 tex_size = texture->get_size(); + Size2 scaleSize(size.width/tex_size.width, size.height/tex_size.height); + float scale = scaleSize.width > scaleSize.height? scaleSize.width : scaleSize.height; + Size2 scaledTexSize = tex_size * scale; + Point2 ofs = ((scaledTexSize - size) / scale).abs() / 2.0f; + draw_texture_rect_region(texture, Rect2(Point2(), size), Rect2(ofs, size/scale)); + } break; } } @@ -95,16 +103,16 @@ Size2 TextureRect::get_minimum_size() const { void TextureRect::_bind_methods() { - ClassDB::bind_method(_MD("set_texture","texture"), & TextureRect::set_texture ); - ClassDB::bind_method(_MD("get_texture"), & TextureRect::get_texture ); - ClassDB::bind_method(_MD("set_expand","enable"), & TextureRect::set_expand ); - ClassDB::bind_method(_MD("has_expand"), & TextureRect::has_expand ); - ClassDB::bind_method(_MD("set_stretch_mode","stretch_mode"), & TextureRect::set_stretch_mode ); - ClassDB::bind_method(_MD("get_stretch_mode"), & TextureRect::get_stretch_mode ); + ClassDB::bind_method(D_METHOD("set_texture","texture"), & TextureRect::set_texture ); + ClassDB::bind_method(D_METHOD("get_texture"), & TextureRect::get_texture ); + ClassDB::bind_method(D_METHOD("set_expand","enable"), & TextureRect::set_expand ); + ClassDB::bind_method(D_METHOD("has_expand"), & TextureRect::has_expand ); + ClassDB::bind_method(D_METHOD("set_stretch_mode","stretch_mode"), & TextureRect::set_stretch_mode ); + ClassDB::bind_method(D_METHOD("get_stretch_mode"), & TextureRect::get_stretch_mode ); - ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), _SCS("set_texture"),_SCS("get_texture") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "expand" ), _SCS("set_expand"),_SCS("has_expand") ); - ADD_PROPERTYNO( PropertyInfo( Variant::INT, "stretch_mode",PROPERTY_HINT_ENUM,"Scale On Expand (Compat),Scale,Tile,Keep,Keep Centered,Keep Aspect,Keep Aspect Centered"), _SCS("set_stretch_mode"),_SCS("get_stretch_mode") ); + ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture"); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "expand" ), "set_expand","has_expand"); + ADD_PROPERTYNO( PropertyInfo( Variant::INT, "stretch_mode",PROPERTY_HINT_ENUM,"Scale On Expand (Compat),Scale,Tile,Keep,Keep Centered,Keep Aspect,Keep Aspect Centered,Keep Aspect Covered"), "set_stretch_mode", "get_stretch_mode"); BIND_CONSTANT( STRETCH_SCALE_ON_EXPAND ); BIND_CONSTANT( STRETCH_SCALE ); @@ -113,7 +121,7 @@ void TextureRect::_bind_methods() { BIND_CONSTANT( STRETCH_KEEP_CENTERED ); BIND_CONSTANT( STRETCH_KEEP_ASPECT ); BIND_CONSTANT( STRETCH_KEEP_ASPECT_CENTERED ); - + BIND_CONSTANT( STRETCH_KEEP_ASPECT_COVERED ); } diff --git a/scene/gui/texture_rect.h b/scene/gui/texture_rect.h index e95d742759..0d72458909 100644 --- a/scene/gui/texture_rect.h +++ b/scene/gui/texture_rect.h @@ -45,7 +45,7 @@ public: STRETCH_KEEP_CENTERED, STRETCH_KEEP_ASPECT, STRETCH_KEEP_ASPECT_CENTERED, - + STRETCH_KEEP_ASPECT_COVERED, }; private: bool expand; diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 1a7392f27e..292efdcc01 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -30,7 +30,7 @@ #include "print_string.h" #include "os/os.h" #include "os/keyboard.h" -#include "globals.h" +#include "global_config.h" #include "os/input.h" #include "scene/main/viewport.h" @@ -657,76 +657,76 @@ Color TreeItem::get_custom_bg_color(int p_column) const { void TreeItem::_bind_methods() { - ClassDB::bind_method(_MD("set_cell_mode","column","mode"),&TreeItem::set_cell_mode); - ClassDB::bind_method(_MD("get_cell_mode","column"),&TreeItem::get_cell_mode); + ClassDB::bind_method(D_METHOD("set_cell_mode","column","mode"),&TreeItem::set_cell_mode); + ClassDB::bind_method(D_METHOD("get_cell_mode","column"),&TreeItem::get_cell_mode); - ClassDB::bind_method(_MD("set_checked","column","checked"),&TreeItem::set_checked); - ClassDB::bind_method(_MD("is_checked","column"),&TreeItem::is_checked); + ClassDB::bind_method(D_METHOD("set_checked","column","checked"),&TreeItem::set_checked); + ClassDB::bind_method(D_METHOD("is_checked","column"),&TreeItem::is_checked); - ClassDB::bind_method(_MD("set_text","column","text"),&TreeItem::set_text); - ClassDB::bind_method(_MD("get_text","column"),&TreeItem::get_text); + ClassDB::bind_method(D_METHOD("set_text","column","text"),&TreeItem::set_text); + ClassDB::bind_method(D_METHOD("get_text","column"),&TreeItem::get_text); - ClassDB::bind_method(_MD("set_icon","column","texture:Texture"),&TreeItem::set_icon); - ClassDB::bind_method(_MD("get_icon:Texture","column"),&TreeItem::get_icon); + ClassDB::bind_method(D_METHOD("set_icon","column","texture:Texture"),&TreeItem::set_icon); + ClassDB::bind_method(D_METHOD("get_icon:Texture","column"),&TreeItem::get_icon); - ClassDB::bind_method(_MD("set_icon_region","column","region"),&TreeItem::set_icon_region); - ClassDB::bind_method(_MD("get_icon_region","column"),&TreeItem::get_icon_region); + ClassDB::bind_method(D_METHOD("set_icon_region","column","region"),&TreeItem::set_icon_region); + ClassDB::bind_method(D_METHOD("get_icon_region","column"),&TreeItem::get_icon_region); - ClassDB::bind_method(_MD("set_icon_max_width","column","width"),&TreeItem::set_icon_max_width); - ClassDB::bind_method(_MD("get_icon_max_width","column"),&TreeItem::get_icon_max_width); + ClassDB::bind_method(D_METHOD("set_icon_max_width","column","width"),&TreeItem::set_icon_max_width); + ClassDB::bind_method(D_METHOD("get_icon_max_width","column"),&TreeItem::get_icon_max_width); - ClassDB::bind_method(_MD("set_range","column","value"),&TreeItem::set_range); - ClassDB::bind_method(_MD("get_range","column"),&TreeItem::get_range); - ClassDB::bind_method(_MD("set_range_config","column","min","max","step","expr"),&TreeItem::set_range_config,DEFVAL(false)); - ClassDB::bind_method(_MD("get_range_config","column"),&TreeItem::_get_range_config); + ClassDB::bind_method(D_METHOD("set_range","column","value"),&TreeItem::set_range); + ClassDB::bind_method(D_METHOD("get_range","column"),&TreeItem::get_range); + ClassDB::bind_method(D_METHOD("set_range_config","column","min","max","step","expr"),&TreeItem::set_range_config,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_range_config","column"),&TreeItem::_get_range_config); - ClassDB::bind_method(_MD("set_metadata","column","meta"),&TreeItem::set_metadata); - ClassDB::bind_method(_MD("get_metadata","column"),&TreeItem::get_metadata); + ClassDB::bind_method(D_METHOD("set_metadata","column","meta"),&TreeItem::set_metadata); + ClassDB::bind_method(D_METHOD("get_metadata","column"),&TreeItem::get_metadata); - ClassDB::bind_method(_MD("set_custom_draw","column","object","callback"),&TreeItem::set_custom_draw); + ClassDB::bind_method(D_METHOD("set_custom_draw","column","object","callback"),&TreeItem::set_custom_draw); - ClassDB::bind_method(_MD("set_collapsed","enable"),&TreeItem::set_collapsed); - ClassDB::bind_method(_MD("is_collapsed"),&TreeItem::is_collapsed); + ClassDB::bind_method(D_METHOD("set_collapsed","enable"),&TreeItem::set_collapsed); + ClassDB::bind_method(D_METHOD("is_collapsed"),&TreeItem::is_collapsed); - ClassDB::bind_method(_MD("get_next:TreeItem"),&TreeItem::get_next); - ClassDB::bind_method(_MD("get_prev:TreeItem"),&TreeItem::get_prev); - ClassDB::bind_method(_MD("get_parent:TreeItem"),&TreeItem::get_parent); - ClassDB::bind_method(_MD("get_children:TreeItem"),&TreeItem::get_children); + ClassDB::bind_method(D_METHOD("get_next:TreeItem"),&TreeItem::get_next); + ClassDB::bind_method(D_METHOD("get_prev:TreeItem"),&TreeItem::get_prev); + ClassDB::bind_method(D_METHOD("get_parent:TreeItem"),&TreeItem::get_parent); + ClassDB::bind_method(D_METHOD("get_children:TreeItem"),&TreeItem::get_children); - ClassDB::bind_method(_MD("get_next_visible:TreeItem"),&TreeItem::get_next_visible); - ClassDB::bind_method(_MD("get_prev_visible:TreeItem"),&TreeItem::get_prev_visible); + ClassDB::bind_method(D_METHOD("get_next_visible:TreeItem"),&TreeItem::get_next_visible); + ClassDB::bind_method(D_METHOD("get_prev_visible:TreeItem"),&TreeItem::get_prev_visible); - ClassDB::bind_method(_MD("remove_child:TreeItem","child"),&TreeItem::_remove_child); + ClassDB::bind_method(D_METHOD("remove_child:TreeItem","child"),&TreeItem::_remove_child); - ClassDB::bind_method(_MD("set_selectable","column","selectable"),&TreeItem::set_selectable); - ClassDB::bind_method(_MD("is_selectable","column"),&TreeItem::is_selectable); + ClassDB::bind_method(D_METHOD("set_selectable","column","selectable"),&TreeItem::set_selectable); + ClassDB::bind_method(D_METHOD("is_selectable","column"),&TreeItem::is_selectable); - ClassDB::bind_method(_MD("is_selected","column"),&TreeItem::is_selected); - ClassDB::bind_method(_MD("select","column"),&TreeItem::select); - ClassDB::bind_method(_MD("deselect","column"),&TreeItem::deselect); + ClassDB::bind_method(D_METHOD("is_selected","column"),&TreeItem::is_selected); + ClassDB::bind_method(D_METHOD("select","column"),&TreeItem::select); + ClassDB::bind_method(D_METHOD("deselect","column"),&TreeItem::deselect); - ClassDB::bind_method(_MD("set_editable","column","enabled"),&TreeItem::set_editable); - ClassDB::bind_method(_MD("is_editable","column"),&TreeItem::is_editable); + ClassDB::bind_method(D_METHOD("set_editable","column","enabled"),&TreeItem::set_editable); + ClassDB::bind_method(D_METHOD("is_editable","column"),&TreeItem::is_editable); - ClassDB::bind_method(_MD("set_custom_color","column","color"),&TreeItem::set_custom_color); - ClassDB::bind_method(_MD("clear_custom_color","column"),&TreeItem::clear_custom_color); + ClassDB::bind_method(D_METHOD("set_custom_color","column","color"),&TreeItem::set_custom_color); + ClassDB::bind_method(D_METHOD("clear_custom_color","column"),&TreeItem::clear_custom_color); - ClassDB::bind_method(_MD("set_custom_bg_color","column","color","just_outline"),&TreeItem::set_custom_bg_color,DEFVAL(false)); - ClassDB::bind_method(_MD("clear_custom_bg_color","column"),&TreeItem::clear_custom_bg_color); - ClassDB::bind_method(_MD("get_custom_bg_color","column"),&TreeItem::get_custom_bg_color); + ClassDB::bind_method(D_METHOD("set_custom_bg_color","column","color","just_outline"),&TreeItem::set_custom_bg_color,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("clear_custom_bg_color","column"),&TreeItem::clear_custom_bg_color); + ClassDB::bind_method(D_METHOD("get_custom_bg_color","column"),&TreeItem::get_custom_bg_color); - ClassDB::bind_method(_MD("add_button","column","button:Texture","button_idx","disabled"),&TreeItem::add_button,DEFVAL(-1),DEFVAL(false)); - ClassDB::bind_method(_MD("get_button_count","column"),&TreeItem::get_button_count); - ClassDB::bind_method(_MD("get_button:Texture","column","button_idx"),&TreeItem::get_button); - ClassDB::bind_method(_MD("set_button","column","button_idx","button:Texture"),&TreeItem::set_button); - ClassDB::bind_method(_MD("erase_button","column","button_idx"),&TreeItem::erase_button); - ClassDB::bind_method(_MD("is_button_disabled","column","button_idx"),&TreeItem::is_button_disabled); + ClassDB::bind_method(D_METHOD("add_button","column","button:Texture","button_idx","disabled"),&TreeItem::add_button,DEFVAL(-1),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_button_count","column"),&TreeItem::get_button_count); + ClassDB::bind_method(D_METHOD("get_button:Texture","column","button_idx"),&TreeItem::get_button); + ClassDB::bind_method(D_METHOD("set_button","column","button_idx","button:Texture"),&TreeItem::set_button); + ClassDB::bind_method(D_METHOD("erase_button","column","button_idx"),&TreeItem::erase_button); + ClassDB::bind_method(D_METHOD("is_button_disabled","column","button_idx"),&TreeItem::is_button_disabled); - ClassDB::bind_method(_MD("set_tooltip","column","tooltip"),&TreeItem::set_tooltip); - ClassDB::bind_method(_MD("get_tooltip","column"),&TreeItem::get_tooltip); + ClassDB::bind_method(D_METHOD("set_tooltip","column","tooltip"),&TreeItem::set_tooltip); + ClassDB::bind_method(D_METHOD("get_tooltip","column"),&TreeItem::get_tooltip); - ClassDB::bind_method(_MD("move_to_top"),&TreeItem::move_to_top); - ClassDB::bind_method(_MD("move_to_bottom"),&TreeItem::move_to_bottom); + ClassDB::bind_method(D_METHOD("move_to_top"),&TreeItem::move_to_top); + ClassDB::bind_method(D_METHOD("move_to_bottom"),&TreeItem::move_to_bottom); BIND_CONSTANT( CELL_MODE_STRING ); BIND_CONSTANT( CELL_MODE_CHECK ); @@ -1610,6 +1610,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_ cache.click_id=c.buttons[j].id; cache.click_item=p_item; cache.click_column=col; + cache.click_pos=get_global_mouse_pos()-get_global_pos(); update(); //emit_signal("button_pressed"); return -1; @@ -2390,6 +2391,8 @@ void Tree::_gui_input(InputEvent p_event) { if (cache.click_type==Cache::CLICK_BUTTON) { + // make sure in case of wrong reference after reconstructing whole TreeItems + cache.click_item=get_item_at_pos(cache.click_pos); emit_signal("button_pressed",cache.click_item,cache.click_column,cache.click_id); } @@ -2970,7 +2973,6 @@ void Tree::clear() { selected_item=NULL; edited_item=NULL; popup_edited_item=NULL; - selected_item=NULL; update(); }; @@ -3586,59 +3588,59 @@ bool Tree::get_allow_rmb_select() const{ void Tree::_bind_methods() { - ClassDB::bind_method(_MD("_range_click_timeout"),&Tree::_range_click_timeout); - ClassDB::bind_method(_MD("_gui_input"),&Tree::_gui_input); - ClassDB::bind_method(_MD("_popup_select"),&Tree::popup_select); - ClassDB::bind_method(_MD("_text_editor_enter"),&Tree::text_editor_enter); - ClassDB::bind_method(_MD("_text_editor_modal_close"),&Tree::_text_editor_modal_close); - ClassDB::bind_method(_MD("_value_editor_changed"),&Tree::value_editor_changed); - ClassDB::bind_method(_MD("_scroll_moved"),&Tree::_scroll_moved); + ClassDB::bind_method(D_METHOD("_range_click_timeout"),&Tree::_range_click_timeout); + ClassDB::bind_method(D_METHOD("_gui_input"),&Tree::_gui_input); + ClassDB::bind_method(D_METHOD("_popup_select"),&Tree::popup_select); + ClassDB::bind_method(D_METHOD("_text_editor_enter"),&Tree::text_editor_enter); + ClassDB::bind_method(D_METHOD("_text_editor_modal_close"),&Tree::_text_editor_modal_close); + ClassDB::bind_method(D_METHOD("_value_editor_changed"),&Tree::value_editor_changed); + ClassDB::bind_method(D_METHOD("_scroll_moved"),&Tree::_scroll_moved); - ClassDB::bind_method(_MD("clear"),&Tree::clear); - ClassDB::bind_method(_MD("create_item:TreeItem","parent:TreeItem"),&Tree::_create_item,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("clear"),&Tree::clear); + ClassDB::bind_method(D_METHOD("create_item:TreeItem","parent:TreeItem"),&Tree::_create_item,DEFVAL(Variant())); - ClassDB::bind_method(_MD("get_root:TreeItem"),&Tree::get_root); - ClassDB::bind_method(_MD("set_column_min_width","column","min_width"),&Tree::set_column_min_width); - ClassDB::bind_method(_MD("set_column_expand","column","expand"),&Tree::set_column_expand); - ClassDB::bind_method(_MD("get_column_width","column"),&Tree::get_column_width); + ClassDB::bind_method(D_METHOD("get_root:TreeItem"),&Tree::get_root); + ClassDB::bind_method(D_METHOD("set_column_min_width","column","min_width"),&Tree::set_column_min_width); + ClassDB::bind_method(D_METHOD("set_column_expand","column","expand"),&Tree::set_column_expand); + ClassDB::bind_method(D_METHOD("get_column_width","column"),&Tree::get_column_width); - ClassDB::bind_method(_MD("set_hide_root","enable"),&Tree::set_hide_root); - ClassDB::bind_method(_MD("get_next_selected:TreeItem","from:TreeItem"),&Tree::_get_next_selected); - ClassDB::bind_method(_MD("get_selected:TreeItem"),&Tree::get_selected); - ClassDB::bind_method(_MD("get_selected_column"),&Tree::get_selected_column); - ClassDB::bind_method(_MD("get_pressed_button"),&Tree::get_pressed_button); - ClassDB::bind_method(_MD("set_select_mode","mode"),&Tree::set_select_mode); + ClassDB::bind_method(D_METHOD("set_hide_root","enable"),&Tree::set_hide_root); + ClassDB::bind_method(D_METHOD("get_next_selected:TreeItem","from:TreeItem"),&Tree::_get_next_selected); + ClassDB::bind_method(D_METHOD("get_selected:TreeItem"),&Tree::get_selected); + ClassDB::bind_method(D_METHOD("get_selected_column"),&Tree::get_selected_column); + ClassDB::bind_method(D_METHOD("get_pressed_button"),&Tree::get_pressed_button); + ClassDB::bind_method(D_METHOD("set_select_mode","mode"),&Tree::set_select_mode); - ClassDB::bind_method(_MD("set_columns","amount"),&Tree::set_columns); - ClassDB::bind_method(_MD("get_columns"),&Tree::get_columns); + ClassDB::bind_method(D_METHOD("set_columns","amount"),&Tree::set_columns); + ClassDB::bind_method(D_METHOD("get_columns"),&Tree::get_columns); - ClassDB::bind_method(_MD("get_edited:TreeItem"),&Tree::get_edited); - ClassDB::bind_method(_MD("get_edited_column"),&Tree::get_edited_column); - ClassDB::bind_method(_MD("get_custom_popup_rect"),&Tree::get_custom_popup_rect); - ClassDB::bind_method(_MD("get_item_area_rect","item:TreeItem","column"),&Tree::_get_item_rect,DEFVAL(-1)); - ClassDB::bind_method(_MD("get_item_at_pos:TreeItem","pos"),&Tree::get_item_at_pos); - ClassDB::bind_method(_MD("get_column_at_pos","pos"),&Tree::get_column_at_pos); + ClassDB::bind_method(D_METHOD("get_edited:TreeItem"),&Tree::get_edited); + ClassDB::bind_method(D_METHOD("get_edited_column"),&Tree::get_edited_column); + ClassDB::bind_method(D_METHOD("get_custom_popup_rect"),&Tree::get_custom_popup_rect); + ClassDB::bind_method(D_METHOD("get_item_area_rect","item:TreeItem","column"),&Tree::_get_item_rect,DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("get_item_at_pos:TreeItem","pos"),&Tree::get_item_at_pos); + ClassDB::bind_method(D_METHOD("get_column_at_pos","pos"),&Tree::get_column_at_pos); - ClassDB::bind_method(_MD("ensure_cursor_is_visible"),&Tree::ensure_cursor_is_visible); + ClassDB::bind_method(D_METHOD("ensure_cursor_is_visible"),&Tree::ensure_cursor_is_visible); - ClassDB::bind_method(_MD("set_column_titles_visible","visible"),&Tree::set_column_titles_visible); - ClassDB::bind_method(_MD("are_column_titles_visible"),&Tree::are_column_titles_visible); + ClassDB::bind_method(D_METHOD("set_column_titles_visible","visible"),&Tree::set_column_titles_visible); + ClassDB::bind_method(D_METHOD("are_column_titles_visible"),&Tree::are_column_titles_visible); - ClassDB::bind_method(_MD("set_column_title","column","title"),&Tree::set_column_title); - ClassDB::bind_method(_MD("get_column_title","column"),&Tree::get_column_title); - ClassDB::bind_method(_MD("get_scroll"),&Tree::get_scroll); + ClassDB::bind_method(D_METHOD("set_column_title","column","title"),&Tree::set_column_title); + ClassDB::bind_method(D_METHOD("get_column_title","column"),&Tree::get_column_title); + ClassDB::bind_method(D_METHOD("get_scroll"),&Tree::get_scroll); - ClassDB::bind_method(_MD("set_hide_folding","hide"),&Tree::set_hide_folding); - ClassDB::bind_method(_MD("is_folding_hidden"),&Tree::is_folding_hidden); + ClassDB::bind_method(D_METHOD("set_hide_folding","hide"),&Tree::set_hide_folding); + ClassDB::bind_method(D_METHOD("is_folding_hidden"),&Tree::is_folding_hidden); - ClassDB::bind_method(_MD("set_drop_mode_flags","flags"),&Tree::set_drop_mode_flags); - ClassDB::bind_method(_MD("get_drop_mode_flags"),&Tree::get_drop_mode_flags); + ClassDB::bind_method(D_METHOD("set_drop_mode_flags","flags"),&Tree::set_drop_mode_flags); + ClassDB::bind_method(D_METHOD("get_drop_mode_flags"),&Tree::get_drop_mode_flags); - ClassDB::bind_method(_MD("set_allow_rmb_select","allow"),&Tree::set_allow_rmb_select); - ClassDB::bind_method(_MD("get_allow_rmb_select"),&Tree::get_allow_rmb_select); + ClassDB::bind_method(D_METHOD("set_allow_rmb_select","allow"),&Tree::set_allow_rmb_select); + ClassDB::bind_method(D_METHOD("get_allow_rmb_select"),&Tree::get_allow_rmb_select); - ClassDB::bind_method(_MD("set_single_select_cell_editing_only_when_already_selected","enable"),&Tree::set_single_select_cell_editing_only_when_already_selected); - ClassDB::bind_method(_MD("get_single_select_cell_editing_only_when_already_selected"),&Tree::get_single_select_cell_editing_only_when_already_selected); + ClassDB::bind_method(D_METHOD("set_single_select_cell_editing_only_when_already_selected","enable"),&Tree::set_single_select_cell_editing_only_when_already_selected); + ClassDB::bind_method(D_METHOD("get_single_select_cell_editing_only_when_already_selected"),&Tree::get_single_select_cell_editing_only_when_already_selected); ADD_SIGNAL( MethodInfo("item_selected")); ADD_SIGNAL( MethodInfo("cell_selected")); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 351cc4cb50..14bd2efbaa 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -409,6 +409,7 @@ friend class TreeItem; TreeItem *click_item; int click_column; int hover_index; + Point2 click_pos; } cache; diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 46c0eeca65..063ad8c44a 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -358,48 +358,48 @@ bool VideoPlayer::has_autoplay() const { void VideoPlayer::_bind_methods() { - ClassDB::bind_method(_MD("set_stream","stream:VideoStream"),&VideoPlayer::set_stream); - ClassDB::bind_method(_MD("get_stream:VideoStream"),&VideoPlayer::get_stream); + ClassDB::bind_method(D_METHOD("set_stream","stream:VideoStream"),&VideoPlayer::set_stream); + ClassDB::bind_method(D_METHOD("get_stream:VideoStream"),&VideoPlayer::get_stream); - ClassDB::bind_method(_MD("play"),&VideoPlayer::play); - ClassDB::bind_method(_MD("stop"),&VideoPlayer::stop); + ClassDB::bind_method(D_METHOD("play"),&VideoPlayer::play); + ClassDB::bind_method(D_METHOD("stop"),&VideoPlayer::stop); - ClassDB::bind_method(_MD("is_playing"),&VideoPlayer::is_playing); + ClassDB::bind_method(D_METHOD("is_playing"),&VideoPlayer::is_playing); - ClassDB::bind_method(_MD("set_paused","paused"),&VideoPlayer::set_paused); - ClassDB::bind_method(_MD("is_paused"),&VideoPlayer::is_paused); + ClassDB::bind_method(D_METHOD("set_paused","paused"),&VideoPlayer::set_paused); + ClassDB::bind_method(D_METHOD("is_paused"),&VideoPlayer::is_paused); - ClassDB::bind_method(_MD("set_volume","volume"),&VideoPlayer::set_volume); - ClassDB::bind_method(_MD("get_volume"),&VideoPlayer::get_volume); + ClassDB::bind_method(D_METHOD("set_volume","volume"),&VideoPlayer::set_volume); + ClassDB::bind_method(D_METHOD("get_volume"),&VideoPlayer::get_volume); - ClassDB::bind_method(_MD("set_volume_db","db"),&VideoPlayer::set_volume_db); - ClassDB::bind_method(_MD("get_volume_db"),&VideoPlayer::get_volume_db); + ClassDB::bind_method(D_METHOD("set_volume_db","db"),&VideoPlayer::set_volume_db); + ClassDB::bind_method(D_METHOD("get_volume_db"),&VideoPlayer::get_volume_db); - ClassDB::bind_method(_MD("set_audio_track","track"),&VideoPlayer::set_audio_track); - ClassDB::bind_method(_MD("get_audio_track"),&VideoPlayer::get_audio_track); + ClassDB::bind_method(D_METHOD("set_audio_track","track"),&VideoPlayer::set_audio_track); + ClassDB::bind_method(D_METHOD("get_audio_track"),&VideoPlayer::get_audio_track); - ClassDB::bind_method(_MD("get_stream_name"),&VideoPlayer::get_stream_name); + ClassDB::bind_method(D_METHOD("get_stream_name"),&VideoPlayer::get_stream_name); - ClassDB::bind_method(_MD("get_stream_pos"),&VideoPlayer::get_stream_pos); + ClassDB::bind_method(D_METHOD("get_stream_pos"),&VideoPlayer::get_stream_pos); - ClassDB::bind_method(_MD("set_autoplay","enabled"),&VideoPlayer::set_autoplay); - ClassDB::bind_method(_MD("has_autoplay"),&VideoPlayer::has_autoplay); + ClassDB::bind_method(D_METHOD("set_autoplay","enabled"),&VideoPlayer::set_autoplay); + ClassDB::bind_method(D_METHOD("has_autoplay"),&VideoPlayer::has_autoplay); - ClassDB::bind_method(_MD("set_expand","enable"), &VideoPlayer::set_expand ); - ClassDB::bind_method(_MD("has_expand"), &VideoPlayer::has_expand ); + ClassDB::bind_method(D_METHOD("set_expand","enable"), &VideoPlayer::set_expand ); + ClassDB::bind_method(D_METHOD("has_expand"), &VideoPlayer::has_expand ); - ClassDB::bind_method(_MD("set_buffering_msec","msec"),&VideoPlayer::set_buffering_msec); - ClassDB::bind_method(_MD("get_buffering_msec"),&VideoPlayer::get_buffering_msec); + ClassDB::bind_method(D_METHOD("set_buffering_msec","msec"),&VideoPlayer::set_buffering_msec); + ClassDB::bind_method(D_METHOD("get_buffering_msec"),&VideoPlayer::get_buffering_msec); - ClassDB::bind_method(_MD("get_video_texture:Texture"), &VideoPlayer::get_video_texture ); + ClassDB::bind_method(D_METHOD("get_video_texture:Texture"), &VideoPlayer::get_video_texture ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "audio_track",PROPERTY_HINT_RANGE,"0,128,1"), _SCS("set_audio_track"), _SCS("get_audio_track") ); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE,"VideoStream"), _SCS("set_stream"), _SCS("get_stream") ); - //ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "paused"), _SCS("set_paused"), _SCS("is_paused") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "expand" ), _SCS("set_expand"),_SCS("has_expand") ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "audio_track",PROPERTY_HINT_RANGE,"0,128,1"), "set_audio_track", "get_audio_track") ; + ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE,"VideoStream"), "set_stream", "get_stream") ; + //ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), "set_loop", "has_loop") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), "set_volume_db", "get_volume_db") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "has_autoplay") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "paused"), "set_paused", "is_paused") ; + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "expand" ), "set_expand","has_expand") ; } diff --git a/scene/gui/viewport_container.cpp b/scene/gui/viewport_container.cpp index 9e89de66dd..adc4a14a60 100644 --- a/scene/gui/viewport_container.cpp +++ b/scene/gui/viewport_container.cpp @@ -1,7 +1,36 @@ +/*************************************************************************/ +/* viewport_container.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "viewport_container.h" + #include "scene/main/viewport.h" -Size2 ViewportContainer::get_minimum_size() const { +Size2 ViewportContainer::get_minimum_size() const { if (stretch) return Size2(); @@ -91,10 +120,10 @@ void ViewportContainer::_notification(int p_what) { void ViewportContainer::_bind_methods() { - ClassDB::bind_method(_MD("set_stretch","enable"),&ViewportContainer::set_stretch); - ClassDB::bind_method(_MD("is_stretch_enabled"),&ViewportContainer::is_stretch_enabled); + ClassDB::bind_method(D_METHOD("set_stretch","enable"),&ViewportContainer::set_stretch); + ClassDB::bind_method(D_METHOD("is_stretch_enabled"),&ViewportContainer::is_stretch_enabled); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"stretch"),_SCS("set_stretch"),_SCS("is_stretch_enabled")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"stretch"),"set_stretch","is_stretch_enabled"); } ViewportContainer::ViewportContainer() { diff --git a/scene/gui/viewport_container.h b/scene/gui/viewport_container.h index 632c54f2f4..bcd41fa4a8 100644 --- a/scene/gui/viewport_container.h +++ b/scene/gui/viewport_container.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* viewport_container.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VIEWPORTCONTAINER_H #define VIEWPORTCONTAINER_H diff --git a/scene/io/resource_format_image.cpp b/scene/io/resource_format_image.cpp index 4d15ab86fd..8bb07adb5f 100644 --- a/scene/io/resource_format_image.cpp +++ b/scene/io/resource_format_image.cpp @@ -31,7 +31,7 @@ #if 0 #include "scene/resources/texture.h" #include "io/image_loader.h" -#include "globals.h" +#include "global_config.h" #include "os/os.h" RES ResourceFormatLoaderImage::load(const String &p_path, const String& p_original_path, Error *r_error) { diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index 84fe2a00f6..04d72b5a3d 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -259,39 +259,39 @@ int CanvasLayer::get_sort_index() { void CanvasLayer::_bind_methods() { - ClassDB::bind_method(_MD("set_layer","layer"),&CanvasLayer::set_layer); - ClassDB::bind_method(_MD("get_layer"),&CanvasLayer::get_layer); + ClassDB::bind_method(D_METHOD("set_layer","layer"),&CanvasLayer::set_layer); + ClassDB::bind_method(D_METHOD("get_layer"),&CanvasLayer::get_layer); - ClassDB::bind_method(_MD("set_transform","transform"),&CanvasLayer::set_transform); - ClassDB::bind_method(_MD("get_transform"),&CanvasLayer::get_transform); + ClassDB::bind_method(D_METHOD("set_transform","transform"),&CanvasLayer::set_transform); + ClassDB::bind_method(D_METHOD("get_transform"),&CanvasLayer::get_transform); - ClassDB::bind_method(_MD("set_offset","offset"),&CanvasLayer::set_offset); - ClassDB::bind_method(_MD("get_offset"),&CanvasLayer::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","offset"),&CanvasLayer::set_offset); + ClassDB::bind_method(D_METHOD("get_offset"),&CanvasLayer::get_offset); - ClassDB::bind_method(_MD("set_rotation","radians"),&CanvasLayer::set_rotation); - ClassDB::bind_method(_MD("get_rotation"),&CanvasLayer::get_rotation); + ClassDB::bind_method(D_METHOD("set_rotation","radians"),&CanvasLayer::set_rotation); + ClassDB::bind_method(D_METHOD("get_rotation"),&CanvasLayer::get_rotation); - ClassDB::bind_method(_MD("set_rotationd","degrees"),&CanvasLayer::set_rotationd); - ClassDB::bind_method(_MD("get_rotationd"),&CanvasLayer::get_rotationd); + ClassDB::bind_method(D_METHOD("set_rotationd","degrees"),&CanvasLayer::set_rotationd); + ClassDB::bind_method(D_METHOD("get_rotationd"),&CanvasLayer::get_rotationd); // TODO: Obsolete those two methods (old name) properly (GH-4397) - ClassDB::bind_method(_MD("_set_rotationd","degrees"),&CanvasLayer::_set_rotationd); - ClassDB::bind_method(_MD("_get_rotationd"),&CanvasLayer::_get_rotationd); + ClassDB::bind_method(D_METHOD("_set_rotationd","degrees"),&CanvasLayer::_set_rotationd); + ClassDB::bind_method(D_METHOD("_get_rotationd"),&CanvasLayer::_get_rotationd); - ClassDB::bind_method(_MD("set_scale","scale"),&CanvasLayer::set_scale); - ClassDB::bind_method(_MD("get_scale"),&CanvasLayer::get_scale); + ClassDB::bind_method(D_METHOD("set_scale","scale"),&CanvasLayer::set_scale); + ClassDB::bind_method(D_METHOD("get_scale"),&CanvasLayer::get_scale); - ClassDB::bind_method(_MD("set_custom_viewport","viewport:Viewport"),&CanvasLayer::set_custom_viewport); - ClassDB::bind_method(_MD("get_custom_viewport:Viewport"),&CanvasLayer::get_custom_viewport); + ClassDB::bind_method(D_METHOD("set_custom_viewport","viewport:Viewport"),&CanvasLayer::set_custom_viewport); + ClassDB::bind_method(D_METHOD("get_custom_viewport:Viewport"),&CanvasLayer::get_custom_viewport); - ClassDB::bind_method(_MD("get_world_2d:World2D"),&CanvasLayer::get_world_2d); - //ClassDB::bind_method(_MD("get_viewport"),&CanvasLayer::get_viewport); + ClassDB::bind_method(D_METHOD("get_world_2d:World2D"),&CanvasLayer::get_world_2d); + //ClassDB::bind_method(D_METHOD("get_viewport"),&CanvasLayer::get_viewport); - ADD_PROPERTY( PropertyInfo(Variant::INT,"layer",PROPERTY_HINT_RANGE,"-128,128,1"),_SCS("set_layer"),_SCS("get_layer") ); - //ADD_PROPERTY( PropertyInfo(Variant::MATRIX32,"transform",PROPERTY_HINT_RANGE),_SCS("set_transform"),_SCS("get_transform") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"offset"),_SCS("set_offset"),_SCS("get_offset") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"rotation"),_SCS("set_rotationd"),_SCS("get_rotationd") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scale"),_SCS("set_scale"),_SCS("get_scale") ); + ADD_PROPERTY( PropertyInfo(Variant::INT,"layer",PROPERTY_HINT_RANGE,"-128,128,1"),"set_layer","get_layer") ; + //ADD_PROPERTY( PropertyInfo(Variant::MATRIX32,"transform",PROPERTY_HINT_RANGE),"set_transform","get_transform") ; + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"offset"),"set_offset","get_offset") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"rotation"),"set_rotationd","get_rotationd") ; + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scale"),"set_scale","get_scale") ; } diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 63a81a139d..77b08fd58b 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -28,10 +28,6 @@ /*************************************************************************/ #include "http_request.h" -void HTTPRequest::set_ip_type(IP::Type p_type) { - client->set_ip_type(p_type); -} - void HTTPRequest::_redirect_request(const String& p_new_url) { @@ -539,33 +535,32 @@ int HTTPRequest::get_body_size() const{ void HTTPRequest::_bind_methods() { - ClassDB::bind_method(_MD("set_ip_type","ip_type"),&HTTPRequest::set_ip_type); - ClassDB::bind_method(_MD("request","url","custom_headers","ssl_validate_domain","method","request_data"),&HTTPRequest::request,DEFVAL(PoolStringArray()),DEFVAL(true),DEFVAL(HTTPClient::METHOD_GET),DEFVAL(String())); - ClassDB::bind_method(_MD("cancel_request"),&HTTPRequest::cancel_request); + ClassDB::bind_method(D_METHOD("request","url","custom_headers","ssl_validate_domain","method","request_data"),&HTTPRequest::request,DEFVAL(PoolStringArray()),DEFVAL(true),DEFVAL(HTTPClient::METHOD_GET),DEFVAL(String())); + ClassDB::bind_method(D_METHOD("cancel_request"),&HTTPRequest::cancel_request); - ClassDB::bind_method(_MD("get_http_client_status"),&HTTPRequest::get_http_client_status); + ClassDB::bind_method(D_METHOD("get_http_client_status"),&HTTPRequest::get_http_client_status); - ClassDB::bind_method(_MD("set_use_threads","enable"),&HTTPRequest::set_use_threads); - ClassDB::bind_method(_MD("is_using_threads"),&HTTPRequest::is_using_threads); + ClassDB::bind_method(D_METHOD("set_use_threads","enable"),&HTTPRequest::set_use_threads); + ClassDB::bind_method(D_METHOD("is_using_threads"),&HTTPRequest::is_using_threads); - ClassDB::bind_method(_MD("set_body_size_limit","bytes"),&HTTPRequest::set_body_size_limit); - ClassDB::bind_method(_MD("get_body_size_limit"),&HTTPRequest::get_body_size_limit); + ClassDB::bind_method(D_METHOD("set_body_size_limit","bytes"),&HTTPRequest::set_body_size_limit); + ClassDB::bind_method(D_METHOD("get_body_size_limit"),&HTTPRequest::get_body_size_limit); - ClassDB::bind_method(_MD("set_max_redirects","amount"),&HTTPRequest::set_max_redirects); - ClassDB::bind_method(_MD("get_max_redirects"),&HTTPRequest::get_max_redirects); + ClassDB::bind_method(D_METHOD("set_max_redirects","amount"),&HTTPRequest::set_max_redirects); + ClassDB::bind_method(D_METHOD("get_max_redirects"),&HTTPRequest::get_max_redirects); - ClassDB::bind_method(_MD("set_download_file","path"),&HTTPRequest::set_download_file); - ClassDB::bind_method(_MD("get_download_file"),&HTTPRequest::get_download_file); + ClassDB::bind_method(D_METHOD("set_download_file","path"),&HTTPRequest::set_download_file); + ClassDB::bind_method(D_METHOD("get_download_file"),&HTTPRequest::get_download_file); - ClassDB::bind_method(_MD("get_downloaded_bytes"),&HTTPRequest::get_downloaded_bytes); - ClassDB::bind_method(_MD("get_body_size"),&HTTPRequest::get_body_size); + ClassDB::bind_method(D_METHOD("get_downloaded_bytes"),&HTTPRequest::get_downloaded_bytes); + ClassDB::bind_method(D_METHOD("get_body_size"),&HTTPRequest::get_body_size); - ClassDB::bind_method(_MD("_redirect_request"),&HTTPRequest::_redirect_request); - ClassDB::bind_method(_MD("_request_done"),&HTTPRequest::_request_done); + ClassDB::bind_method(D_METHOD("_redirect_request"),&HTTPRequest::_redirect_request); + ClassDB::bind_method(D_METHOD("_request_done"),&HTTPRequest::_request_done); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_threads"),_SCS("set_use_threads"),_SCS("is_using_threads")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"body_size_limit",PROPERTY_HINT_RANGE,"-1,2000000000"),_SCS("set_body_size_limit"),_SCS("get_body_size_limit")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"max_redirects",PROPERTY_HINT_RANGE,"-1,1024"),_SCS("set_max_redirects"),_SCS("get_max_redirects")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_threads"),"set_use_threads","is_using_threads"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"body_size_limit",PROPERTY_HINT_RANGE,"-1,2000000000"),"set_body_size_limit","get_body_size_limit"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"max_redirects",PROPERTY_HINT_RANGE,"-1,1024"),"set_max_redirects","get_max_redirects"); ADD_SIGNAL(MethodInfo("request_completed",PropertyInfo(Variant::INT,"result"),PropertyInfo(Variant::INT,"response_code"),PropertyInfo(Variant::POOL_STRING_ARRAY,"headers"),PropertyInfo(Variant::POOL_BYTE_ARRAY,"body"))); diff --git a/scene/main/http_request.h b/scene/main/http_request.h index 51c5ddeb69..a9c495fd81 100644 --- a/scene/main/http_request.h +++ b/scene/main/http_request.h @@ -116,7 +116,6 @@ protected: static void _bind_methods(); public: - void set_ip_type(IP::Type p_type); Error request(const String& p_url, const Vector<String>& p_custom_headers=Vector<String>(), bool p_ssl_validate_domain=true, HTTPClient::Method p_method=HTTPClient::METHOD_GET, const String& p_request_data=""); //connects to a full url and perform request void cancel_request(); HTTPClient::Status get_http_client_status() const; diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index 5d1b0495c0..935811009b 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -122,9 +122,9 @@ Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) { void InstancePlaceholder::_bind_methods() { - ClassDB::bind_method(_MD("get_stored_values","with_order"),&InstancePlaceholder::get_stored_values,DEFVAL(false)); - ClassDB::bind_method(_MD("replace_by_instance","custom_scene:PackedScene"),&InstancePlaceholder::replace_by_instance,DEFVAL(Variant())); - ClassDB::bind_method(_MD("get_instance_path"),&InstancePlaceholder::get_instance_path); + ClassDB::bind_method(D_METHOD("get_stored_values","with_order"),&InstancePlaceholder::get_stored_values,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("replace_by_instance","custom_scene:PackedScene"),&InstancePlaceholder::replace_by_instance,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("get_instance_path"),&InstancePlaceholder::get_instance_path); } InstancePlaceholder::InstancePlaceholder() { diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 039dce37de..a189702894 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2288,7 +2288,7 @@ int Node::get_position_in_parent() const { -Node *Node::_duplicate(bool p_use_instancing) const { +Node *Node::_duplicate(int p_flags) const { Node *node=NULL; @@ -2302,7 +2302,7 @@ Node *Node::_duplicate(bool p_use_instancing) const { nip->set_instance_path( ip->get_instance_path() ); node=nip; - } else if (p_use_instancing && get_filename()!=String()) { + } else if ((p_flags&DUPLICATE_USE_INSTANCING) && get_filename()!=String()) { Ref<PackedScene> res = ResourceLoader::load(get_filename()); ERR_FAIL_COND_V(res.is_null(),NULL); @@ -2335,20 +2335,26 @@ Node *Node::_duplicate(bool p_use_instancing) const { if (!(E->get().usage&PROPERTY_USAGE_STORAGE)) continue; String name = E->get().name; + if (!(p_flags&DUPLICATE_SCRIPTS) && name=="script/script") + continue; + node->set( name, get(name) ); } node->set_name(get_name()); - List<GroupInfo> gi; - get_groups(&gi); - for (List<GroupInfo>::Element *E=gi.front();E;E=E->next()) { + if (p_flags & DUPLICATE_GROUPS) { + List<GroupInfo> gi; + get_groups(&gi); + for (List<GroupInfo>::Element *E=gi.front();E;E=E->next()) { - node->add_to_group(E->get().name, E->get().persistent); + node->add_to_group(E->get().name, E->get().persistent); + } } - _duplicate_signals(this, node); + if (p_flags & DUPLICATE_SIGNALS) + _duplicate_signals(this, node); for(int i=0;i<get_child_count();i++) { @@ -2357,7 +2363,7 @@ Node *Node::_duplicate(bool p_use_instancing) const { if (instanced && get_child(i)->data.owner==this) continue; //part of instance - Node *dup = get_child(i)->duplicate(p_use_instancing); + Node *dup = get_child(i)->duplicate(p_flags); if (!dup) { memdelete(node); @@ -2371,11 +2377,11 @@ Node *Node::_duplicate(bool p_use_instancing) const { return node; } -Node *Node::duplicate(bool p_use_instancing) const { +Node *Node::duplicate(int p_flags) const { - Node* dupe = _duplicate(p_use_instancing); + Node* dupe = _duplicate(p_flags); - if (dupe) { + if (dupe && (p_flags&DUPLICATE_SIGNALS)) { _duplicate_signals(this,dupe); } @@ -2904,96 +2910,96 @@ void Node::_bind_methods() { GLOBAL_DEF("node/name_casing",NAME_CASING_PASCAL_CASE); GlobalConfig::get_singleton()->set_custom_property_info("node/name_casing",PropertyInfo(Variant::INT,"node/name_casing",PROPERTY_HINT_ENUM,"PascalCase,camelCase,snake_case")); - ClassDB::bind_method(_MD("_add_child_below_node","node:Node","child_node:Node","legible_unique_name"),&Node::add_child_below_node,DEFVAL(false)); - - ClassDB::bind_method(_MD("set_name","name"),&Node::set_name); - ClassDB::bind_method(_MD("get_name"),&Node::get_name); - ClassDB::bind_method(_MD("add_child","node:Node","legible_unique_name"),&Node::add_child,DEFVAL(false)); - ClassDB::bind_method(_MD("remove_child","node:Node"),&Node::remove_child); - //ClassDB::bind_method(_MD("remove_and_delete_child","node:Node"),&Node::remove_and_delete_child); - ClassDB::bind_method(_MD("get_child_count"),&Node::get_child_count); - ClassDB::bind_method(_MD("get_children"),&Node::_get_children); - ClassDB::bind_method(_MD("get_child:Node","idx"),&Node::get_child); - ClassDB::bind_method(_MD("has_node","path"),&Node::has_node); - ClassDB::bind_method(_MD("get_node:Node","path"),&Node::get_node); - ClassDB::bind_method(_MD("get_parent:Node"),&Node::get_parent); - ClassDB::bind_method(_MD("find_node:Node","mask","recursive","owned"),&Node::find_node,DEFVAL(true),DEFVAL(true)); - ClassDB::bind_method(_MD("has_node_and_resource","path"),&Node::has_node_and_resource); - ClassDB::bind_method(_MD("get_node_and_resource","path"),&Node::_get_node_and_resource); - - ClassDB::bind_method(_MD("is_inside_tree"),&Node::is_inside_tree); - ClassDB::bind_method(_MD("is_a_parent_of","node:Node"),&Node::is_a_parent_of); - ClassDB::bind_method(_MD("is_greater_than","node:Node"),&Node::is_greater_than); - ClassDB::bind_method(_MD("get_path"),&Node::get_path); - ClassDB::bind_method(_MD("get_path_to","node:Node"),&Node::get_path_to); - ClassDB::bind_method(_MD("add_to_group","group","persistent"),&Node::add_to_group,DEFVAL(false)); - ClassDB::bind_method(_MD("remove_from_group","group"),&Node::remove_from_group); - ClassDB::bind_method(_MD("is_in_group","group"),&Node::is_in_group); - ClassDB::bind_method(_MD("move_child","child_node:Node","to_pos"),&Node::move_child); - ClassDB::bind_method(_MD("get_groups"),&Node::_get_groups); - ClassDB::bind_method(_MD("raise"),&Node::raise); - ClassDB::bind_method(_MD("set_owner","owner:Node"),&Node::set_owner); - ClassDB::bind_method(_MD("get_owner:Node"),&Node::get_owner); - ClassDB::bind_method(_MD("remove_and_skip"),&Node::remove_and_skip); - ClassDB::bind_method(_MD("get_index"),&Node::get_index); - ClassDB::bind_method(_MD("print_tree"),&Node::print_tree); - ClassDB::bind_method(_MD("set_filename","filename"),&Node::set_filename); - ClassDB::bind_method(_MD("get_filename"),&Node::get_filename); - ClassDB::bind_method(_MD("propagate_notification","what"),&Node::propagate_notification); - ClassDB::bind_method(_MD("set_fixed_process","enable"),&Node::set_fixed_process); - ClassDB::bind_method(_MD("get_fixed_process_delta_time"),&Node::get_fixed_process_delta_time); - ClassDB::bind_method(_MD("is_fixed_processing"),&Node::is_fixed_processing); - ClassDB::bind_method(_MD("get_process_delta_time"),&Node::get_process_delta_time); - ClassDB::bind_method(_MD("set_process","enable"),&Node::set_process); - ClassDB::bind_method(_MD("is_processing"),&Node::is_processing); - ClassDB::bind_method(_MD("set_process_input","enable"),&Node::set_process_input); - ClassDB::bind_method(_MD("is_processing_input"),&Node::is_processing_input); - ClassDB::bind_method(_MD("set_process_unhandled_input","enable"),&Node::set_process_unhandled_input); - ClassDB::bind_method(_MD("is_processing_unhandled_input"),&Node::is_processing_unhandled_input); - ClassDB::bind_method(_MD("set_process_unhandled_key_input","enable"),&Node::set_process_unhandled_key_input); - ClassDB::bind_method(_MD("is_processing_unhandled_key_input"),&Node::is_processing_unhandled_key_input); - ClassDB::bind_method(_MD("set_pause_mode","mode"),&Node::set_pause_mode); - ClassDB::bind_method(_MD("get_pause_mode"),&Node::get_pause_mode); - ClassDB::bind_method(_MD("can_process"),&Node::can_process); - ClassDB::bind_method(_MD("print_stray_nodes"),&Node::_print_stray_nodes); - ClassDB::bind_method(_MD("get_position_in_parent"),&Node::get_position_in_parent); - ClassDB::bind_method(_MD("set_display_folded","fold"),&Node::set_display_folded); - ClassDB::bind_method(_MD("is_displayed_folded"),&Node::is_displayed_folded); - - ClassDB::bind_method(_MD("set_process_internal","enable"),&Node::set_process_internal); - ClassDB::bind_method(_MD("is_processing_internal"),&Node::is_processing_internal); - - ClassDB::bind_method(_MD("set_fixed_process_internal","enable"),&Node::set_fixed_process_internal); - ClassDB::bind_method(_MD("is_fixed_processing_internal"),&Node::is_fixed_processing_internal); - - ClassDB::bind_method(_MD("get_tree:SceneTree"),&Node::get_tree); - - ClassDB::bind_method(_MD("duplicate:Node","use_instancing"),&Node::duplicate,DEFVAL(false)); - ClassDB::bind_method(_MD("replace_by","node:Node","keep_data"),&Node::replace_by,DEFVAL(false)); - - ClassDB::bind_method(_MD("set_scene_instance_load_placeholder","load_placeholder"),&Node::set_scene_instance_load_placeholder); - ClassDB::bind_method(_MD("get_scene_instance_load_placeholder"),&Node::get_scene_instance_load_placeholder); - - - ClassDB::bind_method(_MD("get_viewport"),&Node::get_viewport); - - ClassDB::bind_method(_MD("queue_free"),&Node::queue_delete); - - ClassDB::bind_method(_MD("request_ready"),&Node::request_ready); - - ClassDB::bind_method(_MD("set_network_mode","mode"),&Node::set_network_mode); - ClassDB::bind_method(_MD("get_network_mode"),&Node::get_network_mode); - - ClassDB::bind_method(_MD("is_network_master"),&Node::is_network_master); - - ClassDB::bind_method(_MD("rpc_config","method","mode"),&Node::rpc_config); - ClassDB::bind_method(_MD("rset_config","property","mode"),&Node::rset_config); + ClassDB::bind_method(D_METHOD("_add_child_below_node","node:Node","child_node:Node","legible_unique_name"),&Node::add_child_below_node,DEFVAL(false)); + + ClassDB::bind_method(D_METHOD("set_name","name"),&Node::set_name); + ClassDB::bind_method(D_METHOD("get_name"),&Node::get_name); + ClassDB::bind_method(D_METHOD("add_child","node:Node","legible_unique_name"),&Node::add_child,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("remove_child","node:Node"),&Node::remove_child); + //ClassDB::bind_method(D_METHOD("remove_and_delete_child","node:Node"),&Node::remove_and_delete_child); + ClassDB::bind_method(D_METHOD("get_child_count"),&Node::get_child_count); + ClassDB::bind_method(D_METHOD("get_children"),&Node::_get_children); + ClassDB::bind_method(D_METHOD("get_child:Node","idx"),&Node::get_child); + ClassDB::bind_method(D_METHOD("has_node","path"),&Node::has_node); + ClassDB::bind_method(D_METHOD("get_node:Node","path"),&Node::get_node); + ClassDB::bind_method(D_METHOD("get_parent:Node"),&Node::get_parent); + ClassDB::bind_method(D_METHOD("find_node:Node","mask","recursive","owned"),&Node::find_node,DEFVAL(true),DEFVAL(true)); + ClassDB::bind_method(D_METHOD("has_node_and_resource","path"),&Node::has_node_and_resource); + ClassDB::bind_method(D_METHOD("get_node_and_resource","path"),&Node::_get_node_and_resource); + + ClassDB::bind_method(D_METHOD("is_inside_tree"),&Node::is_inside_tree); + ClassDB::bind_method(D_METHOD("is_a_parent_of","node:Node"),&Node::is_a_parent_of); + ClassDB::bind_method(D_METHOD("is_greater_than","node:Node"),&Node::is_greater_than); + ClassDB::bind_method(D_METHOD("get_path"),&Node::get_path); + ClassDB::bind_method(D_METHOD("get_path_to","node:Node"),&Node::get_path_to); + ClassDB::bind_method(D_METHOD("add_to_group","group","persistent"),&Node::add_to_group,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("remove_from_group","group"),&Node::remove_from_group); + ClassDB::bind_method(D_METHOD("is_in_group","group"),&Node::is_in_group); + ClassDB::bind_method(D_METHOD("move_child","child_node:Node","to_pos"),&Node::move_child); + ClassDB::bind_method(D_METHOD("get_groups"),&Node::_get_groups); + ClassDB::bind_method(D_METHOD("raise"),&Node::raise); + ClassDB::bind_method(D_METHOD("set_owner","owner:Node"),&Node::set_owner); + ClassDB::bind_method(D_METHOD("get_owner:Node"),&Node::get_owner); + ClassDB::bind_method(D_METHOD("remove_and_skip"),&Node::remove_and_skip); + ClassDB::bind_method(D_METHOD("get_index"),&Node::get_index); + ClassDB::bind_method(D_METHOD("print_tree"),&Node::print_tree); + ClassDB::bind_method(D_METHOD("set_filename","filename"),&Node::set_filename); + ClassDB::bind_method(D_METHOD("get_filename"),&Node::get_filename); + ClassDB::bind_method(D_METHOD("propagate_notification","what"),&Node::propagate_notification); + ClassDB::bind_method(D_METHOD("set_fixed_process","enable"),&Node::set_fixed_process); + ClassDB::bind_method(D_METHOD("get_fixed_process_delta_time"),&Node::get_fixed_process_delta_time); + ClassDB::bind_method(D_METHOD("is_fixed_processing"),&Node::is_fixed_processing); + ClassDB::bind_method(D_METHOD("get_process_delta_time"),&Node::get_process_delta_time); + ClassDB::bind_method(D_METHOD("set_process","enable"),&Node::set_process); + ClassDB::bind_method(D_METHOD("is_processing"),&Node::is_processing); + ClassDB::bind_method(D_METHOD("set_process_input","enable"),&Node::set_process_input); + ClassDB::bind_method(D_METHOD("is_processing_input"),&Node::is_processing_input); + ClassDB::bind_method(D_METHOD("set_process_unhandled_input","enable"),&Node::set_process_unhandled_input); + ClassDB::bind_method(D_METHOD("is_processing_unhandled_input"),&Node::is_processing_unhandled_input); + ClassDB::bind_method(D_METHOD("set_process_unhandled_key_input","enable"),&Node::set_process_unhandled_key_input); + ClassDB::bind_method(D_METHOD("is_processing_unhandled_key_input"),&Node::is_processing_unhandled_key_input); + ClassDB::bind_method(D_METHOD("set_pause_mode","mode"),&Node::set_pause_mode); + ClassDB::bind_method(D_METHOD("get_pause_mode"),&Node::get_pause_mode); + ClassDB::bind_method(D_METHOD("can_process"),&Node::can_process); + ClassDB::bind_method(D_METHOD("print_stray_nodes"),&Node::_print_stray_nodes); + ClassDB::bind_method(D_METHOD("get_position_in_parent"),&Node::get_position_in_parent); + ClassDB::bind_method(D_METHOD("set_display_folded","fold"),&Node::set_display_folded); + ClassDB::bind_method(D_METHOD("is_displayed_folded"),&Node::is_displayed_folded); + + ClassDB::bind_method(D_METHOD("set_process_internal","enable"),&Node::set_process_internal); + ClassDB::bind_method(D_METHOD("is_processing_internal"),&Node::is_processing_internal); + + ClassDB::bind_method(D_METHOD("set_fixed_process_internal","enable"),&Node::set_fixed_process_internal); + ClassDB::bind_method(D_METHOD("is_fixed_processing_internal"),&Node::is_fixed_processing_internal); + + ClassDB::bind_method(D_METHOD("get_tree:SceneTree"),&Node::get_tree); + + ClassDB::bind_method(D_METHOD("duplicate:Node","flags"),&Node::duplicate,DEFVAL(DUPLICATE_USE_INSTANCING|DUPLICATE_SIGNALS|DUPLICATE_GROUPS|DUPLICATE_SCRIPTS)); + ClassDB::bind_method(D_METHOD("replace_by","node:Node","keep_data"),&Node::replace_by,DEFVAL(false)); + + ClassDB::bind_method(D_METHOD("set_scene_instance_load_placeholder","load_placeholder"),&Node::set_scene_instance_load_placeholder); + ClassDB::bind_method(D_METHOD("get_scene_instance_load_placeholder"),&Node::get_scene_instance_load_placeholder); + + + ClassDB::bind_method(D_METHOD("get_viewport"),&Node::get_viewport); + + ClassDB::bind_method(D_METHOD("queue_free"),&Node::queue_delete); + + ClassDB::bind_method(D_METHOD("request_ready"),&Node::request_ready); + + ClassDB::bind_method(D_METHOD("set_network_mode","mode"),&Node::set_network_mode); + ClassDB::bind_method(D_METHOD("get_network_mode"),&Node::get_network_mode); + + ClassDB::bind_method(D_METHOD("is_network_master"),&Node::is_network_master); + + ClassDB::bind_method(D_METHOD("rpc_config","method","mode"),&Node::rpc_config); + ClassDB::bind_method(D_METHOD("rset_config","property","mode"),&Node::rset_config); #ifdef TOOLS_ENABLED - ClassDB::bind_method(_MD("_set_import_path","import_path"),&Node::set_import_path); - ClassDB::bind_method(_MD("_get_import_path"),&Node::get_import_path); - ADD_PROPERTYNZ( PropertyInfo(Variant::NODE_PATH,"_import_path",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_import_path"),_SCS("_get_import_path")); + ClassDB::bind_method(D_METHOD("_set_import_path","import_path"),&Node::set_import_path); + ClassDB::bind_method(D_METHOD("_get_import_path"),&Node::get_import_path); + ADD_PROPERTYNZ( PropertyInfo(Variant::NODE_PATH,"_import_path",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_import_path","_get_import_path"); #endif @@ -3018,10 +3024,10 @@ void Node::_bind_methods() { } - ClassDB::bind_method(_MD("rset","property","value:Variant"),&Node::rset); - ClassDB::bind_method(_MD("rset_id","peer_id","property","value:Variant"),&Node::rset_id); - ClassDB::bind_method(_MD("rset_unreliable","property","value:Variant"),&Node::rset_unreliable); - ClassDB::bind_method(_MD("rset_unreliable_id","peer_id","property","value:Variant"),&Node::rset_unreliable_id); + ClassDB::bind_method(D_METHOD("rset","property","value:Variant"),&Node::rset); + ClassDB::bind_method(D_METHOD("rset_id","peer_id","property","value:Variant"),&Node::rset_id); + ClassDB::bind_method(D_METHOD("rset_unreliable","property","value:Variant"),&Node::rset_unreliable); + ClassDB::bind_method(D_METHOD("rset_unreliable_id","peer_id","property","value:Variant"),&Node::rset_unreliable_id); BIND_CONSTANT( NOTIFICATION_ENTER_TREE ); @@ -3058,17 +3064,21 @@ void Node::_bind_methods() { BIND_CONSTANT( PAUSE_MODE_STOP ); BIND_CONSTANT( PAUSE_MODE_PROCESS ); + BIND_CONSTANT( DUPLICATE_SIGNALS ); + BIND_CONSTANT( DUPLICATE_GROUPS ); + BIND_CONSTANT( DUPLICATE_SCRIPTS ); + ADD_SIGNAL( MethodInfo("renamed") ); ADD_SIGNAL( MethodInfo("tree_entered") ); ADD_SIGNAL( MethodInfo("tree_exited") ); - //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/process" ),_SCS("set_process"),_SCS("is_processing") ); - //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/fixed_process" ), _SCS("set_fixed_process"),_SCS("is_fixed_processing") ); - //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/input" ), _SCS("set_process_input"),_SCS("is_processing_input" ) ); - //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/unhandled_input" ), _SCS("set_process_unhandled_input"),_SCS("is_processing_unhandled_input" ) ); + //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/process" ),"set_process","is_processing") ; + //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/fixed_process" ), "set_fixed_process","is_fixed_processing") ; + //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/input" ), "set_process_input","is_processing_input" ) ; + //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/unhandled_input" ), "set_process_unhandled_input","is_processing_unhandled_input" ) ; ADD_GROUP("Pause","pause_"); - ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "pause_mode",PROPERTY_HINT_ENUM,"Inherit,Stop,Process" ), _SCS("set_pause_mode"),_SCS("get_pause_mode" ) ); - ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "editor/display_folded",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR ), _SCS("set_display_folded"),_SCS("is_displayed_folded" ) ); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "pause_mode",PROPERTY_HINT_ENUM,"Inherit,Stop,Process" ), "set_pause_mode", "get_pause_mode" ); + ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "editor/display_folded",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR ), "set_display_folded", "is_displayed_folded"); BIND_VMETHOD( MethodInfo("_process",PropertyInfo(Variant::REAL,"delta")) ); BIND_VMETHOD( MethodInfo("_fixed_process",PropertyInfo(Variant::REAL,"delta")) ); @@ -3079,8 +3089,8 @@ void Node::_bind_methods() { BIND_VMETHOD( MethodInfo("_unhandled_input",PropertyInfo(Variant::INPUT_EVENT,"event")) ); BIND_VMETHOD( MethodInfo("_unhandled_key_input",PropertyInfo(Variant::INPUT_EVENT,"key_event")) ); - //ClassDB::bind_method(_MD("get_child",&Node::get_child,PH("index"))); - //ClassDB::bind_method(_MD("get_node",&Node::get_node,PH("path"))); + //ClassDB::bind_method(D_METHOD("get_child",&Node::get_child,PH("index"))); + //ClassDB::bind_method(D_METHOD("get_node",&Node::get_node,PH("path"))); } diff --git a/scene/main/node.h b/scene/main/node.h index d88db8ecb0..b042cabb6f 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -29,7 +29,7 @@ #ifndef NODE_H #define NODE_H -#include "globals.h" +#include "global_config.h" #include "object.h" #include "path_db.h" #include "map.h" @@ -54,6 +54,14 @@ public: PAUSE_MODE_PROCESS }; + enum DuplicateFlags { + + DUPLICATE_SIGNALS=1, + DUPLICATE_GROUPS=2, + DUPLICATE_SCRIPTS=4, + DUPLICATE_USE_INSTANCING=8 + }; + enum NetworkMode { NETWORK_MODE_INHERIT, @@ -177,7 +185,7 @@ private: void _duplicate_signals(const Node* p_original,Node* p_copy) const; void _duplicate_and_reown(Node* p_new_parent, const Map<Node*,Node*>& p_reown_map) const; - Node *_duplicate(bool p_use_instancing) const; + Node *_duplicate(int p_flags) const; Array _get_children() const; Array _get_groups() const; @@ -332,7 +340,7 @@ public: int get_position_in_parent() const; - Node *duplicate(bool p_use_instancing=false) const; + Node *duplicate(int p_flags=DUPLICATE_GROUPS|DUPLICATE_SIGNALS|DUPLICATE_SCRIPTS) const; Node *duplicate_and_reown(const Map<Node*,Node*>& p_reown_map) const; //Node *clone_tree() const; diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp index 93a836a2eb..29333ff4bc 100644 --- a/scene/main/resource_preloader.cpp +++ b/scene/main/resource_preloader.cpp @@ -163,18 +163,18 @@ void ResourcePreloader::get_resource_list(List<StringName> *p_list) { void ResourcePreloader::_bind_methods() { - ClassDB::bind_method(_MD("_set_resources"),&ResourcePreloader::_set_resources); - ClassDB::bind_method(_MD("_get_resources"),&ResourcePreloader::_get_resources); + ClassDB::bind_method(D_METHOD("_set_resources"),&ResourcePreloader::_set_resources); + ClassDB::bind_method(D_METHOD("_get_resources"),&ResourcePreloader::_get_resources); - ClassDB::bind_method(_MD("add_resource","name","resource"),&ResourcePreloader::add_resource); - ClassDB::bind_method(_MD("remove_resource","name"),&ResourcePreloader::remove_resource); - ClassDB::bind_method(_MD("rename_resource","name","newname"),&ResourcePreloader::rename_resource); - ClassDB::bind_method(_MD("has_resource","name"),&ResourcePreloader::has_resource); - ClassDB::bind_method(_MD("get_resource","name"),&ResourcePreloader::get_resource); - ClassDB::bind_method(_MD("get_resource_list"),&ResourcePreloader::_get_resource_list); + ClassDB::bind_method(D_METHOD("add_resource","name","resource"),&ResourcePreloader::add_resource); + ClassDB::bind_method(D_METHOD("remove_resource","name"),&ResourcePreloader::remove_resource); + ClassDB::bind_method(D_METHOD("rename_resource","name","newname"),&ResourcePreloader::rename_resource); + ClassDB::bind_method(D_METHOD("has_resource","name"),&ResourcePreloader::has_resource); + ClassDB::bind_method(D_METHOD("get_resource","name"),&ResourcePreloader::get_resource); + ClassDB::bind_method(D_METHOD("get_resource_list"),&ResourcePreloader::_get_resource_list); - ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"resources",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_resources"), _SCS("_get_resources")); + ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"resources",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_resources", "_get_resources"); } diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index 9db1d3fd77..093359ab16 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -32,7 +32,7 @@ #include "os/os.h" #include "message_queue.h" #include "node.h" -#include "globals.h" +#include "global_config.h" #include <stdio.h> #include "os/keyboard.h" //#include "servers/spatial_sound_2d_server.h" @@ -48,8 +48,8 @@ void SceneTreeTimer::_bind_methods() { - ClassDB::bind_method(_MD("set_time_left","time"),&SceneTreeTimer::set_time_left); - ClassDB::bind_method(_MD("get_time_left"),&SceneTreeTimer::get_time_left); + ClassDB::bind_method(D_METHOD("set_time_left","time"),&SceneTreeTimer::set_time_left); + ClassDB::bind_method(D_METHOD("get_time_left"),&SceneTreeTimer::get_time_left); ADD_SIGNAL(MethodInfo("timeout")); } @@ -63,9 +63,19 @@ float SceneTreeTimer::get_time_left() const { return time_left; } +void SceneTreeTimer::set_pause_mode_process(bool p_pause_mode_process) { + if (process_pause != p_pause_mode_process) { + process_pause = p_pause_mode_process; + } +} + +bool SceneTreeTimer::is_pause_mode_process() { + return process_pause; +} SceneTreeTimer::SceneTreeTimer() { time_left=0; + process_pause = true; } @@ -602,7 +612,10 @@ bool SceneTree::idle(float p_time){ for (List<Ref<SceneTreeTimer> >::Element *E=timers.front();E;) { List<Ref<SceneTreeTimer> >::Element *N = E->next(); - + if (pause && !E->get()->is_pause_mode_process()) { + E=N; + continue; + } float time_left = E->get()->get_time_left(); time_left-=p_time; E->get()->set_time_left(time_left); @@ -1714,10 +1727,11 @@ void SceneTree::drop_files(const Vector<String>& p_files,int p_from_screen) { } -Ref<SceneTreeTimer> SceneTree::create_timer(float p_delay_sec) { +Ref<SceneTreeTimer> SceneTree::create_timer(float p_delay_sec, bool p_process_pause) { Ref<SceneTreeTimer> stt; stt.instance(); + stt->set_pause_mode_process(p_process_pause); stt->set_time_left(p_delay_sec); timers.push_back(stt); return stt; @@ -1789,6 +1803,10 @@ bool SceneTree::is_network_server() const { } +bool SceneTree::has_network_peer() const { + return network_peer.is_valid(); +} + int SceneTree::get_network_unique_id() const { ERR_FAIL_COND_V(!network_peer.is_valid(),0); @@ -2220,39 +2238,39 @@ void SceneTree::_network_poll() { void SceneTree::_bind_methods() { - //ClassDB::bind_method(_MD("call_group","call_flags","group","method","arg1","arg2"),&SceneMainLoop::_call_group,DEFVAL(Variant()),DEFVAL(Variant())); + //ClassDB::bind_method(D_METHOD("call_group","call_flags","group","method","arg1","arg2"),&SceneMainLoop::_call_group,DEFVAL(Variant()),DEFVAL(Variant())); - ClassDB::bind_method(_MD("get_root:Viewport"),&SceneTree::get_root); - ClassDB::bind_method(_MD("has_group","name"),&SceneTree::has_group); + ClassDB::bind_method(D_METHOD("get_root:Viewport"),&SceneTree::get_root); + ClassDB::bind_method(D_METHOD("has_group","name"),&SceneTree::has_group); - ClassDB::bind_method(_MD("set_auto_accept_quit","enabled"),&SceneTree::set_auto_accept_quit); + ClassDB::bind_method(D_METHOD("set_auto_accept_quit","enabled"),&SceneTree::set_auto_accept_quit); - ClassDB::bind_method(_MD("set_editor_hint","enable"),&SceneTree::set_editor_hint); - ClassDB::bind_method(_MD("is_editor_hint"),&SceneTree::is_editor_hint); - ClassDB::bind_method(_MD("set_debug_collisions_hint","enable"),&SceneTree::set_debug_collisions_hint); - ClassDB::bind_method(_MD("is_debugging_collisions_hint"),&SceneTree::is_debugging_collisions_hint); - ClassDB::bind_method(_MD("set_debug_navigation_hint","enable"),&SceneTree::set_debug_navigation_hint); - ClassDB::bind_method(_MD("is_debugging_navigation_hint"),&SceneTree::is_debugging_navigation_hint); + ClassDB::bind_method(D_METHOD("set_editor_hint","enable"),&SceneTree::set_editor_hint); + ClassDB::bind_method(D_METHOD("is_editor_hint"),&SceneTree::is_editor_hint); + ClassDB::bind_method(D_METHOD("set_debug_collisions_hint","enable"),&SceneTree::set_debug_collisions_hint); + ClassDB::bind_method(D_METHOD("is_debugging_collisions_hint"),&SceneTree::is_debugging_collisions_hint); + ClassDB::bind_method(D_METHOD("set_debug_navigation_hint","enable"),&SceneTree::set_debug_navigation_hint); + ClassDB::bind_method(D_METHOD("is_debugging_navigation_hint"),&SceneTree::is_debugging_navigation_hint); #ifdef TOOLS_ENABLED - ClassDB::bind_method(_MD("set_edited_scene_root","scene"),&SceneTree::set_edited_scene_root); - ClassDB::bind_method(_MD("get_edited_scene_root"),&SceneTree::get_edited_scene_root); + ClassDB::bind_method(D_METHOD("set_edited_scene_root","scene"),&SceneTree::set_edited_scene_root); + ClassDB::bind_method(D_METHOD("get_edited_scene_root"),&SceneTree::get_edited_scene_root); #endif - ClassDB::bind_method(_MD("set_pause","enable"),&SceneTree::set_pause); - ClassDB::bind_method(_MD("is_paused"),&SceneTree::is_paused); - ClassDB::bind_method(_MD("set_input_as_handled"),&SceneTree::set_input_as_handled); + ClassDB::bind_method(D_METHOD("set_pause","enable"),&SceneTree::set_pause); + ClassDB::bind_method(D_METHOD("is_paused"),&SceneTree::is_paused); + ClassDB::bind_method(D_METHOD("set_input_as_handled"),&SceneTree::set_input_as_handled); - ClassDB::bind_method(_MD("create_timer:SceneTreeTimer","time_sec"),&SceneTree::create_timer); + ClassDB::bind_method(D_METHOD("create_timer:SceneTreeTimer","time_sec", "pause_mode_process"),&SceneTree::create_timer, DEFVAL(true)); - ClassDB::bind_method(_MD("get_node_count"),&SceneTree::get_node_count); - ClassDB::bind_method(_MD("get_frame"),&SceneTree::get_frame); - ClassDB::bind_method(_MD("quit"),&SceneTree::quit); + ClassDB::bind_method(D_METHOD("get_node_count"),&SceneTree::get_node_count); + ClassDB::bind_method(D_METHOD("get_frame"),&SceneTree::get_frame); + ClassDB::bind_method(D_METHOD("quit"),&SceneTree::quit); - ClassDB::bind_method(_MD("set_screen_stretch","mode","aspect","minsize"),&SceneTree::set_screen_stretch); + ClassDB::bind_method(D_METHOD("set_screen_stretch","mode","aspect","minsize"),&SceneTree::set_screen_stretch); - ClassDB::bind_method(_MD("queue_delete","obj"),&SceneTree::queue_delete); + ClassDB::bind_method(D_METHOD("queue_delete","obj"),&SceneTree::queue_delete); @@ -2266,8 +2284,8 @@ void SceneTree::_bind_methods() { ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_group_flags",&SceneTree::_call_group_flags,mi); - ClassDB::bind_method(_MD("notify_group_flags","call_flags","group","notification"),&SceneTree::notify_group_flags); - ClassDB::bind_method(_MD("set_group_flags","call_flags","group","property","value"),&SceneTree::set_group_flags); + ClassDB::bind_method(D_METHOD("notify_group_flags","call_flags","group","notification"),&SceneTree::notify_group_flags); + ClassDB::bind_method(D_METHOD("set_group_flags","call_flags","group","property","value"),&SceneTree::set_group_flags); MethodInfo mi2; mi2.name="call_group"; @@ -2277,33 +2295,34 @@ void SceneTree::_bind_methods() { ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_group",&SceneTree::_call_group,mi2); - ClassDB::bind_method(_MD("notify_group","call_flags","group","notification"),&SceneTree::notify_group); - ClassDB::bind_method(_MD("set_group","call_flags","group","property","value"),&SceneTree::set_group); + ClassDB::bind_method(D_METHOD("notify_group","call_flags","group","notification"),&SceneTree::notify_group); + ClassDB::bind_method(D_METHOD("set_group","call_flags","group","property","value"),&SceneTree::set_group); - ClassDB::bind_method(_MD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group); + ClassDB::bind_method(D_METHOD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group); - ClassDB::bind_method(_MD("set_current_scene","child_node:Node"),&SceneTree::set_current_scene); - ClassDB::bind_method(_MD("get_current_scene:Node"),&SceneTree::get_current_scene); + ClassDB::bind_method(D_METHOD("set_current_scene","child_node:Node"),&SceneTree::set_current_scene); + ClassDB::bind_method(D_METHOD("get_current_scene:Node"),&SceneTree::get_current_scene); - ClassDB::bind_method(_MD("change_scene","path"),&SceneTree::change_scene); - ClassDB::bind_method(_MD("change_scene_to","packed_scene:PackedScene"),&SceneTree::change_scene_to); + ClassDB::bind_method(D_METHOD("change_scene","path"),&SceneTree::change_scene); + ClassDB::bind_method(D_METHOD("change_scene_to","packed_scene:PackedScene"),&SceneTree::change_scene_to); - ClassDB::bind_method(_MD("reload_current_scene"),&SceneTree::reload_current_scene); + ClassDB::bind_method(D_METHOD("reload_current_scene"),&SceneTree::reload_current_scene); - ClassDB::bind_method(_MD("_change_scene"),&SceneTree::_change_scene); + ClassDB::bind_method(D_METHOD("_change_scene"),&SceneTree::_change_scene); - ClassDB::bind_method(_MD("set_network_peer","peer:NetworkedMultiplayerPeer"),&SceneTree::set_network_peer); - ClassDB::bind_method(_MD("is_network_server"),&SceneTree::is_network_server); - ClassDB::bind_method(_MD("get_network_unique_id"),&SceneTree::get_network_unique_id); - ClassDB::bind_method(_MD("set_refuse_new_network_connections","refuse"),&SceneTree::set_refuse_new_network_connections); - ClassDB::bind_method(_MD("is_refusing_new_network_connections"),&SceneTree::is_refusing_new_network_connections); - ClassDB::bind_method(_MD("_network_peer_connected"),&SceneTree::_network_peer_connected); - ClassDB::bind_method(_MD("_network_peer_disconnected"),&SceneTree::_network_peer_disconnected); - ClassDB::bind_method(_MD("_connected_to_server"),&SceneTree::_connected_to_server); - ClassDB::bind_method(_MD("_connection_failed"),&SceneTree::_connection_failed); - ClassDB::bind_method(_MD("_server_disconnected"),&SceneTree::_server_disconnected); + ClassDB::bind_method(D_METHOD("set_network_peer","peer:NetworkedMultiplayerPeer"),&SceneTree::set_network_peer); + ClassDB::bind_method(D_METHOD("is_network_server"),&SceneTree::is_network_server); + ClassDB::bind_method(D_METHOD("has_network_peer"),&SceneTree::has_network_peer); + ClassDB::bind_method(D_METHOD("get_network_unique_id"),&SceneTree::get_network_unique_id); + ClassDB::bind_method(D_METHOD("set_refuse_new_network_connections","refuse"),&SceneTree::set_refuse_new_network_connections); + ClassDB::bind_method(D_METHOD("is_refusing_new_network_connections"),&SceneTree::is_refusing_new_network_connections); + ClassDB::bind_method(D_METHOD("_network_peer_connected"),&SceneTree::_network_peer_connected); + ClassDB::bind_method(D_METHOD("_network_peer_disconnected"),&SceneTree::_network_peer_disconnected); + ClassDB::bind_method(D_METHOD("_connected_to_server"),&SceneTree::_connected_to_server); + ClassDB::bind_method(D_METHOD("_connection_failed"),&SceneTree::_connection_failed); + ClassDB::bind_method(D_METHOD("_server_disconnected"),&SceneTree::_server_disconnected); ADD_SIGNAL( MethodInfo("tree_changed") ); ADD_SIGNAL( MethodInfo("node_removed",PropertyInfo( Variant::OBJECT, "node") ) ); diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h index f4271e5454..7f69f5eef7 100644 --- a/scene/main/scene_main_loop.h +++ b/scene/main/scene_main_loop.h @@ -56,6 +56,7 @@ class SceneTreeTimer : public Reference { GDCLASS(SceneTreeTimer,Reference); float time_left; + bool process_pause; protected: static void _bind_methods(); public: @@ -63,6 +64,9 @@ public: void set_time_left(float p_time); float get_time_left() const; + void set_pause_mode_process(bool p_pause_mode_process); + bool is_pause_mode_process(); + SceneTreeTimer(); }; @@ -430,7 +434,7 @@ public: Error change_scene_to(const Ref<PackedScene>& p_scene); Error reload_current_scene(); - Ref<SceneTreeTimer> create_timer(float p_delay_sec); + Ref<SceneTreeTimer> create_timer(float p_delay_sec, bool p_process_pause=true); //used by Main::start, don't use otherwise void add_current_scene(Node * p_current); @@ -443,6 +447,7 @@ public: void set_network_peer(const Ref<NetworkedMultiplayerPeer>& p_network_peer); bool is_network_server() const; + bool has_network_peer() const; int get_network_unique_id() const; void set_refuse_new_network_connections(bool p_refuse); diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index 7852e2b46b..d27b53d48b 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -179,32 +179,32 @@ void Timer::_set_process(bool p_process, bool p_force) void Timer::_bind_methods() { - ClassDB::bind_method(_MD("set_wait_time","time_sec"),&Timer::set_wait_time); - ClassDB::bind_method(_MD("get_wait_time"),&Timer::get_wait_time); + ClassDB::bind_method(D_METHOD("set_wait_time","time_sec"),&Timer::set_wait_time); + ClassDB::bind_method(D_METHOD("get_wait_time"),&Timer::get_wait_time); - ClassDB::bind_method(_MD("set_one_shot","enable"),&Timer::set_one_shot); - ClassDB::bind_method(_MD("is_one_shot"),&Timer::is_one_shot); + ClassDB::bind_method(D_METHOD("set_one_shot","enable"),&Timer::set_one_shot); + ClassDB::bind_method(D_METHOD("is_one_shot"),&Timer::is_one_shot); - ClassDB::bind_method(_MD("set_autostart","enable"),&Timer::set_autostart); - ClassDB::bind_method(_MD("has_autostart"),&Timer::has_autostart); + ClassDB::bind_method(D_METHOD("set_autostart","enable"),&Timer::set_autostart); + ClassDB::bind_method(D_METHOD("has_autostart"),&Timer::has_autostart); - ClassDB::bind_method(_MD("start"),&Timer::start); - ClassDB::bind_method(_MD("stop"),&Timer::stop); + ClassDB::bind_method(D_METHOD("start"),&Timer::start); + ClassDB::bind_method(D_METHOD("stop"),&Timer::stop); - ClassDB::bind_method(_MD("set_active", "active"), &Timer::set_active); - ClassDB::bind_method(_MD("is_active"), &Timer::is_active); + ClassDB::bind_method(D_METHOD("set_active", "active"), &Timer::set_active); + ClassDB::bind_method(D_METHOD("is_active"), &Timer::is_active); - ClassDB::bind_method(_MD("get_time_left"),&Timer::get_time_left); + ClassDB::bind_method(D_METHOD("get_time_left"),&Timer::get_time_left); - ClassDB::bind_method(_MD("set_timer_process_mode", "mode"), &Timer::set_timer_process_mode); - ClassDB::bind_method(_MD("get_timer_process_mode"), &Timer::get_timer_process_mode); + ClassDB::bind_method(D_METHOD("set_timer_process_mode", "mode"), &Timer::set_timer_process_mode); + ClassDB::bind_method(D_METHOD("get_timer_process_mode"), &Timer::get_timer_process_mode); ADD_SIGNAL( MethodInfo("timeout") ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_timer_process_mode"), _SCS("get_timer_process_mode") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL, "wait_time", PROPERTY_HINT_EXP_RANGE, "0.01,4096,0.01" ), _SCS("set_wait_time"), _SCS("get_wait_time") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "one_shot" ), _SCS("set_one_shot"), _SCS("is_one_shot") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autostart" ), _SCS("set_autostart"), _SCS("has_autostart") ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), "set_timer_process_mode", "get_timer_process_mode") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL, "wait_time", PROPERTY_HINT_EXP_RANGE, "0.01,4096,0.01" ), "set_wait_time", "get_wait_time") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "one_shot" ), "set_one_shot", "is_one_shot") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autostart" ), "set_autostart", "has_autostart") ; BIND_CONSTANT( TIMER_PROCESS_FIXED ); BIND_CONSTANT( TIMER_PROCESS_IDLE ); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 989c048682..ef39dcde4b 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -48,7 +48,7 @@ #include "scene/main/timer.h" #include "scene/scene_string_names.h" -#include "globals.h" +#include "global_config.h" void ViewportTexture::setup_local_to_scene() { @@ -139,10 +139,10 @@ uint32_t ViewportTexture::get_flags() const{ void ViewportTexture::_bind_methods() { - ClassDB::bind_method(_MD("set_viewport_path_in_scene","path"),&ViewportTexture::set_viewport_path_in_scene); - ClassDB::bind_method(_MD("get_viewport_path_in_scene"),&ViewportTexture::get_viewport_path_in_scene); + ClassDB::bind_method(D_METHOD("set_viewport_path_in_scene","path"),&ViewportTexture::set_viewport_path_in_scene); + ClassDB::bind_method(D_METHOD("get_viewport_path_in_scene"),&ViewportTexture::get_viewport_path_in_scene); - ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"viewport_path"),_SCS("set_viewport_path_in_scene"),_SCS("get_viewport_path_in_scene")); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"viewport_path"),"set_viewport_path_in_scene","get_viewport_path_in_scene"); } @@ -2774,128 +2774,128 @@ bool Viewport::get_hdr() const{ void Viewport::_bind_methods() { - ClassDB::bind_method(_MD("set_size","size"), &Viewport::set_size); - ClassDB::bind_method(_MD("get_size"), &Viewport::get_size); - ClassDB::bind_method(_MD("set_world_2d","world_2d:World2D"), &Viewport::set_world_2d); - ClassDB::bind_method(_MD("get_world_2d:World2D"), &Viewport::get_world_2d); - ClassDB::bind_method(_MD("find_world_2d:World2D"), &Viewport::find_world_2d); - ClassDB::bind_method(_MD("set_world","world:World"), &Viewport::set_world); - ClassDB::bind_method(_MD("get_world:World"), &Viewport::get_world); - ClassDB::bind_method(_MD("find_world:World"), &Viewport::find_world); + ClassDB::bind_method(D_METHOD("set_size","size"), &Viewport::set_size); + ClassDB::bind_method(D_METHOD("get_size"), &Viewport::get_size); + ClassDB::bind_method(D_METHOD("set_world_2d","world_2d:World2D"), &Viewport::set_world_2d); + ClassDB::bind_method(D_METHOD("get_world_2d:World2D"), &Viewport::get_world_2d); + ClassDB::bind_method(D_METHOD("find_world_2d:World2D"), &Viewport::find_world_2d); + ClassDB::bind_method(D_METHOD("set_world","world:World"), &Viewport::set_world); + ClassDB::bind_method(D_METHOD("get_world:World"), &Viewport::get_world); + ClassDB::bind_method(D_METHOD("find_world:World"), &Viewport::find_world); - ClassDB::bind_method(_MD("set_canvas_transform","xform"), &Viewport::set_canvas_transform); - ClassDB::bind_method(_MD("get_canvas_transform"), &Viewport::get_canvas_transform); + ClassDB::bind_method(D_METHOD("set_canvas_transform","xform"), &Viewport::set_canvas_transform); + ClassDB::bind_method(D_METHOD("get_canvas_transform"), &Viewport::get_canvas_transform); - ClassDB::bind_method(_MD("set_global_canvas_transform","xform"), &Viewport::set_global_canvas_transform); - ClassDB::bind_method(_MD("get_global_canvas_transform"), &Viewport::get_global_canvas_transform); - ClassDB::bind_method(_MD("get_final_transform"), &Viewport::get_final_transform); + ClassDB::bind_method(D_METHOD("set_global_canvas_transform","xform"), &Viewport::set_global_canvas_transform); + ClassDB::bind_method(D_METHOD("get_global_canvas_transform"), &Viewport::get_global_canvas_transform); + ClassDB::bind_method(D_METHOD("get_final_transform"), &Viewport::get_final_transform); - ClassDB::bind_method(_MD("get_visible_rect"), &Viewport::get_visible_rect); - ClassDB::bind_method(_MD("set_transparent_background","enable"), &Viewport::set_transparent_background); - ClassDB::bind_method(_MD("has_transparent_background"), &Viewport::has_transparent_background); + ClassDB::bind_method(D_METHOD("get_visible_rect"), &Viewport::get_visible_rect); + ClassDB::bind_method(D_METHOD("set_transparent_background","enable"), &Viewport::set_transparent_background); + ClassDB::bind_method(D_METHOD("has_transparent_background"), &Viewport::has_transparent_background); - ClassDB::bind_method(_MD("_parent_visibility_changed"), &Viewport::_parent_visibility_changed); + ClassDB::bind_method(D_METHOD("_parent_visibility_changed"), &Viewport::_parent_visibility_changed); - ClassDB::bind_method(_MD("_parent_resized"), &Viewport::_parent_resized); - ClassDB::bind_method(_MD("_vp_input"), &Viewport::_vp_input); - ClassDB::bind_method(_MD("_vp_input_text","text"), &Viewport::_vp_input_text); - ClassDB::bind_method(_MD("_vp_unhandled_input"), &Viewport::_vp_unhandled_input); + ClassDB::bind_method(D_METHOD("_parent_resized"), &Viewport::_parent_resized); + ClassDB::bind_method(D_METHOD("_vp_input"), &Viewport::_vp_input); + ClassDB::bind_method(D_METHOD("_vp_input_text","text"), &Viewport::_vp_input_text); + ClassDB::bind_method(D_METHOD("_vp_unhandled_input"), &Viewport::_vp_unhandled_input); - ClassDB::bind_method(_MD("set_size_override","enable","size","margin"), &Viewport::set_size_override,DEFVAL(Size2(-1,-1)),DEFVAL(Size2(0,0))); - ClassDB::bind_method(_MD("get_size_override"), &Viewport::get_size_override); - ClassDB::bind_method(_MD("is_size_override_enabled"), &Viewport::is_size_override_enabled); - ClassDB::bind_method(_MD("set_size_override_stretch","enabled"), &Viewport::set_size_override_stretch); - ClassDB::bind_method(_MD("is_size_override_stretch_enabled"), &Viewport::is_size_override_stretch_enabled); - ClassDB::bind_method(_MD("queue_screen_capture"), &Viewport::queue_screen_capture); - ClassDB::bind_method(_MD("get_screen_capture"), &Viewport::get_screen_capture); + ClassDB::bind_method(D_METHOD("set_size_override","enable","size","margin"), &Viewport::set_size_override,DEFVAL(Size2(-1,-1)),DEFVAL(Size2(0,0))); + ClassDB::bind_method(D_METHOD("get_size_override"), &Viewport::get_size_override); + ClassDB::bind_method(D_METHOD("is_size_override_enabled"), &Viewport::is_size_override_enabled); + ClassDB::bind_method(D_METHOD("set_size_override_stretch","enabled"), &Viewport::set_size_override_stretch); + ClassDB::bind_method(D_METHOD("is_size_override_stretch_enabled"), &Viewport::is_size_override_stretch_enabled); + ClassDB::bind_method(D_METHOD("queue_screen_capture"), &Viewport::queue_screen_capture); + ClassDB::bind_method(D_METHOD("get_screen_capture"), &Viewport::get_screen_capture); - ClassDB::bind_method(_MD("set_vflip","enable"), &Viewport::set_vflip); - ClassDB::bind_method(_MD("get_vflip"), &Viewport::get_vflip); + ClassDB::bind_method(D_METHOD("set_vflip","enable"), &Viewport::set_vflip); + ClassDB::bind_method(D_METHOD("get_vflip"), &Viewport::get_vflip); - ClassDB::bind_method(_MD("set_clear_on_new_frame","enable"), &Viewport::set_clear_on_new_frame); - ClassDB::bind_method(_MD("get_clear_on_new_frame"), &Viewport::get_clear_on_new_frame); + ClassDB::bind_method(D_METHOD("set_clear_on_new_frame","enable"), &Viewport::set_clear_on_new_frame); + ClassDB::bind_method(D_METHOD("get_clear_on_new_frame"), &Viewport::get_clear_on_new_frame); - ClassDB::bind_method(_MD("clear"), &Viewport::clear); - ClassDB::bind_method(_MD("set_update_mode","mode"), &Viewport::set_update_mode); - ClassDB::bind_method(_MD("get_update_mode"), &Viewport::get_update_mode); + ClassDB::bind_method(D_METHOD("clear"), &Viewport::clear); + ClassDB::bind_method(D_METHOD("set_update_mode","mode"), &Viewport::set_update_mode); + ClassDB::bind_method(D_METHOD("get_update_mode"), &Viewport::get_update_mode); - ClassDB::bind_method(_MD("set_msaa","msaa"), &Viewport::set_msaa); - ClassDB::bind_method(_MD("get_msaa"), &Viewport::get_msaa); + ClassDB::bind_method(D_METHOD("set_msaa","msaa"), &Viewport::set_msaa); + ClassDB::bind_method(D_METHOD("get_msaa"), &Viewport::get_msaa); - ClassDB::bind_method(_MD("set_hdr","enable"), &Viewport::set_hdr); - ClassDB::bind_method(_MD("get_hdr"), &Viewport::get_hdr); + ClassDB::bind_method(D_METHOD("set_hdr","enable"), &Viewport::set_hdr); + ClassDB::bind_method(D_METHOD("get_hdr"), &Viewport::get_hdr); - ClassDB::bind_method(_MD("get_texture:ViewportTexture"), &Viewport::get_texture); + ClassDB::bind_method(D_METHOD("get_texture:ViewportTexture"), &Viewport::get_texture); - ClassDB::bind_method(_MD("set_physics_object_picking","enable"), &Viewport::set_physics_object_picking); - ClassDB::bind_method(_MD("get_physics_object_picking"), &Viewport::get_physics_object_picking); + ClassDB::bind_method(D_METHOD("set_physics_object_picking","enable"), &Viewport::set_physics_object_picking); + ClassDB::bind_method(D_METHOD("get_physics_object_picking"), &Viewport::get_physics_object_picking); - ClassDB::bind_method(_MD("get_viewport_rid"), &Viewport::get_viewport_rid); - ClassDB::bind_method(_MD("input","local_event"), &Viewport::input); - ClassDB::bind_method(_MD("unhandled_input","local_event"), &Viewport::unhandled_input); + ClassDB::bind_method(D_METHOD("get_viewport_rid"), &Viewport::get_viewport_rid); + ClassDB::bind_method(D_METHOD("input","local_event"), &Viewport::input); + ClassDB::bind_method(D_METHOD("unhandled_input","local_event"), &Viewport::unhandled_input); - ClassDB::bind_method(_MD("update_worlds"), &Viewport::update_worlds); + ClassDB::bind_method(D_METHOD("update_worlds"), &Viewport::update_worlds); - ClassDB::bind_method(_MD("set_use_own_world","enable"), &Viewport::set_use_own_world); - ClassDB::bind_method(_MD("is_using_own_world"), &Viewport::is_using_own_world); + ClassDB::bind_method(D_METHOD("set_use_own_world","enable"), &Viewport::set_use_own_world); + ClassDB::bind_method(D_METHOD("is_using_own_world"), &Viewport::is_using_own_world); - ClassDB::bind_method(_MD("get_camera:Camera"), &Viewport::get_camera); + ClassDB::bind_method(D_METHOD("get_camera:Camera"), &Viewport::get_camera); - ClassDB::bind_method(_MD("set_as_audio_listener","enable"), &Viewport::set_as_audio_listener); - ClassDB::bind_method(_MD("is_audio_listener","enable"), &Viewport::is_audio_listener); + ClassDB::bind_method(D_METHOD("set_as_audio_listener","enable"), &Viewport::set_as_audio_listener); + ClassDB::bind_method(D_METHOD("is_audio_listener","enable"), &Viewport::is_audio_listener); - ClassDB::bind_method(_MD("set_as_audio_listener_2d","enable"), &Viewport::set_as_audio_listener_2d); - ClassDB::bind_method(_MD("is_audio_listener_2d","enable"), &Viewport::is_audio_listener_2d); - ClassDB::bind_method(_MD("set_attach_to_screen_rect","rect"), &Viewport::set_attach_to_screen_rect); + ClassDB::bind_method(D_METHOD("set_as_audio_listener_2d","enable"), &Viewport::set_as_audio_listener_2d); + ClassDB::bind_method(D_METHOD("is_audio_listener_2d","enable"), &Viewport::is_audio_listener_2d); + ClassDB::bind_method(D_METHOD("set_attach_to_screen_rect","rect"), &Viewport::set_attach_to_screen_rect); - ClassDB::bind_method(_MD("get_mouse_pos"), &Viewport::get_mouse_pos); - ClassDB::bind_method(_MD("warp_mouse","to_pos"), &Viewport::warp_mouse); + ClassDB::bind_method(D_METHOD("get_mouse_pos"), &Viewport::get_mouse_pos); + ClassDB::bind_method(D_METHOD("warp_mouse","to_pos"), &Viewport::warp_mouse); - ClassDB::bind_method(_MD("gui_has_modal_stack"), &Viewport::gui_has_modal_stack); - ClassDB::bind_method(_MD("gui_get_drag_data:Variant"), &Viewport::gui_get_drag_data); + ClassDB::bind_method(D_METHOD("gui_has_modal_stack"), &Viewport::gui_has_modal_stack); + ClassDB::bind_method(D_METHOD("gui_get_drag_data:Variant"), &Viewport::gui_get_drag_data); - ClassDB::bind_method(_MD("set_disable_input","disable"), &Viewport::set_disable_input); - ClassDB::bind_method(_MD("is_input_disabled"), &Viewport::is_input_disabled); + ClassDB::bind_method(D_METHOD("set_disable_input","disable"), &Viewport::set_disable_input); + ClassDB::bind_method(D_METHOD("is_input_disabled"), &Viewport::is_input_disabled); - ClassDB::bind_method(_MD("set_disable_3d","disable"), &Viewport::set_disable_3d); - ClassDB::bind_method(_MD("is_3d_disabled"), &Viewport::is_3d_disabled); + ClassDB::bind_method(D_METHOD("set_disable_3d","disable"), &Viewport::set_disable_3d); + ClassDB::bind_method(D_METHOD("is_3d_disabled"), &Viewport::is_3d_disabled); - ClassDB::bind_method(_MD("_gui_show_tooltip"), &Viewport::_gui_show_tooltip); - ClassDB::bind_method(_MD("_gui_remove_focus"), &Viewport::_gui_remove_focus); + ClassDB::bind_method(D_METHOD("_gui_show_tooltip"), &Viewport::_gui_show_tooltip); + ClassDB::bind_method(D_METHOD("_gui_remove_focus"), &Viewport::_gui_remove_focus); - ClassDB::bind_method(_MD("set_shadow_atlas_size","size"), &Viewport::set_shadow_atlas_size); - ClassDB::bind_method(_MD("get_shadow_atlas_size"), &Viewport::get_shadow_atlas_size); + ClassDB::bind_method(D_METHOD("set_shadow_atlas_size","size"), &Viewport::set_shadow_atlas_size); + ClassDB::bind_method(D_METHOD("get_shadow_atlas_size"), &Viewport::get_shadow_atlas_size); - ClassDB::bind_method(_MD("set_shadow_atlas_quadrant_subdiv","quadrant","subdiv"), &Viewport::set_shadow_atlas_quadrant_subdiv); - ClassDB::bind_method(_MD("get_shadow_atlas_quadrant_subdiv","quadrant"), &Viewport::get_shadow_atlas_quadrant_subdiv); + ClassDB::bind_method(D_METHOD("set_shadow_atlas_quadrant_subdiv","quadrant","subdiv"), &Viewport::set_shadow_atlas_quadrant_subdiv); + ClassDB::bind_method(D_METHOD("get_shadow_atlas_quadrant_subdiv","quadrant"), &Viewport::get_shadow_atlas_quadrant_subdiv); - ADD_PROPERTY( PropertyInfo(Variant::RECT2,"size"), _SCS("set_size"), _SCS("get_size") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"own_world"), _SCS("set_use_own_world"), _SCS("is_using_own_world") ); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world",PROPERTY_HINT_RESOURCE_TYPE,"World"), _SCS("set_world"), _SCS("get_world") ); - //ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world_2d",PROPERTY_HINT_RESOURCE_TYPE,"World2D"), _SCS("set_world_2d"), _SCS("get_world_2d") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"transparent_bg"), _SCS("set_transparent_background"), _SCS("has_transparent_background") ); + ADD_PROPERTY( PropertyInfo(Variant::RECT2,"size"), "set_size", "get_size") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"own_world"), "set_use_own_world", "is_using_own_world") ; + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world",PROPERTY_HINT_RESOURCE_TYPE,"World"), "set_world", "get_world") ; + //ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world_2d",PROPERTY_HINT_RESOURCE_TYPE,"World2D"), "set_world_2d", "get_world_2d") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"transparent_bg"), "set_transparent_background", "has_transparent_background") ; ADD_GROUP("Rendering",""); - ADD_PROPERTY( PropertyInfo(Variant::INT,"msaa",PROPERTY_HINT_ENUM,"Disabled,2x,4x,8x,16x"), _SCS("set_msaa"), _SCS("get_msaa") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"hdr"), _SCS("set_hdr"), _SCS("get_hdr") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"disable_3d"), _SCS("set_disable_3d"), _SCS("is_3d_disabled") ); + ADD_PROPERTY( PropertyInfo(Variant::INT,"msaa",PROPERTY_HINT_ENUM,"Disabled,2x,4x,8x,16x"), "set_msaa", "get_msaa") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"hdr"), "set_hdr", "get_hdr") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"disable_3d"), "set_disable_3d", "is_3d_disabled") ; ADD_GROUP("Render Target","render_target_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target_v_flip"), _SCS("set_vflip"), _SCS("get_vflip") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target_clear_on_new_frame"), _SCS("set_clear_on_new_frame"), _SCS("get_clear_on_new_frame") ); - ADD_PROPERTY( PropertyInfo(Variant::INT,"render_target_update_mode",PROPERTY_HINT_ENUM,"Disabled,Once,When Visible,Always"), _SCS("set_update_mode"), _SCS("get_update_mode") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target_v_flip"), "set_vflip", "get_vflip") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target_clear_on_new_frame"), "set_clear_on_new_frame", "get_clear_on_new_frame") ; + ADD_PROPERTY( PropertyInfo(Variant::INT,"render_target_update_mode",PROPERTY_HINT_ENUM,"Disabled,Once,When Visible,Always"), "set_update_mode", "get_update_mode") ; ADD_GROUP("Audio Listener","audio_listener_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"audio_listener_enable_2d"), _SCS("set_as_audio_listener_2d"), _SCS("is_audio_listener_2d") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"audio_listener_enable_3d"), _SCS("set_as_audio_listener"), _SCS("is_audio_listener") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"audio_listener_enable_2d"), "set_as_audio_listener_2d", "is_audio_listener_2d") ; + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"audio_listener_enable_3d"), "set_as_audio_listener", "is_audio_listener") ; ADD_GROUP("Physics","physics_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"physics_object_picking"), _SCS("set_physics_object_picking"), _SCS("get_physics_object_picking") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"physics_object_picking"), "set_physics_object_picking", "get_physics_object_picking") ; ADD_GROUP("GUI","gui_"); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"gui_disable_input"), _SCS("set_disable_input"), _SCS("is_input_disabled") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"gui_disable_input"), "set_disable_input", "is_input_disabled") ; ADD_GROUP("Shadow Atlas","shadow_atlas_"); - ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow_atlas_size"), _SCS("set_shadow_atlas_size"), _SCS("get_shadow_atlas_size") ); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_0",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), _SCS("set_shadow_atlas_quadrant_subdiv"), _SCS("get_shadow_atlas_quadrant_subdiv"),0 ); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_1",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), _SCS("set_shadow_atlas_quadrant_subdiv"), _SCS("get_shadow_atlas_quadrant_subdiv"),1 ); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_2",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), _SCS("set_shadow_atlas_quadrant_subdiv"), _SCS("get_shadow_atlas_quadrant_subdiv"),2 ); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_3",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), _SCS("set_shadow_atlas_quadrant_subdiv"), _SCS("get_shadow_atlas_quadrant_subdiv"),3 ); + ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow_atlas_size"), "set_shadow_atlas_size", "get_shadow_atlas_size") ; + ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_0",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), "set_shadow_atlas_quadrant_subdiv", "get_shadow_atlas_quadrant_subdiv",0 ); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_1",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), "set_shadow_atlas_quadrant_subdiv", "get_shadow_atlas_quadrant_subdiv",1 ); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_2",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), "set_shadow_atlas_quadrant_subdiv", "get_shadow_atlas_quadrant_subdiv",2 ); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_3",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), "set_shadow_atlas_quadrant_subdiv", "get_shadow_atlas_quadrant_subdiv",3 ); ADD_SIGNAL(MethodInfo("size_changed")); diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index c0eaca24a3..ffdc85301a 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "register_scene_types.h" #include "os/os.h" -#include "globals.h" +#include "global_config.h" #include "scene/io/resource_format_image.h" #include "scene/io/resource_format_wav.h" @@ -121,6 +121,8 @@ #include "scene/2d/position_2d.h" #include "scene/2d/tile_map.h" //#include "scene/2d/tile_map.h" +#include "scene/2d/line_2d.h" + #include "scene/resources/tile_set.h" #include "scene/animation/animation_player.h" @@ -494,6 +496,7 @@ void register_scene_types() { ClassDB::register_class<SpriteFrames>(); ClassDB::register_class<AnimatedSprite>(); ClassDB::register_class<Position2D>(); + ClassDB::register_class<Line2D>(); ClassDB::register_virtual_class<CollisionObject2D>(); ClassDB::register_virtual_class<PhysicsBody2D>(); ClassDB::register_class<StaticBody2D>(); diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 5b9baa6a67..b743834e63 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -1698,61 +1698,61 @@ float Animation::get_step() const{ void Animation::_bind_methods() { - ClassDB::bind_method(_MD("add_track","type","at_pos"),&Animation::add_track,DEFVAL(-1)); - ClassDB::bind_method(_MD("remove_track","idx"),&Animation::remove_track); - ClassDB::bind_method(_MD("get_track_count"),&Animation::get_track_count); - ClassDB::bind_method(_MD("track_get_type","idx"),&Animation::track_get_type); - ClassDB::bind_method(_MD("track_get_path","idx"),&Animation::track_get_path); - ClassDB::bind_method(_MD("track_set_path","idx","path"),&Animation::track_set_path); - ClassDB::bind_method(_MD("find_track","path"),&Animation::find_track); + ClassDB::bind_method(D_METHOD("add_track","type","at_pos"),&Animation::add_track,DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("remove_track","idx"),&Animation::remove_track); + ClassDB::bind_method(D_METHOD("get_track_count"),&Animation::get_track_count); + ClassDB::bind_method(D_METHOD("track_get_type","idx"),&Animation::track_get_type); + ClassDB::bind_method(D_METHOD("track_get_path","idx"),&Animation::track_get_path); + ClassDB::bind_method(D_METHOD("track_set_path","idx","path"),&Animation::track_set_path); + ClassDB::bind_method(D_METHOD("find_track","path"),&Animation::find_track); - ClassDB::bind_method(_MD("track_move_up","idx"),&Animation::track_move_up); - ClassDB::bind_method(_MD("track_move_down","idx"),&Animation::track_move_down); + ClassDB::bind_method(D_METHOD("track_move_up","idx"),&Animation::track_move_up); + ClassDB::bind_method(D_METHOD("track_move_down","idx"),&Animation::track_move_down); - ClassDB::bind_method(_MD("track_set_imported","idx","imported"),&Animation::track_set_imported); - ClassDB::bind_method(_MD("track_is_imported","idx"),&Animation::track_is_imported); + ClassDB::bind_method(D_METHOD("track_set_imported","idx","imported"),&Animation::track_set_imported); + ClassDB::bind_method(D_METHOD("track_is_imported","idx"),&Animation::track_is_imported); - ClassDB::bind_method(_MD("transform_track_insert_key","idx","time","loc","rot","scale"),&Animation::transform_track_insert_key); - ClassDB::bind_method(_MD("track_insert_key","idx","time","key","transition"),&Animation::track_insert_key,DEFVAL(1)); - ClassDB::bind_method(_MD("track_remove_key","idx","key_idx"),&Animation::track_remove_key); - ClassDB::bind_method(_MD("track_remove_key_at_pos","idx","pos"),&Animation::track_remove_key_at_pos); - ClassDB::bind_method(_MD("track_set_key_value","idx","key","value"),&Animation::track_set_key_value); - ClassDB::bind_method(_MD("track_set_key_transition","idx","key_idx","transition"),&Animation::track_set_key_transition); - ClassDB::bind_method(_MD("track_get_key_transition","idx","key_idx"),&Animation::track_get_key_transition); + ClassDB::bind_method(D_METHOD("transform_track_insert_key","idx","time","loc","rot","scale"),&Animation::transform_track_insert_key); + ClassDB::bind_method(D_METHOD("track_insert_key","idx","time","key","transition"),&Animation::track_insert_key,DEFVAL(1)); + ClassDB::bind_method(D_METHOD("track_remove_key","idx","key_idx"),&Animation::track_remove_key); + ClassDB::bind_method(D_METHOD("track_remove_key_at_pos","idx","pos"),&Animation::track_remove_key_at_pos); + ClassDB::bind_method(D_METHOD("track_set_key_value","idx","key","value"),&Animation::track_set_key_value); + ClassDB::bind_method(D_METHOD("track_set_key_transition","idx","key_idx","transition"),&Animation::track_set_key_transition); + ClassDB::bind_method(D_METHOD("track_get_key_transition","idx","key_idx"),&Animation::track_get_key_transition); - ClassDB::bind_method(_MD("track_get_key_count","idx"),&Animation::track_get_key_count); - ClassDB::bind_method(_MD("track_get_key_value","idx","key_idx"),&Animation::track_get_key_value); - ClassDB::bind_method(_MD("track_get_key_time","idx","key_idx"),&Animation::track_get_key_time); - ClassDB::bind_method(_MD("track_find_key","idx","time","exact"),&Animation::track_find_key,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("track_get_key_count","idx"),&Animation::track_get_key_count); + ClassDB::bind_method(D_METHOD("track_get_key_value","idx","key_idx"),&Animation::track_get_key_value); + ClassDB::bind_method(D_METHOD("track_get_key_time","idx","key_idx"),&Animation::track_get_key_time); + ClassDB::bind_method(D_METHOD("track_find_key","idx","time","exact"),&Animation::track_find_key,DEFVAL(false)); - ClassDB::bind_method(_MD("track_set_interpolation_type","idx","interpolation"),&Animation::track_set_interpolation_type); - ClassDB::bind_method(_MD("track_get_interpolation_type","idx"),&Animation::track_get_interpolation_type); + ClassDB::bind_method(D_METHOD("track_set_interpolation_type","idx","interpolation"),&Animation::track_set_interpolation_type); + ClassDB::bind_method(D_METHOD("track_get_interpolation_type","idx"),&Animation::track_get_interpolation_type); - ClassDB::bind_method(_MD("track_set_interpolation_loop_wrap","idx","interpolation"),&Animation::track_set_interpolation_loop_wrap); - ClassDB::bind_method(_MD("track_get_interpolation_loop_wrap","idx"),&Animation::track_get_interpolation_loop_wrap); + ClassDB::bind_method(D_METHOD("track_set_interpolation_loop_wrap","idx","interpolation"),&Animation::track_set_interpolation_loop_wrap); + ClassDB::bind_method(D_METHOD("track_get_interpolation_loop_wrap","idx"),&Animation::track_get_interpolation_loop_wrap); - ClassDB::bind_method(_MD("transform_track_interpolate","idx","time_sec"),&Animation::_transform_track_interpolate); - ClassDB::bind_method(_MD("value_track_set_update_mode","idx","mode"),&Animation::value_track_set_update_mode); - ClassDB::bind_method(_MD("value_track_get_update_mode","idx"),&Animation::value_track_get_update_mode); + ClassDB::bind_method(D_METHOD("transform_track_interpolate","idx","time_sec"),&Animation::_transform_track_interpolate); + ClassDB::bind_method(D_METHOD("value_track_set_update_mode","idx","mode"),&Animation::value_track_set_update_mode); + ClassDB::bind_method(D_METHOD("value_track_get_update_mode","idx"),&Animation::value_track_get_update_mode); - ClassDB::bind_method(_MD("value_track_get_key_indices","idx","time_sec","delta"),&Animation::_value_track_get_key_indices); + ClassDB::bind_method(D_METHOD("value_track_get_key_indices","idx","time_sec","delta"),&Animation::_value_track_get_key_indices); - ClassDB::bind_method(_MD("method_track_get_key_indices","idx","time_sec","delta"),&Animation::_method_track_get_key_indices); - ClassDB::bind_method(_MD("method_track_get_name","idx","key_idx"),&Animation::method_track_get_name); - ClassDB::bind_method(_MD("method_track_get_params","idx","key_idx"),&Animation::method_track_get_params); + ClassDB::bind_method(D_METHOD("method_track_get_key_indices","idx","time_sec","delta"),&Animation::_method_track_get_key_indices); + ClassDB::bind_method(D_METHOD("method_track_get_name","idx","key_idx"),&Animation::method_track_get_name); + ClassDB::bind_method(D_METHOD("method_track_get_params","idx","key_idx"),&Animation::method_track_get_params); - ClassDB::bind_method(_MD("set_length","time_sec"),&Animation::set_length); - ClassDB::bind_method(_MD("get_length"),&Animation::get_length); + ClassDB::bind_method(D_METHOD("set_length","time_sec"),&Animation::set_length); + ClassDB::bind_method(D_METHOD("get_length"),&Animation::get_length); - ClassDB::bind_method(_MD("set_loop","enabled"),&Animation::set_loop); - ClassDB::bind_method(_MD("has_loop"),&Animation::has_loop); + ClassDB::bind_method(D_METHOD("set_loop","enabled"),&Animation::set_loop); + ClassDB::bind_method(D_METHOD("has_loop"),&Animation::has_loop); - ClassDB::bind_method(_MD("set_step","size_sec"),&Animation::set_step); - ClassDB::bind_method(_MD("get_step"),&Animation::get_step); + ClassDB::bind_method(D_METHOD("set_step","size_sec"),&Animation::set_step); + ClassDB::bind_method(D_METHOD("get_step"),&Animation::get_step); - ClassDB::bind_method(_MD("clear"),&Animation::clear); + ClassDB::bind_method(D_METHOD("clear"),&Animation::clear); BIND_CONSTANT( TYPE_VALUE ); BIND_CONSTANT( TYPE_TRANSFORM ); diff --git a/scene/resources/audio_stream_resampled.cpp b/scene/resources/audio_stream_resampled.cpp index 7b49ec0849..b2f314a55e 100644 --- a/scene/resources/audio_stream_resampled.cpp +++ b/scene/resources/audio_stream_resampled.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "audio_stream_resampled.h" -#include "globals.h" +#include "global_config.h" #if 0 diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index 21339cb90b..4aee119b0e 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_stream_sample.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_stream_sample.h" void AudioStreamPlaybackSample::start(float p_from_pos) { @@ -504,34 +532,34 @@ String AudioStreamSample::get_stream_name() const { void AudioStreamSample::_bind_methods() { - ClassDB::bind_method(_MD("set_format","format"),&AudioStreamSample::set_format); - ClassDB::bind_method(_MD("get_format"),&AudioStreamSample::get_format); + ClassDB::bind_method(D_METHOD("set_format","format"),&AudioStreamSample::set_format); + ClassDB::bind_method(D_METHOD("get_format"),&AudioStreamSample::get_format); - ClassDB::bind_method(_MD("set_loop_mode","loop_mode"),&AudioStreamSample::set_loop_mode); - ClassDB::bind_method(_MD("get_loop_mode"),&AudioStreamSample::get_loop_mode); + ClassDB::bind_method(D_METHOD("set_loop_mode","loop_mode"),&AudioStreamSample::set_loop_mode); + ClassDB::bind_method(D_METHOD("get_loop_mode"),&AudioStreamSample::get_loop_mode); - ClassDB::bind_method(_MD("set_loop_begin","loop_begin"),&AudioStreamSample::set_loop_begin); - ClassDB::bind_method(_MD("get_loop_begin"),&AudioStreamSample::get_loop_begin); + ClassDB::bind_method(D_METHOD("set_loop_begin","loop_begin"),&AudioStreamSample::set_loop_begin); + ClassDB::bind_method(D_METHOD("get_loop_begin"),&AudioStreamSample::get_loop_begin); - ClassDB::bind_method(_MD("set_loop_end","loop_end"),&AudioStreamSample::set_loop_end); - ClassDB::bind_method(_MD("get_loop_end"),&AudioStreamSample::get_loop_end); + ClassDB::bind_method(D_METHOD("set_loop_end","loop_end"),&AudioStreamSample::set_loop_end); + ClassDB::bind_method(D_METHOD("get_loop_end"),&AudioStreamSample::get_loop_end); - ClassDB::bind_method(_MD("set_mix_rate","mix_rate"),&AudioStreamSample::set_mix_rate); - ClassDB::bind_method(_MD("get_mix_rate"),&AudioStreamSample::get_mix_rate); + ClassDB::bind_method(D_METHOD("set_mix_rate","mix_rate"),&AudioStreamSample::set_mix_rate); + ClassDB::bind_method(D_METHOD("get_mix_rate"),&AudioStreamSample::get_mix_rate); - ClassDB::bind_method(_MD("set_stereo","stereo"),&AudioStreamSample::set_stereo); - ClassDB::bind_method(_MD("is_stereo"),&AudioStreamSample::is_stereo); + ClassDB::bind_method(D_METHOD("set_stereo","stereo"),&AudioStreamSample::set_stereo); + ClassDB::bind_method(D_METHOD("is_stereo"),&AudioStreamSample::is_stereo); - ClassDB::bind_method(_MD("set_data","data"),&AudioStreamSample::set_data); - ClassDB::bind_method(_MD("get_data"),&AudioStreamSample::get_data); + ClassDB::bind_method(D_METHOD("set_data","data"),&AudioStreamSample::set_data); + ClassDB::bind_method(D_METHOD("get_data"),&AudioStreamSample::get_data); - ADD_PROPERTY(PropertyInfo(Variant::INT,"format",PROPERTY_HINT_ENUM,"8-Bit,16-Bit,IMA-ADPCM"),_SCS("set_format"),_SCS("get_format")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"loop_mode",PROPERTY_HINT_ENUM,"Disabled,Forward,Ping-Pong"),_SCS("set_loop_mode"),_SCS("get_loop_mode")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"loop_begin"),_SCS("set_loop_begin"),_SCS("get_loop_begin")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"loop_end"),_SCS("set_loop_end"),_SCS("get_loop_end")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"mix_rate"),_SCS("set_mix_rate"),_SCS("get_mix_rate")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"stereo"),_SCS("set_stereo"),_SCS("is_stereo")); - ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_data"),_SCS("get_data")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"format",PROPERTY_HINT_ENUM,"8-Bit,16-Bit,IMA-ADPCM"),"set_format","get_format"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"loop_mode",PROPERTY_HINT_ENUM,"Disabled,Forward,Ping-Pong"),"set_loop_mode","get_loop_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"loop_begin"),"set_loop_begin","get_loop_begin"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"loop_end"),"set_loop_end","get_loop_end"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"mix_rate"),"set_mix_rate","get_mix_rate"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"stereo"),"set_stereo","is_stereo"); + ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"set_data","get_data"); } diff --git a/scene/resources/audio_stream_sample.h b/scene/resources/audio_stream_sample.h index 8c1e74608b..53e628c0e4 100644 --- a/scene/resources/audio_stream_sample.h +++ b/scene/resources/audio_stream_sample.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_stream_sample.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOSTREAMSAMPLE_H #define AUDIOSTREAMSAMPLE_H diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp index d669ab771c..4ceac5af0c 100644 --- a/scene/resources/bit_mask.cpp +++ b/scene/resources/bit_mask.cpp @@ -177,21 +177,21 @@ Dictionary BitMap::_get_data() const{ void BitMap::_bind_methods() { - ClassDB::bind_method(_MD("create","size"),&BitMap::create); - ClassDB::bind_method(_MD("create_from_image_alpha","image"),&BitMap::create_from_image_alpha); + ClassDB::bind_method(D_METHOD("create","size"),&BitMap::create); + ClassDB::bind_method(D_METHOD("create_from_image_alpha","image"),&BitMap::create_from_image_alpha); - ClassDB::bind_method(_MD("set_bit","pos","bit"),&BitMap::set_bit); - ClassDB::bind_method(_MD("get_bit","pos"),&BitMap::get_bit); + ClassDB::bind_method(D_METHOD("set_bit","pos","bit"),&BitMap::set_bit); + ClassDB::bind_method(D_METHOD("get_bit","pos"),&BitMap::get_bit); - ClassDB::bind_method(_MD("set_bit_rect","p_rect","bit"),&BitMap::set_bit_rect); - ClassDB::bind_method(_MD("get_true_bit_count"),&BitMap::get_true_bit_count); + ClassDB::bind_method(D_METHOD("set_bit_rect","p_rect","bit"),&BitMap::set_bit_rect); + ClassDB::bind_method(D_METHOD("get_true_bit_count"),&BitMap::get_true_bit_count); - ClassDB::bind_method(_MD("get_size"),&BitMap::get_size); + ClassDB::bind_method(D_METHOD("get_size"),&BitMap::get_size); - ClassDB::bind_method(_MD("_set_data"),&BitMap::_set_data); - ClassDB::bind_method(_MD("_get_data"),&BitMap::_get_data); + ClassDB::bind_method(D_METHOD("_set_data"),&BitMap::_set_data); + ClassDB::bind_method(D_METHOD("_get_data"),&BitMap::_get_data); - ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_data"),_SCS("_get_data")); + ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_data","_get_data"); } diff --git a/scene/resources/bounds.cpp b/scene/resources/bounds.cpp index 03d819451d..26bf6270e9 100644 --- a/scene/resources/bounds.cpp +++ b/scene/resources/bounds.cpp @@ -31,10 +31,10 @@ void Bounds::_bind_methods() { - ClassDB::bind_method( _MD("set_bsp_tree","bsp_tree"),&Bounds::set_bsp_tree); - ClassDB::bind_method( _MD("get_bsp_tree"),&Bounds::get_bsp_tree ); + ClassDB::bind_method( D_METHOD("set_bsp_tree","bsp_tree"),&Bounds::set_bsp_tree); + ClassDB::bind_method( D_METHOD("get_bsp_tree"),&Bounds::get_bsp_tree ); - ADD_PROPERTY( PropertyInfo( Variant::ARRAY, "bsp_tree" ), _SCS("set_bsp_tree"), _SCS("get_bsp_tree")); + ADD_PROPERTY( PropertyInfo( Variant::ARRAY, "bsp_tree" ), "set_bsp_tree", "get_bsp_tree"); } diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp index 87585af862..e8eccaceae 100644 --- a/scene/resources/box_shape.cpp +++ b/scene/resources/box_shape.cpp @@ -70,10 +70,10 @@ Vector3 BoxShape::get_extents() const { void BoxShape::_bind_methods() { - ClassDB::bind_method(_MD("set_extents","extents"),&BoxShape::set_extents); - ClassDB::bind_method(_MD("get_extents"),&BoxShape::get_extents); + ClassDB::bind_method(D_METHOD("set_extents","extents"),&BoxShape::set_extents); + ClassDB::bind_method(D_METHOD("get_extents"),&BoxShape::get_extents); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"extents"), _SCS("set_extents"), _SCS("get_extents") ); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"extents"), "set_extents", "get_extents") ; } diff --git a/scene/resources/capsule_shape.cpp b/scene/resources/capsule_shape.cpp index 23538c1957..bd30f009c4 100644 --- a/scene/resources/capsule_shape.cpp +++ b/scene/resources/capsule_shape.cpp @@ -107,13 +107,13 @@ float CapsuleShape::get_height() const { void CapsuleShape::_bind_methods() { - ClassDB::bind_method(_MD("set_radius","radius"),&CapsuleShape::set_radius); - ClassDB::bind_method(_MD("get_radius"),&CapsuleShape::get_radius); - ClassDB::bind_method(_MD("set_height","height"),&CapsuleShape::set_height); - ClassDB::bind_method(_MD("get_height"),&CapsuleShape::get_height); + ClassDB::bind_method(D_METHOD("set_radius","radius"),&CapsuleShape::set_radius); + ClassDB::bind_method(D_METHOD("get_radius"),&CapsuleShape::get_radius); + ClassDB::bind_method(D_METHOD("set_height","height"),&CapsuleShape::set_height); + ClassDB::bind_method(D_METHOD("get_height"),&CapsuleShape::get_height); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,4096,0.01"), _SCS("set_radius"),_SCS("get_radius") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"height",PROPERTY_HINT_RANGE,"0.01,4096,0.01"), _SCS("set_height"),_SCS("get_height") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,4096,0.01"), "set_radius","get_radius") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"height",PROPERTY_HINT_RANGE,"0.01,4096,0.01"), "set_height","get_height") ; } diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp index 27dcff0ce0..523d6d7455 100644 --- a/scene/resources/capsule_shape_2d.cpp +++ b/scene/resources/capsule_shape_2d.cpp @@ -89,15 +89,15 @@ Rect2 CapsuleShape2D::get_rect() const { void CapsuleShape2D::_bind_methods() { - ClassDB::bind_method(_MD("set_radius","radius"),&CapsuleShape2D::set_radius); - ClassDB::bind_method(_MD("get_radius"),&CapsuleShape2D::get_radius); + ClassDB::bind_method(D_METHOD("set_radius","radius"),&CapsuleShape2D::set_radius); + ClassDB::bind_method(D_METHOD("get_radius"),&CapsuleShape2D::get_radius); - ClassDB::bind_method(_MD("set_height","height"),&CapsuleShape2D::set_height); - ClassDB::bind_method(_MD("get_height"),&CapsuleShape2D::get_height); + ClassDB::bind_method(D_METHOD("set_height","height"),&CapsuleShape2D::set_height); + ClassDB::bind_method(D_METHOD("get_height"),&CapsuleShape2D::get_height); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius"),_SCS("set_radius"),_SCS("get_radius") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"height"),_SCS("set_height"),_SCS("get_height") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius"),"set_radius","get_radius") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"height"),"set_height","get_height") ; } diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp index a82f3f5e2d..cd707b1032 100644 --- a/scene/resources/circle_shape_2d.cpp +++ b/scene/resources/circle_shape_2d.cpp @@ -51,10 +51,10 @@ real_t CircleShape2D::get_radius() const { void CircleShape2D::_bind_methods() { - ClassDB::bind_method(_MD("set_radius","radius"),&CircleShape2D::set_radius); - ClassDB::bind_method(_MD("get_radius"),&CircleShape2D::get_radius); + ClassDB::bind_method(D_METHOD("set_radius","radius"),&CircleShape2D::set_radius); + ClassDB::bind_method(D_METHOD("get_radius"),&CircleShape2D::get_radius); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,16384,0.5"),_SCS("set_radius"),_SCS("get_radius") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,16384,0.5"),"set_radius","get_radius") ; } diff --git a/scene/resources/color_ramp.cpp b/scene/resources/color_ramp.cpp index 1144ea41f1..b14ba4c8ed 100644 --- a/scene/resources/color_ramp.cpp +++ b/scene/resources/color_ramp.cpp @@ -27,6 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "color_ramp.h" +#include "core_string_names.h" //setter and getter names for property serialization #define COLOR_RAMP_GET_OFFSETS "get_offsets" @@ -54,27 +55,27 @@ void ColorRamp::_bind_methods() { - ClassDB::bind_method(_MD("add_point","offset","color"),&ColorRamp::add_point); - ClassDB::bind_method(_MD("remove_point","offset","color"),&ColorRamp::remove_point); + ClassDB::bind_method(D_METHOD("add_point","offset","color"),&ColorRamp::add_point); + ClassDB::bind_method(D_METHOD("remove_point","offset","color"),&ColorRamp::remove_point); - ClassDB::bind_method(_MD("set_offset","point","offset"),&ColorRamp::set_offset); - ClassDB::bind_method(_MD("get_offset","point"),&ColorRamp::get_offset); + ClassDB::bind_method(D_METHOD("set_offset","point","offset"),&ColorRamp::set_offset); + ClassDB::bind_method(D_METHOD("get_offset","point"),&ColorRamp::get_offset); - ClassDB::bind_method(_MD("set_color","point","color"),&ColorRamp::set_color); - ClassDB::bind_method(_MD("get_color","point"),&ColorRamp::get_color); + ClassDB::bind_method(D_METHOD("set_color","point","color"),&ColorRamp::set_color); + ClassDB::bind_method(D_METHOD("get_color","point"),&ColorRamp::get_color); - ClassDB::bind_method(_MD("interpolate","offset"),&ColorRamp::get_color_at_offset); + ClassDB::bind_method(D_METHOD("interpolate","offset"),&ColorRamp::get_color_at_offset); - ClassDB::bind_method(_MD("get_point_count"),&ColorRamp::get_points_count); + ClassDB::bind_method(D_METHOD("get_point_count"),&ColorRamp::get_points_count); - ClassDB::bind_method(_MD(COLOR_RAMP_SET_OFFSETS,"offsets"),&ColorRamp::set_offsets); - ClassDB::bind_method(_MD(COLOR_RAMP_GET_OFFSETS),&ColorRamp::get_offsets); + ClassDB::bind_method(D_METHOD(COLOR_RAMP_SET_OFFSETS,"offsets"),&ColorRamp::set_offsets); + ClassDB::bind_method(D_METHOD(COLOR_RAMP_GET_OFFSETS),&ColorRamp::get_offsets); - ClassDB::bind_method(_MD(COLOR_RAMP_SET_COLORS,"colors"),&ColorRamp::set_colors); - ClassDB::bind_method(_MD(COLOR_RAMP_GET_COLORS),&ColorRamp::get_colors); + ClassDB::bind_method(D_METHOD(COLOR_RAMP_SET_COLORS,"colors"),&ColorRamp::set_colors); + ClassDB::bind_method(D_METHOD(COLOR_RAMP_GET_COLORS),&ColorRamp::get_colors); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"offsets"),_SCS(COLOR_RAMP_SET_OFFSETS),_SCS(COLOR_RAMP_GET_OFFSETS) ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"colors"),_SCS(COLOR_RAMP_SET_COLORS),_SCS(COLOR_RAMP_GET_COLORS) ); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"offsets"),COLOR_RAMP_SET_OFFSETS,COLOR_RAMP_GET_OFFSETS) ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"colors"),COLOR_RAMP_SET_COLORS,COLOR_RAMP_GET_COLORS) ; } Vector<float> ColorRamp::get_offsets() const { @@ -104,6 +105,7 @@ void ColorRamp::set_offsets(const Vector<float>& p_offsets) { points[i].offset = p_offsets[i]; } is_sorted = false; + emit_signal(CoreStringNames::get_singleton()->changed); } void ColorRamp::set_colors(const Vector<Color>& p_colors) { @@ -114,6 +116,7 @@ void ColorRamp::set_colors(const Vector<Color>& p_colors) { { points[i].color = p_colors[i]; } + emit_signal(CoreStringNames::get_singleton()->changed); } Vector<ColorRamp::Point>& ColorRamp::get_points() { @@ -128,6 +131,7 @@ void ColorRamp::add_point(float p_offset, const Color& p_color) { is_sorted=false; points.push_back(p); + emit_signal(CoreStringNames::get_singleton()->changed); } void ColorRamp::remove_point(int p_index) { @@ -135,11 +139,13 @@ void ColorRamp::remove_point(int p_index) { ERR_FAIL_INDEX(p_index,points.size()); ERR_FAIL_COND(points.size()<=2); points.remove(p_index); + emit_signal(CoreStringNames::get_singleton()->changed); } void ColorRamp::set_points(Vector<ColorRamp::Point>& p_points) { points = p_points; is_sorted = false; + emit_signal(CoreStringNames::get_singleton()->changed); } void ColorRamp::set_offset(int pos, const float offset) { @@ -147,6 +153,7 @@ void ColorRamp::set_offset(int pos, const float offset) { points.resize(pos + 1); points[pos].offset = offset; is_sorted = false; + emit_signal(CoreStringNames::get_singleton()->changed); } float ColorRamp::get_offset(int pos) const { @@ -162,6 +169,7 @@ void ColorRamp::set_color(int pos, const Color& color) { is_sorted = false; } points[pos].color = color; + emit_signal(CoreStringNames::get_singleton()->changed); } Color ColorRamp::get_color(int pos) const { diff --git a/scene/resources/concave_polygon_shape.cpp b/scene/resources/concave_polygon_shape.cpp index 5190bba6a5..3945ade215 100644 --- a/scene/resources/concave_polygon_shape.cpp +++ b/scene/resources/concave_polygon_shape.cpp @@ -110,8 +110,8 @@ PoolVector<Vector3> ConcavePolygonShape::get_faces() const { void ConcavePolygonShape::_bind_methods() { - ClassDB::bind_method(_MD("set_faces","faces"),&ConcavePolygonShape::set_faces); - ClassDB::bind_method(_MD("get_faces"),&ConcavePolygonShape::get_faces); + ClassDB::bind_method(D_METHOD("set_faces","faces"),&ConcavePolygonShape::set_faces); + ClassDB::bind_method(D_METHOD("get_faces"),&ConcavePolygonShape::get_faces); } ConcavePolygonShape::ConcavePolygonShape() : Shape( PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONCAVE_POLYGON)) { diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp index 6866750006..f3dfa8a2b3 100644 --- a/scene/resources/concave_polygon_shape_2d.cpp +++ b/scene/resources/concave_polygon_shape_2d.cpp @@ -82,10 +82,10 @@ Rect2 ConcavePolygonShape2D::get_rect() const { void ConcavePolygonShape2D::_bind_methods() { - ClassDB::bind_method(_MD("set_segments","segments"),&ConcavePolygonShape2D::set_segments); - ClassDB::bind_method(_MD("get_segments"),&ConcavePolygonShape2D::get_segments); + ClassDB::bind_method(D_METHOD("set_segments","segments"),&ConcavePolygonShape2D::set_segments); + ClassDB::bind_method(D_METHOD("get_segments"),&ConcavePolygonShape2D::get_segments); - ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"segments"),_SCS("set_segments"),_SCS("get_segments") ); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"segments"),"set_segments","get_segments") ; } diff --git a/scene/resources/convex_polygon_shape.cpp b/scene/resources/convex_polygon_shape.cpp index ca9897bf97..207419f8cd 100644 --- a/scene/resources/convex_polygon_shape.cpp +++ b/scene/resources/convex_polygon_shape.cpp @@ -79,10 +79,10 @@ PoolVector<Vector3> ConvexPolygonShape::get_points() const { void ConvexPolygonShape::_bind_methods() { - ClassDB::bind_method(_MD("set_points","points"),&ConvexPolygonShape::set_points); - ClassDB::bind_method(_MD("get_points"),&ConvexPolygonShape::get_points); + ClassDB::bind_method(D_METHOD("set_points","points"),&ConvexPolygonShape::set_points); + ClassDB::bind_method(D_METHOD("get_points"),&ConvexPolygonShape::get_points); - ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"points"), _SCS("set_points"), _SCS("get_points") ); + ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"points"), "set_points", "get_points") ; } diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp index 0d3ba238f6..2a4b181611 100644 --- a/scene/resources/convex_polygon_shape_2d.cpp +++ b/scene/resources/convex_polygon_shape_2d.cpp @@ -61,13 +61,13 @@ Vector<Vector2> ConvexPolygonShape2D::get_points() const { void ConvexPolygonShape2D::_bind_methods() { - ClassDB::bind_method(_MD("set_point_cloud","point_cloud"),&ConvexPolygonShape2D::set_point_cloud); - ClassDB::bind_method(_MD("set_points","points"),&ConvexPolygonShape2D::set_points); - ClassDB::bind_method(_MD("get_points"),&ConvexPolygonShape2D::get_points); + ClassDB::bind_method(D_METHOD("set_point_cloud","point_cloud"),&ConvexPolygonShape2D::set_point_cloud); + ClassDB::bind_method(D_METHOD("set_points","points"),&ConvexPolygonShape2D::set_points); + ClassDB::bind_method(D_METHOD("get_points"),&ConvexPolygonShape2D::get_points); - ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"points"),_SCS("set_points"),_SCS("get_points") ); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"points"),"set_points","get_points") ; } diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 3392c68e75..9311ab4dd7 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -349,30 +349,30 @@ Vector2Array Curve2D::get_points_pos() const { void Curve2D::_bind_methods() { - ClassDB::bind_method(_MD("get_point_count"),&Curve2D::get_point_count); - ClassDB::bind_method(_MD("add_point","pos","in","out"),&Curve2D::add_point,DEFVAL(Vector2()),DEFVAL(Vector2())); - ClassDB::bind_method(_MD("set_point_pos","idx","pos"),&Curve2D::set_point_pos); - ClassDB::bind_method(_MD("get_point_pos","idx"),&Curve2D::get_point_pos); - ClassDB::bind_method(_MD("set_point_in","idx","pos"),&Curve2D::set_point_in); - ClassDB::bind_method(_MD("get_point_in","idx"),&Curve2D::get_point_in); - ClassDB::bind_method(_MD("set_point_out","idx","pos"),&Curve2D::set_point_out); - ClassDB::bind_method(_MD("get_point_out","idx"),&Curve2D::get_point_out); - ClassDB::bind_method(_MD("remove_point","idx"),&Curve2D::remove_point); - ClassDB::bind_method(_MD("interpolate","idx","t"),&Curve2D::interpolate); - ClassDB::bind_method(_MD("bake","subdivs"),&Curve2D::bake,DEFVAL(10)); + ClassDB::bind_method(D_METHOD("get_point_count"),&Curve2D::get_point_count); + ClassDB::bind_method(D_METHOD("add_point","pos","in","out"),&Curve2D::add_point,DEFVAL(Vector2()),DEFVAL(Vector2())); + ClassDB::bind_method(D_METHOD("set_point_pos","idx","pos"),&Curve2D::set_point_pos); + ClassDB::bind_method(D_METHOD("get_point_pos","idx"),&Curve2D::get_point_pos); + ClassDB::bind_method(D_METHOD("set_point_in","idx","pos"),&Curve2D::set_point_in); + ClassDB::bind_method(D_METHOD("get_point_in","idx"),&Curve2D::get_point_in); + ClassDB::bind_method(D_METHOD("set_point_out","idx","pos"),&Curve2D::set_point_out); + ClassDB::bind_method(D_METHOD("get_point_out","idx"),&Curve2D::get_point_out); + ClassDB::bind_method(D_METHOD("remove_point","idx"),&Curve2D::remove_point); + ClassDB::bind_method(D_METHOD("interpolate","idx","t"),&Curve2D::interpolate); + ClassDB::bind_method(D_METHOD("bake","subdivs"),&Curve2D::bake,DEFVAL(10)); - ClassDB::bind_method(_MD("set_points_in"),&Curve2D::set_points_in); - ClassDB::bind_method(_MD("set_points_out"),&Curve2D::set_points_out); - ClassDB::bind_method(_MD("set_points_pos"),&Curve2D::set_points_pos); + ClassDB::bind_method(D_METHOD("set_points_in"),&Curve2D::set_points_in); + ClassDB::bind_method(D_METHOD("set_points_out"),&Curve2D::set_points_out); + ClassDB::bind_method(D_METHOD("set_points_pos"),&Curve2D::set_points_pos); - ClassDB::bind_method(_MD("get_points_in"),&Curve2D::get_points_in); - ClassDB::bind_method(_MD("get_points_out"),&Curve2D::get_points_out); - ClassDB::bind_method(_MD("get_points_pos"),&Curve2D::get_points_pos); + ClassDB::bind_method(D_METHOD("get_points_in"),&Curve2D::get_points_in); + ClassDB::bind_method(D_METHOD("get_points_out"),&Curve2D::get_points_out); + ClassDB::bind_method(D_METHOD("get_points_pos"),&Curve2D::get_points_pos); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_in"), _SCS("set_points_in"),_SCS("get_points_in")); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_out"), _SCS("set_points_out"),_SCS("get_points_out")); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_pos"), _SCS("set_points_pos"),_SCS("get_points_pos")); + ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_in"), "set_points_in","get_points_in"); + ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_out"), "set_points_out","get_points_out"); + ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_pos"), "set_points_pos","get_points_pos"); } @@ -789,35 +789,35 @@ PoolVector2Array Curve2D::tesselate(int p_max_stages,float p_tolerance) const { void Curve2D::_bind_methods() { - ClassDB::bind_method(_MD("get_point_count"),&Curve2D::get_point_count); - ClassDB::bind_method(_MD("add_point","pos","in","out","atpos"),&Curve2D::add_point,DEFVAL(Vector2()),DEFVAL(Vector2()),DEFVAL(-1)); - ClassDB::bind_method(_MD("set_point_pos","idx","pos"),&Curve2D::set_point_pos); - ClassDB::bind_method(_MD("get_point_pos","idx"),&Curve2D::get_point_pos); - ClassDB::bind_method(_MD("set_point_in","idx","pos"),&Curve2D::set_point_in); - ClassDB::bind_method(_MD("get_point_in","idx"),&Curve2D::get_point_in); - ClassDB::bind_method(_MD("set_point_out","idx","pos"),&Curve2D::set_point_out); - ClassDB::bind_method(_MD("get_point_out","idx"),&Curve2D::get_point_out); - ClassDB::bind_method(_MD("remove_point","idx"),&Curve2D::remove_point); - ClassDB::bind_method(_MD("clear_points"),&Curve2D::clear_points); - ClassDB::bind_method(_MD("interpolate","idx","t"),&Curve2D::interpolate); - ClassDB::bind_method(_MD("interpolatef","fofs"),&Curve2D::interpolatef); - //ClassDB::bind_method(_MD("bake","subdivs"),&Curve2D::bake,DEFVAL(10)); - ClassDB::bind_method(_MD("set_bake_interval","distance"),&Curve2D::set_bake_interval); - ClassDB::bind_method(_MD("get_bake_interval"),&Curve2D::get_bake_interval); - - ClassDB::bind_method(_MD("get_baked_length"),&Curve2D::get_baked_length); - ClassDB::bind_method(_MD("interpolate_baked","offset","cubic"),&Curve2D::interpolate_baked,DEFVAL(false)); - ClassDB::bind_method(_MD("get_baked_points"),&Curve2D::get_baked_points); - ClassDB::bind_method(_MD("tesselate","max_stages","tolerance_degrees"),&Curve2D::tesselate,DEFVAL(5),DEFVAL(4)); - - ClassDB::bind_method(_MD("_get_data"),&Curve2D::_get_data); - ClassDB::bind_method(_MD("_set_data"),&Curve2D::_set_data); - - - ADD_PROPERTY( PropertyInfo( Variant::REAL, "bake_interval",PROPERTY_HINT_RANGE,"0.01,512,0.01"), _SCS("set_bake_interval"),_SCS("get_bake_interval")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"),_SCS("_get_data")); - /*ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_out"), _SCS("set_points_out"),_SCS("get_points_out")); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_pos"), _SCS("set_points_pos"),_SCS("get_points_pos")); + ClassDB::bind_method(D_METHOD("get_point_count"),&Curve2D::get_point_count); + ClassDB::bind_method(D_METHOD("add_point","pos","in","out","atpos"),&Curve2D::add_point,DEFVAL(Vector2()),DEFVAL(Vector2()),DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("set_point_pos","idx","pos"),&Curve2D::set_point_pos); + ClassDB::bind_method(D_METHOD("get_point_pos","idx"),&Curve2D::get_point_pos); + ClassDB::bind_method(D_METHOD("set_point_in","idx","pos"),&Curve2D::set_point_in); + ClassDB::bind_method(D_METHOD("get_point_in","idx"),&Curve2D::get_point_in); + ClassDB::bind_method(D_METHOD("set_point_out","idx","pos"),&Curve2D::set_point_out); + ClassDB::bind_method(D_METHOD("get_point_out","idx"),&Curve2D::get_point_out); + ClassDB::bind_method(D_METHOD("remove_point","idx"),&Curve2D::remove_point); + ClassDB::bind_method(D_METHOD("clear_points"),&Curve2D::clear_points); + ClassDB::bind_method(D_METHOD("interpolate","idx","t"),&Curve2D::interpolate); + ClassDB::bind_method(D_METHOD("interpolatef","fofs"),&Curve2D::interpolatef); + //ClassDB::bind_method(D_METHOD("bake","subdivs"),&Curve2D::bake,DEFVAL(10)); + ClassDB::bind_method(D_METHOD("set_bake_interval","distance"),&Curve2D::set_bake_interval); + ClassDB::bind_method(D_METHOD("get_bake_interval"),&Curve2D::get_bake_interval); + + ClassDB::bind_method(D_METHOD("get_baked_length"),&Curve2D::get_baked_length); + ClassDB::bind_method(D_METHOD("interpolate_baked","offset","cubic"),&Curve2D::interpolate_baked,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_baked_points"),&Curve2D::get_baked_points); + ClassDB::bind_method(D_METHOD("tesselate","max_stages","tolerance_degrees"),&Curve2D::tesselate,DEFVAL(5),DEFVAL(4)); + + ClassDB::bind_method(D_METHOD("_get_data"),&Curve2D::_get_data); + ClassDB::bind_method(D_METHOD("_set_data"),&Curve2D::_set_data); + + + ADD_PROPERTY( PropertyInfo( Variant::REAL, "bake_interval",PROPERTY_HINT_RANGE,"0.01,512,0.01"), "set_bake_interval","get_bake_interval"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_data","_get_data"); + /*ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_out"), "set_points_out","get_points_out"); + ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_pos"), "set_points_pos","get_points_pos"); */ } @@ -1329,38 +1329,38 @@ PoolVector3Array Curve3D::tesselate(int p_max_stages,float p_tolerance) const { void Curve3D::_bind_methods() { - ClassDB::bind_method(_MD("get_point_count"),&Curve3D::get_point_count); - ClassDB::bind_method(_MD("add_point","pos","in","out","atpos"),&Curve3D::add_point,DEFVAL(Vector3()),DEFVAL(Vector3()),DEFVAL(-1)); - ClassDB::bind_method(_MD("set_point_pos","idx","pos"),&Curve3D::set_point_pos); - ClassDB::bind_method(_MD("get_point_pos","idx"),&Curve3D::get_point_pos); - ClassDB::bind_method(_MD("set_point_tilt","idx","tilt"),&Curve3D::set_point_tilt); - ClassDB::bind_method(_MD("get_point_tilt","idx"),&Curve3D::get_point_tilt); - ClassDB::bind_method(_MD("set_point_in","idx","pos"),&Curve3D::set_point_in); - ClassDB::bind_method(_MD("get_point_in","idx"),&Curve3D::get_point_in); - ClassDB::bind_method(_MD("set_point_out","idx","pos"),&Curve3D::set_point_out); - ClassDB::bind_method(_MD("get_point_out","idx"),&Curve3D::get_point_out); - ClassDB::bind_method(_MD("remove_point","idx"),&Curve3D::remove_point); - ClassDB::bind_method(_MD("clear_points"),&Curve3D::clear_points); - ClassDB::bind_method(_MD("interpolate","idx","t"),&Curve3D::interpolate); - ClassDB::bind_method(_MD("interpolatef","fofs"),&Curve3D::interpolatef); - //ClassDB::bind_method(_MD("bake","subdivs"),&Curve3D::bake,DEFVAL(10)); - ClassDB::bind_method(_MD("set_bake_interval","distance"),&Curve3D::set_bake_interval); - ClassDB::bind_method(_MD("get_bake_interval"),&Curve3D::get_bake_interval); - - ClassDB::bind_method(_MD("get_baked_length"),&Curve3D::get_baked_length); - ClassDB::bind_method(_MD("interpolate_baked","offset","cubic"),&Curve3D::interpolate_baked,DEFVAL(false)); - ClassDB::bind_method(_MD("get_baked_points"),&Curve3D::get_baked_points); - ClassDB::bind_method(_MD("get_baked_tilts"),&Curve3D::get_baked_tilts); - ClassDB::bind_method(_MD("tesselate","max_stages","tolerance_degrees"),&Curve3D::tesselate,DEFVAL(5),DEFVAL(4)); - - ClassDB::bind_method(_MD("_get_data"),&Curve3D::_get_data); - ClassDB::bind_method(_MD("_set_data"),&Curve3D::_set_data); - - - ADD_PROPERTY( PropertyInfo( Variant::REAL, "bake_interval",PROPERTY_HINT_RANGE,"0.01,512,0.01"), _SCS("set_bake_interval"),_SCS("get_bake_interval")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"),_SCS("_get_data")); - /*ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_out"), _SCS("set_points_out"),_SCS("get_points_out")); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_pos"), _SCS("set_points_pos"),_SCS("get_points_pos")); + ClassDB::bind_method(D_METHOD("get_point_count"),&Curve3D::get_point_count); + ClassDB::bind_method(D_METHOD("add_point","pos","in","out","atpos"),&Curve3D::add_point,DEFVAL(Vector3()),DEFVAL(Vector3()),DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("set_point_pos","idx","pos"),&Curve3D::set_point_pos); + ClassDB::bind_method(D_METHOD("get_point_pos","idx"),&Curve3D::get_point_pos); + ClassDB::bind_method(D_METHOD("set_point_tilt","idx","tilt"),&Curve3D::set_point_tilt); + ClassDB::bind_method(D_METHOD("get_point_tilt","idx"),&Curve3D::get_point_tilt); + ClassDB::bind_method(D_METHOD("set_point_in","idx","pos"),&Curve3D::set_point_in); + ClassDB::bind_method(D_METHOD("get_point_in","idx"),&Curve3D::get_point_in); + ClassDB::bind_method(D_METHOD("set_point_out","idx","pos"),&Curve3D::set_point_out); + ClassDB::bind_method(D_METHOD("get_point_out","idx"),&Curve3D::get_point_out); + ClassDB::bind_method(D_METHOD("remove_point","idx"),&Curve3D::remove_point); + ClassDB::bind_method(D_METHOD("clear_points"),&Curve3D::clear_points); + ClassDB::bind_method(D_METHOD("interpolate","idx","t"),&Curve3D::interpolate); + ClassDB::bind_method(D_METHOD("interpolatef","fofs"),&Curve3D::interpolatef); + //ClassDB::bind_method(D_METHOD("bake","subdivs"),&Curve3D::bake,DEFVAL(10)); + ClassDB::bind_method(D_METHOD("set_bake_interval","distance"),&Curve3D::set_bake_interval); + ClassDB::bind_method(D_METHOD("get_bake_interval"),&Curve3D::get_bake_interval); + + ClassDB::bind_method(D_METHOD("get_baked_length"),&Curve3D::get_baked_length); + ClassDB::bind_method(D_METHOD("interpolate_baked","offset","cubic"),&Curve3D::interpolate_baked,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_baked_points"),&Curve3D::get_baked_points); + ClassDB::bind_method(D_METHOD("get_baked_tilts"),&Curve3D::get_baked_tilts); + ClassDB::bind_method(D_METHOD("tesselate","max_stages","tolerance_degrees"),&Curve3D::tesselate,DEFVAL(5),DEFVAL(4)); + + ClassDB::bind_method(D_METHOD("_get_data"),&Curve3D::_get_data); + ClassDB::bind_method(D_METHOD("_set_data"),&Curve3D::_set_data); + + + ADD_PROPERTY( PropertyInfo( Variant::REAL, "bake_interval",PROPERTY_HINT_RANGE,"0.01,512,0.01"), "set_bake_interval","get_bake_interval"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_data","_get_data"); + /*ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_out"), "set_points_out","get_points_out"); + ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "points_pos"), "set_points_pos","get_points_pos"); */ } diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 50c6a6c725..dbe0f3e33e 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -583,24 +583,19 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref // WindowDialog - Ref<StyleBoxTexture> style_pp_win = sb_expand(make_stylebox( popup_window_png,10,30,10,8),8,26,8,4); - /*for(int i=0;i<4;i++) - style_pp_win->set_expand_margin_size((Margin)i,3); - style_pp_win->set_expand_margin_size(MARGIN_TOP,26);*/ + Ref<StyleBoxTexture> style_pp_win = sb_expand(make_stylebox(popup_window_png, 10, 26, 10, 8), 8, 24, 8, 6); + t->set_stylebox("panel", "WindowDialog", style_pp_win); + t->set_constant("titlebar_height", "WindowDialog", 20 * scale); + t->set_constant("scaleborder_size", "WindowDialog", 4); - t->set_stylebox("panel","WindowDialog", style_pp_win ); + t->set_font("title_font", "WindowDialog", large_font); + t->set_color("title_color", "WindowDialog", Color(0, 0, 0)); + t->set_constant("title_height", "WindowDialog", 18 * scale); - t->set_icon("close","WindowDialog", make_icon( close_png ) ); - t->set_icon("close_hilite","WindowDialog", make_icon( close_hl_png ) ); - - t->set_font("title_font","WindowDialog", large_font ); - - t->set_color("title_color","WindowDialog", Color(0,0,0) ); - - t->set_constant("close_h_ofs","WindowDialog", 22 *scale); - t->set_constant("close_v_ofs","WindowDialog", 20 *scale); - t->set_constant("titlebar_height","WindowDialog", 18 *scale); - t->set_constant("title_height","WindowDialog", 20 *scale); + t->set_icon("close", "WindowDialog", make_icon(close_png)); + t->set_icon("close_hilite", "WindowDialog", make_icon(close_hl_png)); + t->set_constant("close_h_ofs", "WindowDialog", 18 * scale); + t->set_constant("close_v_ofs", "WindowDialog", 18 * scale); // File Dialog @@ -750,6 +745,7 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref t->set_stylebox("tab_fg","TabContainer", sb_expand( make_stylebox( tab_current_png,4,4,4,1,16,4,16,4),2,2,2,2) ); t->set_stylebox("tab_bg","TabContainer", sb_expand( make_stylebox( tab_behind_png,5,5,5,1,16,6,16,4),3,0,3,3) ); + t->set_stylebox("tab_disabled", "TabContainer", sb_expand(make_stylebox(tab_disabled_png, 5, 5, 5, 1, 16, 6, 16, 4), 3, 0, 3, 3)); t->set_stylebox("panel","TabContainer", tc_sb ); t->set_icon("increment","TabContainer",make_icon( scroll_button_right_png)); @@ -763,6 +759,7 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref t->set_color("font_color_fg","TabContainer", control_font_color_hover ); t->set_color("font_color_bg","TabContainer", control_font_color_low ); + t->set_color("font_color_disabled", "TabContainer", control_font_color_disabled); t->set_constant("side_margin","TabContainer", 8 *scale); t->set_constant("top_margin","TabContainer", 24 *scale); @@ -776,6 +773,7 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref t->set_stylebox("tab_fg","Tabs", sb_expand( make_stylebox( tab_current_png,4,3,4,1,16,3,16,2),2,2,2,2) ); t->set_stylebox("tab_bg","Tabs", sb_expand( make_stylebox( tab_behind_png,5,4,5,1,16,5,16,2),3,3,3,3) ); + t->set_stylebox("tab_disabled", "Tabs", sb_expand(make_stylebox(tab_disabled_png, 5, 4, 5, 1, 16, 5, 16, 2), 3, 3, 3, 3)); t->set_stylebox("panel","Tabs",tc_sb ); t->set_stylebox("button_pressed","Tabs", make_stylebox( button_pressed_png,4,4,4,4) ); t->set_stylebox("button","Tabs", make_stylebox( button_normal_png,4,4,4,4) ); @@ -790,6 +788,7 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref t->set_color("font_color_fg","Tabs", control_font_color_hover ); t->set_color("font_color_bg","Tabs", control_font_color_low ); + t->set_color("font_color_disabled", "Tabs", control_font_color_disabled); t->set_constant("top_margin","Tabs", 24 *scale); t->set_constant("label_valign_fg","Tabs", 0 *scale); @@ -982,7 +981,7 @@ void make_default_theme(bool p_hidpi,Ref<Font> p_font) { Ref<BitmapFont> default_font; if (p_font.is_valid()) { default_font=p_font; - } if (p_hidpi) { + } else if (p_hidpi) { default_font=make_font2(_hidpi_font_height,_hidpi_font_ascent,_hidpi_font_charcount,&_hidpi_font_charrects[0][0],_hidpi_font_kerning_pair_count,&_hidpi_font_kerning_pairs[0][0],_hidpi_font_img_width,_hidpi_font_img_height,_hidpi_font_img_data); } else { default_font=make_font2(_lodpi_font_height,_lodpi_font_ascent,_lodpi_font_charcount,&_lodpi_font_charrects[0][0],_lodpi_font_kerning_pair_count,&_lodpi_font_kerning_pairs[0][0],_lodpi_font_img_width,_lodpi_font_img_height,_lodpi_font_img_data); diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h index 5b5868ba14..394cfaf424 100644 --- a/scene/resources/default_theme/theme_data.h +++ b/scene/resources/default_theme/theme_data.h @@ -458,6 +458,10 @@ static const unsigned char tab_current_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,0x3,0x0,0x0,0x0,0x28,0x2d,0xf,0x53,0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x26,0x0,0x0,0x80,0x84,0x0,0x0,0xfa,0x0,0x0,0x0,0x80,0xe8,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60,0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x70,0x9c,0xba,0x51,0x3c,0x0,0x0,0x0,0x9c,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3f,0x3d,0x48,0x5b,0x58,0x66,0x5b,0x57,0x65,0x57,0x54,0x62,0x55,0x53,0x62,0x4a,0x46,0x52,0x46,0x41,0x4e,0x45,0x41,0x4d,0x55,0x52,0x60,0x44,0x41,0x4c,0x53,0x50,0x5e,0x43,0x40,0x4b,0x52,0x4e,0x5d,0x41,0x3e,0x4a,0x4f,0x4d,0x5a,0x3f,0x3d,0x48,0x4e,0x4b,0x59,0x3e,0x3c,0x47,0x4d,0x4a,0x58,0x3d,0x3b,0x46,0x4b,0x49,0x54,0x3c,0x3a,0x44,0x4b,0x47,0x54,0x3b,0x39,0x43,0x3b,0x39,0x42,0x3b,0x38,0x43,0x3b,0x38,0x42,0x3a,0x37,0x41,0x39,0x37,0x41,0x3a,0x38,0x41,0x39,0x36,0x3f,0x38,0x36,0x3f,0x39,0x36,0x40,0x38,0x36,0x40,0x37,0x35,0x3e,0x37,0x34,0x3e,0x36,0x35,0x3d,0x35,0x32,0x3b,0x59,0xdd,0xd3,0xff,0x0,0x0,0x0,0x11,0x74,0x52,0x4e,0x53,0x4,0xa,0x11,0x19,0x1f,0x22,0x24,0x15,0x25,0x34,0x3f,0x46,0x47,0x48,0x77,0xef,0xef,0xa3,0x31,0x6b,0xc2,0x0,0x0,0x0,0x1,0x62,0x4b,0x47,0x44,0x33,0x37,0xd5,0x7c,0x5e,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,0xe0,0x6,0x16,0x12,0x2b,0x5,0x39,0x1a,0x32,0x39,0x0,0x0,0x0,0xa2,0x49,0x44,0x41,0x54,0x18,0xd3,0x45,0xcd,0xd9,0x12,0x82,0x30,0xc,0x40,0xd1,0x0,0x2d,0x4b,0x5b,0x36,0x59,0x44,0x44,0x44,0xa4,0x68,0x59,0x54,0xfc,0xff,0x8f,0x33,0x30,0x4c,0x3d,0x93,0xa7,0x3b,0x93,0x4,0xc0,0x30,0x2d,0x42,0x6d,0x44,0x89,0x65,0x1a,0x0,0x86,0xe3,0x7a,0x8c,0xb,0xdf,0x17,0x9c,0x79,0xae,0x63,0x80,0xe9,0x6,0x61,0x7c,0xd8,0xc4,0x61,0xe0,0x9a,0x60,0x79,0x51,0x92,0x66,0x9b,0x34,0x89,0x3c,0xb,0x8,0xcb,0xb3,0xe3,0x2e,0xcb,0x19,0x1,0xca,0x8b,0x93,0x56,0x70,0xa,0xb6,0x28,0xcf,0x5a,0x29,0x6c,0xb0,0xfd,0xea,0xa2,0x55,0xfe,0x1a,0xea,0xab,0x56,0xaf,0x41,0x34,0x37,0xad,0xc1,0x15,0xca,0xdb,0xbb,0xd6,0xe2,0x51,0xc2,0xba,0x7f,0xe8,0xf0,0x2d,0x6,0x29,0xfb,0x5e,0xca,0xc7,0x53,0xca,0x3d,0xa8,0x61,0x50,0xc3,0xa8,0xc6,0x41,0xed,0x61,0x9a,0xa6,0x19,0xbd,0xe6,0xf7,0x1e,0x3e,0xcb,0x82,0x83,0xbe,0x18,0x7e,0xa1,0xe5,0x17,0x1f,0xcf,0x5d,0x82,0x6b,0x0,0x0,0x0,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x63,0x72,0x65,0x61,0x74,0x65,0x0,0x32,0x30,0x31,0x36,0x2d,0x30,0x36,0x2d,0x32,0x32,0x54,0x32,0x30,0x3a,0x33,0x39,0x3a,0x32,0x36,0x2b,0x30,0x32,0x3a,0x30,0x30,0xc9,0xad,0xc8,0x52,0x0,0x0,0x0,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x6d,0x6f,0x64,0x69,0x66,0x79,0x0,0x32,0x30,0x31,0x36,0x2d,0x30,0x36,0x2d,0x32,0x32,0x54,0x32,0x30,0x3a,0x33,0x39,0x3a,0x32,0x36,0x2b,0x30,0x32,0x3a,0x30,0x30,0xb8,0xf0,0x70,0xee,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 }; +static const unsigned char tab_disabled_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,0xd2,0x49,0x44,0x41,0x54,0x38,0xcb,0xd5,0x90,0x51,0xa,0xc2,0x30,0xc,0x86,0xd3,0x2e,0xdb,0x4,0x1f,0xb6,0x57,0x75,0x77,0xd9,0x1d,0x3c,0x8d,0x47,0xd8,0x69,0xbc,0x81,0xf,0xbb,0xcb,0xf0,0x6d,0xa8,0xa0,0xa0,0x6b,0xd7,0x9a,0x40,0x26,0xa,0xdb,0x98,0x22,0x88,0x81,0xf,0x92,0xf2,0xe7,0x4f,0x13,0x5,0x0,0x48,0x44,0x44,0x4c,0xcc,0x24,0xf,0x8,0xd,0xaf,0xe1,0x88,0x96,0x68,0x88,0x2b,0x71,0xe3,0xbc,0x6b,0x9e,0x13,0x29,0x91,0x48,0xce,0x66,0x4a,0xe0,0xf0,0x2,0x37,0x5d,0x88,0x13,0x71,0x4,0x99,0xce,0xe2,0x34,0xcf,0xf3,0x75,0xb6,0xcc,0xa,0xd3,0x1a,0x18,0x8b,0x30,0x8,0xa1,0xda,0x57,0x9b,0xb2,0x2c,0xb7,0x54,0x5a,0x94,0x6f,0x27,0xab,0xc5,0xaa,0xa8,0xf,0x35,0x58,0x6b,0xc1,0x7b,0xdf,0xdb,0xac,0x94,0x2,0x44,0x4,0xd6,0x52,0xb9,0x23,0xce,0x8f,0x15,0x1a,0xdb,0x80,0x31,0xe3,0xd3,0xd9,0x98,0x35,0xac,0x95,0x55,0x23,0x2d,0x7,0x8b,0x87,0xa6,0xe,0x19,0xc9,0xea,0x1,0xca,0xb5,0x15,0x3f,0x4e,0x35,0x11,0x1d,0x1f,0x58,0x63,0xb7,0xde,0x87,0x6,0x80,0xcf,0x8f,0x6f,0x1a,0xc0,0x77,0xd,0x9c,0x73,0x93,0xd,0x58,0xdb,0x85,0xee,0x73,0xfd,0xcd,0xa,0xff,0x6b,0x70,0x7,0xd6,0xd5,0x90,0x3b,0x10,0xe9,0x51,0x80,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 +}; + static const unsigned char tab_menu_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,0x6f,0x49,0x44,0x41,0x54,0x38,0x8d,0x63,0x60,0x18,0x5,0xa3,0x80,0x81,0x81,0x11,0x5d,0xe0,0xc1,0x83,0x7,0xff,0xf1,0x69,0x50,0x50,0x50,0x40,0xd1,0xc3,0x44,0xa9,0xb,0xa8,0x6f,0x0,0x23,0x23,0x63,0x3c,0x3,0x3,0xc3,0x57,0x2c,0x6a,0xbf,0x33,0x32,0x32,0xa6,0x63,0xa8,0xc7,0x66,0xea,0xfd,0xfb,0xf7,0x35,0x18,0x18,0x18,0x56,0x31,0x32,0x32,0xea,0x42,0x85,0x6e,0x30,0x33,0x33,0x87,0xc9,0xca,0xca,0x5e,0x26,0xca,0x0,0x6,0x6,0x6,0x86,0x17,0x2f,0x5e,0x70,0xff,0xfc,0xf9,0x73,0xa,0x3,0x3,0x3,0x3,0x3b,0x3b,0x7b,0x8e,0x84,0x84,0x4,0x36,0x57,0xd,0x2,0x0,0x0,0x67,0xf2,0x14,0xc2,0xc2,0xbe,0xf5,0xb5,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index ba4b12900f..02149f5748 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -84,10 +84,10 @@ void DynamicFontData::set_force_autohinter(bool p_force) { } void DynamicFontData::_bind_methods() { - ClassDB::bind_method(_MD("set_font_path","path"),&DynamicFontData::set_font_path); - ClassDB::bind_method(_MD("get_font_path"),&DynamicFontData::get_font_path); + ClassDB::bind_method(D_METHOD("set_font_path","path"),&DynamicFontData::set_font_path); + ClassDB::bind_method(D_METHOD("get_font_path"),&DynamicFontData::get_font_path); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"font_path",PROPERTY_HINT_FILE,"*.ttf,*.otf"),_SCS("set_font_path"),_SCS("get_font_path")); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"font_path",PROPERTY_HINT_FILE,"*.ttf,*.otf"),"set_font_path","get_font_path"); } DynamicFontData::DynamicFontData() @@ -879,37 +879,37 @@ void DynamicFont::_get_property_list( List<PropertyInfo> *p_list) const{ void DynamicFont::_bind_methods() { - ClassDB::bind_method(_MD("set_font_data","data:DynamicFontData"),&DynamicFont::set_font_data); - ClassDB::bind_method(_MD("get_font_data:DynamicFontData"),&DynamicFont::get_font_data); + ClassDB::bind_method(D_METHOD("set_font_data","data:DynamicFontData"),&DynamicFont::set_font_data); + ClassDB::bind_method(D_METHOD("get_font_data:DynamicFontData"),&DynamicFont::get_font_data); - ClassDB::bind_method(_MD("set_size","data"),&DynamicFont::set_size); - ClassDB::bind_method(_MD("get_size"),&DynamicFont::get_size); + ClassDB::bind_method(D_METHOD("set_size","data"),&DynamicFont::set_size); + ClassDB::bind_method(D_METHOD("get_size"),&DynamicFont::get_size); - ClassDB::bind_method(_MD("set_use_mipmaps","enable"),&DynamicFont::set_use_mipmaps); - ClassDB::bind_method(_MD("get_use_mipmaps"),&DynamicFont::get_use_mipmaps); - ClassDB::bind_method(_MD("set_use_filter","enable"),&DynamicFont::set_use_filter); - ClassDB::bind_method(_MD("get_use_filter"),&DynamicFont::get_use_filter); - ClassDB::bind_method(_MD("set_spacing","type","value"),&DynamicFont::set_spacing); - ClassDB::bind_method(_MD("get_spacing","type"),&DynamicFont::get_spacing); + ClassDB::bind_method(D_METHOD("set_use_mipmaps","enable"),&DynamicFont::set_use_mipmaps); + ClassDB::bind_method(D_METHOD("get_use_mipmaps"),&DynamicFont::get_use_mipmaps); + ClassDB::bind_method(D_METHOD("set_use_filter","enable"),&DynamicFont::set_use_filter); + ClassDB::bind_method(D_METHOD("get_use_filter"),&DynamicFont::get_use_filter); + ClassDB::bind_method(D_METHOD("set_spacing","type","value"),&DynamicFont::set_spacing); + ClassDB::bind_method(D_METHOD("get_spacing","type"),&DynamicFont::get_spacing); - ClassDB::bind_method(_MD("add_fallback","data:DynamicFontData"),&DynamicFont::add_fallback); - ClassDB::bind_method(_MD("set_fallback","idx","data:DynamicFontData"),&DynamicFont::set_fallback); - ClassDB::bind_method(_MD("get_fallback:DynamicFontData","idx"),&DynamicFont::get_fallback); - ClassDB::bind_method(_MD("remove_fallback","idx"),&DynamicFont::remove_fallback); - ClassDB::bind_method(_MD("get_fallback_count"),&DynamicFont::get_fallback_count); + ClassDB::bind_method(D_METHOD("add_fallback","data:DynamicFontData"),&DynamicFont::add_fallback); + ClassDB::bind_method(D_METHOD("set_fallback","idx","data:DynamicFontData"),&DynamicFont::set_fallback); + ClassDB::bind_method(D_METHOD("get_fallback:DynamicFontData","idx"),&DynamicFont::get_fallback); + ClassDB::bind_method(D_METHOD("remove_fallback","idx"),&DynamicFont::remove_fallback); + ClassDB::bind_method(D_METHOD("get_fallback_count"),&DynamicFont::get_fallback_count); ADD_GROUP("Settings",""); - ADD_PROPERTY(PropertyInfo(Variant::INT,"size"),_SCS("set_size"),_SCS("get_size")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_mipmaps"),_SCS("set_use_mipmaps"),_SCS("get_use_mipmaps")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_filter"),_SCS("set_use_filter"),_SCS("get_use_filter")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"size"),"set_size","get_size"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_mipmaps"),"set_use_mipmaps","get_use_mipmaps"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_filter"),"set_use_filter","get_use_filter"); ADD_GROUP("Extra Spacing","extra_spacing"); - ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_top"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_TOP); - ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_bottom"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_BOTTOM); - ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_char"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_CHAR); - ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_space"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_SPACE); + ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_top"),"set_spacing","get_spacing",SPACING_TOP); + ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_bottom"),"set_spacing","get_spacing",SPACING_BOTTOM); + ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_char"),"set_spacing","get_spacing",SPACING_CHAR); + ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_space"),"set_spacing","get_spacing",SPACING_SPACE); ADD_GROUP("Font",""); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"font_data",PROPERTY_HINT_RESOURCE_TYPE,"DynamicFontData"),_SCS("set_font_data"),_SCS("get_font_data")); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"font_data",PROPERTY_HINT_RESOURCE_TYPE,"DynamicFontData"),"set_font_data","get_font_data"); BIND_CONSTANT( SPACING_TOP ); BIND_CONSTANT( SPACING_BOTTOM ); diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp index cbbca49f0f..2d659a7e97 100644 --- a/scene/resources/dynamic_font_stb.cpp +++ b/scene/resources/dynamic_font_stb.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* dynamic_font_stb.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "dynamic_font_stb.h" #ifndef FREETYPE_ENABLED @@ -378,14 +406,14 @@ DynamicFontAtSize::~DynamicFontAtSize(){ void DynamicFont::_bind_methods() { - ClassDB::bind_method(_MD("set_font_data","data:DynamicFontData"),&DynamicFont::set_font_data); - ClassDB::bind_method(_MD("get_font_data:DynamicFontData"),&DynamicFont::get_font_data); + ClassDB::bind_method(D_METHOD("set_font_data","data:DynamicFontData"),&DynamicFont::set_font_data); + ClassDB::bind_method(D_METHOD("get_font_data:DynamicFontData"),&DynamicFont::get_font_data); - ClassDB::bind_method(_MD("set_size","data"),&DynamicFont::set_size); - ClassDB::bind_method(_MD("get_size"),&DynamicFont::get_size); + ClassDB::bind_method(D_METHOD("set_size","data"),&DynamicFont::set_size); + ClassDB::bind_method(D_METHOD("get_size"),&DynamicFont::get_size); - ADD_PROPERTY(PropertyInfo(Variant::INT,"font/size"),_SCS("set_size"),_SCS("get_size")); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"font/font",PROPERTY_HINT_RESOURCE_TYPE,"DynamicFontData"),_SCS("set_font_data"),_SCS("get_font_data")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"font/size"),"set_size","get_size"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"font/font",PROPERTY_HINT_RESOURCE_TYPE,"DynamicFontData"),"set_font_data","get_font_data"); } diff --git a/scene/resources/dynamic_font_stb.h b/scene/resources/dynamic_font_stb.h index 07a3e5ee6c..4eb0575d8e 100644 --- a/scene/resources/dynamic_font_stb.h +++ b/scene/resources/dynamic_font_stb.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* dynamic_font_stb.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 DYNAMICFONT_STB_H #define DYNAMICFONT_STB_H diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index ffc0a38fc2..f44b37f6f5 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "environment.h" #include "texture.h" -#include "globals.h" +#include "global_config.h" #include "servers/visual_server.h" RID Environment::get_rid() const { @@ -701,257 +701,257 @@ Environment::DOFBlurQuality Environment::get_dof_blur_near_quality() const { void Environment::_bind_methods() { - ClassDB::bind_method(_MD("set_background","mode"),&Environment::set_background); - ClassDB::bind_method(_MD("set_skybox","skybox:CubeMap"),&Environment::set_skybox); - ClassDB::bind_method(_MD("set_skybox_scale","scale"),&Environment::set_skybox_scale); - ClassDB::bind_method(_MD("set_bg_color","color"),&Environment::set_bg_color); - ClassDB::bind_method(_MD("set_bg_energy","energy"),&Environment::set_bg_energy); - ClassDB::bind_method(_MD("set_canvas_max_layer","layer"),&Environment::set_canvas_max_layer); - ClassDB::bind_method(_MD("set_ambient_light_color","color"),&Environment::set_ambient_light_color); - ClassDB::bind_method(_MD("set_ambient_light_energy","energy"),&Environment::set_ambient_light_energy); - ClassDB::bind_method(_MD("set_ambient_light_skybox_contribution","energy"),&Environment::set_ambient_light_skybox_contribution); + ClassDB::bind_method(D_METHOD("set_background","mode"),&Environment::set_background); + ClassDB::bind_method(D_METHOD("set_skybox","skybox:CubeMap"),&Environment::set_skybox); + ClassDB::bind_method(D_METHOD("set_skybox_scale","scale"),&Environment::set_skybox_scale); + ClassDB::bind_method(D_METHOD("set_bg_color","color"),&Environment::set_bg_color); + ClassDB::bind_method(D_METHOD("set_bg_energy","energy"),&Environment::set_bg_energy); + ClassDB::bind_method(D_METHOD("set_canvas_max_layer","layer"),&Environment::set_canvas_max_layer); + ClassDB::bind_method(D_METHOD("set_ambient_light_color","color"),&Environment::set_ambient_light_color); + ClassDB::bind_method(D_METHOD("set_ambient_light_energy","energy"),&Environment::set_ambient_light_energy); + ClassDB::bind_method(D_METHOD("set_ambient_light_skybox_contribution","energy"),&Environment::set_ambient_light_skybox_contribution); - ClassDB::bind_method(_MD("get_background"),&Environment::get_background); - ClassDB::bind_method(_MD("get_skybox:CubeMap"),&Environment::get_skybox); - ClassDB::bind_method(_MD("get_skybox_scale"),&Environment::get_skybox_scale); - ClassDB::bind_method(_MD("get_bg_color"),&Environment::get_bg_color); - ClassDB::bind_method(_MD("get_bg_energy"),&Environment::get_bg_energy); - ClassDB::bind_method(_MD("get_canvas_max_layer"),&Environment::get_canvas_max_layer); - ClassDB::bind_method(_MD("get_ambient_light_color"),&Environment::get_ambient_light_color); - ClassDB::bind_method(_MD("get_ambient_light_energy"),&Environment::get_ambient_light_energy); - ClassDB::bind_method(_MD("get_ambient_light_skybox_contribution"),&Environment::get_ambient_light_skybox_contribution); + ClassDB::bind_method(D_METHOD("get_background"),&Environment::get_background); + ClassDB::bind_method(D_METHOD("get_skybox:CubeMap"),&Environment::get_skybox); + ClassDB::bind_method(D_METHOD("get_skybox_scale"),&Environment::get_skybox_scale); + ClassDB::bind_method(D_METHOD("get_bg_color"),&Environment::get_bg_color); + ClassDB::bind_method(D_METHOD("get_bg_energy"),&Environment::get_bg_energy); + ClassDB::bind_method(D_METHOD("get_canvas_max_layer"),&Environment::get_canvas_max_layer); + ClassDB::bind_method(D_METHOD("get_ambient_light_color"),&Environment::get_ambient_light_color); + ClassDB::bind_method(D_METHOD("get_ambient_light_energy"),&Environment::get_ambient_light_energy); + ClassDB::bind_method(D_METHOD("get_ambient_light_skybox_contribution"),&Environment::get_ambient_light_skybox_contribution); ADD_GROUP("Background","background_"); - ADD_PROPERTY(PropertyInfo(Variant::INT,"background_mode",PROPERTY_HINT_ENUM,"Clear Color,Custom Color,Skybox,Canvas,Keep"),_SCS("set_background"),_SCS("get_background") ); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"background_skybox",PROPERTY_HINT_RESOURCE_TYPE,"SkyBox"),_SCS("set_skybox"),_SCS("get_skybox") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"background_skybox_scale",PROPERTY_HINT_RANGE,"0,32,0.01"),_SCS("set_skybox_scale"),_SCS("get_skybox_scale") ); - ADD_PROPERTY(PropertyInfo(Variant::COLOR,"background_color"),_SCS("set_bg_color"),_SCS("get_bg_color") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"background_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_bg_energy"),_SCS("get_bg_energy") ); - ADD_PROPERTY(PropertyInfo(Variant::INT,"background_canvas_max_layer",PROPERTY_HINT_RANGE,"-1000,1000,1"),_SCS("set_canvas_max_layer"),_SCS("get_canvas_max_layer") ); + ADD_PROPERTY(PropertyInfo(Variant::INT,"background_mode",PROPERTY_HINT_ENUM,"Clear Color,Custom Color,Skybox,Canvas,Keep"),"set_background","get_background") ; + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"background_skybox",PROPERTY_HINT_RESOURCE_TYPE,"SkyBox"),"set_skybox","get_skybox") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"background_skybox_scale",PROPERTY_HINT_RANGE,"0,32,0.01"),"set_skybox_scale","get_skybox_scale") ; + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"background_color"),"set_bg_color","get_bg_color") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"background_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),"set_bg_energy","get_bg_energy") ; + ADD_PROPERTY(PropertyInfo(Variant::INT,"background_canvas_max_layer",PROPERTY_HINT_RANGE,"-1000,1000,1"),"set_canvas_max_layer","get_canvas_max_layer") ; ADD_GROUP("Ambient Light","ambient_light_"); - ADD_PROPERTY(PropertyInfo(Variant::COLOR,"ambient_light_color"),_SCS("set_ambient_light_color"),_SCS("get_ambient_light_color") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ambient_light_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_ambient_light_energy"),_SCS("get_ambient_light_energy") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ambient_light_skybox_contribution",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_ambient_light_skybox_contribution"),_SCS("get_ambient_light_skybox_contribution") ); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"ambient_light_color"),"set_ambient_light_color","get_ambient_light_color") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ambient_light_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),"set_ambient_light_energy","get_ambient_light_energy") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ambient_light_skybox_contribution",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_ambient_light_skybox_contribution","get_ambient_light_skybox_contribution") ; - ClassDB::bind_method(_MD("set_ssr_enabled","enabled"),&Environment::set_ssr_enabled); - ClassDB::bind_method(_MD("is_ssr_enabled"),&Environment::is_ssr_enabled); + ClassDB::bind_method(D_METHOD("set_ssr_enabled","enabled"),&Environment::set_ssr_enabled); + ClassDB::bind_method(D_METHOD("is_ssr_enabled"),&Environment::is_ssr_enabled); - ClassDB::bind_method(_MD("set_ssr_max_steps","max_steps"),&Environment::set_ssr_max_steps); - ClassDB::bind_method(_MD("get_ssr_max_steps"),&Environment::get_ssr_max_steps); + ClassDB::bind_method(D_METHOD("set_ssr_max_steps","max_steps"),&Environment::set_ssr_max_steps); + ClassDB::bind_method(D_METHOD("get_ssr_max_steps"),&Environment::get_ssr_max_steps); - ClassDB::bind_method(_MD("set_ssr_accel","accel"),&Environment::set_ssr_accel); - ClassDB::bind_method(_MD("get_ssr_accel"),&Environment::get_ssr_accel); + ClassDB::bind_method(D_METHOD("set_ssr_accel","accel"),&Environment::set_ssr_accel); + ClassDB::bind_method(D_METHOD("get_ssr_accel"),&Environment::get_ssr_accel); - ClassDB::bind_method(_MD("set_ssr_fade","fade"),&Environment::set_ssr_fade); - ClassDB::bind_method(_MD("get_ssr_fade"),&Environment::get_ssr_fade); + ClassDB::bind_method(D_METHOD("set_ssr_fade","fade"),&Environment::set_ssr_fade); + ClassDB::bind_method(D_METHOD("get_ssr_fade"),&Environment::get_ssr_fade); - ClassDB::bind_method(_MD("set_ssr_depth_tolerance","depth_tolerance"),&Environment::set_ssr_depth_tolerance); - ClassDB::bind_method(_MD("get_ssr_depth_tolerance"),&Environment::get_ssr_depth_tolerance); + ClassDB::bind_method(D_METHOD("set_ssr_depth_tolerance","depth_tolerance"),&Environment::set_ssr_depth_tolerance); + ClassDB::bind_method(D_METHOD("get_ssr_depth_tolerance"),&Environment::get_ssr_depth_tolerance); - ClassDB::bind_method(_MD("set_ssr_smooth","smooth"),&Environment::set_ssr_smooth); - ClassDB::bind_method(_MD("is_ssr_smooth"),&Environment::is_ssr_smooth); + ClassDB::bind_method(D_METHOD("set_ssr_smooth","smooth"),&Environment::set_ssr_smooth); + ClassDB::bind_method(D_METHOD("is_ssr_smooth"),&Environment::is_ssr_smooth); - ClassDB::bind_method(_MD("set_ssr_rough","rough"),&Environment::set_ssr_rough); - ClassDB::bind_method(_MD("is_ssr_rough"),&Environment::is_ssr_rough); + ClassDB::bind_method(D_METHOD("set_ssr_rough","rough"),&Environment::set_ssr_rough); + ClassDB::bind_method(D_METHOD("is_ssr_rough"),&Environment::is_ssr_rough); ADD_GROUP("SS Reflections","ss_reflections_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ss_reflections_enabled"),_SCS("set_ssr_enabled"),_SCS("is_ssr_enabled") ); - ADD_PROPERTY(PropertyInfo(Variant::INT,"ss_reflections_max_steps",PROPERTY_HINT_RANGE,"1,512,1"),_SCS("set_ssr_max_steps"),_SCS("get_ssr_max_steps") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ss_reflections_accel",PROPERTY_HINT_RANGE,"0,4,0.01"),_SCS("set_ssr_accel"),_SCS("get_ssr_accel") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ss_reflections_fade",PROPERTY_HINT_EXP_EASING),_SCS("set_ssr_fade"),_SCS("get_ssr_fade") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ss_reflections_depth_tolerance",PROPERTY_HINT_RANGE,"0.1,128,0.1"),_SCS("set_ssr_depth_tolerance"),_SCS("get_ssr_depth_tolerance") ); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ss_reflections_accel_smooth"),_SCS("set_ssr_smooth"),_SCS("is_ssr_smooth") ); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ss_reflections_roughness"),_SCS("set_ssr_rough"),_SCS("is_ssr_rough") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ss_reflections_enabled"),"set_ssr_enabled","is_ssr_enabled") ; + ADD_PROPERTY(PropertyInfo(Variant::INT,"ss_reflections_max_steps",PROPERTY_HINT_RANGE,"1,512,1"),"set_ssr_max_steps","get_ssr_max_steps") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ss_reflections_accel",PROPERTY_HINT_RANGE,"0,4,0.01"),"set_ssr_accel","get_ssr_accel") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ss_reflections_fade",PROPERTY_HINT_EXP_EASING),"set_ssr_fade","get_ssr_fade") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ss_reflections_depth_tolerance",PROPERTY_HINT_RANGE,"0.1,128,0.1"),"set_ssr_depth_tolerance","get_ssr_depth_tolerance") ; + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ss_reflections_accel_smooth"),"set_ssr_smooth","is_ssr_smooth") ; + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ss_reflections_roughness"),"set_ssr_rough","is_ssr_rough") ; - ClassDB::bind_method(_MD("set_ssao_enabled","enabled"),&Environment::set_ssao_enabled); - ClassDB::bind_method(_MD("is_ssao_enabled"),&Environment::is_ssao_enabled); + ClassDB::bind_method(D_METHOD("set_ssao_enabled","enabled"),&Environment::set_ssao_enabled); + ClassDB::bind_method(D_METHOD("is_ssao_enabled"),&Environment::is_ssao_enabled); - ClassDB::bind_method(_MD("set_ssao_radius","radius"),&Environment::set_ssao_radius); - ClassDB::bind_method(_MD("get_ssao_radius"),&Environment::get_ssao_radius); + ClassDB::bind_method(D_METHOD("set_ssao_radius","radius"),&Environment::set_ssao_radius); + ClassDB::bind_method(D_METHOD("get_ssao_radius"),&Environment::get_ssao_radius); - ClassDB::bind_method(_MD("set_ssao_intensity","intensity"),&Environment::set_ssao_intensity); - ClassDB::bind_method(_MD("get_ssao_intensity"),&Environment::get_ssao_intensity); + ClassDB::bind_method(D_METHOD("set_ssao_intensity","intensity"),&Environment::set_ssao_intensity); + ClassDB::bind_method(D_METHOD("get_ssao_intensity"),&Environment::get_ssao_intensity); - ClassDB::bind_method(_MD("set_ssao_radius2","radius"),&Environment::set_ssao_radius2); - ClassDB::bind_method(_MD("get_ssao_radius2"),&Environment::get_ssao_radius2); + ClassDB::bind_method(D_METHOD("set_ssao_radius2","radius"),&Environment::set_ssao_radius2); + ClassDB::bind_method(D_METHOD("get_ssao_radius2"),&Environment::get_ssao_radius2); - ClassDB::bind_method(_MD("set_ssao_intensity2","intensity"),&Environment::set_ssao_intensity2); - ClassDB::bind_method(_MD("get_ssao_intensity2"),&Environment::get_ssao_intensity2); + ClassDB::bind_method(D_METHOD("set_ssao_intensity2","intensity"),&Environment::set_ssao_intensity2); + ClassDB::bind_method(D_METHOD("get_ssao_intensity2"),&Environment::get_ssao_intensity2); - ClassDB::bind_method(_MD("set_ssao_bias","bias"),&Environment::set_ssao_bias); - ClassDB::bind_method(_MD("get_ssao_bias"),&Environment::get_ssao_bias); + ClassDB::bind_method(D_METHOD("set_ssao_bias","bias"),&Environment::set_ssao_bias); + ClassDB::bind_method(D_METHOD("get_ssao_bias"),&Environment::get_ssao_bias); - ClassDB::bind_method(_MD("set_ssao_direct_light_affect","amount"),&Environment::set_ssao_direct_light_affect); - ClassDB::bind_method(_MD("get_ssao_direct_light_affect"),&Environment::get_ssao_direct_light_affect); + ClassDB::bind_method(D_METHOD("set_ssao_direct_light_affect","amount"),&Environment::set_ssao_direct_light_affect); + ClassDB::bind_method(D_METHOD("get_ssao_direct_light_affect"),&Environment::get_ssao_direct_light_affect); - ClassDB::bind_method(_MD("set_ssao_color","color"),&Environment::set_ssao_color); - ClassDB::bind_method(_MD("get_ssao_color"),&Environment::get_ssao_color); + ClassDB::bind_method(D_METHOD("set_ssao_color","color"),&Environment::set_ssao_color); + ClassDB::bind_method(D_METHOD("get_ssao_color"),&Environment::get_ssao_color); - ClassDB::bind_method(_MD("set_ssao_blur","enabled"),&Environment::set_ssao_blur); - ClassDB::bind_method(_MD("is_ssao_blur_enabled"),&Environment::is_ssao_blur_enabled); + ClassDB::bind_method(D_METHOD("set_ssao_blur","enabled"),&Environment::set_ssao_blur); + ClassDB::bind_method(D_METHOD("is_ssao_blur_enabled"),&Environment::is_ssao_blur_enabled); ADD_GROUP("SSAO","ssao_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ssao_enabled"),_SCS("set_ssao_enabled"),_SCS("is_ssao_enabled") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_radius",PROPERTY_HINT_RANGE,"0.1,16,0.1"),_SCS("set_ssao_radius"),_SCS("get_ssao_radius") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_intensity",PROPERTY_HINT_RANGE,"0.0,9,0.1"),_SCS("set_ssao_intensity"),_SCS("get_ssao_intensity") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_radius2",PROPERTY_HINT_RANGE,"0.0,16,0.1"),_SCS("set_ssao_radius2"),_SCS("get_ssao_radius2") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_intensity2",PROPERTY_HINT_RANGE,"0.0,9,0.1"),_SCS("set_ssao_intensity2"),_SCS("get_ssao_intensity2") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_bias",PROPERTY_HINT_RANGE,"0.001,8,0.001"),_SCS("set_ssao_bias"),_SCS("get_ssao_bias") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_light_affect",PROPERTY_HINT_RANGE,"0.00,1,0.01"),_SCS("set_ssao_direct_light_affect"),_SCS("get_ssao_direct_light_affect") ); - ADD_PROPERTY(PropertyInfo(Variant::COLOR,"ssao_color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("set_ssao_color"),_SCS("get_ssao_color") ); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ssao_blur"),_SCS("set_ssao_blur"),_SCS("is_ssao_blur_enabled") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ssao_enabled"),"set_ssao_enabled","is_ssao_enabled") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_radius",PROPERTY_HINT_RANGE,"0.1,16,0.1"),"set_ssao_radius","get_ssao_radius") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_intensity",PROPERTY_HINT_RANGE,"0.0,9,0.1"),"set_ssao_intensity","get_ssao_intensity") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_radius2",PROPERTY_HINT_RANGE,"0.0,16,0.1"),"set_ssao_radius2","get_ssao_radius2") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_intensity2",PROPERTY_HINT_RANGE,"0.0,9,0.1"),"set_ssao_intensity2","get_ssao_intensity2") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_bias",PROPERTY_HINT_RANGE,"0.001,8,0.001"),"set_ssao_bias","get_ssao_bias") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_light_affect",PROPERTY_HINT_RANGE,"0.00,1,0.01"),"set_ssao_direct_light_affect","get_ssao_direct_light_affect") ; + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"ssao_color",PROPERTY_HINT_COLOR_NO_ALPHA),"set_ssao_color","get_ssao_color") ; + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ssao_blur"),"set_ssao_blur","is_ssao_blur_enabled") ; - ClassDB::bind_method(_MD("set_dof_blur_far_enabled","enabled"),&Environment::set_dof_blur_far_enabled); - ClassDB::bind_method(_MD("is_dof_blur_far_enabled"),&Environment::is_dof_blur_far_enabled); + ClassDB::bind_method(D_METHOD("set_dof_blur_far_enabled","enabled"),&Environment::set_dof_blur_far_enabled); + ClassDB::bind_method(D_METHOD("is_dof_blur_far_enabled"),&Environment::is_dof_blur_far_enabled); - ClassDB::bind_method(_MD("set_dof_blur_far_distance","intensity"),&Environment::set_dof_blur_far_distance); - ClassDB::bind_method(_MD("get_dof_blur_far_distance"),&Environment::get_dof_blur_far_distance); + ClassDB::bind_method(D_METHOD("set_dof_blur_far_distance","intensity"),&Environment::set_dof_blur_far_distance); + ClassDB::bind_method(D_METHOD("get_dof_blur_far_distance"),&Environment::get_dof_blur_far_distance); - ClassDB::bind_method(_MD("set_dof_blur_far_transition","intensity"),&Environment::set_dof_blur_far_transition); - ClassDB::bind_method(_MD("get_dof_blur_far_transition"),&Environment::get_dof_blur_far_transition); + ClassDB::bind_method(D_METHOD("set_dof_blur_far_transition","intensity"),&Environment::set_dof_blur_far_transition); + ClassDB::bind_method(D_METHOD("get_dof_blur_far_transition"),&Environment::get_dof_blur_far_transition); - ClassDB::bind_method(_MD("set_dof_blur_far_amount","intensity"),&Environment::set_dof_blur_far_amount); - ClassDB::bind_method(_MD("get_dof_blur_far_amount"),&Environment::get_dof_blur_far_amount); + ClassDB::bind_method(D_METHOD("set_dof_blur_far_amount","intensity"),&Environment::set_dof_blur_far_amount); + ClassDB::bind_method(D_METHOD("get_dof_blur_far_amount"),&Environment::get_dof_blur_far_amount); - ClassDB::bind_method(_MD("set_dof_blur_far_quality","intensity"),&Environment::set_dof_blur_far_quality); - ClassDB::bind_method(_MD("get_dof_blur_far_quality"),&Environment::get_dof_blur_far_quality); + ClassDB::bind_method(D_METHOD("set_dof_blur_far_quality","intensity"),&Environment::set_dof_blur_far_quality); + ClassDB::bind_method(D_METHOD("get_dof_blur_far_quality"),&Environment::get_dof_blur_far_quality); - ClassDB::bind_method(_MD("set_dof_blur_near_enabled","enabled"),&Environment::set_dof_blur_near_enabled); - ClassDB::bind_method(_MD("is_dof_blur_near_enabled"),&Environment::is_dof_blur_near_enabled); + ClassDB::bind_method(D_METHOD("set_dof_blur_near_enabled","enabled"),&Environment::set_dof_blur_near_enabled); + ClassDB::bind_method(D_METHOD("is_dof_blur_near_enabled"),&Environment::is_dof_blur_near_enabled); - ClassDB::bind_method(_MD("set_dof_blur_near_distance","intensity"),&Environment::set_dof_blur_near_distance); - ClassDB::bind_method(_MD("get_dof_blur_near_distance"),&Environment::get_dof_blur_near_distance); + ClassDB::bind_method(D_METHOD("set_dof_blur_near_distance","intensity"),&Environment::set_dof_blur_near_distance); + ClassDB::bind_method(D_METHOD("get_dof_blur_near_distance"),&Environment::get_dof_blur_near_distance); - ClassDB::bind_method(_MD("set_dof_blur_near_transition","intensity"),&Environment::set_dof_blur_near_transition); - ClassDB::bind_method(_MD("get_dof_blur_near_transition"),&Environment::get_dof_blur_near_transition); + ClassDB::bind_method(D_METHOD("set_dof_blur_near_transition","intensity"),&Environment::set_dof_blur_near_transition); + ClassDB::bind_method(D_METHOD("get_dof_blur_near_transition"),&Environment::get_dof_blur_near_transition); - ClassDB::bind_method(_MD("set_dof_blur_near_amount","intensity"),&Environment::set_dof_blur_near_amount); - ClassDB::bind_method(_MD("get_dof_blur_near_amount"),&Environment::get_dof_blur_near_amount); + ClassDB::bind_method(D_METHOD("set_dof_blur_near_amount","intensity"),&Environment::set_dof_blur_near_amount); + ClassDB::bind_method(D_METHOD("get_dof_blur_near_amount"),&Environment::get_dof_blur_near_amount); - ClassDB::bind_method(_MD("set_dof_blur_near_quality","level"),&Environment::set_dof_blur_near_quality); - ClassDB::bind_method(_MD("get_dof_blur_near_quality"),&Environment::get_dof_blur_near_quality); + ClassDB::bind_method(D_METHOD("set_dof_blur_near_quality","level"),&Environment::set_dof_blur_near_quality); + ClassDB::bind_method(D_METHOD("get_dof_blur_near_quality"),&Environment::get_dof_blur_near_quality); ADD_GROUP("DOF Far Blur","dof_blur_far_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"dof_blur_far_enabled"),_SCS("set_dof_blur_far_enabled"),_SCS("is_dof_blur_far_enabled") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_far_distance",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),_SCS("set_dof_blur_far_distance"),_SCS("get_dof_blur_far_distance") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_far_transition",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),_SCS("set_dof_blur_far_transition"),_SCS("get_dof_blur_far_transition") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_far_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_dof_blur_far_amount"),_SCS("get_dof_blur_far_amount") ); - ADD_PROPERTY(PropertyInfo(Variant::INT,"dof_blur_far_quality",PROPERTY_HINT_ENUM,"Low,Medium,High"),_SCS("set_dof_blur_far_quality"),_SCS("get_dof_blur_far_quality") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"dof_blur_far_enabled"),"set_dof_blur_far_enabled","is_dof_blur_far_enabled") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_far_distance",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),"set_dof_blur_far_distance","get_dof_blur_far_distance") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_far_transition",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),"set_dof_blur_far_transition","get_dof_blur_far_transition") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_far_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_dof_blur_far_amount","get_dof_blur_far_amount") ; + ADD_PROPERTY(PropertyInfo(Variant::INT,"dof_blur_far_quality",PROPERTY_HINT_ENUM,"Low,Medium,High"),"set_dof_blur_far_quality","get_dof_blur_far_quality") ; ADD_GROUP("DOF Far Near","dof_blur_near_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"dof_blur_near_enabled"),_SCS("set_dof_blur_near_enabled"),_SCS("is_dof_blur_near_enabled") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_near_distance",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),_SCS("set_dof_blur_near_distance"),_SCS("get_dof_blur_near_distance") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_near_transition",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),_SCS("set_dof_blur_near_transition"),_SCS("get_dof_blur_near_transition") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_near_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_dof_blur_near_amount"),_SCS("get_dof_blur_near_amount") ); - ADD_PROPERTY(PropertyInfo(Variant::INT,"dof_blur_near_quality",PROPERTY_HINT_ENUM,"Low,Medium,High"),_SCS("set_dof_blur_near_quality"),_SCS("get_dof_blur_near_quality") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"dof_blur_near_enabled"),"set_dof_blur_near_enabled","is_dof_blur_near_enabled") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_near_distance",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),"set_dof_blur_near_distance","get_dof_blur_near_distance") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_near_transition",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),"set_dof_blur_near_transition","get_dof_blur_near_transition") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_near_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_dof_blur_near_amount","get_dof_blur_near_amount") ; + ADD_PROPERTY(PropertyInfo(Variant::INT,"dof_blur_near_quality",PROPERTY_HINT_ENUM,"Low,Medium,High"),"set_dof_blur_near_quality","get_dof_blur_near_quality") ; - ClassDB::bind_method(_MD("set_glow_enabled","enabled"),&Environment::set_glow_enabled); - ClassDB::bind_method(_MD("is_glow_enabled"),&Environment::is_glow_enabled); + ClassDB::bind_method(D_METHOD("set_glow_enabled","enabled"),&Environment::set_glow_enabled); + ClassDB::bind_method(D_METHOD("is_glow_enabled"),&Environment::is_glow_enabled); - ClassDB::bind_method(_MD("set_glow_level","idx","enabled"),&Environment::set_glow_level); - ClassDB::bind_method(_MD("is_glow_level_enabled","idx"),&Environment::is_glow_level_enabled); + ClassDB::bind_method(D_METHOD("set_glow_level","idx","enabled"),&Environment::set_glow_level); + ClassDB::bind_method(D_METHOD("is_glow_level_enabled","idx"),&Environment::is_glow_level_enabled); - ClassDB::bind_method(_MD("set_glow_intensity","intensity"),&Environment::set_glow_intensity); - ClassDB::bind_method(_MD("get_glow_intensity"),&Environment::get_glow_intensity); + ClassDB::bind_method(D_METHOD("set_glow_intensity","intensity"),&Environment::set_glow_intensity); + ClassDB::bind_method(D_METHOD("get_glow_intensity"),&Environment::get_glow_intensity); - ClassDB::bind_method(_MD("set_glow_strength","strength"),&Environment::set_glow_strength); - ClassDB::bind_method(_MD("get_glow_strength"),&Environment::get_glow_strength); + ClassDB::bind_method(D_METHOD("set_glow_strength","strength"),&Environment::set_glow_strength); + ClassDB::bind_method(D_METHOD("get_glow_strength"),&Environment::get_glow_strength); - ClassDB::bind_method(_MD("set_glow_bloom","amount"),&Environment::set_glow_bloom); - ClassDB::bind_method(_MD("get_glow_bloom"),&Environment::get_glow_bloom); + ClassDB::bind_method(D_METHOD("set_glow_bloom","amount"),&Environment::set_glow_bloom); + ClassDB::bind_method(D_METHOD("get_glow_bloom"),&Environment::get_glow_bloom); - ClassDB::bind_method(_MD("set_glow_blend_mode","mode"),&Environment::set_glow_blend_mode); - ClassDB::bind_method(_MD("get_glow_blend_mode"),&Environment::get_glow_blend_mode); + ClassDB::bind_method(D_METHOD("set_glow_blend_mode","mode"),&Environment::set_glow_blend_mode); + ClassDB::bind_method(D_METHOD("get_glow_blend_mode"),&Environment::get_glow_blend_mode); - ClassDB::bind_method(_MD("set_glow_hdr_bleed_treshold","treshold"),&Environment::set_glow_hdr_bleed_treshold); - ClassDB::bind_method(_MD("get_glow_hdr_bleed_treshold"),&Environment::get_glow_hdr_bleed_treshold); + ClassDB::bind_method(D_METHOD("set_glow_hdr_bleed_treshold","treshold"),&Environment::set_glow_hdr_bleed_treshold); + ClassDB::bind_method(D_METHOD("get_glow_hdr_bleed_treshold"),&Environment::get_glow_hdr_bleed_treshold); - ClassDB::bind_method(_MD("set_glow_hdr_bleed_scale","scale"),&Environment::set_glow_hdr_bleed_scale); - ClassDB::bind_method(_MD("get_glow_hdr_bleed_scale"),&Environment::get_glow_hdr_bleed_scale); + ClassDB::bind_method(D_METHOD("set_glow_hdr_bleed_scale","scale"),&Environment::set_glow_hdr_bleed_scale); + ClassDB::bind_method(D_METHOD("get_glow_hdr_bleed_scale"),&Environment::get_glow_hdr_bleed_scale); - ClassDB::bind_method(_MD("set_glow_bicubic_upscale","enabled"),&Environment::set_glow_bicubic_upscale); - ClassDB::bind_method(_MD("is_glow_bicubic_upscale_enabled"),&Environment::is_glow_bicubic_upscale_enabled); + ClassDB::bind_method(D_METHOD("set_glow_bicubic_upscale","enabled"),&Environment::set_glow_bicubic_upscale); + ClassDB::bind_method(D_METHOD("is_glow_bicubic_upscale_enabled"),&Environment::is_glow_bicubic_upscale_enabled); ADD_GROUP("Glow","glow_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"glow_enabled"),_SCS("set_glow_enabled"),_SCS("is_glow_enabled") ); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/1"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),0 ); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/2"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),1 ); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/3"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),2 ); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/4"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),3 ); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/5"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),4 ); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/6"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),5 ); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/7"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),6 ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"glow_enabled"),"set_glow_enabled","is_glow_enabled") ; + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/1"),"set_glow_level","is_glow_level_enabled",0 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/2"),"set_glow_level","is_glow_level_enabled",1 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/3"),"set_glow_level","is_glow_level_enabled",2 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/4"),"set_glow_level","is_glow_level_enabled",3 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/5"),"set_glow_level","is_glow_level_enabled",4 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/6"),"set_glow_level","is_glow_level_enabled",5 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/7"),"set_glow_level","is_glow_level_enabled",6 ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_intensity",PROPERTY_HINT_RANGE,"0.0,8.0,0.01"),_SCS("set_glow_intensity"),_SCS("get_glow_intensity") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_strength",PROPERTY_HINT_RANGE,"0.0,2.0,0.01"),_SCS("set_glow_strength"),_SCS("get_glow_strength") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_bloom",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_glow_bloom"),_SCS("get_glow_bloom") ); - ADD_PROPERTY(PropertyInfo(Variant::INT,"glow_blend_mode",PROPERTY_HINT_ENUM,"Additive,Screen,Softlight,Replace"),_SCS("set_glow_blend_mode"),_SCS("get_glow_blend_mode") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_hdr_treshold",PROPERTY_HINT_RANGE,"0.0,4.0,0.01"),_SCS("set_glow_hdr_bleed_treshold"),_SCS("get_glow_hdr_bleed_treshold") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_hdr_scale",PROPERTY_HINT_RANGE,"0.0,4.0,0.01"),_SCS("set_glow_hdr_bleed_scale"),_SCS("get_glow_hdr_bleed_scale") ); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"glow_bicubic_upscale"),_SCS("set_glow_bicubic_upscale"),_SCS("is_glow_bicubic_upscale_enabled") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_intensity",PROPERTY_HINT_RANGE,"0.0,8.0,0.01"),"set_glow_intensity","get_glow_intensity") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_strength",PROPERTY_HINT_RANGE,"0.0,2.0,0.01"),"set_glow_strength","get_glow_strength") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_bloom",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),"set_glow_bloom","get_glow_bloom") ; + ADD_PROPERTY(PropertyInfo(Variant::INT,"glow_blend_mode",PROPERTY_HINT_ENUM,"Additive,Screen,Softlight,Replace"),"set_glow_blend_mode","get_glow_blend_mode") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_hdr_treshold",PROPERTY_HINT_RANGE,"0.0,4.0,0.01"),"set_glow_hdr_bleed_treshold","get_glow_hdr_bleed_treshold") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_hdr_scale",PROPERTY_HINT_RANGE,"0.0,4.0,0.01"),"set_glow_hdr_bleed_scale","get_glow_hdr_bleed_scale") ; + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"glow_bicubic_upscale"),"set_glow_bicubic_upscale","is_glow_bicubic_upscale_enabled") ; - ClassDB::bind_method(_MD("set_tonemapper","mode"),&Environment::set_tonemapper); - ClassDB::bind_method(_MD("get_tonemapper"),&Environment::get_tonemapper); + ClassDB::bind_method(D_METHOD("set_tonemapper","mode"),&Environment::set_tonemapper); + ClassDB::bind_method(D_METHOD("get_tonemapper"),&Environment::get_tonemapper); - ClassDB::bind_method(_MD("set_tonemap_exposure","exposure"),&Environment::set_tonemap_exposure); - ClassDB::bind_method(_MD("get_tonemap_exposure"),&Environment::get_tonemap_exposure); + ClassDB::bind_method(D_METHOD("set_tonemap_exposure","exposure"),&Environment::set_tonemap_exposure); + ClassDB::bind_method(D_METHOD("get_tonemap_exposure"),&Environment::get_tonemap_exposure); - ClassDB::bind_method(_MD("set_tonemap_white","white"),&Environment::set_tonemap_white); - ClassDB::bind_method(_MD("get_tonemap_white"),&Environment::get_tonemap_white); + ClassDB::bind_method(D_METHOD("set_tonemap_white","white"),&Environment::set_tonemap_white); + ClassDB::bind_method(D_METHOD("get_tonemap_white"),&Environment::get_tonemap_white); - ClassDB::bind_method(_MD("set_tonemap_auto_exposure","auto_exposure"),&Environment::set_tonemap_auto_exposure); - ClassDB::bind_method(_MD("get_tonemap_auto_exposure"),&Environment::get_tonemap_auto_exposure); + ClassDB::bind_method(D_METHOD("set_tonemap_auto_exposure","auto_exposure"),&Environment::set_tonemap_auto_exposure); + ClassDB::bind_method(D_METHOD("get_tonemap_auto_exposure"),&Environment::get_tonemap_auto_exposure); - ClassDB::bind_method(_MD("set_tonemap_auto_exposure_max","exposure_max"),&Environment::set_tonemap_auto_exposure_max); - ClassDB::bind_method(_MD("get_tonemap_auto_exposure_max"),&Environment::get_tonemap_auto_exposure_max); + ClassDB::bind_method(D_METHOD("set_tonemap_auto_exposure_max","exposure_max"),&Environment::set_tonemap_auto_exposure_max); + ClassDB::bind_method(D_METHOD("get_tonemap_auto_exposure_max"),&Environment::get_tonemap_auto_exposure_max); - ClassDB::bind_method(_MD("set_tonemap_auto_exposure_min","exposure_min"),&Environment::set_tonemap_auto_exposure_min); - ClassDB::bind_method(_MD("get_tonemap_auto_exposure_min"),&Environment::get_tonemap_auto_exposure_min); + ClassDB::bind_method(D_METHOD("set_tonemap_auto_exposure_min","exposure_min"),&Environment::set_tonemap_auto_exposure_min); + ClassDB::bind_method(D_METHOD("get_tonemap_auto_exposure_min"),&Environment::get_tonemap_auto_exposure_min); - ClassDB::bind_method(_MD("set_tonemap_auto_exposure_speed","exposure_speed"),&Environment::set_tonemap_auto_exposure_speed); - ClassDB::bind_method(_MD("get_tonemap_auto_exposure_speed"),&Environment::get_tonemap_auto_exposure_speed); + ClassDB::bind_method(D_METHOD("set_tonemap_auto_exposure_speed","exposure_speed"),&Environment::set_tonemap_auto_exposure_speed); + ClassDB::bind_method(D_METHOD("get_tonemap_auto_exposure_speed"),&Environment::get_tonemap_auto_exposure_speed); - ClassDB::bind_method(_MD("set_tonemap_auto_exposure_grey","exposure_grey"),&Environment::set_tonemap_auto_exposure_grey); - ClassDB::bind_method(_MD("get_tonemap_auto_exposure_grey"),&Environment::get_tonemap_auto_exposure_grey); + ClassDB::bind_method(D_METHOD("set_tonemap_auto_exposure_grey","exposure_grey"),&Environment::set_tonemap_auto_exposure_grey); + ClassDB::bind_method(D_METHOD("get_tonemap_auto_exposure_grey"),&Environment::get_tonemap_auto_exposure_grey); ADD_GROUP("Tonemap","tonemap_"); - ADD_PROPERTY(PropertyInfo(Variant::INT,"tonemap_mode",PROPERTY_HINT_ENUM,"Linear,Reindhart,Filmic,Aces"),_SCS("set_tonemapper"),_SCS("get_tonemapper") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"tonemap_exposure",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_tonemap_exposure"),_SCS("get_tonemap_exposure") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"tonemap_white",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_tonemap_white"),_SCS("get_tonemap_white") ); + ADD_PROPERTY(PropertyInfo(Variant::INT,"tonemap_mode",PROPERTY_HINT_ENUM,"Linear,Reindhart,Filmic,Aces"),"set_tonemapper","get_tonemapper") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"tonemap_exposure",PROPERTY_HINT_RANGE,"0,16,0.01"),"set_tonemap_exposure","get_tonemap_exposure") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"tonemap_white",PROPERTY_HINT_RANGE,"0,16,0.01"),"set_tonemap_white","get_tonemap_white") ; ADD_GROUP("Auto Exposure","auto_exposure_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"auto_expoure_enabled"),_SCS("set_tonemap_auto_exposure"),_SCS("get_tonemap_auto_exposure") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_scale",PROPERTY_HINT_RANGE,"0.01,64,0.01"),_SCS("set_tonemap_auto_exposure_grey"),_SCS("get_tonemap_auto_exposure_grey") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_min_luma",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_tonemap_auto_exposure_min"),_SCS("get_tonemap_auto_exposure_min") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_max_luma",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_tonemap_auto_exposure_max"),_SCS("get_tonemap_auto_exposure_max") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_speed",PROPERTY_HINT_RANGE,"0.01,64,0.01"),_SCS("set_tonemap_auto_exposure_speed"),_SCS("get_tonemap_auto_exposure_speed") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"auto_expoure_enabled"),"set_tonemap_auto_exposure","get_tonemap_auto_exposure") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_scale",PROPERTY_HINT_RANGE,"0.01,64,0.01"),"set_tonemap_auto_exposure_grey","get_tonemap_auto_exposure_grey") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_min_luma",PROPERTY_HINT_RANGE,"0,16,0.01"),"set_tonemap_auto_exposure_min","get_tonemap_auto_exposure_min") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_max_luma",PROPERTY_HINT_RANGE,"0,16,0.01"),"set_tonemap_auto_exposure_max","get_tonemap_auto_exposure_max") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_speed",PROPERTY_HINT_RANGE,"0.01,64,0.01"),"set_tonemap_auto_exposure_speed","get_tonemap_auto_exposure_speed") ; - ClassDB::bind_method(_MD("set_adjustment_enable","enabled"),&Environment::set_adjustment_enable); - ClassDB::bind_method(_MD("is_adjustment_enabled"),&Environment::is_adjustment_enabled); + ClassDB::bind_method(D_METHOD("set_adjustment_enable","enabled"),&Environment::set_adjustment_enable); + ClassDB::bind_method(D_METHOD("is_adjustment_enabled"),&Environment::is_adjustment_enabled); - ClassDB::bind_method(_MD("set_adjustment_brightness","brightness"),&Environment::set_adjustment_brightness); - ClassDB::bind_method(_MD("get_adjustment_brightness"),&Environment::get_adjustment_brightness); + ClassDB::bind_method(D_METHOD("set_adjustment_brightness","brightness"),&Environment::set_adjustment_brightness); + ClassDB::bind_method(D_METHOD("get_adjustment_brightness"),&Environment::get_adjustment_brightness); - ClassDB::bind_method(_MD("set_adjustment_contrast","contrast"),&Environment::set_adjustment_contrast); - ClassDB::bind_method(_MD("get_adjustment_contrast"),&Environment::get_adjustment_contrast); + ClassDB::bind_method(D_METHOD("set_adjustment_contrast","contrast"),&Environment::set_adjustment_contrast); + ClassDB::bind_method(D_METHOD("get_adjustment_contrast"),&Environment::get_adjustment_contrast); - ClassDB::bind_method(_MD("set_adjustment_saturation","saturation"),&Environment::set_adjustment_saturation); - ClassDB::bind_method(_MD("get_adjustment_saturation"),&Environment::get_adjustment_saturation); + ClassDB::bind_method(D_METHOD("set_adjustment_saturation","saturation"),&Environment::set_adjustment_saturation); + ClassDB::bind_method(D_METHOD("get_adjustment_saturation"),&Environment::get_adjustment_saturation); - ClassDB::bind_method(_MD("set_adjustment_color_correction","color_correction"),&Environment::set_adjustment_color_correction); - ClassDB::bind_method(_MD("get_adjustment_color_correction"),&Environment::get_adjustment_color_correction); + ClassDB::bind_method(D_METHOD("set_adjustment_color_correction","color_correction"),&Environment::set_adjustment_color_correction); + ClassDB::bind_method(D_METHOD("get_adjustment_color_correction"),&Environment::get_adjustment_color_correction); ADD_GROUP("Adjustments","adjustment_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"adjustment_enabled"),_SCS("set_adjustment_enable"),_SCS("is_adjustment_enabled") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"adjustment_brightness",PROPERTY_HINT_RANGE,"0.01,8,0.01"),_SCS("set_adjustment_brightness"),_SCS("get_adjustment_brightness") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"adjustment_contrast",PROPERTY_HINT_RANGE,"0.01,8,0.01"),_SCS("set_adjustment_contrast"),_SCS("get_adjustment_contrast") ); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"adjustment_saturation",PROPERTY_HINT_RANGE,"0.01,8,0.01"),_SCS("set_adjustment_saturation"),_SCS("get_adjustment_saturation") ); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"adjustment_color_correction",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_adjustment_color_correction"),_SCS("get_adjustment_color_correction") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"adjustment_enabled"),"set_adjustment_enable","is_adjustment_enabled") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"adjustment_brightness",PROPERTY_HINT_RANGE,"0.01,8,0.01"),"set_adjustment_brightness","get_adjustment_brightness") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"adjustment_contrast",PROPERTY_HINT_RANGE,"0.01,8,0.01"),"set_adjustment_contrast","get_adjustment_contrast") ; + ADD_PROPERTY(PropertyInfo(Variant::REAL,"adjustment_saturation",PROPERTY_HINT_RANGE,"0.01,8,0.01"),"set_adjustment_saturation","get_adjustment_saturation") ; + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"adjustment_color_correction",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_adjustment_color_correction","get_adjustment_color_correction") ; GLOBAL_DEF("rendering/skybox/irradiance_cube_resolution",256); diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index b1d0611f48..d94e046b98 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -78,14 +78,14 @@ void Font::update_changes() { void Font::_bind_methods() { - ClassDB::bind_method(_MD("draw","canvas_item","pos","string","modulate","clip_w"),&Font::draw,DEFVAL(Color(1,1,1)),DEFVAL(-1)); - ClassDB::bind_method(_MD("get_ascent"),&Font::get_ascent); - ClassDB::bind_method(_MD("get_descent"),&Font::get_descent); - ClassDB::bind_method(_MD("get_height"),&Font::get_height); - ClassDB::bind_method(_MD("is_distance_field_hint"),&Font::is_distance_field_hint); - ClassDB::bind_method(_MD("get_string_size","string"),&Font::get_string_size); - ClassDB::bind_method(_MD("draw_char","canvas_item","pos","char","next","modulate"),&Font::draw_char,DEFVAL(-1),DEFVAL(Color(1,1,1))); - ClassDB::bind_method(_MD("update_changes"),&Font::update_changes); + ClassDB::bind_method(D_METHOD("draw","canvas_item","pos","string","modulate","clip_w"),&Font::draw,DEFVAL(Color(1,1,1)),DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("get_ascent"),&Font::get_ascent); + ClassDB::bind_method(D_METHOD("get_descent"),&Font::get_descent); + ClassDB::bind_method(D_METHOD("get_height"),&Font::get_height); + ClassDB::bind_method(D_METHOD("is_distance_field_hint"),&Font::is_distance_field_hint); + ClassDB::bind_method(D_METHOD("get_string_size","string"),&Font::get_string_size); + ClassDB::bind_method(D_METHOD("draw_char","canvas_item","pos","char","next","modulate"),&Font::draw_char,DEFVAL(-1),DEFVAL(Color(1,1,1))); + ClassDB::bind_method(D_METHOD("update_changes"),&Font::update_changes); } @@ -566,48 +566,48 @@ Size2 BitmapFont::get_char_size(CharType p_char,CharType p_next) const { void BitmapFont::_bind_methods() { - ClassDB::bind_method(_MD("create_from_fnt","path"),&BitmapFont::create_from_fnt); - ClassDB::bind_method(_MD("set_height","px"),&BitmapFont::set_height); + ClassDB::bind_method(D_METHOD("create_from_fnt","path"),&BitmapFont::create_from_fnt); + ClassDB::bind_method(D_METHOD("set_height","px"),&BitmapFont::set_height); - ClassDB::bind_method(_MD("set_ascent","px"),&BitmapFont::set_ascent); + ClassDB::bind_method(D_METHOD("set_ascent","px"),&BitmapFont::set_ascent); - ClassDB::bind_method(_MD("add_kerning_pair","char_a","char_b","kerning"),&BitmapFont::add_kerning_pair); - ClassDB::bind_method(_MD("get_kerning_pair","char_a","char_b"),&BitmapFont::get_kerning_pair); + ClassDB::bind_method(D_METHOD("add_kerning_pair","char_a","char_b","kerning"),&BitmapFont::add_kerning_pair); + ClassDB::bind_method(D_METHOD("get_kerning_pair","char_a","char_b"),&BitmapFont::get_kerning_pair); - ClassDB::bind_method(_MD("add_texture","texture:Texture"),&BitmapFont::add_texture); - ClassDB::bind_method(_MD("add_char","character","texture","rect","align","advance"),&BitmapFont::add_char,DEFVAL(Point2()),DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("add_texture","texture:Texture"),&BitmapFont::add_texture); + ClassDB::bind_method(D_METHOD("add_char","character","texture","rect","align","advance"),&BitmapFont::add_char,DEFVAL(Point2()),DEFVAL(-1)); - ClassDB::bind_method(_MD("get_texture_count"),&BitmapFont::get_texture_count); - ClassDB::bind_method(_MD("get_texture:Texture","idx"),&BitmapFont::get_texture); + ClassDB::bind_method(D_METHOD("get_texture_count"),&BitmapFont::get_texture_count); + ClassDB::bind_method(D_METHOD("get_texture:Texture","idx"),&BitmapFont::get_texture); - ClassDB::bind_method(_MD("get_char_size","char","next"),&BitmapFont::get_char_size,DEFVAL(0)); + ClassDB::bind_method(D_METHOD("get_char_size","char","next"),&BitmapFont::get_char_size,DEFVAL(0)); - ClassDB::bind_method(_MD("set_distance_field_hint","enable"),&BitmapFont::set_distance_field_hint); + ClassDB::bind_method(D_METHOD("set_distance_field_hint","enable"),&BitmapFont::set_distance_field_hint); - ClassDB::bind_method(_MD("clear"),&BitmapFont::clear); + ClassDB::bind_method(D_METHOD("clear"),&BitmapFont::clear); - ClassDB::bind_method(_MD("_set_chars"),&BitmapFont::_set_chars); - ClassDB::bind_method(_MD("_get_chars"),&BitmapFont::_get_chars); + ClassDB::bind_method(D_METHOD("_set_chars"),&BitmapFont::_set_chars); + ClassDB::bind_method(D_METHOD("_get_chars"),&BitmapFont::_get_chars); - ClassDB::bind_method(_MD("_set_kernings"),&BitmapFont::_set_kernings); - ClassDB::bind_method(_MD("_get_kernings"),&BitmapFont::_get_kernings); + ClassDB::bind_method(D_METHOD("_set_kernings"),&BitmapFont::_set_kernings); + ClassDB::bind_method(D_METHOD("_get_kernings"),&BitmapFont::_get_kernings); - ClassDB::bind_method(_MD("_set_textures"),&BitmapFont::_set_textures); - ClassDB::bind_method(_MD("_get_textures"),&BitmapFont::_get_textures); + ClassDB::bind_method(D_METHOD("_set_textures"),&BitmapFont::_set_textures); + ClassDB::bind_method(D_METHOD("_get_textures"),&BitmapFont::_get_textures); - ClassDB::bind_method(_MD("set_fallback","fallback"),&BitmapFont::set_fallback); - ClassDB::bind_method(_MD("get_fallback"),&BitmapFont::get_fallback); + ClassDB::bind_method(D_METHOD("set_fallback","fallback"),&BitmapFont::set_fallback); + ClassDB::bind_method(D_METHOD("get_fallback"),&BitmapFont::get_fallback); - ADD_PROPERTY( PropertyInfo( Variant::ARRAY, "textures", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_textures"), _SCS("_get_textures") ); - ADD_PROPERTY( PropertyInfo( Variant::POOL_INT_ARRAY, "chars", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_chars"), _SCS("_get_chars") ); - ADD_PROPERTY( PropertyInfo( Variant::POOL_INT_ARRAY, "kernings", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_kernings"), _SCS("_get_kernings") ); + ADD_PROPERTY( PropertyInfo( Variant::ARRAY, "textures", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), "_set_textures", "_get_textures") ; + ADD_PROPERTY( PropertyInfo( Variant::POOL_INT_ARRAY, "chars", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), "_set_chars", "_get_chars") ; + ADD_PROPERTY( PropertyInfo( Variant::POOL_INT_ARRAY, "kernings", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), "_set_kernings", "_get_kernings") ; - ADD_PROPERTY( PropertyInfo( Variant::REAL, "height", PROPERTY_HINT_RANGE,"-1024,1024,1" ), _SCS("set_height"), _SCS("get_height") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "ascent", PROPERTY_HINT_RANGE,"-1024,1024,1" ), _SCS("set_ascent"), _SCS("get_ascent") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "distance_field" ), _SCS("set_distance_field_hint"), _SCS("is_distance_field_hint") ); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "fallback", PROPERTY_HINT_RESOURCE_TYPE,"BitmapFont" ), _SCS("set_fallback"), _SCS("get_fallback") ); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "height", PROPERTY_HINT_RANGE,"-1024,1024,1" ), "set_height", "get_height") ; + ADD_PROPERTY( PropertyInfo( Variant::REAL, "ascent", PROPERTY_HINT_RANGE,"-1024,1024,1" ), "set_ascent", "get_ascent") ; + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "distance_field" ), "set_distance_field_hint", "is_distance_field_hint") ; + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "fallback", PROPERTY_HINT_RESOURCE_TYPE,"BitmapFont" ), "set_fallback", "get_fallback") ; } diff --git a/scene/resources/gibberish_stream.cpp b/scene/resources/gibberish_stream.cpp index 3a6a6df7ea..fdc5bf01e8 100644 --- a/scene/resources/gibberish_stream.cpp +++ b/scene/resources/gibberish_stream.cpp @@ -305,22 +305,22 @@ float AudioStreamGibberish::get_pitch_random_scale() const { void AudioStreamGibberish::_bind_methods() { - ClassDB::bind_method(_MD("set_phonemes","phonemes"),&AudioStreamGibberish::set_phonemes); - ClassDB::bind_method(_MD("get_phonemes"),&AudioStreamGibberish::get_phonemes); + ClassDB::bind_method(D_METHOD("set_phonemes","phonemes"),&AudioStreamGibberish::set_phonemes); + ClassDB::bind_method(D_METHOD("get_phonemes"),&AudioStreamGibberish::get_phonemes); - ClassDB::bind_method(_MD("set_pitch_scale","pitch_scale"),&AudioStreamGibberish::set_pitch_scale); - ClassDB::bind_method(_MD("get_pitch_scale"),&AudioStreamGibberish::get_pitch_scale); + ClassDB::bind_method(D_METHOD("set_pitch_scale","pitch_scale"),&AudioStreamGibberish::set_pitch_scale); + ClassDB::bind_method(D_METHOD("get_pitch_scale"),&AudioStreamGibberish::get_pitch_scale); - ClassDB::bind_method(_MD("set_pitch_random_scale","pitch_random_scale"),&AudioStreamGibberish::set_pitch_random_scale); - ClassDB::bind_method(_MD("get_pitch_random_scale"),&AudioStreamGibberish::get_pitch_random_scale); + ClassDB::bind_method(D_METHOD("set_pitch_random_scale","pitch_random_scale"),&AudioStreamGibberish::set_pitch_random_scale); + ClassDB::bind_method(D_METHOD("get_pitch_random_scale"),&AudioStreamGibberish::get_pitch_random_scale); - ClassDB::bind_method(_MD("set_xfade_time","sec"),&AudioStreamGibberish::set_xfade_time); - ClassDB::bind_method(_MD("get_xfade_time"),&AudioStreamGibberish::get_xfade_time); + ClassDB::bind_method(D_METHOD("set_xfade_time","sec"),&AudioStreamGibberish::set_xfade_time); + ClassDB::bind_method(D_METHOD("get_xfade_time"),&AudioStreamGibberish::get_xfade_time); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"phonemes",PROPERTY_HINT_RESOURCE_TYPE,"SampleLibrary"),_SCS("set_phonemes"),_SCS("get_phonemes")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"pitch_scale",PROPERTY_HINT_RANGE,"0.01,64,0.01"),_SCS("set_pitch_scale"),_SCS("get_pitch_scale")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"pitch_random_scale",PROPERTY_HINT_RANGE,"0,64,0.01"),_SCS("set_pitch_random_scale"),_SCS("get_pitch_random_scale")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"xfade_sec",PROPERTY_HINT_RANGE,"0.001,0.5,0.001"),_SCS("set_xfade_time"),_SCS("get_xfade_time")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"phonemes",PROPERTY_HINT_RESOURCE_TYPE,"SampleLibrary"),"set_phonemes","get_phonemes"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"pitch_scale",PROPERTY_HINT_RANGE,"0.01,64,0.01"),"set_pitch_scale","get_pitch_scale"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"pitch_random_scale",PROPERTY_HINT_RANGE,"0,64,0.01"),"set_pitch_random_scale","get_pitch_random_scale"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"xfade_sec",PROPERTY_HINT_RANGE,"0.001,0.5,0.001"),"set_xfade_time","get_xfade_time"); } diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index e2e79970f9..3780c466a5 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -339,7 +339,7 @@ void FixedSpatialMaterial::_update_shader() { code+="\tROUGHNESS = specular_tex.a * roughness;\n"; } else { code+="\tvec4 specular_tex = texture(texture_specular,UV);\n"; - code+="\tSPECULAR = vec3(metalness * specular_tex.r);\n"; + code+="\tSPECULAR = vec3(ALBEDO.rgb * metalness * specular_tex.r);\n"; code+="\tROUGHNESS = specular_tex.a * roughness;\n"; } @@ -831,193 +831,193 @@ Vector2 FixedSpatialMaterial::get_uv2_offset() const{ void FixedSpatialMaterial::_bind_methods() { - ClassDB::bind_method(_MD("set_albedo","albedo"),&FixedSpatialMaterial::set_albedo); - ClassDB::bind_method(_MD("get_albedo"),&FixedSpatialMaterial::get_albedo); + ClassDB::bind_method(D_METHOD("set_albedo","albedo"),&FixedSpatialMaterial::set_albedo); + ClassDB::bind_method(D_METHOD("get_albedo"),&FixedSpatialMaterial::get_albedo); - ClassDB::bind_method(_MD("set_specular_mode","specular_mode"),&FixedSpatialMaterial::set_specular_mode); - ClassDB::bind_method(_MD("get_specular_mode"),&FixedSpatialMaterial::get_specular_mode); + ClassDB::bind_method(D_METHOD("set_specular_mode","specular_mode"),&FixedSpatialMaterial::set_specular_mode); + ClassDB::bind_method(D_METHOD("get_specular_mode"),&FixedSpatialMaterial::get_specular_mode); - ClassDB::bind_method(_MD("set_specular","specular"),&FixedSpatialMaterial::set_specular); - ClassDB::bind_method(_MD("get_specular"),&FixedSpatialMaterial::get_specular); + ClassDB::bind_method(D_METHOD("set_specular","specular"),&FixedSpatialMaterial::set_specular); + ClassDB::bind_method(D_METHOD("get_specular"),&FixedSpatialMaterial::get_specular); - ClassDB::bind_method(_MD("set_metalness","metalness"),&FixedSpatialMaterial::set_metalness); - ClassDB::bind_method(_MD("get_metalness"),&FixedSpatialMaterial::get_metalness); + ClassDB::bind_method(D_METHOD("set_metalness","metalness"),&FixedSpatialMaterial::set_metalness); + ClassDB::bind_method(D_METHOD("get_metalness"),&FixedSpatialMaterial::get_metalness); - ClassDB::bind_method(_MD("set_roughness","roughness"),&FixedSpatialMaterial::set_roughness); - ClassDB::bind_method(_MD("get_roughness"),&FixedSpatialMaterial::get_roughness); + ClassDB::bind_method(D_METHOD("set_roughness","roughness"),&FixedSpatialMaterial::set_roughness); + ClassDB::bind_method(D_METHOD("get_roughness"),&FixedSpatialMaterial::get_roughness); - ClassDB::bind_method(_MD("set_emission","emission"),&FixedSpatialMaterial::set_emission); - ClassDB::bind_method(_MD("get_emission"),&FixedSpatialMaterial::get_emission); + ClassDB::bind_method(D_METHOD("set_emission","emission"),&FixedSpatialMaterial::set_emission); + ClassDB::bind_method(D_METHOD("get_emission"),&FixedSpatialMaterial::get_emission); - ClassDB::bind_method(_MD("set_emission_energy","emission_energy"),&FixedSpatialMaterial::set_emission_energy); - ClassDB::bind_method(_MD("get_emission_energy"),&FixedSpatialMaterial::get_emission_energy); + ClassDB::bind_method(D_METHOD("set_emission_energy","emission_energy"),&FixedSpatialMaterial::set_emission_energy); + ClassDB::bind_method(D_METHOD("get_emission_energy"),&FixedSpatialMaterial::get_emission_energy); - ClassDB::bind_method(_MD("set_normal_scale","normal_scale"),&FixedSpatialMaterial::set_normal_scale); - ClassDB::bind_method(_MD("get_normal_scale"),&FixedSpatialMaterial::get_normal_scale); + ClassDB::bind_method(D_METHOD("set_normal_scale","normal_scale"),&FixedSpatialMaterial::set_normal_scale); + ClassDB::bind_method(D_METHOD("get_normal_scale"),&FixedSpatialMaterial::get_normal_scale); - ClassDB::bind_method(_MD("set_rim","rim"),&FixedSpatialMaterial::set_rim); - ClassDB::bind_method(_MD("get_rim"),&FixedSpatialMaterial::get_rim); + ClassDB::bind_method(D_METHOD("set_rim","rim"),&FixedSpatialMaterial::set_rim); + ClassDB::bind_method(D_METHOD("get_rim"),&FixedSpatialMaterial::get_rim); - ClassDB::bind_method(_MD("set_rim_tint","rim_tint"),&FixedSpatialMaterial::set_rim_tint); - ClassDB::bind_method(_MD("get_rim_tint"),&FixedSpatialMaterial::get_rim_tint); + ClassDB::bind_method(D_METHOD("set_rim_tint","rim_tint"),&FixedSpatialMaterial::set_rim_tint); + ClassDB::bind_method(D_METHOD("get_rim_tint"),&FixedSpatialMaterial::get_rim_tint); - ClassDB::bind_method(_MD("set_clearcoat","clearcoat"),&FixedSpatialMaterial::set_clearcoat); - ClassDB::bind_method(_MD("get_clearcoat"),&FixedSpatialMaterial::get_clearcoat); + ClassDB::bind_method(D_METHOD("set_clearcoat","clearcoat"),&FixedSpatialMaterial::set_clearcoat); + ClassDB::bind_method(D_METHOD("get_clearcoat"),&FixedSpatialMaterial::get_clearcoat); - ClassDB::bind_method(_MD("set_clearcoat_gloss","clearcoat_gloss"),&FixedSpatialMaterial::set_clearcoat_gloss); - ClassDB::bind_method(_MD("get_clearcoat_gloss"),&FixedSpatialMaterial::get_clearcoat_gloss); + ClassDB::bind_method(D_METHOD("set_clearcoat_gloss","clearcoat_gloss"),&FixedSpatialMaterial::set_clearcoat_gloss); + ClassDB::bind_method(D_METHOD("get_clearcoat_gloss"),&FixedSpatialMaterial::get_clearcoat_gloss); - ClassDB::bind_method(_MD("set_anisotropy","anisotropy"),&FixedSpatialMaterial::set_anisotropy); - ClassDB::bind_method(_MD("get_anisotropy"),&FixedSpatialMaterial::get_anisotropy); + ClassDB::bind_method(D_METHOD("set_anisotropy","anisotropy"),&FixedSpatialMaterial::set_anisotropy); + ClassDB::bind_method(D_METHOD("get_anisotropy"),&FixedSpatialMaterial::get_anisotropy); - ClassDB::bind_method(_MD("set_height_scale","height_scale"),&FixedSpatialMaterial::set_height_scale); - ClassDB::bind_method(_MD("get_height_scale"),&FixedSpatialMaterial::get_height_scale); + ClassDB::bind_method(D_METHOD("set_height_scale","height_scale"),&FixedSpatialMaterial::set_height_scale); + ClassDB::bind_method(D_METHOD("get_height_scale"),&FixedSpatialMaterial::get_height_scale); - ClassDB::bind_method(_MD("set_subsurface_scattering_strength","strength"),&FixedSpatialMaterial::set_subsurface_scattering_strength); - ClassDB::bind_method(_MD("get_subsurface_scattering_strength"),&FixedSpatialMaterial::get_subsurface_scattering_strength); + ClassDB::bind_method(D_METHOD("set_subsurface_scattering_strength","strength"),&FixedSpatialMaterial::set_subsurface_scattering_strength); + ClassDB::bind_method(D_METHOD("get_subsurface_scattering_strength"),&FixedSpatialMaterial::get_subsurface_scattering_strength); - ClassDB::bind_method(_MD("set_refraction","refraction"),&FixedSpatialMaterial::set_refraction); - ClassDB::bind_method(_MD("get_refraction"),&FixedSpatialMaterial::get_refraction); + ClassDB::bind_method(D_METHOD("set_refraction","refraction"),&FixedSpatialMaterial::set_refraction); + ClassDB::bind_method(D_METHOD("get_refraction"),&FixedSpatialMaterial::get_refraction); - ClassDB::bind_method(_MD("set_refraction_roughness","refraction_roughness"),&FixedSpatialMaterial::set_refraction_roughness); - ClassDB::bind_method(_MD("get_refraction_roughness"),&FixedSpatialMaterial::get_refraction_roughness); + ClassDB::bind_method(D_METHOD("set_refraction_roughness","refraction_roughness"),&FixedSpatialMaterial::set_refraction_roughness); + ClassDB::bind_method(D_METHOD("get_refraction_roughness"),&FixedSpatialMaterial::get_refraction_roughness); - ClassDB::bind_method(_MD("set_line_width","line_width"),&FixedSpatialMaterial::set_line_width); - ClassDB::bind_method(_MD("get_line_width"),&FixedSpatialMaterial::get_line_width); + ClassDB::bind_method(D_METHOD("set_line_width","line_width"),&FixedSpatialMaterial::set_line_width); + ClassDB::bind_method(D_METHOD("get_line_width"),&FixedSpatialMaterial::get_line_width); - ClassDB::bind_method(_MD("set_point_size","point_size"),&FixedSpatialMaterial::set_point_size); - ClassDB::bind_method(_MD("get_point_size"),&FixedSpatialMaterial::get_point_size); + ClassDB::bind_method(D_METHOD("set_point_size","point_size"),&FixedSpatialMaterial::set_point_size); + ClassDB::bind_method(D_METHOD("get_point_size"),&FixedSpatialMaterial::get_point_size); - ClassDB::bind_method(_MD("set_detail_uv","detail_uv"),&FixedSpatialMaterial::set_detail_uv); - ClassDB::bind_method(_MD("get_detail_uv"),&FixedSpatialMaterial::get_detail_uv); + ClassDB::bind_method(D_METHOD("set_detail_uv","detail_uv"),&FixedSpatialMaterial::set_detail_uv); + ClassDB::bind_method(D_METHOD("get_detail_uv"),&FixedSpatialMaterial::get_detail_uv); - ClassDB::bind_method(_MD("set_blend_mode","blend_mode"),&FixedSpatialMaterial::set_blend_mode); - ClassDB::bind_method(_MD("get_blend_mode"),&FixedSpatialMaterial::get_blend_mode); + ClassDB::bind_method(D_METHOD("set_blend_mode","blend_mode"),&FixedSpatialMaterial::set_blend_mode); + ClassDB::bind_method(D_METHOD("get_blend_mode"),&FixedSpatialMaterial::get_blend_mode); - ClassDB::bind_method(_MD("set_depth_draw_mode","depth_draw_mode"),&FixedSpatialMaterial::set_depth_draw_mode); - ClassDB::bind_method(_MD("get_depth_draw_mode"),&FixedSpatialMaterial::get_depth_draw_mode); + ClassDB::bind_method(D_METHOD("set_depth_draw_mode","depth_draw_mode"),&FixedSpatialMaterial::set_depth_draw_mode); + ClassDB::bind_method(D_METHOD("get_depth_draw_mode"),&FixedSpatialMaterial::get_depth_draw_mode); - ClassDB::bind_method(_MD("set_cull_mode","cull_mode"),&FixedSpatialMaterial::set_cull_mode); - ClassDB::bind_method(_MD("get_cull_mode"),&FixedSpatialMaterial::get_cull_mode); + ClassDB::bind_method(D_METHOD("set_cull_mode","cull_mode"),&FixedSpatialMaterial::set_cull_mode); + ClassDB::bind_method(D_METHOD("get_cull_mode"),&FixedSpatialMaterial::get_cull_mode); - ClassDB::bind_method(_MD("set_diffuse_mode","diffuse_mode"),&FixedSpatialMaterial::set_diffuse_mode); - ClassDB::bind_method(_MD("get_diffuse_mode"),&FixedSpatialMaterial::get_diffuse_mode); + ClassDB::bind_method(D_METHOD("set_diffuse_mode","diffuse_mode"),&FixedSpatialMaterial::set_diffuse_mode); + ClassDB::bind_method(D_METHOD("get_diffuse_mode"),&FixedSpatialMaterial::get_diffuse_mode); - ClassDB::bind_method(_MD("set_flag","flag","enable"),&FixedSpatialMaterial::set_flag); - ClassDB::bind_method(_MD("get_flag"),&FixedSpatialMaterial::get_flag); + ClassDB::bind_method(D_METHOD("set_flag","flag","enable"),&FixedSpatialMaterial::set_flag); + ClassDB::bind_method(D_METHOD("get_flag"),&FixedSpatialMaterial::get_flag); - ClassDB::bind_method(_MD("set_feature","feature","enable"),&FixedSpatialMaterial::set_feature); - ClassDB::bind_method(_MD("get_feature","feature"),&FixedSpatialMaterial::get_feature); + ClassDB::bind_method(D_METHOD("set_feature","feature","enable"),&FixedSpatialMaterial::set_feature); + ClassDB::bind_method(D_METHOD("get_feature","feature"),&FixedSpatialMaterial::get_feature); - ClassDB::bind_method(_MD("set_texture","param:Texture","texture"),&FixedSpatialMaterial::set_texture); - ClassDB::bind_method(_MD("get_texture:Texture","param:Texture"),&FixedSpatialMaterial::get_texture); + ClassDB::bind_method(D_METHOD("set_texture","param:Texture","texture"),&FixedSpatialMaterial::set_texture); + ClassDB::bind_method(D_METHOD("get_texture:Texture","param:Texture"),&FixedSpatialMaterial::get_texture); - ClassDB::bind_method(_MD("set_detail_blend_mode","detail_blend_mode"),&FixedSpatialMaterial::set_detail_blend_mode); - ClassDB::bind_method(_MD("get_detail_blend_mode"),&FixedSpatialMaterial::get_detail_blend_mode); + ClassDB::bind_method(D_METHOD("set_detail_blend_mode","detail_blend_mode"),&FixedSpatialMaterial::set_detail_blend_mode); + ClassDB::bind_method(D_METHOD("get_detail_blend_mode"),&FixedSpatialMaterial::get_detail_blend_mode); - ClassDB::bind_method(_MD("set_uv1_scale","scale"),&FixedSpatialMaterial::set_uv1_scale); - ClassDB::bind_method(_MD("get_uv1_scale"),&FixedSpatialMaterial::get_uv1_scale); + ClassDB::bind_method(D_METHOD("set_uv1_scale","scale"),&FixedSpatialMaterial::set_uv1_scale); + ClassDB::bind_method(D_METHOD("get_uv1_scale"),&FixedSpatialMaterial::get_uv1_scale); - ClassDB::bind_method(_MD("set_uv1_offset","offset"),&FixedSpatialMaterial::set_uv1_offset); - ClassDB::bind_method(_MD("get_uv1_offset"),&FixedSpatialMaterial::get_uv1_offset); + ClassDB::bind_method(D_METHOD("set_uv1_offset","offset"),&FixedSpatialMaterial::set_uv1_offset); + ClassDB::bind_method(D_METHOD("get_uv1_offset"),&FixedSpatialMaterial::get_uv1_offset); - ClassDB::bind_method(_MD("set_uv2_scale","scale"),&FixedSpatialMaterial::set_uv2_scale); - ClassDB::bind_method(_MD("get_uv2_scale"),&FixedSpatialMaterial::get_uv2_scale); + ClassDB::bind_method(D_METHOD("set_uv2_scale","scale"),&FixedSpatialMaterial::set_uv2_scale); + ClassDB::bind_method(D_METHOD("get_uv2_scale"),&FixedSpatialMaterial::get_uv2_scale); - ClassDB::bind_method(_MD("set_uv2_offset","offset"),&FixedSpatialMaterial::set_uv2_offset); - ClassDB::bind_method(_MD("get_uv2_offset"),&FixedSpatialMaterial::get_uv2_offset); + ClassDB::bind_method(D_METHOD("set_uv2_offset","offset"),&FixedSpatialMaterial::set_uv2_offset); + ClassDB::bind_method(D_METHOD("get_uv2_offset"),&FixedSpatialMaterial::get_uv2_offset); ADD_GROUP("Flags","flags_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_transparent"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_TRANSPARENT); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_unshaded"),_SCS("set_flag"),_SCS("get_flag"),FLAG_UNSHADED); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_on_top"),_SCS("set_flag"),_SCS("get_flag"),FLAG_ONTOP); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_use_point_size"),_SCS("set_flag"),_SCS("get_flag"),FLAG_USE_POINT_SIZE); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_transparent"),"set_feature","get_feature",FEATURE_TRANSPARENT); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_unshaded"),"set_flag","get_flag",FLAG_UNSHADED); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_on_top"),"set_flag","get_flag",FLAG_ONTOP); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_use_point_size"),"set_flag","get_flag",FLAG_USE_POINT_SIZE); ADD_GROUP("Vertex Color","vertex_color"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"vertex_color_use_as_albedo"),_SCS("set_flag"),_SCS("get_flag"),FLAG_ALBEDO_FROM_VERTEX_COLOR); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"vertex_color_is_srgb"),_SCS("set_flag"),_SCS("get_flag"),FLAG_SRGB_VERTEX_COLOR); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"vertex_color_use_as_albedo"),"set_flag","get_flag",FLAG_ALBEDO_FROM_VERTEX_COLOR); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"vertex_color_is_srgb"),"set_flag","get_flag",FLAG_SRGB_VERTEX_COLOR); ADD_GROUP("Parameters","params_"); - ADD_PROPERTY(PropertyInfo(Variant::INT,"params_diffuse_mode",PROPERTY_HINT_ENUM,"Labert,Lambert Wrap,Oren Nayar,Burley"),_SCS("set_diffuse_mode"),_SCS("get_diffuse_mode")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"params_blend_mode",PROPERTY_HINT_ENUM,"Mix,Add,Sub,Mul"),_SCS("set_blend_mode"),_SCS("get_blend_mode")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"params_cull_mode",PROPERTY_HINT_ENUM,"Back,Front,Disabled"),_SCS("set_cull_mode"),_SCS("get_cull_mode")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"params_depth_draw_mode",PROPERTY_HINT_ENUM,"Opaque Only,Always,Never,Opaque Pre-Pass"),_SCS("set_depth_draw_mode"),_SCS("get_depth_draw_mode")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"params_line_width",PROPERTY_HINT_RANGE,"0.1,128,0.1"),_SCS("set_line_width"),_SCS("get_line_width")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"params_point_size",PROPERTY_HINT_RANGE,"0.1,128,0.1"),_SCS("set_point_size"),_SCS("get_point_size")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"params_diffuse_mode",PROPERTY_HINT_ENUM,"Labert,Lambert Wrap,Oren Nayar,Burley"),"set_diffuse_mode","get_diffuse_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"params_blend_mode",PROPERTY_HINT_ENUM,"Mix,Add,Sub,Mul"),"set_blend_mode","get_blend_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"params_cull_mode",PROPERTY_HINT_ENUM,"Back,Front,Disabled"),"set_cull_mode","get_cull_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"params_depth_draw_mode",PROPERTY_HINT_ENUM,"Opaque Only,Always,Never,Opaque Pre-Pass"),"set_depth_draw_mode","get_depth_draw_mode"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"params_line_width",PROPERTY_HINT_RANGE,"0.1,128,0.1"),"set_line_width","get_line_width"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"params_point_size",PROPERTY_HINT_RANGE,"0.1,128,0.1"),"set_point_size","get_point_size"); ADD_GROUP("Albedo","albedo_"); - ADD_PROPERTY(PropertyInfo(Variant::COLOR,"albedo_color"),_SCS("set_albedo"),_SCS("get_albedo")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"albedo_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_ALBEDO); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"albedo_color"),"set_albedo","get_albedo"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"albedo_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_ALBEDO); ADD_GROUP("Specular","specular_"); - ADD_PROPERTY(PropertyInfo(Variant::INT,"specular_mode",PROPERTY_HINT_ENUM,"Metallic,Specular"),_SCS("set_specular_mode"),_SCS("get_specular_mode")); - ADD_PROPERTY(PropertyInfo(Variant::COLOR,"specular_color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("set_specular"),_SCS("get_specular")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"specular_metalness",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_metalness"),_SCS("get_metalness")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"specular_roughness",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_roughness"),_SCS("get_roughness")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"specular_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_SPECULAR); + ADD_PROPERTY(PropertyInfo(Variant::INT,"specular_mode",PROPERTY_HINT_ENUM,"Metallic,Specular"),"set_specular_mode","get_specular_mode"); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"specular_color",PROPERTY_HINT_COLOR_NO_ALPHA),"set_specular","get_specular"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"specular_metalness",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_metalness","get_metalness"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"specular_roughness",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_roughness","get_roughness"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"specular_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_SPECULAR); ADD_GROUP("Emission","emission_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"emission_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_EMISSION); - ADD_PROPERTY(PropertyInfo(Variant::COLOR,"emission_color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("set_emission"),_SCS("get_emission")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"emission_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_emission_energy"),_SCS("get_emission_energy")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"emission_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_EMISSION); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"emission_enabled"),"set_feature","get_feature",FEATURE_EMISSION); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"emission_color",PROPERTY_HINT_COLOR_NO_ALPHA),"set_emission","get_emission"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"emission_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),"set_emission_energy","get_emission_energy"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"emission_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_EMISSION); ADD_GROUP("NormapMap","normal_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"normal_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_NORMAL_MAPPING); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"normal_scale",PROPERTY_HINT_RANGE,"-16,16,0.01"),_SCS("set_normal_scale"),_SCS("get_normal_scale")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"normal_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_NORMAL); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"normal_enabled"),"set_feature","get_feature",FEATURE_NORMAL_MAPPING); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"normal_scale",PROPERTY_HINT_RANGE,"-16,16,0.01"),"set_normal_scale","get_normal_scale"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"normal_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_NORMAL); ADD_GROUP("Rim","rim_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"rim_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_RIM); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"rim_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_rim"),_SCS("get_rim")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"rim_tint",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_rim_tint"),_SCS("get_rim_tint")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"rim_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_RIM); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"rim_enabled"),"set_feature","get_feature",FEATURE_RIM); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"rim_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_rim","get_rim"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"rim_tint",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_rim_tint","get_rim_tint"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"rim_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_RIM); ADD_GROUP("Clearcoat","clearcoat_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"clearcoat_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_CLEARCOAT); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"clearcoat_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_clearcoat"),_SCS("get_clearcoat")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"clearcoat_gloss",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_clearcoat_gloss"),_SCS("get_clearcoat_gloss")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"clearcoat_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_CLEARCOAT); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"clearcoat_enabled"),"set_feature","get_feature",FEATURE_CLEARCOAT); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"clearcoat_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_clearcoat","get_clearcoat"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"clearcoat_gloss",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_clearcoat_gloss","get_clearcoat_gloss"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"clearcoat_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_CLEARCOAT); ADD_GROUP("Anisotropy","anisotropy_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"anisotropy_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_ANISOTROPY); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"anisotropy_anisotropy",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_anisotropy"),_SCS("get_anisotropy")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"anisotropy_flowmap",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_FLOWMAP); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"anisotropy_enabled"),"set_feature","get_feature",FEATURE_ANISOTROPY); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"anisotropy_anisotropy",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_anisotropy","get_anisotropy"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"anisotropy_flowmap",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_FLOWMAP); ADD_GROUP("Ambient Occlusion","ao_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"ao_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_AMBIENT_OCCLUSION); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"ao_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_AMBIENT_OCCLUSION); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"ao_enabled"),"set_feature","get_feature",FEATURE_AMBIENT_OCCLUSION); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"ao_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_AMBIENT_OCCLUSION); ADD_GROUP("Height","height_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"height_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_HEIGHT_MAPPING); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"height_scale",PROPERTY_HINT_RANGE,"-16,16,0.01"),_SCS("set_height_scale"),_SCS("get_height_scale")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"height_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_HEIGHT); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"height_enabled"),"set_feature","get_feature",FEATURE_HEIGHT_MAPPING); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"height_scale",PROPERTY_HINT_RANGE,"-16,16,0.01"),"set_height_scale","get_height_scale"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"height_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_HEIGHT); ADD_GROUP("Subsurf Scatter","subsurf_scatter_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"subsurf_scatter_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_SUBSURACE_SCATTERING); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"subsurf_scatter_strength",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_subsurface_scattering_strength"),_SCS("get_subsurface_scattering_strength")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"subsurf_scatter_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_SUBSURFACE_SCATTERING); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"subsurf_scatter_enabled"),"set_feature","get_feature",FEATURE_SUBSURACE_SCATTERING); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"subsurf_scatter_strength",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_subsurface_scattering_strength","get_subsurface_scattering_strength"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"subsurf_scatter_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_SUBSURFACE_SCATTERING); ADD_GROUP("Refraction","refraction_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"refraction_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_REFRACTION); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"refraction_displacement",PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_refraction"),_SCS("get_refraction")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"refraction_roughness",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_refraction_roughness"),_SCS("get_refraction_roughness")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"refraction_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_REFRACTION); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"refraction_enabled"),"set_feature","get_feature",FEATURE_REFRACTION); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"refraction_displacement",PROPERTY_HINT_RANGE,"-1,1,0.01"),"set_refraction","get_refraction"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"refraction_roughness",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_refraction_roughness","get_refraction_roughness"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"refraction_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_REFRACTION); ADD_GROUP("Detail","detail_"); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"detail_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_DETAIL); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"detail_mask",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_DETAIL_MASK); - ADD_PROPERTY(PropertyInfo(Variant::INT,"detail_blend_mode",PROPERTY_HINT_ENUM,"Mix,Add,Sub,Mul"),_SCS("set_detail_blend_mode"),_SCS("get_detail_blend_mode")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"detail_uv_layer",PROPERTY_HINT_ENUM,"UV1,UV2"),_SCS("set_detail_uv"),_SCS("get_detail_uv")); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"detail_albedo",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_DETAIL_ALBEDO); - ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"detail_normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_DETAIL_NORMAL); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"detail_enabled"),"set_feature","get_feature",FEATURE_DETAIL); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"detail_mask",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_DETAIL_MASK); + ADD_PROPERTY(PropertyInfo(Variant::INT,"detail_blend_mode",PROPERTY_HINT_ENUM,"Mix,Add,Sub,Mul"),"set_detail_blend_mode","get_detail_blend_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"detail_uv_layer",PROPERTY_HINT_ENUM,"UV1,UV2"),"set_detail_uv","get_detail_uv"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"detail_albedo",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_DETAIL_ALBEDO); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"detail_normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),"set_texture","get_texture",TEXTURE_DETAIL_NORMAL); ADD_GROUP("UV1","uv1_"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv1_scale"),_SCS("set_uv1_scale"),_SCS("get_uv1_scale")); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv1_offset"),_SCS("set_uv1_offset"),_SCS("get_uv1_offset")); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv1_scale"),"set_uv1_scale","get_uv1_scale"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv1_offset"),"set_uv1_offset","get_uv1_offset"); ADD_GROUP("UV2","uv2_"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv2_scale"),_SCS("set_uv2_scale"),_SCS("get_uv2_scale")); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv2_offset"),_SCS("set_uv2_offset"),_SCS("get_uv2_offset")); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv2_scale"),"set_uv2_scale","get_uv2_scale"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv2_offset"),"set_uv2_offset","get_uv2_offset"); BIND_CONSTANT( TEXTURE_ALBEDO ); diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 99911eddeb..9990a6e796 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -128,8 +128,8 @@ bool Mesh::_set(const StringName& p_name, const Variant& p_value) { if (d.has("arrays")) { //old format - ERR_FAIL_COND_V(!d.has("blend_shape_arrays"),false); - add_surface_from_arrays(PrimitiveType(int(d["primitive"])),d["arrays"],d["blend_shape_arrays"]); + ERR_FAIL_COND_V(!d.has("morph_arrays"),false); + add_surface_from_arrays(PrimitiveType(int(d["primitive"])),d["arrays"],d["morph_arrays"]); } else if (d.has("array_data")) { @@ -1019,31 +1019,31 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { void Mesh::_bind_methods() { - ClassDB::bind_method(_MD("add_blend_shape","name"),&Mesh::add_blend_shape); - ClassDB::bind_method(_MD("get_blend_shape_count"),&Mesh::get_blend_shape_count); - ClassDB::bind_method(_MD("get_blend_shape_name","index"),&Mesh::get_blend_shape_name); - ClassDB::bind_method(_MD("clear_blend_shapes"),&Mesh::clear_blend_shapes); - ClassDB::bind_method(_MD("set_blend_shape_mode","mode"),&Mesh::set_blend_shape_mode); - ClassDB::bind_method(_MD("get_blend_shape_mode"),&Mesh::get_blend_shape_mode); - - ClassDB::bind_method(_MD("add_surface_from_arrays","primitive","arrays","blend_shapes","compress_flags"),&Mesh::add_surface_from_arrays,DEFVAL(Array()),DEFVAL(ARRAY_COMPRESS_DEFAULT)); - ClassDB::bind_method(_MD("get_surface_count"),&Mesh::get_surface_count); - ClassDB::bind_method(_MD("surface_remove","surf_idx"),&Mesh::surface_remove); - ClassDB::bind_method(_MD("surface_get_array_len","surf_idx"),&Mesh::surface_get_array_len); - ClassDB::bind_method(_MD("surface_get_array_index_len","surf_idx"),&Mesh::surface_get_array_index_len); - ClassDB::bind_method(_MD("surface_get_format","surf_idx"),&Mesh::surface_get_format); - ClassDB::bind_method(_MD("surface_get_primitive_type","surf_idx"),&Mesh::surface_get_primitive_type); - ClassDB::bind_method(_MD("surface_set_material","surf_idx","material:Material"),&Mesh::surface_set_material); - ClassDB::bind_method(_MD("surface_get_material:Material","surf_idx"),&Mesh::surface_get_material); - ClassDB::bind_method(_MD("surface_set_name","surf_idx","name"),&Mesh::surface_set_name); - ClassDB::bind_method(_MD("surface_get_name","surf_idx"),&Mesh::surface_get_name); - ClassDB::bind_method(_MD("center_geometry"),&Mesh::center_geometry); - ClassDB::set_method_flags(get_class_static(),_SCS("center_geometry"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ClassDB::bind_method(_MD("regen_normalmaps"),&Mesh::regen_normalmaps); - ClassDB::set_method_flags(get_class_static(),_SCS("regen_normalmaps"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - - ClassDB::bind_method(_MD("set_custom_aabb","aabb"),&Mesh::set_custom_aabb); - ClassDB::bind_method(_MD("get_custom_aabb"),&Mesh::get_custom_aabb); + ClassDB::bind_method(D_METHOD("add_blend_shape","name"),&Mesh::add_blend_shape); + ClassDB::bind_method(D_METHOD("get_blend_shape_count"),&Mesh::get_blend_shape_count); + ClassDB::bind_method(D_METHOD("get_blend_shape_name","index"),&Mesh::get_blend_shape_name); + ClassDB::bind_method(D_METHOD("clear_blend_shapes"),&Mesh::clear_blend_shapes); + ClassDB::bind_method(D_METHOD("set_blend_shape_mode","mode"),&Mesh::set_blend_shape_mode); + ClassDB::bind_method(D_METHOD("get_blend_shape_mode"),&Mesh::get_blend_shape_mode); + + ClassDB::bind_method(D_METHOD("add_surface_from_arrays","primitive","arrays","blend_shapes","compress_flags"),&Mesh::add_surface_from_arrays,DEFVAL(Array()),DEFVAL(ARRAY_COMPRESS_DEFAULT)); + ClassDB::bind_method(D_METHOD("get_surface_count"),&Mesh::get_surface_count); + ClassDB::bind_method(D_METHOD("surface_remove","surf_idx"),&Mesh::surface_remove); + ClassDB::bind_method(D_METHOD("surface_get_array_len","surf_idx"),&Mesh::surface_get_array_len); + ClassDB::bind_method(D_METHOD("surface_get_array_index_len","surf_idx"),&Mesh::surface_get_array_index_len); + ClassDB::bind_method(D_METHOD("surface_get_format","surf_idx"),&Mesh::surface_get_format); + ClassDB::bind_method(D_METHOD("surface_get_primitive_type","surf_idx"),&Mesh::surface_get_primitive_type); + ClassDB::bind_method(D_METHOD("surface_set_material","surf_idx","material:Material"),&Mesh::surface_set_material); + ClassDB::bind_method(D_METHOD("surface_get_material:Material","surf_idx"),&Mesh::surface_get_material); + ClassDB::bind_method(D_METHOD("surface_set_name","surf_idx","name"),&Mesh::surface_set_name); + ClassDB::bind_method(D_METHOD("surface_get_name","surf_idx"),&Mesh::surface_get_name); + ClassDB::bind_method(D_METHOD("center_geometry"),&Mesh::center_geometry); + ClassDB::set_method_flags(get_class_static(),_scs_create("center_geometry"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(D_METHOD("regen_normalmaps"),&Mesh::regen_normalmaps); + ClassDB::set_method_flags(get_class_static(),_scs_create("regen_normalmaps"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + + ClassDB::bind_method(D_METHOD("set_custom_aabb","aabb"),&Mesh::set_custom_aabb); + ClassDB::bind_method(D_METHOD("get_custom_aabb"),&Mesh::get_custom_aabb); BIND_CONSTANT( NO_INDEX_ARRAY ); diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index ec699ee8e3..abe335aa5b 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -565,62 +565,62 @@ void MeshDataTool::set_material(const Ref<Material> &p_material) { void MeshDataTool::_bind_methods() { - ClassDB::bind_method(_MD("clear"),&MeshDataTool::clear); - ClassDB::bind_method(_MD("create_from_surface","mesh","surface"),&MeshDataTool::create_from_surface); - ClassDB::bind_method(_MD("commit_to_surface","mesh"),&MeshDataTool::commit_to_surface); + ClassDB::bind_method(D_METHOD("clear"),&MeshDataTool::clear); + ClassDB::bind_method(D_METHOD("create_from_surface","mesh","surface"),&MeshDataTool::create_from_surface); + ClassDB::bind_method(D_METHOD("commit_to_surface","mesh"),&MeshDataTool::commit_to_surface); - ClassDB::bind_method(_MD("get_format"),&MeshDataTool::get_format); + ClassDB::bind_method(D_METHOD("get_format"),&MeshDataTool::get_format); - ClassDB::bind_method(_MD("get_vertex_count"),&MeshDataTool::get_vertex_count); - ClassDB::bind_method(_MD("get_edge_count"),&MeshDataTool::get_edge_count); - ClassDB::bind_method(_MD("get_face_count"),&MeshDataTool::get_face_count); + ClassDB::bind_method(D_METHOD("get_vertex_count"),&MeshDataTool::get_vertex_count); + ClassDB::bind_method(D_METHOD("get_edge_count"),&MeshDataTool::get_edge_count); + ClassDB::bind_method(D_METHOD("get_face_count"),&MeshDataTool::get_face_count); - ClassDB::bind_method(_MD("set_vertex","idx","vertex"),&MeshDataTool::set_vertex); - ClassDB::bind_method(_MD("get_vertex","idx"),&MeshDataTool::get_vertex); + ClassDB::bind_method(D_METHOD("set_vertex","idx","vertex"),&MeshDataTool::set_vertex); + ClassDB::bind_method(D_METHOD("get_vertex","idx"),&MeshDataTool::get_vertex); - ClassDB::bind_method(_MD("set_vertex_normal","idx","normal"),&MeshDataTool::set_vertex_normal); - ClassDB::bind_method(_MD("get_vertex_normal","idx"),&MeshDataTool::get_vertex_normal); + ClassDB::bind_method(D_METHOD("set_vertex_normal","idx","normal"),&MeshDataTool::set_vertex_normal); + ClassDB::bind_method(D_METHOD("get_vertex_normal","idx"),&MeshDataTool::get_vertex_normal); - ClassDB::bind_method(_MD("set_vertex_tangent","idx","tangent"),&MeshDataTool::set_vertex_tangent); - ClassDB::bind_method(_MD("get_vertex_tangent","idx"),&MeshDataTool::get_vertex_tangent); + ClassDB::bind_method(D_METHOD("set_vertex_tangent","idx","tangent"),&MeshDataTool::set_vertex_tangent); + ClassDB::bind_method(D_METHOD("get_vertex_tangent","idx"),&MeshDataTool::get_vertex_tangent); - ClassDB::bind_method(_MD("set_vertex_uv","idx","uv"),&MeshDataTool::set_vertex_uv); - ClassDB::bind_method(_MD("get_vertex_uv","idx"),&MeshDataTool::get_vertex_uv); + ClassDB::bind_method(D_METHOD("set_vertex_uv","idx","uv"),&MeshDataTool::set_vertex_uv); + ClassDB::bind_method(D_METHOD("get_vertex_uv","idx"),&MeshDataTool::get_vertex_uv); - ClassDB::bind_method(_MD("set_vertex_uv2","idx","uv2"),&MeshDataTool::set_vertex_uv2); - ClassDB::bind_method(_MD("get_vertex_uv2","idx"),&MeshDataTool::get_vertex_uv2); + ClassDB::bind_method(D_METHOD("set_vertex_uv2","idx","uv2"),&MeshDataTool::set_vertex_uv2); + ClassDB::bind_method(D_METHOD("get_vertex_uv2","idx"),&MeshDataTool::get_vertex_uv2); - ClassDB::bind_method(_MD("set_vertex_color","idx","color"),&MeshDataTool::set_vertex_color); - ClassDB::bind_method(_MD("get_vertex_color","idx"),&MeshDataTool::get_vertex_color); + ClassDB::bind_method(D_METHOD("set_vertex_color","idx","color"),&MeshDataTool::set_vertex_color); + ClassDB::bind_method(D_METHOD("get_vertex_color","idx"),&MeshDataTool::get_vertex_color); - ClassDB::bind_method(_MD("set_vertex_bones","idx","bones"),&MeshDataTool::set_vertex_bones); - ClassDB::bind_method(_MD("get_vertex_bones","idx"),&MeshDataTool::get_vertex_bones); + ClassDB::bind_method(D_METHOD("set_vertex_bones","idx","bones"),&MeshDataTool::set_vertex_bones); + ClassDB::bind_method(D_METHOD("get_vertex_bones","idx"),&MeshDataTool::get_vertex_bones); - ClassDB::bind_method(_MD("set_vertex_weights","idx","weights"),&MeshDataTool::set_vertex_weights); - ClassDB::bind_method(_MD("get_vertex_weights","idx"),&MeshDataTool::get_vertex_weights); + ClassDB::bind_method(D_METHOD("set_vertex_weights","idx","weights"),&MeshDataTool::set_vertex_weights); + ClassDB::bind_method(D_METHOD("get_vertex_weights","idx"),&MeshDataTool::get_vertex_weights); - ClassDB::bind_method(_MD("set_vertex_meta","idx","meta"),&MeshDataTool::set_vertex_meta); - ClassDB::bind_method(_MD("get_vertex_meta","idx"),&MeshDataTool::get_vertex_meta); + ClassDB::bind_method(D_METHOD("set_vertex_meta","idx","meta"),&MeshDataTool::set_vertex_meta); + ClassDB::bind_method(D_METHOD("get_vertex_meta","idx"),&MeshDataTool::get_vertex_meta); - ClassDB::bind_method(_MD("get_vertex_edges","idx"),&MeshDataTool::get_vertex_edges); - ClassDB::bind_method(_MD("get_vertex_faces","idx"),&MeshDataTool::get_vertex_faces); + ClassDB::bind_method(D_METHOD("get_vertex_edges","idx"),&MeshDataTool::get_vertex_edges); + ClassDB::bind_method(D_METHOD("get_vertex_faces","idx"),&MeshDataTool::get_vertex_faces); - ClassDB::bind_method(_MD("get_edge_vertex","idx","vertex"),&MeshDataTool::get_edge_vertex); - ClassDB::bind_method(_MD("get_edge_faces","idx","faces"),&MeshDataTool::get_edge_faces); + ClassDB::bind_method(D_METHOD("get_edge_vertex","idx","vertex"),&MeshDataTool::get_edge_vertex); + ClassDB::bind_method(D_METHOD("get_edge_faces","idx","faces"),&MeshDataTool::get_edge_faces); - ClassDB::bind_method(_MD("set_edge_meta","idx","meta"),&MeshDataTool::set_edge_meta); - ClassDB::bind_method(_MD("get_edge_meta","idx"),&MeshDataTool::get_edge_meta); + ClassDB::bind_method(D_METHOD("set_edge_meta","idx","meta"),&MeshDataTool::set_edge_meta); + ClassDB::bind_method(D_METHOD("get_edge_meta","idx"),&MeshDataTool::get_edge_meta); - ClassDB::bind_method(_MD("get_face_vertex","idx","vertex"),&MeshDataTool::get_face_vertex); - ClassDB::bind_method(_MD("get_face_edge","idx","edge"),&MeshDataTool::get_face_edge); + ClassDB::bind_method(D_METHOD("get_face_vertex","idx","vertex"),&MeshDataTool::get_face_vertex); + ClassDB::bind_method(D_METHOD("get_face_edge","idx","edge"),&MeshDataTool::get_face_edge); - ClassDB::bind_method(_MD("set_face_meta","idx","meta"),&MeshDataTool::set_face_meta); - ClassDB::bind_method(_MD("get_face_meta","idx"),&MeshDataTool::get_face_meta); + ClassDB::bind_method(D_METHOD("set_face_meta","idx","meta"),&MeshDataTool::set_face_meta); + ClassDB::bind_method(D_METHOD("get_face_meta","idx"),&MeshDataTool::get_face_meta); - ClassDB::bind_method(_MD("get_face_normal","idx"),&MeshDataTool::get_face_normal); + ClassDB::bind_method(D_METHOD("get_face_normal","idx"),&MeshDataTool::get_face_normal); - ClassDB::bind_method(_MD("set_material","material:Material"),&MeshDataTool::set_material); - ClassDB::bind_method(_MD("get_material","material"),&MeshDataTool::get_material); + ClassDB::bind_method(D_METHOD("set_material","material:Material"),&MeshDataTool::set_material); + ClassDB::bind_method(D_METHOD("get_material","material"),&MeshDataTool::get_material); } MeshDataTool::MeshDataTool(){ diff --git a/scene/resources/mesh_library.cpp b/scene/resources/mesh_library.cpp index cc357c4d9b..becbf39dad 100644 --- a/scene/resources/mesh_library.cpp +++ b/scene/resources/mesh_library.cpp @@ -244,19 +244,19 @@ int MeshLibrary::get_last_unused_item_id() const { void MeshLibrary::_bind_methods() { - ClassDB::bind_method(_MD("create_item","id"),&MeshLibrary::create_item); - ClassDB::bind_method(_MD("set_item_name","id","name"),&MeshLibrary::set_item_name); - ClassDB::bind_method(_MD("set_item_mesh","id","mesh:Mesh"),&MeshLibrary::set_item_mesh); - ClassDB::bind_method(_MD("set_item_navmesh","id","navmesh:NavigationMesh"),&MeshLibrary::set_item_navmesh); - ClassDB::bind_method(_MD("set_item_shape","id","shape:Shape"),&MeshLibrary::set_item_shape); - ClassDB::bind_method(_MD("get_item_name","id"),&MeshLibrary::get_item_name); - ClassDB::bind_method(_MD("get_item_mesh:Mesh","id"),&MeshLibrary::get_item_mesh); - ClassDB::bind_method(_MD("get_item_navmesh:NavigationMesh","id"),&MeshLibrary::get_item_navmesh); - ClassDB::bind_method(_MD("get_item_shape:Shape","id"),&MeshLibrary::get_item_shape); - ClassDB::bind_method(_MD("remove_item","id"),&MeshLibrary::remove_item); - ClassDB::bind_method(_MD("clear"),&MeshLibrary::clear); - ClassDB::bind_method(_MD("get_item_list"),&MeshLibrary::get_item_list); - ClassDB::bind_method(_MD("get_last_unused_item_id"),&MeshLibrary::get_last_unused_item_id); + ClassDB::bind_method(D_METHOD("create_item","id"),&MeshLibrary::create_item); + ClassDB::bind_method(D_METHOD("set_item_name","id","name"),&MeshLibrary::set_item_name); + ClassDB::bind_method(D_METHOD("set_item_mesh","id","mesh:Mesh"),&MeshLibrary::set_item_mesh); + ClassDB::bind_method(D_METHOD("set_item_navmesh","id","navmesh:NavigationMesh"),&MeshLibrary::set_item_navmesh); + ClassDB::bind_method(D_METHOD("set_item_shape","id","shape:Shape"),&MeshLibrary::set_item_shape); + ClassDB::bind_method(D_METHOD("get_item_name","id"),&MeshLibrary::get_item_name); + ClassDB::bind_method(D_METHOD("get_item_mesh:Mesh","id"),&MeshLibrary::get_item_mesh); + ClassDB::bind_method(D_METHOD("get_item_navmesh:NavigationMesh","id"),&MeshLibrary::get_item_navmesh); + ClassDB::bind_method(D_METHOD("get_item_shape:Shape","id"),&MeshLibrary::get_item_shape); + ClassDB::bind_method(D_METHOD("remove_item","id"),&MeshLibrary::remove_item); + ClassDB::bind_method(D_METHOD("clear"),&MeshLibrary::clear); + ClassDB::bind_method(D_METHOD("get_item_list"),&MeshLibrary::get_item_list); + ClassDB::bind_method(D_METHOD("get_last_unused_item_id"),&MeshLibrary::get_last_unused_item_id); } MeshLibrary::MeshLibrary() { diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index 75df4a4e60..69ef3f18a6 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -211,34 +211,34 @@ MultiMesh::TransformFormat MultiMesh::get_transform_format() const{ void MultiMesh::_bind_methods() { - ClassDB::bind_method(_MD("set_mesh","mesh:Mesh"),&MultiMesh::set_mesh); - ClassDB::bind_method(_MD("get_mesh:Mesh"),&MultiMesh::get_mesh); - ClassDB::bind_method(_MD("set_color_format","format"),&MultiMesh::set_color_format); - ClassDB::bind_method(_MD("get_color_format"),&MultiMesh::get_color_format); - ClassDB::bind_method(_MD("set_transform_format","format"),&MultiMesh::set_transform_format); - ClassDB::bind_method(_MD("get_transform_format"),&MultiMesh::get_transform_format); - - ClassDB::bind_method(_MD("set_instance_count","count"),&MultiMesh::set_instance_count); - ClassDB::bind_method(_MD("get_instance_count"),&MultiMesh::get_instance_count); - ClassDB::bind_method(_MD("set_instance_transform","instance","transform"),&MultiMesh::set_instance_transform); - ClassDB::bind_method(_MD("get_instance_transform","instance"),&MultiMesh::get_instance_transform); - ClassDB::bind_method(_MD("set_instance_color","instance","color"),&MultiMesh::set_instance_color); - ClassDB::bind_method(_MD("get_instance_color","instance"),&MultiMesh::get_instance_color); - ClassDB::bind_method(_MD("get_aabb"),&MultiMesh::get_aabb); - - - ClassDB::bind_method(_MD("_set_transform_array"),&MultiMesh::_set_transform_array); - ClassDB::bind_method(_MD("_get_transform_array"),&MultiMesh::_get_transform_array); - ClassDB::bind_method(_MD("_set_color_array"),&MultiMesh::_set_color_array); - ClassDB::bind_method(_MD("_get_color_array"),&MultiMesh::_get_color_array); - - - ADD_PROPERTY(PropertyInfo(Variant::INT,"color_format",PROPERTY_HINT_ENUM,"None,Byte,Float"), _SCS("set_color_format"), _SCS("get_color_format")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"transform_format",PROPERTY_HINT_ENUM,"2D,3D"), _SCS("set_transform_format"), _SCS("get_transform_format")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"instance_count",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_instance_count"), _SCS("get_instance_count")); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"mesh",PROPERTY_HINT_RESOURCE_TYPE,"Mesh"), _SCS("set_mesh"), _SCS("get_mesh")); - ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"transform_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_transform_array"), _SCS("_get_transform_array")); - ADD_PROPERTY(PropertyInfo(Variant::POOL_COLOR_ARRAY,"color_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_color_array"), _SCS("_get_color_array")); + ClassDB::bind_method(D_METHOD("set_mesh","mesh:Mesh"),&MultiMesh::set_mesh); + ClassDB::bind_method(D_METHOD("get_mesh:Mesh"),&MultiMesh::get_mesh); + ClassDB::bind_method(D_METHOD("set_color_format","format"),&MultiMesh::set_color_format); + ClassDB::bind_method(D_METHOD("get_color_format"),&MultiMesh::get_color_format); + ClassDB::bind_method(D_METHOD("set_transform_format","format"),&MultiMesh::set_transform_format); + ClassDB::bind_method(D_METHOD("get_transform_format"),&MultiMesh::get_transform_format); + + ClassDB::bind_method(D_METHOD("set_instance_count","count"),&MultiMesh::set_instance_count); + ClassDB::bind_method(D_METHOD("get_instance_count"),&MultiMesh::get_instance_count); + ClassDB::bind_method(D_METHOD("set_instance_transform","instance","transform"),&MultiMesh::set_instance_transform); + ClassDB::bind_method(D_METHOD("get_instance_transform","instance"),&MultiMesh::get_instance_transform); + ClassDB::bind_method(D_METHOD("set_instance_color","instance","color"),&MultiMesh::set_instance_color); + ClassDB::bind_method(D_METHOD("get_instance_color","instance"),&MultiMesh::get_instance_color); + ClassDB::bind_method(D_METHOD("get_aabb"),&MultiMesh::get_aabb); + + + ClassDB::bind_method(D_METHOD("_set_transform_array"),&MultiMesh::_set_transform_array); + ClassDB::bind_method(D_METHOD("_get_transform_array"),&MultiMesh::_get_transform_array); + ClassDB::bind_method(D_METHOD("_set_color_array"),&MultiMesh::_set_color_array); + ClassDB::bind_method(D_METHOD("_get_color_array"),&MultiMesh::_get_color_array); + + + ADD_PROPERTY(PropertyInfo(Variant::INT,"color_format",PROPERTY_HINT_ENUM,"None,Byte,Float"), "set_color_format", "get_color_format"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"transform_format",PROPERTY_HINT_ENUM,"2D,3D"), "set_transform_format", "get_transform_format"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"instance_count",PROPERTY_HINT_RANGE,"0,16384,1"), "set_instance_count", "get_instance_count"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"mesh",PROPERTY_HINT_RESOURCE_TYPE,"Mesh"), "set_mesh", "get_mesh"); + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"transform_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_transform_array", "_get_transform_array"); + ADD_PROPERTY(PropertyInfo(Variant::POOL_COLOR_ARRAY,"color_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_color_array", "_get_color_array"); diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 2707dd6198..5e3347687a 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "packed_scene.h" -#include "globals.h" +#include "global_config.h" #include "io/resource_loader.h" #include "scene/3d/spatial.h" #include "scene/gui/control.h" @@ -177,6 +177,9 @@ Node *SceneState::instance(GenEditState p_edit_state) const { node = obj->cast_to<Node>(); + } else { + print_line("wtf class is disabled for: "+itos(n.type)); + print_line("name: "+String(snames[n.type])); } @@ -196,6 +199,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { ERR_FAIL_INDEX_V( nprops[j].name, sname_count, NULL ); ERR_FAIL_INDEX_V( nprops[j].value, prop_count, NULL ); + if (snames[ nprops[j].name ]==CoreStringNames::get_singleton()->_script) { //work around to avoid old script variables from disappearing, should be the proper fix to: //https://github.com/godotengine/godot/issues/2958 @@ -357,7 +361,7 @@ static int _nm_get_string(const String& p_string, Map<StringName,int> &name_map) return idx; } -static int _vm_get_variant(const Variant& p_variant, HashMap<Variant,int,VariantHasher> &variant_map) { +static int _vm_get_variant(const Variant& p_variant, HashMap<Variant,int,VariantHasher,VariantComparator> &variant_map) { if (variant_map.has(p_variant)) return variant_map[p_variant]; @@ -367,7 +371,7 @@ static int _vm_get_variant(const Variant& p_variant, HashMap<Variant,int,Variant return idx; } -Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher> &variant_map,Map<Node*,int> &node_map,Map<Node*,int> &nodepath_map) { +Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher,VariantComparator> &variant_map,Map<Node*,int> &node_map,Map<Node*,int> &nodepath_map) { // this function handles all the work related to properly packing scenes, be it @@ -743,7 +747,7 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S } -Error SceneState::_parse_connections(Node *p_owner,Node *p_node, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher> &variant_map,Map<Node*,int> &node_map,Map<Node*,int> &nodepath_map) { +Error SceneState::_parse_connections(Node *p_owner,Node *p_node, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher,VariantComparator> &variant_map,Map<Node*,int> &node_map,Map<Node*,int> &nodepath_map) { if (p_node!=p_owner && p_node->get_owner() && p_node->get_owner()!=p_owner && !p_owner->is_editable_instance(p_node->get_owner())) return OK; @@ -948,7 +952,7 @@ Error SceneState::pack(Node *p_scene) { Node *scene = p_scene; Map<StringName,int> name_map; - HashMap<Variant,int,VariantHasher> variant_map; + HashMap<Variant,int,VariantHasher,VariantComparator> variant_map; Map<Node*,int> node_map; Map<Node*,int> nodepath_map; @@ -1716,25 +1720,25 @@ void SceneState::_bind_methods() { //unbuild API - ClassDB::bind_method(_MD("get_node_count"),&SceneState::get_node_count); - ClassDB::bind_method(_MD("get_node_type","idx"),&SceneState::get_node_type); - ClassDB::bind_method(_MD("get_node_name","idx"),&SceneState::get_node_name); - ClassDB::bind_method(_MD("get_node_path","idx","for_parent"),&SceneState::get_node_path,DEFVAL(false)); - ClassDB::bind_method(_MD("get_node_owner_path","idx"),&SceneState::get_node_owner_path); - ClassDB::bind_method(_MD("is_node_instance_placeholder","idx"),&SceneState::is_node_instance_placeholder); - ClassDB::bind_method(_MD("get_node_instance_placeholder","idx"),&SceneState::get_node_instance_placeholder); - ClassDB::bind_method(_MD("get_node_instance:PackedScene","idx"),&SceneState::get_node_instance); - ClassDB::bind_method(_MD("get_node_groups","idx"),&SceneState::_get_node_groups); - ClassDB::bind_method(_MD("get_node_property_count","idx"),&SceneState::get_node_property_count); - ClassDB::bind_method(_MD("get_node_property_name","idx","prop_idx"),&SceneState::get_node_property_name); - ClassDB::bind_method(_MD("get_node_property_value","idx","prop_idx"),&SceneState::get_node_property_value); - ClassDB::bind_method(_MD("get_connection_count"),&SceneState::get_connection_count); - ClassDB::bind_method(_MD("get_connection_source","idx"),&SceneState::get_connection_source); - ClassDB::bind_method(_MD("get_connection_signal","idx"),&SceneState::get_connection_signal); - ClassDB::bind_method(_MD("get_connection_target","idx"),&SceneState::get_connection_target); - ClassDB::bind_method(_MD("get_connection_method","idx"),&SceneState::get_connection_method); - ClassDB::bind_method(_MD("get_connection_flags","idx"),&SceneState::get_connection_flags); - ClassDB::bind_method(_MD("get_connection_binds","idx"),&SceneState::get_connection_binds); + ClassDB::bind_method(D_METHOD("get_node_count"),&SceneState::get_node_count); + ClassDB::bind_method(D_METHOD("get_node_type","idx"),&SceneState::get_node_type); + ClassDB::bind_method(D_METHOD("get_node_name","idx"),&SceneState::get_node_name); + ClassDB::bind_method(D_METHOD("get_node_path","idx","for_parent"),&SceneState::get_node_path,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_node_owner_path","idx"),&SceneState::get_node_owner_path); + ClassDB::bind_method(D_METHOD("is_node_instance_placeholder","idx"),&SceneState::is_node_instance_placeholder); + ClassDB::bind_method(D_METHOD("get_node_instance_placeholder","idx"),&SceneState::get_node_instance_placeholder); + ClassDB::bind_method(D_METHOD("get_node_instance:PackedScene","idx"),&SceneState::get_node_instance); + ClassDB::bind_method(D_METHOD("get_node_groups","idx"),&SceneState::_get_node_groups); + ClassDB::bind_method(D_METHOD("get_node_property_count","idx"),&SceneState::get_node_property_count); + ClassDB::bind_method(D_METHOD("get_node_property_name","idx","prop_idx"),&SceneState::get_node_property_name); + ClassDB::bind_method(D_METHOD("get_node_property_value","idx","prop_idx"),&SceneState::get_node_property_value); + ClassDB::bind_method(D_METHOD("get_connection_count"),&SceneState::get_connection_count); + ClassDB::bind_method(D_METHOD("get_connection_source","idx"),&SceneState::get_connection_source); + ClassDB::bind_method(D_METHOD("get_connection_signal","idx"),&SceneState::get_connection_signal); + ClassDB::bind_method(D_METHOD("get_connection_target","idx"),&SceneState::get_connection_target); + ClassDB::bind_method(D_METHOD("get_connection_method","idx"),&SceneState::get_connection_method); + ClassDB::bind_method(D_METHOD("get_connection_flags","idx"),&SceneState::get_connection_flags); + ClassDB::bind_method(D_METHOD("get_connection_binds","idx"),&SceneState::get_connection_binds); BIND_CONSTANT( GEN_EDIT_STATE_DISABLED ); BIND_CONSTANT( GEN_EDIT_STATE_INSTANCE ); @@ -1837,14 +1841,14 @@ void PackedScene::set_path(const String& p_path,bool p_take_over) { void PackedScene::_bind_methods() { - ClassDB::bind_method(_MD("pack","path:Node"),&PackedScene::pack); - ClassDB::bind_method(_MD("instance:Node","edit_state"),&PackedScene::instance,DEFVAL(false)); - ClassDB::bind_method(_MD("can_instance"),&PackedScene::can_instance); - ClassDB::bind_method(_MD("_set_bundled_scene"),&PackedScene::_set_bundled_scene); - ClassDB::bind_method(_MD("_get_bundled_scene"),&PackedScene::_get_bundled_scene); - ClassDB::bind_method(_MD("get_state:SceneState"),&PackedScene::get_state); + ClassDB::bind_method(D_METHOD("pack","path:Node"),&PackedScene::pack); + ClassDB::bind_method(D_METHOD("instance:Node","edit_state"),&PackedScene::instance,DEFVAL(false)); + ClassDB::bind_method(D_METHOD("can_instance"),&PackedScene::can_instance); + ClassDB::bind_method(D_METHOD("_set_bundled_scene"),&PackedScene::_set_bundled_scene); + ClassDB::bind_method(D_METHOD("_get_bundled_scene"),&PackedScene::_get_bundled_scene); + ClassDB::bind_method(D_METHOD("get_state:SceneState"),&PackedScene::get_state); - ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"_bundled"),_SCS("_set_bundled_scene"),_SCS("_get_bundled_scene")); + ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"_bundled"),"_set_bundled_scene","_get_bundled_scene"); BIND_CONSTANT( GEN_EDIT_STATE_DISABLED ); BIND_CONSTANT( GEN_EDIT_STATE_INSTANCE ); diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index 381b356b1e..4a3841abe9 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -91,8 +91,8 @@ class SceneState : public Reference { Vector<ConnectionData> connections; - Error _parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher> &variant_map,Map<Node*,int> &node_map,Map<Node*,int> &nodepath_map); - Error _parse_connections(Node *p_owner,Node *p_node, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher> &variant_map,Map<Node*,int> &node_map,Map<Node*,int> &nodepath_map); + Error _parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher,VariantComparator> &variant_map,Map<Node*,int> &node_map,Map<Node*,int> &nodepath_map); + Error _parse_connections(Node *p_owner,Node *p_node, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher,VariantComparator> &variant_map,Map<Node*,int> &node_map,Map<Node*,int> &nodepath_map); String path; diff --git a/scene/resources/plane_shape.cpp b/scene/resources/plane_shape.cpp index 1814eea66c..f1bb6d60c0 100644 --- a/scene/resources/plane_shape.cpp +++ b/scene/resources/plane_shape.cpp @@ -80,10 +80,10 @@ Plane PlaneShape::get_plane() const { void PlaneShape::_bind_methods() { - ClassDB::bind_method(_MD("set_plane","plane"),&PlaneShape::set_plane); - ClassDB::bind_method(_MD("get_plane"),&PlaneShape::get_plane); + ClassDB::bind_method(D_METHOD("set_plane","plane"),&PlaneShape::set_plane); + ClassDB::bind_method(D_METHOD("get_plane"),&PlaneShape::get_plane); - ADD_PROPERTY( PropertyInfo(Variant::PLANE,"plane"), _SCS("set_plane"), _SCS("get_plane") ); + ADD_PROPERTY( PropertyInfo(Variant::PLANE,"plane"), "set_plane", "get_plane") ; } diff --git a/scene/resources/polygon_path_finder.cpp b/scene/resources/polygon_path_finder.cpp index 568f086d34..6dac8a9779 100644 --- a/scene/resources/polygon_path_finder.cpp +++ b/scene/resources/polygon_path_finder.cpp @@ -618,19 +618,19 @@ float PolygonPathFinder::get_point_penalty(int p_point) const { void PolygonPathFinder::_bind_methods() { - ClassDB::bind_method(_MD("setup","points","connections"),&PolygonPathFinder::setup); - ClassDB::bind_method(_MD("find_path","from","to"),&PolygonPathFinder::find_path); - ClassDB::bind_method(_MD("get_intersections","from","to"),&PolygonPathFinder::get_intersections); - ClassDB::bind_method(_MD("get_closest_point","point"),&PolygonPathFinder::get_closest_point); - ClassDB::bind_method(_MD("is_point_inside","point"),&PolygonPathFinder::is_point_inside); - ClassDB::bind_method(_MD("set_point_penalty","idx","penalty"),&PolygonPathFinder::set_point_penalty); - ClassDB::bind_method(_MD("get_point_penalty","idx"),&PolygonPathFinder::get_point_penalty); - - ClassDB::bind_method(_MD("get_bounds"),&PolygonPathFinder::get_bounds); - ClassDB::bind_method(_MD("_set_data"),&PolygonPathFinder::_set_data); - ClassDB::bind_method(_MD("_get_data"),&PolygonPathFinder::_get_data); - - ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_data"),_SCS("_get_data")); + ClassDB::bind_method(D_METHOD("setup","points","connections"),&PolygonPathFinder::setup); + ClassDB::bind_method(D_METHOD("find_path","from","to"),&PolygonPathFinder::find_path); + ClassDB::bind_method(D_METHOD("get_intersections","from","to"),&PolygonPathFinder::get_intersections); + ClassDB::bind_method(D_METHOD("get_closest_point","point"),&PolygonPathFinder::get_closest_point); + ClassDB::bind_method(D_METHOD("is_point_inside","point"),&PolygonPathFinder::is_point_inside); + ClassDB::bind_method(D_METHOD("set_point_penalty","idx","penalty"),&PolygonPathFinder::set_point_penalty); + ClassDB::bind_method(D_METHOD("get_point_penalty","idx"),&PolygonPathFinder::get_point_penalty); + + ClassDB::bind_method(D_METHOD("get_bounds"),&PolygonPathFinder::get_bounds); + ClassDB::bind_method(D_METHOD("_set_data"),&PolygonPathFinder::_set_data); + ClassDB::bind_method(D_METHOD("_get_data"),&PolygonPathFinder::_get_data); + + ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),"_set_data","_get_data"); } diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape.cpp index 226062bed3..52ce736925 100644 --- a/scene/resources/ray_shape.cpp +++ b/scene/resources/ray_shape.cpp @@ -60,10 +60,10 @@ float RayShape::get_length() const { void RayShape::_bind_methods() { - ClassDB::bind_method(_MD("set_length","length"),&RayShape::set_length); - ClassDB::bind_method(_MD("get_length"),&RayShape::get_length); + ClassDB::bind_method(D_METHOD("set_length","length"),&RayShape::set_length); + ClassDB::bind_method(D_METHOD("get_length"),&RayShape::get_length); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"length",PROPERTY_HINT_RANGE,"0,4096,0.01"), _SCS("set_length"), _SCS("get_length") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"length",PROPERTY_HINT_RANGE,"0,4096,0.01"), "set_length", "get_length") ; } diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp index 3272125b33..1161843a2b 100644 --- a/scene/resources/rectangle_shape_2d.cpp +++ b/scene/resources/rectangle_shape_2d.cpp @@ -64,12 +64,12 @@ Rect2 RectangleShape2D::get_rect() const { void RectangleShape2D::_bind_methods() { - ClassDB::bind_method(_MD("set_extents","extents"),&RectangleShape2D::set_extents); - ClassDB::bind_method(_MD("get_extents"),&RectangleShape2D::get_extents); + ClassDB::bind_method(D_METHOD("set_extents","extents"),&RectangleShape2D::set_extents); + ClassDB::bind_method(D_METHOD("get_extents"),&RectangleShape2D::get_extents); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"extents"),_SCS("set_extents"),_SCS("get_extents") ); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"extents"),"set_extents","get_extents") ; } diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp index 069127f291..e677f92c31 100644 --- a/scene/resources/room.cpp +++ b/scene/resources/room.cpp @@ -52,11 +52,11 @@ PoolVector<Face3> RoomBounds::get_geometry_hint() const { void RoomBounds::_bind_methods() { - ClassDB::bind_method(_MD("set_geometry_hint","triangles"),&RoomBounds::set_geometry_hint); - ClassDB::bind_method(_MD("get_geometry_hint"),&RoomBounds::get_geometry_hint); + ClassDB::bind_method(D_METHOD("set_geometry_hint","triangles"),&RoomBounds::set_geometry_hint); + ClassDB::bind_method(D_METHOD("get_geometry_hint"),&RoomBounds::get_geometry_hint); - //ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "bounds"), _SCS("set_bounds"),_SCS("get_bounds") ); - ADD_PROPERTY( PropertyInfo( Variant::POOL_VECTOR3_ARRAY, "geometry_hint"),_SCS("set_geometry_hint"),_SCS("get_geometry_hint") ); + //ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "bounds"), "set_bounds","get_bounds") ; + ADD_PROPERTY( PropertyInfo( Variant::POOL_VECTOR3_ARRAY, "geometry_hint"),"set_geometry_hint","get_geometry_hint") ; } diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index 9719f321d6..3a254836a2 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "scene_format_text.h" -#include "globals.h" +#include "global_config.h" #include "version.h" #include "os/dir_access.h" diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index 71d5a8efa8..fbe1efe5d1 100644 --- a/scene/resources/segment_shape_2d.cpp +++ b/scene/resources/segment_shape_2d.cpp @@ -82,15 +82,15 @@ Rect2 SegmentShape2D::get_rect() const{ void SegmentShape2D::_bind_methods() { - ClassDB::bind_method(_MD("set_a","a"),&SegmentShape2D::set_a); - ClassDB::bind_method(_MD("get_a"),&SegmentShape2D::get_a); + ClassDB::bind_method(D_METHOD("set_a","a"),&SegmentShape2D::set_a); + ClassDB::bind_method(D_METHOD("get_a"),&SegmentShape2D::get_a); - ClassDB::bind_method(_MD("set_b","b"),&SegmentShape2D::set_b); - ClassDB::bind_method(_MD("get_b"),&SegmentShape2D::get_b); + ClassDB::bind_method(D_METHOD("set_b","b"),&SegmentShape2D::set_b); + ClassDB::bind_method(D_METHOD("get_b"),&SegmentShape2D::get_b); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"a"),_SCS("set_a"),_SCS("get_a") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"b"),_SCS("set_b"),_SCS("get_b") ); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"a"),"set_a","get_a") ; + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"b"),"set_b","get_b") ; } @@ -145,10 +145,10 @@ Rect2 RayShape2D::get_rect() const { void RayShape2D::_bind_methods() { - ClassDB::bind_method(_MD("set_length","length"),&RayShape2D::set_length); - ClassDB::bind_method(_MD("get_length"),&RayShape2D::get_length); + ClassDB::bind_method(D_METHOD("set_length","length"),&RayShape2D::set_length); + ClassDB::bind_method(D_METHOD("get_length"),&RayShape2D::get_length); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"length"),_SCS("set_length"),_SCS("get_length") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"length"),"set_length","get_length") ; } diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index 6afbf32c35..375a9a1cb0 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -116,20 +116,20 @@ bool Shader::has_param(const StringName& p_param) const { void Shader::_bind_methods() { - ClassDB::bind_method(_MD("get_mode"),&Shader::get_mode); + ClassDB::bind_method(D_METHOD("get_mode"),&Shader::get_mode); - ClassDB::bind_method(_MD("set_code","code"),&Shader::set_code); - ClassDB::bind_method(_MD("get_code"),&Shader::get_code); + ClassDB::bind_method(D_METHOD("set_code","code"),&Shader::set_code); + ClassDB::bind_method(D_METHOD("get_code"),&Shader::get_code); - ClassDB::bind_method(_MD("set_default_texture_param","param","texture:Texture"),&Shader::set_default_texture_param); - ClassDB::bind_method(_MD("get_default_texture_param:Texture","param"),&Shader::get_default_texture_param); + ClassDB::bind_method(D_METHOD("set_default_texture_param","param","texture:Texture"),&Shader::set_default_texture_param); + ClassDB::bind_method(D_METHOD("get_default_texture_param:Texture","param"),&Shader::get_default_texture_param); - ClassDB::bind_method(_MD("has_param","name"),&Shader::has_param); + ClassDB::bind_method(D_METHOD("has_param","name"),&Shader::has_param); - //ClassDB::bind_method(_MD("get_param_list"),&Shader::get_fragment_code); + //ClassDB::bind_method(D_METHOD("get_param_list"),&Shader::get_fragment_code); - ADD_PROPERTY( PropertyInfo(Variant::STRING, "code",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("set_code"), _SCS("get_code") ); + ADD_PROPERTY( PropertyInfo(Variant::STRING, "code",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "set_code", "get_code") ; BIND_CONSTANT( MODE_SPATIAL); BIND_CONSTANT( MODE_CANVAS_ITEM ); diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 22ee253b1a..c21feb0bf5 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -165,108 +165,108 @@ int ShaderGraph::node_count(ShaderType p_which, int p_type) void ShaderGraph::_bind_methods() { - ClassDB::bind_method(_MD("_update_shader"),&ShaderGraph::_update_shader); + ClassDB::bind_method(D_METHOD("_update_shader"),&ShaderGraph::_update_shader); - ClassDB::bind_method(_MD("node_add","shader_type","node_type","id"),&ShaderGraph::node_add); - ClassDB::bind_method(_MD("node_remove","shader_type","id"),&ShaderGraph::node_remove); - ClassDB::bind_method(_MD("node_set_pos","shader_type","id","pos"),&ShaderGraph::node_set_pos); - ClassDB::bind_method(_MD("node_get_pos","shader_type","id"),&ShaderGraph::node_get_pos); + ClassDB::bind_method(D_METHOD("node_add","shader_type","node_type","id"),&ShaderGraph::node_add); + ClassDB::bind_method(D_METHOD("node_remove","shader_type","id"),&ShaderGraph::node_remove); + ClassDB::bind_method(D_METHOD("node_set_pos","shader_type","id","pos"),&ShaderGraph::node_set_pos); + ClassDB::bind_method(D_METHOD("node_get_pos","shader_type","id"),&ShaderGraph::node_get_pos); - ClassDB::bind_method(_MD("node_get_type","shader_type","id"),&ShaderGraph::node_get_type); + ClassDB::bind_method(D_METHOD("node_get_type","shader_type","id"),&ShaderGraph::node_get_type); - ClassDB::bind_method(_MD("get_node_list","shader_type"),&ShaderGraph::_get_node_list); + ClassDB::bind_method(D_METHOD("get_node_list","shader_type"),&ShaderGraph::_get_node_list); - ClassDB::bind_method(_MD("default_set_value","shader_type","id","param_id","value"), &ShaderGraph::default_set_value); - ClassDB::bind_method(_MD("default_get_value","shader_type","id","param_id"), &ShaderGraph::default_get_value); + ClassDB::bind_method(D_METHOD("default_set_value","shader_type","id","param_id","value"), &ShaderGraph::default_set_value); + ClassDB::bind_method(D_METHOD("default_get_value","shader_type","id","param_id"), &ShaderGraph::default_get_value); - ClassDB::bind_method(_MD("scalar_const_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_const_node_set_value); - ClassDB::bind_method(_MD("scalar_const_node_get_value","shader_type","id"),&ShaderGraph::scalar_const_node_get_value); + ClassDB::bind_method(D_METHOD("scalar_const_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_const_node_set_value); + ClassDB::bind_method(D_METHOD("scalar_const_node_get_value","shader_type","id"),&ShaderGraph::scalar_const_node_get_value); - ClassDB::bind_method(_MD("vec_const_node_set_value","shader_type","id","value"),&ShaderGraph::vec_const_node_set_value); - ClassDB::bind_method(_MD("vec_const_node_get_value","shader_type","id"),&ShaderGraph::vec_const_node_get_value); + ClassDB::bind_method(D_METHOD("vec_const_node_set_value","shader_type","id","value"),&ShaderGraph::vec_const_node_set_value); + ClassDB::bind_method(D_METHOD("vec_const_node_get_value","shader_type","id"),&ShaderGraph::vec_const_node_get_value); - ClassDB::bind_method(_MD("rgb_const_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_const_node_set_value); - ClassDB::bind_method(_MD("rgb_const_node_get_value","shader_type","id"),&ShaderGraph::rgb_const_node_get_value); + ClassDB::bind_method(D_METHOD("rgb_const_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_const_node_set_value); + ClassDB::bind_method(D_METHOD("rgb_const_node_get_value","shader_type","id"),&ShaderGraph::rgb_const_node_get_value); - ClassDB::bind_method(_MD("xform_const_node_set_value","shader_type","id","value"),&ShaderGraph::xform_const_node_set_value); - ClassDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_get_value); + ClassDB::bind_method(D_METHOD("xform_const_node_set_value","shader_type","id","value"),&ShaderGraph::xform_const_node_set_value); + ClassDB::bind_method(D_METHOD("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; - ClassDB::bind_method(_MD("texture_node_set_filter_size","shader_type","id","filter_size"),&ShaderGraph::texture_node_set_filter_size); - ClassDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_get_filter_size); + ClassDB::bind_method(D_METHOD("texture_node_set_filter_size","shader_type","id","filter_size"),&ShaderGraph::texture_node_set_filter_size); + ClassDB::bind_method(D_METHOD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_get_filter_size); - ClassDB::bind_method(_MD("texture_node_set_filter_strength","shader_type","id","filter_strength"),&ShaderGraph::texture_node_set_filter_strength); - ClassDB::bind_method(_MD("texture_node_get_filter_strength","shader_type","id"),&ShaderGraph::texture_node_get_filter_strength); + ClassDB::bind_method(D_METHOD("texture_node_set_filter_strength","shader_type","id","filter_strength"),&ShaderGraph::texture_node_set_filter_strength); + ClassDB::bind_method(D_METHOD("texture_node_get_filter_strength","shader_type","id"),&ShaderGraph::texture_node_get_filter_strength); - ClassDB::bind_method(_MD("scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::scalar_op_node_set_op); - ClassDB::bind_method(_MD("scalar_op_node_get_op","shader_type","id"),&ShaderGraph::scalar_op_node_get_op); + ClassDB::bind_method(D_METHOD("scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::scalar_op_node_set_op); + ClassDB::bind_method(D_METHOD("scalar_op_node_get_op","shader_type","id"),&ShaderGraph::scalar_op_node_get_op); - ClassDB::bind_method(_MD("vec_op_node_set_op","shader_type","id","op"),&ShaderGraph::vec_op_node_set_op); - ClassDB::bind_method(_MD("vec_op_node_get_op","shader_type","id"),&ShaderGraph::vec_op_node_get_op); + ClassDB::bind_method(D_METHOD("vec_op_node_set_op","shader_type","id","op"),&ShaderGraph::vec_op_node_set_op); + ClassDB::bind_method(D_METHOD("vec_op_node_get_op","shader_type","id"),&ShaderGraph::vec_op_node_get_op); - ClassDB::bind_method(_MD("vec_scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::vec_scalar_op_node_set_op); - ClassDB::bind_method(_MD("vec_scalar_op_node_get_op","shader_type","id"),&ShaderGraph::vec_scalar_op_node_get_op); + ClassDB::bind_method(D_METHOD("vec_scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::vec_scalar_op_node_set_op); + ClassDB::bind_method(D_METHOD("vec_scalar_op_node_get_op","shader_type","id"),&ShaderGraph::vec_scalar_op_node_get_op); - ClassDB::bind_method(_MD("rgb_op_node_set_op","shader_type","id","op"),&ShaderGraph::rgb_op_node_set_op); - ClassDB::bind_method(_MD("rgb_op_node_get_op","shader_type","id"),&ShaderGraph::rgb_op_node_get_op); + ClassDB::bind_method(D_METHOD("rgb_op_node_set_op","shader_type","id","op"),&ShaderGraph::rgb_op_node_set_op); + ClassDB::bind_method(D_METHOD("rgb_op_node_get_op","shader_type","id"),&ShaderGraph::rgb_op_node_get_op); - ClassDB::bind_method(_MD("xform_vec_mult_node_set_no_translation","shader_type","id","disable"),&ShaderGraph::xform_vec_mult_node_set_no_translation); - ClassDB::bind_method(_MD("xform_vec_mult_node_get_no_translation","shader_type","id"),&ShaderGraph::xform_vec_mult_node_get_no_translation); + ClassDB::bind_method(D_METHOD("xform_vec_mult_node_set_no_translation","shader_type","id","disable"),&ShaderGraph::xform_vec_mult_node_set_no_translation); + ClassDB::bind_method(D_METHOD("xform_vec_mult_node_get_no_translation","shader_type","id"),&ShaderGraph::xform_vec_mult_node_get_no_translation); - ClassDB::bind_method(_MD("scalar_func_node_set_function","shader_type","id","func"),&ShaderGraph::scalar_func_node_set_function); - ClassDB::bind_method(_MD("scalar_func_node_get_function","shader_type","id"),&ShaderGraph::scalar_func_node_get_function); + ClassDB::bind_method(D_METHOD("scalar_func_node_set_function","shader_type","id","func"),&ShaderGraph::scalar_func_node_set_function); + ClassDB::bind_method(D_METHOD("scalar_func_node_get_function","shader_type","id"),&ShaderGraph::scalar_func_node_get_function); - ClassDB::bind_method(_MD("vec_func_node_set_function","shader_type","id","func"),&ShaderGraph::vec_func_node_set_function); - ClassDB::bind_method(_MD("vec_func_node_get_function","shader_type","id"),&ShaderGraph::vec_func_node_get_function); + ClassDB::bind_method(D_METHOD("vec_func_node_set_function","shader_type","id","func"),&ShaderGraph::vec_func_node_set_function); + ClassDB::bind_method(D_METHOD("vec_func_node_get_function","shader_type","id"),&ShaderGraph::vec_func_node_get_function); - ClassDB::bind_method(_MD("input_node_set_name","shader_type","id","name"),&ShaderGraph::input_node_set_name); - ClassDB::bind_method(_MD("input_node_get_name","shader_type","id"),&ShaderGraph::input_node_get_name); + ClassDB::bind_method(D_METHOD("input_node_set_name","shader_type","id","name"),&ShaderGraph::input_node_set_name); + ClassDB::bind_method(D_METHOD("input_node_get_name","shader_type","id"),&ShaderGraph::input_node_get_name); - ClassDB::bind_method(_MD("scalar_input_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_input_node_set_value); - ClassDB::bind_method(_MD("scalar_input_node_get_value","shader_type","id"),&ShaderGraph::scalar_input_node_get_value); + ClassDB::bind_method(D_METHOD("scalar_input_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_input_node_set_value); + ClassDB::bind_method(D_METHOD("scalar_input_node_get_value","shader_type","id"),&ShaderGraph::scalar_input_node_get_value); - ClassDB::bind_method(_MD("vec_input_node_set_value","shader_type","id","value"),&ShaderGraph::vec_input_node_set_value); - ClassDB::bind_method(_MD("vec_input_node_get_value","shader_type","id"),&ShaderGraph::vec_input_node_get_value); + ClassDB::bind_method(D_METHOD("vec_input_node_set_value","shader_type","id","value"),&ShaderGraph::vec_input_node_set_value); + ClassDB::bind_method(D_METHOD("vec_input_node_get_value","shader_type","id"),&ShaderGraph::vec_input_node_get_value); - ClassDB::bind_method(_MD("rgb_input_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_input_node_set_value); - ClassDB::bind_method(_MD("rgb_input_node_get_value","shader_type","id"),&ShaderGraph::rgb_input_node_get_value); + ClassDB::bind_method(D_METHOD("rgb_input_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_input_node_set_value); + ClassDB::bind_method(D_METHOD("rgb_input_node_get_value","shader_type","id"),&ShaderGraph::rgb_input_node_get_value); - ClassDB::bind_method(_MD("xform_input_node_set_value","shader_type","id","value"),&ShaderGraph::xform_input_node_set_value); - ClassDB::bind_method(_MD("xform_input_node_get_value","shader_type","id"),&ShaderGraph::xform_input_node_get_value); + ClassDB::bind_method(D_METHOD("xform_input_node_set_value","shader_type","id","value"),&ShaderGraph::xform_input_node_set_value); + ClassDB::bind_method(D_METHOD("xform_input_node_get_value","shader_type","id"),&ShaderGraph::xform_input_node_get_value); - ClassDB::bind_method(_MD("texture_input_node_set_value","shader_type","id","value:Texture"),&ShaderGraph::texture_input_node_set_value); - ClassDB::bind_method(_MD("texture_input_node_get_value:Texture","shader_type","id"),&ShaderGraph::texture_input_node_get_value); + ClassDB::bind_method(D_METHOD("texture_input_node_set_value","shader_type","id","value:Texture"),&ShaderGraph::texture_input_node_set_value); + ClassDB::bind_method(D_METHOD("texture_input_node_get_value:Texture","shader_type","id"),&ShaderGraph::texture_input_node_get_value); - ClassDB::bind_method(_MD("cubemap_input_node_set_value","shader_type","id","value:CubeMap"),&ShaderGraph::cubemap_input_node_set_value); - ClassDB::bind_method(_MD("cubemap_input_node_get_value:CubeMap","shader_type","id"),&ShaderGraph::cubemap_input_node_get_value); + ClassDB::bind_method(D_METHOD("cubemap_input_node_set_value","shader_type","id","value:CubeMap"),&ShaderGraph::cubemap_input_node_set_value); + ClassDB::bind_method(D_METHOD("cubemap_input_node_get_value:CubeMap","shader_type","id"),&ShaderGraph::cubemap_input_node_get_value); - ClassDB::bind_method(_MD("comment_node_set_text","shader_type","id","text"),&ShaderGraph::comment_node_set_text); - ClassDB::bind_method(_MD("comment_node_get_text","shader_type","id"),&ShaderGraph::comment_node_get_text); + ClassDB::bind_method(D_METHOD("comment_node_set_text","shader_type","id","text"),&ShaderGraph::comment_node_set_text); + ClassDB::bind_method(D_METHOD("comment_node_get_text","shader_type","id"),&ShaderGraph::comment_node_get_text); - ClassDB::bind_method(_MD("color_ramp_node_set_ramp","shader_type","id","colors","offsets"),&ShaderGraph::color_ramp_node_set_ramp); - ClassDB::bind_method(_MD("color_ramp_node_get_colors","shader_type","id"),&ShaderGraph::color_ramp_node_get_colors); - ClassDB::bind_method(_MD("color_ramp_node_get_offsets","shader_type","id"),&ShaderGraph::color_ramp_node_get_offsets); + ClassDB::bind_method(D_METHOD("color_ramp_node_set_ramp","shader_type","id","colors","offsets"),&ShaderGraph::color_ramp_node_set_ramp); + ClassDB::bind_method(D_METHOD("color_ramp_node_get_colors","shader_type","id"),&ShaderGraph::color_ramp_node_get_colors); + ClassDB::bind_method(D_METHOD("color_ramp_node_get_offsets","shader_type","id"),&ShaderGraph::color_ramp_node_get_offsets); - ClassDB::bind_method(_MD("curve_map_node_set_points","shader_type","id","points"),&ShaderGraph::curve_map_node_set_points); - ClassDB::bind_method(_MD("curve_map_node_get_points","shader_type","id"),&ShaderGraph::curve_map_node_get_points); + ClassDB::bind_method(D_METHOD("curve_map_node_set_points","shader_type","id","points"),&ShaderGraph::curve_map_node_set_points); + ClassDB::bind_method(D_METHOD("curve_map_node_get_points","shader_type","id"),&ShaderGraph::curve_map_node_get_points); - ClassDB::bind_method(_MD("connect_node:Error","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::connect_node); - ClassDB::bind_method(_MD("is_node_connected","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::is_node_connected); - ClassDB::bind_method(_MD("disconnect_node","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::disconnect_node); - ClassDB::bind_method(_MD("get_node_connections","shader_type"),&ShaderGraph::_get_connections); + ClassDB::bind_method(D_METHOD("connect_node:Error","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::connect_node); + ClassDB::bind_method(D_METHOD("is_node_connected","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::is_node_connected); + ClassDB::bind_method(D_METHOD("disconnect_node","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::disconnect_node); + ClassDB::bind_method(D_METHOD("get_node_connections","shader_type"),&ShaderGraph::_get_connections); - ClassDB::bind_method(_MD("clear","shader_type"),&ShaderGraph::clear); + ClassDB::bind_method(D_METHOD("clear","shader_type"),&ShaderGraph::clear); - ClassDB::bind_method(_MD("node_set_state","shader_type","id","state"),&ShaderGraph::node_set_state); - ClassDB::bind_method(_MD("node_get_state:Variant","shader_type","id"),&ShaderGraph::node_get_state); + ClassDB::bind_method(D_METHOD("node_set_state","shader_type","id","state"),&ShaderGraph::node_set_state); + ClassDB::bind_method(D_METHOD("node_get_state:Variant","shader_type","id"),&ShaderGraph::node_get_state); - ClassDB::bind_method(_MD("_set_data"),&ShaderGraph::_set_data); - ClassDB::bind_method(_MD("_get_data"),&ShaderGraph::_get_data); + ClassDB::bind_method(D_METHOD("_set_data"),&ShaderGraph::_set_data); + ClassDB::bind_method(D_METHOD("_get_data"),&ShaderGraph::_get_data); - ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"),_SCS("_get_data")); + ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_data","_get_data"); //void get_connections(ShaderType p_which,List<Connection> *p_connections) const; @@ -399,21 +399,21 @@ void ShaderGraph::_bind_methods() { #if 0 - ClassDB::bind_method(_MD("node_add"),&ShaderGraph::node_add ); - ClassDB::bind_method(_MD("node_remove"),&ShaderGraph::node_remove ); - ClassDB::bind_method(_MD("node_set_param"),&ShaderGraph::node_set_param ); - ClassDB::bind_method(_MD("node_set_pos"),&ShaderGraph::node_set_pos ); + ClassDB::bind_method(D_METHOD("node_add"),&ShaderGraph::node_add ); + ClassDB::bind_method(D_METHOD("node_remove"),&ShaderGraph::node_remove ); + ClassDB::bind_method(D_METHOD("node_set_param"),&ShaderGraph::node_set_param ); + ClassDB::bind_method(D_METHOD("node_set_pos"),&ShaderGraph::node_set_pos ); - ClassDB::bind_method(_MD("node_get_pos"),&ShaderGraph::node_get_pos ); - ClassDB::bind_method(_MD("node_get_param"),&ShaderGraph::node_get_param); - ClassDB::bind_method(_MD("node_get_type"),&ShaderGraph::node_get_type); + ClassDB::bind_method(D_METHOD("node_get_pos"),&ShaderGraph::node_get_pos ); + ClassDB::bind_method(D_METHOD("node_get_param"),&ShaderGraph::node_get_param); + ClassDB::bind_method(D_METHOD("node_get_type"),&ShaderGraph::node_get_type); - ClassDB::bind_method(_MD("connect"),&ShaderGraph::connect ); - ClassDB::bind_method(_MD("disconnect"),&ShaderGraph::disconnect ); + ClassDB::bind_method(D_METHOD("connect"),&ShaderGraph::connect ); + ClassDB::bind_method(D_METHOD("disconnect"),&ShaderGraph::disconnect ); - ClassDB::bind_method(_MD("get_connections"),&ShaderGraph::_get_connections_helper ); + ClassDB::bind_method(D_METHOD("get_connections"),&ShaderGraph::_get_connections_helper ); - ClassDB::bind_method(_MD("clear"),&ShaderGraph::clear ); + ClassDB::bind_method(D_METHOD("clear"),&ShaderGraph::clear ); BIND_CONSTANT( NODE_IN ); ///< param 0: name BIND_CONSTANT( NODE_OUT ); ///< param 0: name diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index b5a886b4b9..ec1568e218 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -104,14 +104,14 @@ Variant Shape2D::collide_and_get_contacts(const Transform2D& p_local_xform, con void Shape2D::_bind_methods() { - ClassDB::bind_method(_MD("set_custom_solver_bias","bias"),&Shape2D::set_custom_solver_bias); - ClassDB::bind_method(_MD("get_custom_solver_bias"),&Shape2D::get_custom_solver_bias); - ClassDB::bind_method(_MD("collide","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide); - ClassDB::bind_method(_MD("collide_with_motion","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion); - ClassDB::bind_method(_MD("collide_and_get_contacts:Variant","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide_and_get_contacts); - ClassDB::bind_method(_MD("collide_with_motion_and_get_contacts:Variant","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion_and_get_contacts); - - ADD_PROPERTY( PropertyInfo(Variant::REAL,"custom_solver_bias",PROPERTY_HINT_RANGE,"0,1,0.001"),_SCS("set_custom_solver_bias"),_SCS("get_custom_solver_bias")); + ClassDB::bind_method(D_METHOD("set_custom_solver_bias","bias"),&Shape2D::set_custom_solver_bias); + ClassDB::bind_method(D_METHOD("get_custom_solver_bias"),&Shape2D::get_custom_solver_bias); + ClassDB::bind_method(D_METHOD("collide","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide); + ClassDB::bind_method(D_METHOD("collide_with_motion","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion); + ClassDB::bind_method(D_METHOD("collide_and_get_contacts:Variant","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide_and_get_contacts); + ClassDB::bind_method(D_METHOD("collide_with_motion_and_get_contacts:Variant","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion_and_get_contacts); + + ADD_PROPERTY( PropertyInfo(Variant::REAL,"custom_solver_bias",PROPERTY_HINT_RANGE,"0,1,0.001"),"set_custom_solver_bias","get_custom_solver_bias"); } diff --git a/scene/resources/shape_line_2d.cpp b/scene/resources/shape_line_2d.cpp index b2270d00c0..64e50e62c8 100644 --- a/scene/resources/shape_line_2d.cpp +++ b/scene/resources/shape_line_2d.cpp @@ -90,14 +90,14 @@ Rect2 LineShape2D::get_rect() const{ void LineShape2D::_bind_methods() { - ClassDB::bind_method(_MD("set_normal","normal"),&LineShape2D::set_normal); - ClassDB::bind_method(_MD("get_normal"),&LineShape2D::get_normal); + ClassDB::bind_method(D_METHOD("set_normal","normal"),&LineShape2D::set_normal); + ClassDB::bind_method(D_METHOD("get_normal"),&LineShape2D::get_normal); - ClassDB::bind_method(_MD("set_d","d"),&LineShape2D::set_d); - ClassDB::bind_method(_MD("get_d"),&LineShape2D::get_d); + ClassDB::bind_method(D_METHOD("set_d","d"),&LineShape2D::set_d); + ClassDB::bind_method(D_METHOD("get_d"),&LineShape2D::get_d); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"normal"),_SCS("set_normal"),_SCS("get_normal") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"d"),_SCS("set_d"),_SCS("get_d") ); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"normal"),"set_normal","get_normal") ; + ADD_PROPERTY( PropertyInfo(Variant::REAL,"d"),"set_d","get_d") ; } diff --git a/scene/resources/sky_box.cpp b/scene/resources/sky_box.cpp index 2a4fbfa8d4..0f8a1e5339 100644 --- a/scene/resources/sky_box.cpp +++ b/scene/resources/sky_box.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* sky_box.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "sky_box.h" #include "io/image_loader.h" @@ -16,10 +44,10 @@ SkyBox::RadianceSize SkyBox::get_radiance_size() const { void SkyBox::_bind_methods() { - ClassDB::bind_method(_MD("set_radiance_size","size"),&SkyBox::set_radiance_size); - ClassDB::bind_method(_MD("get_radiance_size"),&SkyBox::get_radiance_size); + ClassDB::bind_method(D_METHOD("set_radiance_size","size"),&SkyBox::set_radiance_size); + ClassDB::bind_method(D_METHOD("get_radiance_size"),&SkyBox::get_radiance_size); - ADD_PROPERTY(PropertyInfo(Variant::INT,"radiance_size",PROPERTY_HINT_ENUM,"256,512,1024,2048"),_SCS("set_radiance_size"),_SCS("get_radiance_size")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"radiance_size",PROPERTY_HINT_ENUM,"256,512,1024,2048"),"set_radiance_size","get_radiance_size"); BIND_CONSTANT( RADIANCE_SIZE_256 ); @@ -113,8 +141,8 @@ RID ImageSkyBox::get_rid() const { void ImageSkyBox::_bind_methods() { - ClassDB::bind_method(_MD("set_image_path","image","path"),&ImageSkyBox::set_image_path); - ClassDB::bind_method(_MD("get_image_path","image"),&ImageSkyBox::get_image_path); + ClassDB::bind_method(D_METHOD("set_image_path","image","path"),&ImageSkyBox::set_image_path); + ClassDB::bind_method(D_METHOD("get_image_path","image"),&ImageSkyBox::get_image_path); List<String> extensions; ImageLoader::get_recognized_extensions(&extensions); @@ -127,12 +155,12 @@ void ImageSkyBox::_bind_methods() { } ADD_GROUP("Image Path","image_path_"); - ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_negative_x",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_NEGATIVE_X); - ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_positive_x",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_POSITIVE_X); - ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_negative_y",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_NEGATIVE_Y); - ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_positive_y",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_POSITIVE_Y); - ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_negative_z",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_NEGATIVE_Z); - ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_positive_z",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_POSITIVE_Z); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_negative_x",PROPERTY_HINT_FILE,hints),"set_image_path","get_image_path",IMAGE_PATH_NEGATIVE_X); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_positive_x",PROPERTY_HINT_FILE,hints),"set_image_path","get_image_path",IMAGE_PATH_POSITIVE_X); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_negative_y",PROPERTY_HINT_FILE,hints),"set_image_path","get_image_path",IMAGE_PATH_NEGATIVE_Y); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_positive_y",PROPERTY_HINT_FILE,hints),"set_image_path","get_image_path",IMAGE_PATH_POSITIVE_Y); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_negative_z",PROPERTY_HINT_FILE,hints),"set_image_path","get_image_path",IMAGE_PATH_NEGATIVE_Z); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_positive_z",PROPERTY_HINT_FILE,hints),"set_image_path","get_image_path",IMAGE_PATH_POSITIVE_Z); BIND_CONSTANT( IMAGE_PATH_NEGATIVE_X ); BIND_CONSTANT( IMAGE_PATH_POSITIVE_X ); diff --git a/scene/resources/sky_box.h b/scene/resources/sky_box.h index a3caf15aa7..171782d132 100644 --- a/scene/resources/sky_box.h +++ b/scene/resources/sky_box.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* sky_box.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 SKYBOX_H #define SKYBOX_H diff --git a/scene/resources/space_2d.cpp b/scene/resources/space_2d.cpp index 3f0d2824ce..f1fe9629dd 100644 --- a/scene/resources/space_2d.cpp +++ b/scene/resources/space_2d.cpp @@ -48,10 +48,10 @@ bool Space2D::is_active() const { void Space2D::_bind_methods() { - ClassDB::bind_method(_MD("set_active","active"),&Space2D::set_active); - ClassDB::bind_method(_MD("is_active"),&Space2D::is_active); + ClassDB::bind_method(D_METHOD("set_active","active"),&Space2D::set_active); + ClassDB::bind_method(D_METHOD("is_active"),&Space2D::is_active); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"active"),_SCS("set_active"),_SCS("is_active") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"active"),"set_active","is_active") ; } diff --git a/scene/resources/sphere_shape.cpp b/scene/resources/sphere_shape.cpp index c7c4d94aad..3029625928 100644 --- a/scene/resources/sphere_shape.cpp +++ b/scene/resources/sphere_shape.cpp @@ -75,10 +75,10 @@ float SphereShape::get_radius() const { void SphereShape::_bind_methods() { - ClassDB::bind_method(_MD("set_radius","radius"),&SphereShape::set_radius); - ClassDB::bind_method(_MD("get_radius"),&SphereShape::get_radius); + ClassDB::bind_method(D_METHOD("set_radius","radius"),&SphereShape::set_radius); + ClassDB::bind_method(D_METHOD("get_radius"),&SphereShape::get_radius); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0,4096,0.01"), _SCS("set_radius"), _SCS("get_radius")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0,4096,0.01"), "set_radius", "get_radius"); } diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index e5e32ba4e9..34a4202942 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -70,26 +70,26 @@ Size2 StyleBox::get_center_size() const { void StyleBox::_bind_methods() { - ClassDB::bind_method(_MD("test_mask","point","rect"),&StyleBox::test_mask); + ClassDB::bind_method(D_METHOD("test_mask","point","rect"),&StyleBox::test_mask); - ClassDB::bind_method(_MD("set_default_margin","margin","offset"),&StyleBox::set_default_margin); - ClassDB::bind_method(_MD("get_default_margin","margin"),&StyleBox::get_default_margin); + ClassDB::bind_method(D_METHOD("set_default_margin","margin","offset"),&StyleBox::set_default_margin); + ClassDB::bind_method(D_METHOD("get_default_margin","margin"),&StyleBox::get_default_margin); - //ClassDB::bind_method(_MD("set_default_margin"),&StyleBox::set_default_margin); - //ClassDB::bind_method(_MD("get_default_margin"),&StyleBox::get_default_margin); + //ClassDB::bind_method(D_METHOD("set_default_margin"),&StyleBox::set_default_margin); + //ClassDB::bind_method(D_METHOD("get_default_margin"),&StyleBox::get_default_margin); - ClassDB::bind_method(_MD("get_margin","margin"),&StyleBox::get_margin); - ClassDB::bind_method(_MD("get_minimum_size"),&StyleBox::get_minimum_size); - ClassDB::bind_method(_MD("get_center_size"),&StyleBox::get_center_size); - ClassDB::bind_method(_MD("get_offset"),&StyleBox::get_offset); + ClassDB::bind_method(D_METHOD("get_margin","margin"),&StyleBox::get_margin); + ClassDB::bind_method(D_METHOD("get_minimum_size"),&StyleBox::get_minimum_size); + ClassDB::bind_method(D_METHOD("get_center_size"),&StyleBox::get_center_size); + ClassDB::bind_method(D_METHOD("get_offset"),&StyleBox::get_offset); - ClassDB::bind_method(_MD("draw","canvas_item","rect"),&StyleBox::draw); + ClassDB::bind_method(D_METHOD("draw","canvas_item","rect"),&StyleBox::draw); ADD_GROUP("Content Margin","content_margin_"); - 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 ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin_top", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_TOP); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin_bottom", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_BOTTOM ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin_left", PROPERTY_HINT_RANGE,"-1,2048,1" ), "set_default_margin","get_default_margin", MARGIN_LEFT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin_right", PROPERTY_HINT_RANGE,"-1,2048,1" ), "set_default_margin","get_default_margin", MARGIN_RIGHT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin_top", PROPERTY_HINT_RANGE,"-1,2048,1" ), "set_default_margin","get_default_margin", MARGIN_TOP); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin_bottom", PROPERTY_HINT_RANGE,"-1,2048,1" ), "set_default_margin","get_default_margin", MARGIN_BOTTOM ); } @@ -209,42 +209,42 @@ Color StyleBoxTexture::get_modulate() const { void StyleBoxTexture::_bind_methods() { - ClassDB::bind_method(_MD("set_texture","texture:Texture"),&StyleBoxTexture::set_texture); - ClassDB::bind_method(_MD("get_texture:Texture"),&StyleBoxTexture::get_texture); + ClassDB::bind_method(D_METHOD("set_texture","texture:Texture"),&StyleBoxTexture::set_texture); + ClassDB::bind_method(D_METHOD("get_texture:Texture"),&StyleBoxTexture::get_texture); - ClassDB::bind_method(_MD("set_margin_size","margin","size"),&StyleBoxTexture::set_margin_size); - ClassDB::bind_method(_MD("get_margin_size","margin"),&StyleBoxTexture::get_margin_size); + ClassDB::bind_method(D_METHOD("set_margin_size","margin","size"),&StyleBoxTexture::set_margin_size); + ClassDB::bind_method(D_METHOD("get_margin_size","margin"),&StyleBoxTexture::get_margin_size); - ClassDB::bind_method(_MD("set_expand_margin_size","margin","size"),&StyleBoxTexture::set_expand_margin_size); - ClassDB::bind_method(_MD("get_expand_margin_size","margin"),&StyleBoxTexture::get_expand_margin_size); + ClassDB::bind_method(D_METHOD("set_expand_margin_size","margin","size"),&StyleBoxTexture::set_expand_margin_size); + ClassDB::bind_method(D_METHOD("get_expand_margin_size","margin"),&StyleBoxTexture::get_expand_margin_size); - ClassDB::bind_method(_MD("set_region_rect","region"),&StyleBoxTexture::set_region_rect); - ClassDB::bind_method(_MD("get_region_rect"),&StyleBoxTexture::get_region_rect); + ClassDB::bind_method(D_METHOD("set_region_rect","region"),&StyleBoxTexture::set_region_rect); + ClassDB::bind_method(D_METHOD("get_region_rect"),&StyleBoxTexture::get_region_rect); - ClassDB::bind_method(_MD("set_draw_center","enable"),&StyleBoxTexture::set_draw_center); - ClassDB::bind_method(_MD("get_draw_center"),&StyleBoxTexture::get_draw_center); + ClassDB::bind_method(D_METHOD("set_draw_center","enable"),&StyleBoxTexture::set_draw_center); + ClassDB::bind_method(D_METHOD("get_draw_center"),&StyleBoxTexture::get_draw_center); - ClassDB::bind_method(_MD("set_modulate","color"),&StyleBoxTexture::set_modulate); - ClassDB::bind_method(_MD("get_modulate"),&StyleBoxTexture::get_modulate); + ClassDB::bind_method(D_METHOD("set_modulate","color"),&StyleBoxTexture::set_modulate); + ClassDB::bind_method(D_METHOD("get_modulate"),&StyleBoxTexture::get_modulate); ADD_SIGNAL(MethodInfo("texture_changed")); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture" ), _SCS("set_texture"),_SCS("get_texture") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect")); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture" ), "set_texture","get_texture") ; + ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), "set_region_rect","get_region_rect"); ADD_GROUP("Margin","margin_"); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_left", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_LEFT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_right", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_RIGHT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_top", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_TOP); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_bottom", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_BOTTOM ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_left", PROPERTY_HINT_RANGE,"0,2048,1" ), "set_margin_size","get_margin_size", MARGIN_LEFT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_right", PROPERTY_HINT_RANGE,"0,2048,1" ), "set_margin_size","get_margin_size", MARGIN_RIGHT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_top", PROPERTY_HINT_RANGE,"0,2048,1" ), "set_margin_size","get_margin_size", MARGIN_TOP); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_bottom", PROPERTY_HINT_RANGE,"0,2048,1" ), "set_margin_size","get_margin_size", MARGIN_BOTTOM ); ADD_GROUP("Expand Margin","expand_margin_"); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_left", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_LEFT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_right", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_RIGHT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_top", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_TOP ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_bottom", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_BOTTOM ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_left", PROPERTY_HINT_RANGE,"0,2048,1" ), "set_expand_margin_size","get_expand_margin_size", MARGIN_LEFT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_right", PROPERTY_HINT_RANGE,"0,2048,1" ), "set_expand_margin_size","get_expand_margin_size", MARGIN_RIGHT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_top", PROPERTY_HINT_RANGE,"0,2048,1" ), "set_expand_margin_size","get_expand_margin_size", MARGIN_TOP ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_bottom", PROPERTY_HINT_RANGE,"0,2048,1" ), "set_expand_margin_size","get_expand_margin_size", MARGIN_BOTTOM ); ADD_GROUP("Modulate","modulate_"); - ADD_PROPERTY( PropertyInfo( Variant::COLOR, "modulate_color" ), _SCS("set_modulate"),_SCS("get_modulate")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "draw_center" ) , _SCS("set_draw_center"),_SCS("get_draw_center")); + ADD_PROPERTY( PropertyInfo( Variant::COLOR, "modulate_color" ), "set_modulate","get_modulate"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "draw_center" ) , "set_draw_center","get_draw_center"); } @@ -390,25 +390,25 @@ float StyleBoxFlat::get_style_margin(Margin p_margin) const { } void StyleBoxFlat::_bind_methods() { - ClassDB::bind_method(_MD("set_bg_color","color"),&StyleBoxFlat::set_bg_color); - ClassDB::bind_method(_MD("get_bg_color"),&StyleBoxFlat::get_bg_color); - ClassDB::bind_method(_MD("set_light_color","color"),&StyleBoxFlat::set_light_color); - ClassDB::bind_method(_MD("get_light_color"),&StyleBoxFlat::get_light_color); - ClassDB::bind_method(_MD("set_dark_color","color"),&StyleBoxFlat::set_dark_color); - ClassDB::bind_method(_MD("get_dark_color"),&StyleBoxFlat::get_dark_color); - ClassDB::bind_method(_MD("set_border_size","size"),&StyleBoxFlat::set_border_size); - ClassDB::bind_method(_MD("get_border_size"),&StyleBoxFlat::get_border_size); - ClassDB::bind_method(_MD("set_border_blend","blend"),&StyleBoxFlat::set_border_blend); - ClassDB::bind_method(_MD("get_border_blend"),&StyleBoxFlat::get_border_blend); - ClassDB::bind_method(_MD("set_draw_center","size"),&StyleBoxFlat::set_draw_center); - ClassDB::bind_method(_MD("get_draw_center"),&StyleBoxFlat::get_draw_center); - - ADD_PROPERTY( PropertyInfo( Variant::COLOR, "bg_color"), _SCS("set_bg_color"),_SCS("get_bg_color") ); - ADD_PROPERTY( PropertyInfo( Variant::COLOR, "light_color"),_SCS("set_light_color"),_SCS("get_light_color")); - ADD_PROPERTY( PropertyInfo( Variant::COLOR, "dark_color"),_SCS("set_dark_color"),_SCS("get_dark_color")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "border_size",PROPERTY_HINT_RANGE,"0,4096"),_SCS("set_border_size"),_SCS("get_border_size")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "border_blend"),_SCS("set_border_blend"),_SCS("get_border_blend")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "draw_bg"),_SCS("set_draw_center"),_SCS("get_draw_center")); + ClassDB::bind_method(D_METHOD("set_bg_color","color"),&StyleBoxFlat::set_bg_color); + ClassDB::bind_method(D_METHOD("get_bg_color"),&StyleBoxFlat::get_bg_color); + ClassDB::bind_method(D_METHOD("set_light_color","color"),&StyleBoxFlat::set_light_color); + ClassDB::bind_method(D_METHOD("get_light_color"),&StyleBoxFlat::get_light_color); + ClassDB::bind_method(D_METHOD("set_dark_color","color"),&StyleBoxFlat::set_dark_color); + ClassDB::bind_method(D_METHOD("get_dark_color"),&StyleBoxFlat::get_dark_color); + ClassDB::bind_method(D_METHOD("set_border_size","size"),&StyleBoxFlat::set_border_size); + ClassDB::bind_method(D_METHOD("get_border_size"),&StyleBoxFlat::get_border_size); + ClassDB::bind_method(D_METHOD("set_border_blend","blend"),&StyleBoxFlat::set_border_blend); + ClassDB::bind_method(D_METHOD("get_border_blend"),&StyleBoxFlat::get_border_blend); + ClassDB::bind_method(D_METHOD("set_draw_center","size"),&StyleBoxFlat::set_draw_center); + ClassDB::bind_method(D_METHOD("get_draw_center"),&StyleBoxFlat::get_draw_center); + + ADD_PROPERTY( PropertyInfo( Variant::COLOR, "bg_color"), "set_bg_color","get_bg_color") ; + ADD_PROPERTY( PropertyInfo( Variant::COLOR, "light_color"),"set_light_color","get_light_color"); + ADD_PROPERTY( PropertyInfo( Variant::COLOR, "dark_color"),"set_dark_color","get_dark_color"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "border_size",PROPERTY_HINT_RANGE,"0,4096"),"set_border_size","get_border_size"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "border_blend"),"set_border_blend","get_border_blend"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "draw_bg"),"set_draw_center","get_draw_center"); } diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 1d0d323546..cf07f1658b 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -862,25 +862,25 @@ void SurfaceTool::clear() { void SurfaceTool::_bind_methods() { - ClassDB::bind_method(_MD("begin","primitive"),&SurfaceTool::begin); - ClassDB::bind_method(_MD("add_vertex","vertex"),&SurfaceTool::add_vertex); - ClassDB::bind_method(_MD("add_color","color"),&SurfaceTool::add_color); - ClassDB::bind_method(_MD("add_normal","normal"),&SurfaceTool::add_normal); - ClassDB::bind_method(_MD("add_tangent","tangent"),&SurfaceTool::add_tangent); - ClassDB::bind_method(_MD("add_uv","uv"),&SurfaceTool::add_uv); - ClassDB::bind_method(_MD("add_uv2","uv2"),&SurfaceTool::add_uv2); - ClassDB::bind_method(_MD("add_bones","bones"),&SurfaceTool::add_bones); - ClassDB::bind_method(_MD("add_weights","weights"),&SurfaceTool::add_weights); - ClassDB::bind_method(_MD("add_smooth_group","smooth"),&SurfaceTool::add_smooth_group); - ClassDB::bind_method(_MD("add_triangle_fan", "vertexes", "uvs", "colors", "uv2s", "normals", "tangents"),&SurfaceTool::add_triangle_fan, DEFVAL(Vector<Vector2>()), DEFVAL(Vector<Color>()), DEFVAL(Vector<Vector2>()),DEFVAL(Vector<Vector3>()), DEFVAL(Vector<Plane>())); - ClassDB::bind_method(_MD("set_material","material:Material"),&SurfaceTool::set_material); - ClassDB::bind_method(_MD("index"),&SurfaceTool::index); - ClassDB::bind_method(_MD("deindex"),&SurfaceTool::deindex); - ///ClassDB::bind_method(_MD("generate_flat_normals"),&SurfaceTool::generate_flat_normals); - ClassDB::bind_method(_MD("generate_normals"),&SurfaceTool::generate_normals); - ClassDB::bind_method(_MD("add_index", "index"), &SurfaceTool::add_index); - ClassDB::bind_method(_MD("commit:Mesh","existing:Mesh"),&SurfaceTool::commit,DEFVAL(Variant())); - ClassDB::bind_method(_MD("clear"),&SurfaceTool::clear); + ClassDB::bind_method(D_METHOD("begin","primitive"),&SurfaceTool::begin); + ClassDB::bind_method(D_METHOD("add_vertex","vertex"),&SurfaceTool::add_vertex); + ClassDB::bind_method(D_METHOD("add_color","color"),&SurfaceTool::add_color); + ClassDB::bind_method(D_METHOD("add_normal","normal"),&SurfaceTool::add_normal); + ClassDB::bind_method(D_METHOD("add_tangent","tangent"),&SurfaceTool::add_tangent); + ClassDB::bind_method(D_METHOD("add_uv","uv"),&SurfaceTool::add_uv); + ClassDB::bind_method(D_METHOD("add_uv2","uv2"),&SurfaceTool::add_uv2); + ClassDB::bind_method(D_METHOD("add_bones","bones"),&SurfaceTool::add_bones); + ClassDB::bind_method(D_METHOD("add_weights","weights"),&SurfaceTool::add_weights); + ClassDB::bind_method(D_METHOD("add_smooth_group","smooth"),&SurfaceTool::add_smooth_group); + ClassDB::bind_method(D_METHOD("add_triangle_fan", "vertexes", "uvs", "colors", "uv2s", "normals", "tangents"),&SurfaceTool::add_triangle_fan, DEFVAL(Vector<Vector2>()), DEFVAL(Vector<Color>()), DEFVAL(Vector<Vector2>()),DEFVAL(Vector<Vector3>()), DEFVAL(Vector<Plane>())); + ClassDB::bind_method(D_METHOD("set_material","material:Material"),&SurfaceTool::set_material); + ClassDB::bind_method(D_METHOD("index"),&SurfaceTool::index); + ClassDB::bind_method(D_METHOD("deindex"),&SurfaceTool::deindex); + ///ClassDB::bind_method(D_METHOD("generate_flat_normals"),&SurfaceTool::generate_flat_normals); + ClassDB::bind_method(D_METHOD("generate_normals"),&SurfaceTool::generate_normals); + ClassDB::bind_method(D_METHOD("add_index", "index"), &SurfaceTool::add_index); + ClassDB::bind_method(D_METHOD("commit:Mesh","existing:Mesh"),&SurfaceTool::commit,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("clear"),&SurfaceTool::clear); } diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index fa89b7ba00..62feb7b37c 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -63,15 +63,15 @@ bool Texture::get_rect_region(const Rect2& p_rect, const Rect2& p_src_rect,Rect2 void Texture::_bind_methods() { - ClassDB::bind_method(_MD("get_width"),&Texture::get_width); - ClassDB::bind_method(_MD("get_height"),&Texture::get_height); - ClassDB::bind_method(_MD("get_size"),&Texture::get_size); - ClassDB::bind_method(_MD("has_alpha"),&Texture::has_alpha); - ClassDB::bind_method(_MD("set_flags","flags"),&Texture::set_flags); - ClassDB::bind_method(_MD("get_flags"),&Texture::get_flags); - ClassDB::bind_method(_MD("draw","canvas_item","pos","modulate","transpose"),&Texture::draw,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ClassDB::bind_method(_MD("draw_rect","canvas_item","rect","tile","modulate","transpose"),&Texture::draw_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ClassDB::bind_method(_MD("draw_rect_region","canvas_item","rect","src_rect","modulate","transpose"),&Texture::draw_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_width"),&Texture::get_width); + ClassDB::bind_method(D_METHOD("get_height"),&Texture::get_height); + ClassDB::bind_method(D_METHOD("get_size"),&Texture::get_size); + ClassDB::bind_method(D_METHOD("has_alpha"),&Texture::has_alpha); + ClassDB::bind_method(D_METHOD("set_flags","flags"),&Texture::set_flags); + ClassDB::bind_method(D_METHOD("get_flags"),&Texture::get_flags); + ClassDB::bind_method(D_METHOD("draw","canvas_item","pos","modulate","transpose"),&Texture::draw,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("draw_rect","canvas_item","rect","tile","modulate","transpose"),&Texture::draw_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("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 ); @@ -406,27 +406,27 @@ void ImageTexture::_set_data(Dictionary p_data) { void ImageTexture::_bind_methods() { - ClassDB::bind_method(_MD("create","width","height","format","flags"),&ImageTexture::create,DEFVAL(FLAGS_DEFAULT)); - ClassDB::bind_method(_MD("create_from_image","image","flags"),&ImageTexture::create_from_image,DEFVAL(FLAGS_DEFAULT)); - ClassDB::bind_method(_MD("get_format"),&ImageTexture::get_format); - ClassDB::bind_method(_MD("load","path"),&ImageTexture::load); - ClassDB::bind_method(_MD("set_data","image"),&ImageTexture::set_data); - ClassDB::bind_method(_MD("get_data","cube_side"),&ImageTexture::get_data); - ClassDB::bind_method(_MD("set_storage","mode"),&ImageTexture::set_storage); - ClassDB::bind_method(_MD("get_storage"),&ImageTexture::get_storage); - ClassDB::bind_method(_MD("set_lossy_storage_quality","quality"),&ImageTexture::set_lossy_storage_quality); - ClassDB::bind_method(_MD("get_lossy_storage_quality"),&ImageTexture::get_lossy_storage_quality); - ClassDB::bind_method(_MD("fix_alpha_edges"),&ImageTexture::fix_alpha_edges); - ClassDB::bind_method(_MD("premultiply_alpha"),&ImageTexture::premultiply_alpha); - ClassDB::bind_method(_MD("normal_to_xy"),&ImageTexture::normal_to_xy); - ClassDB::bind_method(_MD("shrink_x2_and_keep_size"),&ImageTexture::shrink_x2_and_keep_size); - - ClassDB::bind_method(_MD("set_size_override","size"),&ImageTexture::set_size_override); - ClassDB::set_method_flags(get_class_static(),_SCS("fix_alpha_edges"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ClassDB::set_method_flags(get_class_static(),_SCS("premultiply_alpha"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ClassDB::set_method_flags(get_class_static(),_SCS("normal_to_xy"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ClassDB::set_method_flags(get_class_static(),_SCS("shrink_x2_and_keep_size"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ClassDB::bind_method(_MD("_reload_hook","rid"),&ImageTexture::_reload_hook); + ClassDB::bind_method(D_METHOD("create","width","height","format","flags"),&ImageTexture::create,DEFVAL(FLAGS_DEFAULT)); + ClassDB::bind_method(D_METHOD("create_from_image","image","flags"),&ImageTexture::create_from_image,DEFVAL(FLAGS_DEFAULT)); + ClassDB::bind_method(D_METHOD("get_format"),&ImageTexture::get_format); + ClassDB::bind_method(D_METHOD("load","path"),&ImageTexture::load); + ClassDB::bind_method(D_METHOD("set_data","image"),&ImageTexture::set_data); + ClassDB::bind_method(D_METHOD("get_data","cube_side"),&ImageTexture::get_data); + ClassDB::bind_method(D_METHOD("set_storage","mode"),&ImageTexture::set_storage); + ClassDB::bind_method(D_METHOD("get_storage"),&ImageTexture::get_storage); + ClassDB::bind_method(D_METHOD("set_lossy_storage_quality","quality"),&ImageTexture::set_lossy_storage_quality); + ClassDB::bind_method(D_METHOD("get_lossy_storage_quality"),&ImageTexture::get_lossy_storage_quality); + ClassDB::bind_method(D_METHOD("fix_alpha_edges"),&ImageTexture::fix_alpha_edges); + ClassDB::bind_method(D_METHOD("premultiply_alpha"),&ImageTexture::premultiply_alpha); + ClassDB::bind_method(D_METHOD("normal_to_xy"),&ImageTexture::normal_to_xy); + ClassDB::bind_method(D_METHOD("shrink_x2_and_keep_size"),&ImageTexture::shrink_x2_and_keep_size); + + ClassDB::bind_method(D_METHOD("set_size_override","size"),&ImageTexture::set_size_override); + ClassDB::set_method_flags(get_class_static(),_scs_create("fix_alpha_edges"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::set_method_flags(get_class_static(),_scs_create("premultiply_alpha"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::set_method_flags(get_class_static(),_scs_create("normal_to_xy"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::set_method_flags(get_class_static(),_scs_create("shrink_x2_and_keep_size"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(D_METHOD("_reload_hook","rid"),&ImageTexture::_reload_hook); BIND_CONSTANT( STORAGE_RAW ); @@ -559,6 +559,11 @@ Error StreamTexture::_load_data(const String& p_path,int &tw,int &th,int& flags, int total_size=0; for(int i=0;i<mipmaps;i++) { + + if (i>0) { + size = f->get_32(); + } + PoolVector<uint8_t> pv; pv.resize(size); { @@ -754,6 +759,12 @@ bool StreamTexture::has_alpha() const { return false; } + +Image StreamTexture::get_data() const { + + return VS::get_singleton()->texture_get_data(texture); +} + void StreamTexture::set_flags(uint32_t p_flags){ } @@ -771,10 +782,10 @@ void StreamTexture::reload_from_file() { void StreamTexture::_bind_methods() { - ClassDB::bind_method(_MD("load","path"),&StreamTexture::load); - ClassDB::bind_method(_MD("get_load_path"),&StreamTexture::get_load_path); + ClassDB::bind_method(D_METHOD("load","path"),&StreamTexture::load); + ClassDB::bind_method(D_METHOD("get_load_path"),&StreamTexture::get_load_path); - ADD_PROPERTY( PropertyInfo(Variant::STRING,"load_path",PROPERTY_HINT_FILE,"*.stex"),_SCS("load"),_SCS("get_load_path")); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"load_path",PROPERTY_HINT_FILE,"*.stex"),"load","get_load_path"); } @@ -921,20 +932,20 @@ Rect2 AtlasTexture::get_margin() const { void AtlasTexture::_bind_methods() { - ClassDB::bind_method(_MD("set_atlas","atlas:Texture"),&AtlasTexture::set_atlas); - ClassDB::bind_method(_MD("get_atlas:Texture"),&AtlasTexture::get_atlas); + ClassDB::bind_method(D_METHOD("set_atlas","atlas:Texture"),&AtlasTexture::set_atlas); + ClassDB::bind_method(D_METHOD("get_atlas:Texture"),&AtlasTexture::get_atlas); - ClassDB::bind_method(_MD("set_region","region"),&AtlasTexture::set_region); - ClassDB::bind_method(_MD("get_region"),&AtlasTexture::get_region); + ClassDB::bind_method(D_METHOD("set_region","region"),&AtlasTexture::set_region); + ClassDB::bind_method(D_METHOD("get_region"),&AtlasTexture::get_region); - ClassDB::bind_method(_MD("set_margin","margin"),&AtlasTexture::set_margin); - ClassDB::bind_method(_MD("get_margin"),&AtlasTexture::get_margin); + ClassDB::bind_method(D_METHOD("set_margin","margin"),&AtlasTexture::set_margin); + ClassDB::bind_method(D_METHOD("get_margin"),&AtlasTexture::get_margin); ADD_SIGNAL(MethodInfo("atlas_changed")); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "atlas", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_atlas"),_SCS("get_atlas") ); - ADD_PROPERTY( PropertyInfo( Variant::RECT2, "region"), _SCS("set_region"),_SCS("get_region") ); - ADD_PROPERTY( PropertyInfo( Variant::RECT2, "margin"), _SCS("set_margin"),_SCS("get_margin") ); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "atlas", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), "set_atlas","get_atlas") ; + ADD_PROPERTY( PropertyInfo( Variant::RECT2, "region"), "set_region","get_region") ; + ADD_PROPERTY( PropertyInfo( Variant::RECT2, "margin"), "set_margin","get_margin") ; } @@ -1176,20 +1187,20 @@ Ref<Texture> LargeTexture::get_piece_texture(int p_idx) const{ void LargeTexture::_bind_methods() { - ClassDB::bind_method(_MD("add_piece","ofs","texture:Texture"),&LargeTexture::add_piece); - ClassDB::bind_method(_MD("set_piece_offset", "idx", "ofs"),&LargeTexture::set_piece_offset); - ClassDB::bind_method(_MD("set_piece_texture","idx", "texture:Texture"),&LargeTexture::set_piece_texture); - ClassDB::bind_method(_MD("set_size","size"),&LargeTexture::set_size); - ClassDB::bind_method(_MD("clear"),&LargeTexture::clear); + ClassDB::bind_method(D_METHOD("add_piece","ofs","texture:Texture"),&LargeTexture::add_piece); + ClassDB::bind_method(D_METHOD("set_piece_offset", "idx", "ofs"),&LargeTexture::set_piece_offset); + ClassDB::bind_method(D_METHOD("set_piece_texture","idx", "texture:Texture"),&LargeTexture::set_piece_texture); + ClassDB::bind_method(D_METHOD("set_size","size"),&LargeTexture::set_size); + ClassDB::bind_method(D_METHOD("clear"),&LargeTexture::clear); - ClassDB::bind_method(_MD("get_piece_count"),&LargeTexture::get_piece_count); - ClassDB::bind_method(_MD("get_piece_offset","idx"),&LargeTexture::get_piece_offset); - ClassDB::bind_method(_MD("get_piece_texture:Texture","idx"),&LargeTexture::get_piece_texture); + ClassDB::bind_method(D_METHOD("get_piece_count"),&LargeTexture::get_piece_count); + ClassDB::bind_method(D_METHOD("get_piece_offset","idx"),&LargeTexture::get_piece_offset); + ClassDB::bind_method(D_METHOD("get_piece_texture:Texture","idx"),&LargeTexture::get_piece_texture); - ClassDB::bind_method(_MD("_set_data","data"),&LargeTexture::_set_data); - ClassDB::bind_method(_MD("_get_data"),&LargeTexture::_get_data); + ClassDB::bind_method(D_METHOD("_set_data","data"),&LargeTexture::_set_data); + ClassDB::bind_method(D_METHOD("_get_data"),&LargeTexture::_get_data); - ADD_PROPERTY( PropertyInfo( Variant::ARRAY, "_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"),_SCS("_get_data") ); + ADD_PROPERTY( PropertyInfo( Variant::ARRAY, "_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), "_set_data","_get_data") ; } @@ -1420,18 +1431,18 @@ void CubeMap::_get_property_list( List<PropertyInfo> *p_list) const { void CubeMap::_bind_methods() { - ClassDB::bind_method(_MD("get_width"),&CubeMap::get_width); - ClassDB::bind_method(_MD("get_height"),&CubeMap::get_height); - //ClassDB::bind_method(_MD("get_rid"),&CubeMap::get_rid); - ClassDB::bind_method(_MD("set_flags","flags"),&CubeMap::set_flags); - ClassDB::bind_method(_MD("get_flags"),&CubeMap::get_flags); - - ClassDB::bind_method(_MD("set_side","side","image"),&CubeMap::set_side); - ClassDB::bind_method(_MD("get_side","side"),&CubeMap::get_side); - ClassDB::bind_method(_MD("set_storage","mode"),&CubeMap::set_storage); - ClassDB::bind_method(_MD("get_storage"),&CubeMap::get_storage); - ClassDB::bind_method(_MD("set_lossy_storage_quality","quality"),&CubeMap::set_lossy_storage_quality); - ClassDB::bind_method(_MD("get_lossy_storage_quality"),&CubeMap::get_lossy_storage_quality); + ClassDB::bind_method(D_METHOD("get_width"),&CubeMap::get_width); + ClassDB::bind_method(D_METHOD("get_height"),&CubeMap::get_height); + //ClassDB::bind_method(D_METHOD("get_rid"),&CubeMap::get_rid); + ClassDB::bind_method(D_METHOD("set_flags","flags"),&CubeMap::set_flags); + ClassDB::bind_method(D_METHOD("get_flags"),&CubeMap::get_flags); + + ClassDB::bind_method(D_METHOD("set_side","side","image"),&CubeMap::set_side); + ClassDB::bind_method(D_METHOD("get_side","side"),&CubeMap::get_side); + ClassDB::bind_method(D_METHOD("set_storage","mode"),&CubeMap::set_storage); + ClassDB::bind_method(D_METHOD("get_storage"),&CubeMap::get_storage); + ClassDB::bind_method(D_METHOD("set_lossy_storage_quality","quality"),&CubeMap::set_lossy_storage_quality); + ClassDB::bind_method(D_METHOD("get_lossy_storage_quality"),&CubeMap::get_lossy_storage_quality); BIND_CONSTANT( STORAGE_RAW ); diff --git a/scene/resources/texture.h b/scene/resources/texture.h index f684aeb658..cae77ad5cf 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -76,7 +76,7 @@ public: virtual void draw_rect_region(RID p_canvas_item,const Rect2& p_rect, const Rect2& p_src_rect,const Color& p_modulate=Color(1,1,1), bool p_transpose=false) const; virtual bool get_rect_region(const Rect2& p_rect, const Rect2& p_src_rect,Rect2& r_rect,Rect2& r_src_rect) const; - + virtual Image get_data() const { return Image(); } Texture(); }; @@ -224,6 +224,8 @@ public: virtual bool has_alpha() const; virtual void set_flags(uint32_t p_flags); + virtual Image get_data() const; + StreamTexture(); ~StreamTexture(); diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 4793f8143b..10ad38d498 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -664,50 +664,50 @@ void Theme::get_type_list(List<StringName> *p_list) const { void Theme::_bind_methods() { - ClassDB::bind_method(_MD("set_icon","name","type","texture:Texture"),&Theme::set_icon); - ClassDB::bind_method(_MD("get_icon:Texture","name","type"),&Theme::get_icon); - ClassDB::bind_method(_MD("has_icon","name","type"),&Theme::has_icon); - ClassDB::bind_method(_MD("clear_icon","name","type"),&Theme::clear_icon); - ClassDB::bind_method(_MD("get_icon_list","type"),&Theme::_get_icon_list); + ClassDB::bind_method(D_METHOD("set_icon","name","type","texture:Texture"),&Theme::set_icon); + ClassDB::bind_method(D_METHOD("get_icon:Texture","name","type"),&Theme::get_icon); + ClassDB::bind_method(D_METHOD("has_icon","name","type"),&Theme::has_icon); + ClassDB::bind_method(D_METHOD("clear_icon","name","type"),&Theme::clear_icon); + ClassDB::bind_method(D_METHOD("get_icon_list","type"),&Theme::_get_icon_list); - ClassDB::bind_method(_MD("set_stylebox","name","type","texture:StyleBox"),&Theme::set_stylebox); - ClassDB::bind_method(_MD("get_stylebox:StyleBox","name","type"),&Theme::get_stylebox); - ClassDB::bind_method(_MD("has_stylebox","name","type"),&Theme::has_stylebox); - ClassDB::bind_method(_MD("clear_stylebox","name","type"),&Theme::clear_stylebox); - ClassDB::bind_method(_MD("get_stylebox_list","type"),&Theme::_get_stylebox_list); - ClassDB::bind_method(_MD("get_stylebox_types"),&Theme::_get_stylebox_types); + ClassDB::bind_method(D_METHOD("set_stylebox","name","type","texture:StyleBox"),&Theme::set_stylebox); + ClassDB::bind_method(D_METHOD("get_stylebox:StyleBox","name","type"),&Theme::get_stylebox); + ClassDB::bind_method(D_METHOD("has_stylebox","name","type"),&Theme::has_stylebox); + ClassDB::bind_method(D_METHOD("clear_stylebox","name","type"),&Theme::clear_stylebox); + ClassDB::bind_method(D_METHOD("get_stylebox_list","type"),&Theme::_get_stylebox_list); + ClassDB::bind_method(D_METHOD("get_stylebox_types"),&Theme::_get_stylebox_types); - ClassDB::bind_method(_MD("set_font","name","type","font:Font"),&Theme::set_font); - ClassDB::bind_method(_MD("get_font:Font","name","type"),&Theme::get_font); - ClassDB::bind_method(_MD("has_font","name","type"),&Theme::has_font); - ClassDB::bind_method(_MD("clear_font","name","type"),&Theme::clear_font); - ClassDB::bind_method(_MD("get_font_list","type"),&Theme::_get_font_list); + ClassDB::bind_method(D_METHOD("set_font","name","type","font:Font"),&Theme::set_font); + ClassDB::bind_method(D_METHOD("get_font:Font","name","type"),&Theme::get_font); + ClassDB::bind_method(D_METHOD("has_font","name","type"),&Theme::has_font); + ClassDB::bind_method(D_METHOD("clear_font","name","type"),&Theme::clear_font); + ClassDB::bind_method(D_METHOD("get_font_list","type"),&Theme::_get_font_list); - ClassDB::bind_method(_MD("set_color","name","type","color"),&Theme::set_color); - ClassDB::bind_method(_MD("get_color","name","type"),&Theme::get_color); - ClassDB::bind_method(_MD("has_color","name","type"),&Theme::has_color); - ClassDB::bind_method(_MD("clear_color","name","type"),&Theme::clear_color); - ClassDB::bind_method(_MD("get_color_list","type"),&Theme::_get_color_list); + ClassDB::bind_method(D_METHOD("set_color","name","type","color"),&Theme::set_color); + ClassDB::bind_method(D_METHOD("get_color","name","type"),&Theme::get_color); + ClassDB::bind_method(D_METHOD("has_color","name","type"),&Theme::has_color); + ClassDB::bind_method(D_METHOD("clear_color","name","type"),&Theme::clear_color); + ClassDB::bind_method(D_METHOD("get_color_list","type"),&Theme::_get_color_list); - ClassDB::bind_method(_MD("set_constant","name","type","constant"),&Theme::set_constant); - ClassDB::bind_method(_MD("get_constant","name","type"),&Theme::get_constant); - ClassDB::bind_method(_MD("has_constant","name","type"),&Theme::has_constant); - ClassDB::bind_method(_MD("clear_constant","name","type"),&Theme::clear_constant); - ClassDB::bind_method(_MD("get_constant_list","type"),&Theme::_get_constant_list); + ClassDB::bind_method(D_METHOD("set_constant","name","type","constant"),&Theme::set_constant); + ClassDB::bind_method(D_METHOD("get_constant","name","type"),&Theme::get_constant); + ClassDB::bind_method(D_METHOD("has_constant","name","type"),&Theme::has_constant); + ClassDB::bind_method(D_METHOD("clear_constant","name","type"),&Theme::clear_constant); + ClassDB::bind_method(D_METHOD("get_constant_list","type"),&Theme::_get_constant_list); - ClassDB::bind_method(_MD("set_default_font","font"),&Theme::set_default_theme_font); - ClassDB::bind_method(_MD("get_default_font"),&Theme::get_default_theme_font); + ClassDB::bind_method(D_METHOD("set_default_font","font"),&Theme::set_default_theme_font); + ClassDB::bind_method(D_METHOD("get_default_font"),&Theme::get_default_theme_font); - ClassDB::bind_method(_MD("get_type_list","type"),&Theme::_get_type_list); + ClassDB::bind_method(D_METHOD("get_type_list","type"),&Theme::_get_type_list); - ClassDB::bind_method(_MD("_emit_theme_changed"),&Theme::_emit_theme_changed); + ClassDB::bind_method(D_METHOD("_emit_theme_changed"),&Theme::_emit_theme_changed); ClassDB::bind_method("copy_default_theme",&Theme::copy_default_theme); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"default_font",PROPERTY_HINT_RESOURCE_TYPE,"Font"),_SCS("set_default_font"),_SCS("get_default_font")); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"default_font",PROPERTY_HINT_RESOURCE_TYPE,"Font"),"set_default_font","get_default_font"); } diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index c97682f504..e12d8057d8 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -426,37 +426,37 @@ void TileSet::clear() { void TileSet::_bind_methods() { - ClassDB::bind_method(_MD("create_tile","id"),&TileSet::create_tile); - ClassDB::bind_method(_MD("tile_set_name","id","name"),&TileSet::tile_set_name); - ClassDB::bind_method(_MD("tile_get_name","id"),&TileSet::tile_get_name); - ClassDB::bind_method(_MD("tile_set_texture","id","texture:Texture"),&TileSet::tile_set_texture); - ClassDB::bind_method(_MD("tile_get_texture:Texture","id"),&TileSet::tile_get_texture); - ClassDB::bind_method(_MD("tile_set_material","id","material:CanvasItemMaterial"),&TileSet::tile_set_material); - ClassDB::bind_method(_MD("tile_get_material:CanvasItemMaterial","id"),&TileSet::tile_get_material); - ClassDB::bind_method(_MD("tile_set_texture_offset","id","texture_offset"),&TileSet::tile_set_texture_offset); - ClassDB::bind_method(_MD("tile_get_texture_offset","id"),&TileSet::tile_get_texture_offset); - ClassDB::bind_method(_MD("tile_set_shape_offset","id","shape_offset"),&TileSet::tile_set_shape_offset); - ClassDB::bind_method(_MD("tile_get_shape_offset","id"),&TileSet::tile_get_shape_offset); - ClassDB::bind_method(_MD("tile_set_region","id","region"),&TileSet::tile_set_region); - ClassDB::bind_method(_MD("tile_get_region","id"),&TileSet::tile_get_region); - ClassDB::bind_method(_MD("tile_set_shape","id","shape:Shape2D"),&TileSet::tile_set_shape); - ClassDB::bind_method(_MD("tile_get_shape:Shape2D","id"),&TileSet::tile_get_shape); - ClassDB::bind_method(_MD("tile_set_shapes","id","shapes"),&TileSet::_tile_set_shapes); - ClassDB::bind_method(_MD("tile_get_shapes","id"),&TileSet::_tile_get_shapes); - ClassDB::bind_method(_MD("tile_set_navigation_polygon","id","navigation_polygon:NavigationPolygon"),&TileSet::tile_set_navigation_polygon); - ClassDB::bind_method(_MD("tile_get_navigation_polygon:NavigationPolygon","id"),&TileSet::tile_get_navigation_polygon); - ClassDB::bind_method(_MD("tile_set_navigation_polygon_offset","id","navigation_polygon_offset"),&TileSet::tile_set_navigation_polygon_offset); - ClassDB::bind_method(_MD("tile_get_navigation_polygon_offset","id"),&TileSet::tile_get_navigation_polygon_offset); - ClassDB::bind_method(_MD("tile_set_light_occluder","id","light_occluder:OccluderPolygon2D"),&TileSet::tile_set_light_occluder); - ClassDB::bind_method(_MD("tile_get_light_occluder:OccluderPolygon2D","id"),&TileSet::tile_get_light_occluder); - ClassDB::bind_method(_MD("tile_set_occluder_offset","id","occluder_offset"),&TileSet::tile_set_occluder_offset); - ClassDB::bind_method(_MD("tile_get_occluder_offset","id"),&TileSet::tile_get_occluder_offset); - - ClassDB::bind_method(_MD("remove_tile","id"),&TileSet::remove_tile); - ClassDB::bind_method(_MD("clear"),&TileSet::clear); - ClassDB::bind_method(_MD("get_last_unused_tile_id"),&TileSet::get_last_unused_tile_id); - ClassDB::bind_method(_MD("find_tile_by_name","name"),&TileSet::find_tile_by_name); - ClassDB::bind_method(_MD("get_tiles_ids", "name"), &TileSet::_get_tiles_ids); + ClassDB::bind_method(D_METHOD("create_tile","id"),&TileSet::create_tile); + ClassDB::bind_method(D_METHOD("tile_set_name","id","name"),&TileSet::tile_set_name); + ClassDB::bind_method(D_METHOD("tile_get_name","id"),&TileSet::tile_get_name); + ClassDB::bind_method(D_METHOD("tile_set_texture","id","texture:Texture"),&TileSet::tile_set_texture); + ClassDB::bind_method(D_METHOD("tile_get_texture:Texture","id"),&TileSet::tile_get_texture); + ClassDB::bind_method(D_METHOD("tile_set_material","id","material:CanvasItemMaterial"),&TileSet::tile_set_material); + ClassDB::bind_method(D_METHOD("tile_get_material:CanvasItemMaterial","id"),&TileSet::tile_get_material); + ClassDB::bind_method(D_METHOD("tile_set_texture_offset","id","texture_offset"),&TileSet::tile_set_texture_offset); + ClassDB::bind_method(D_METHOD("tile_get_texture_offset","id"),&TileSet::tile_get_texture_offset); + ClassDB::bind_method(D_METHOD("tile_set_shape_offset","id","shape_offset"),&TileSet::tile_set_shape_offset); + ClassDB::bind_method(D_METHOD("tile_get_shape_offset","id"),&TileSet::tile_get_shape_offset); + ClassDB::bind_method(D_METHOD("tile_set_region","id","region"),&TileSet::tile_set_region); + ClassDB::bind_method(D_METHOD("tile_get_region","id"),&TileSet::tile_get_region); + ClassDB::bind_method(D_METHOD("tile_set_shape","id","shape:Shape2D"),&TileSet::tile_set_shape); + ClassDB::bind_method(D_METHOD("tile_get_shape:Shape2D","id"),&TileSet::tile_get_shape); + ClassDB::bind_method(D_METHOD("tile_set_shapes","id","shapes"),&TileSet::_tile_set_shapes); + ClassDB::bind_method(D_METHOD("tile_get_shapes","id"),&TileSet::_tile_get_shapes); + ClassDB::bind_method(D_METHOD("tile_set_navigation_polygon","id","navigation_polygon:NavigationPolygon"),&TileSet::tile_set_navigation_polygon); + ClassDB::bind_method(D_METHOD("tile_get_navigation_polygon:NavigationPolygon","id"),&TileSet::tile_get_navigation_polygon); + ClassDB::bind_method(D_METHOD("tile_set_navigation_polygon_offset","id","navigation_polygon_offset"),&TileSet::tile_set_navigation_polygon_offset); + ClassDB::bind_method(D_METHOD("tile_get_navigation_polygon_offset","id"),&TileSet::tile_get_navigation_polygon_offset); + ClassDB::bind_method(D_METHOD("tile_set_light_occluder","id","light_occluder:OccluderPolygon2D"),&TileSet::tile_set_light_occluder); + ClassDB::bind_method(D_METHOD("tile_get_light_occluder:OccluderPolygon2D","id"),&TileSet::tile_get_light_occluder); + ClassDB::bind_method(D_METHOD("tile_set_occluder_offset","id","occluder_offset"),&TileSet::tile_set_occluder_offset); + ClassDB::bind_method(D_METHOD("tile_get_occluder_offset","id"),&TileSet::tile_get_occluder_offset); + + ClassDB::bind_method(D_METHOD("remove_tile","id"),&TileSet::remove_tile); + ClassDB::bind_method(D_METHOD("clear"),&TileSet::clear); + ClassDB::bind_method(D_METHOD("get_last_unused_tile_id"),&TileSet::get_last_unused_tile_id); + ClassDB::bind_method(D_METHOD("find_tile_by_name","name"),&TileSet::find_tile_by_name); + ClassDB::bind_method(D_METHOD("get_tiles_ids", "name"), &TileSet::_get_tiles_ids); } diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp index 72cb8cc906..f9233d950c 100644 --- a/scene/resources/world.cpp +++ b/scene/resources/world.cpp @@ -310,12 +310,12 @@ PhysicsDirectSpaceState *World::get_direct_space_state() { void World::_bind_methods() { - ClassDB::bind_method(_MD("get_space"),&World::get_space); - ClassDB::bind_method(_MD("get_scenario"),&World::get_scenario); - ClassDB::bind_method(_MD("set_environment","env:Environment"),&World::set_environment); - ClassDB::bind_method(_MD("get_environment:Environment"),&World::get_environment); - ClassDB::bind_method(_MD("get_direct_space_state:PhysicsDirectSpaceState"),&World::get_direct_space_state); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"environment",PROPERTY_HINT_RESOURCE_TYPE,"Environment"),_SCS("set_environment"),_SCS("get_environment")); + ClassDB::bind_method(D_METHOD("get_space"),&World::get_space); + ClassDB::bind_method(D_METHOD("get_scenario"),&World::get_scenario); + ClassDB::bind_method(D_METHOD("set_environment","env:Environment"),&World::set_environment); + ClassDB::bind_method(D_METHOD("get_environment:Environment"),&World::get_environment); + ClassDB::bind_method(D_METHOD("get_direct_space_state:PhysicsDirectSpaceState"),&World::get_direct_space_state); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"environment",PROPERTY_HINT_RESOURCE_TYPE,"Environment"),"set_environment","get_environment"); } diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index d4eff8d2b3..6b745d5d35 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -30,11 +30,11 @@ #include "servers/visual_server.h" #include "servers/physics_2d_server.h" //#include "servers/spatial_sound_2d_server.h" -#include "globals.h" +#include "global_config.h" #include "scene/2d/visibility_notifier_2d.h" #include "scene/main/viewport.h" #include "scene/2d/camera_2d.h" -#include "globals.h" +#include "global_config.h" struct SpatialIndexer2D { @@ -382,11 +382,11 @@ RID World2D::get_sound_space() { void World2D::_bind_methods() { - ClassDB::bind_method(_MD("get_canvas"),&World2D::get_canvas); - ClassDB::bind_method(_MD("get_space"),&World2D::get_space); - ClassDB::bind_method(_MD("get_sound_space"),&World2D::get_sound_space); + ClassDB::bind_method(D_METHOD("get_canvas"),&World2D::get_canvas); + ClassDB::bind_method(D_METHOD("get_space"),&World2D::get_space); + ClassDB::bind_method(D_METHOD("get_sound_space"),&World2D::get_sound_space); - ClassDB::bind_method(_MD("get_direct_space_state:Physics2DDirectSpaceState"),&World2D::get_direct_space_state); + ClassDB::bind_method(D_METHOD("get_direct_space_state:Physics2DDirectSpaceState"),&World2D::get_direct_space_state); } diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h index a9110b3bd9..c02880e9ed 100644 --- a/scene/resources/world_2d.h +++ b/scene/resources/world_2d.h @@ -31,7 +31,7 @@ #include "resource.h" #include "servers/physics_2d_server.h" -#include "globals.h" +#include "global_config.h" class SpatialIndexer2D; class VisibilityNotifier2D; diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index ffa35a93d8..d3a913680b 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -51,6 +51,7 @@ SceneStringNames::SceneStringNames() { sleeping_state_changed=StaticCString::create("sleeping_state_changed"); finished=StaticCString::create("finished"); + emission_finished=StaticCString::create("emission_finished"); animation_finished=StaticCString::create("animation_finished"); animation_changed=StaticCString::create("animation_changed"); animation_started=StaticCString::create("animation_started"); @@ -115,6 +116,7 @@ SceneStringNames::SceneStringNames() { _area_enter_tree = StaticCString::create("_area_enter_tree"); _area_exit_tree = StaticCString::create("_area_exit_tree"); + _input = StaticCString::create("_input"); _input_event=StaticCString::create("_input_event"); gui_input=StaticCString::create("gui_input"); diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index 125d391294..624a9147d5 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -80,6 +80,7 @@ public: StringName sort_children; StringName finished; + StringName emission_finished; StringName animation_finished; StringName animation_changed; StringName animation_started; diff --git a/servers/audio/audio_driver_dummy.cpp b/servers/audio/audio_driver_dummy.cpp index 6e0c0089ca..6c12957851 100644 --- a/servers/audio/audio_driver_dummy.cpp +++ b/servers/audio/audio_driver_dummy.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "audio_driver_dummy.h" -#include "globals.h" +#include "global_config.h" #include "os/os.h" diff --git a/servers/audio/audio_effect.cpp b/servers/audio/audio_effect.cpp index 372c0cbc13..b0844ff924 100644 --- a/servers/audio/audio_effect.cpp +++ b/servers/audio/audio_effect.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect.h" AudioEffect::AudioEffect() diff --git a/servers/audio/audio_effect.h b/servers/audio/audio_effect.h index 02eb258f99..db3ec91195 100644 --- a/servers/audio/audio_effect.h +++ b/servers/audio/audio_effect.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECT_H #define AUDIOEFFECT_H diff --git a/servers/audio/effects/audio_effect_amplify.cpp b/servers/audio/effects/audio_effect_amplify.cpp index d723f8d2fe..a0796f5224 100644 --- a/servers/audio/effects/audio_effect_amplify.cpp +++ b/servers/audio/effects/audio_effect_amplify.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_amplify.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_amplify.h" @@ -38,10 +66,10 @@ float AudioEffectAmplify::get_volume_db() const { void AudioEffectAmplify::_bind_methods() { - ClassDB::bind_method(_MD("set_volume_db","volume"),&AudioEffectAmplify::set_volume_db); - ClassDB::bind_method(_MD("get_volume_db"),&AudioEffectAmplify::get_volume_db); + ClassDB::bind_method(D_METHOD("set_volume_db","volume"),&AudioEffectAmplify::set_volume_db); + ClassDB::bind_method(D_METHOD("get_volume_db"),&AudioEffectAmplify::get_volume_db); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"volume_db",PROPERTY_HINT_RANGE,"-80,24,0.01"),_SCS("set_volume_db"),_SCS("get_volume_db")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"volume_db",PROPERTY_HINT_RANGE,"-80,24,0.01"),"set_volume_db","get_volume_db"); } AudioEffectAmplify::AudioEffectAmplify() diff --git a/servers/audio/effects/audio_effect_amplify.h b/servers/audio/effects/audio_effect_amplify.h index 921054e2cd..03f558e52e 100644 --- a/servers/audio/effects/audio_effect_amplify.h +++ b/servers/audio/effects/audio_effect_amplify.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_amplify.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECTAMPLIFY_H #define AUDIOEFFECTAMPLIFY_H diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp index d3105343ae..20b45b5725 100644 --- a/servers/audio/effects/audio_effect_chorus.cpp +++ b/servers/audio/effects/audio_effect_chorus.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_chorus.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_chorus.h" #include "servers/audio_server.h" #include "math_funcs.h" @@ -284,65 +312,65 @@ void AudioEffectChorus::_validate_property(PropertyInfo& property) const { void AudioEffectChorus::_bind_methods() { - ClassDB::bind_method(_MD("set_voice_count","voices"),&AudioEffectChorus::set_voice_count); - ClassDB::bind_method(_MD("get_voice_count"),&AudioEffectChorus::get_voice_count); + ClassDB::bind_method(D_METHOD("set_voice_count","voices"),&AudioEffectChorus::set_voice_count); + ClassDB::bind_method(D_METHOD("get_voice_count"),&AudioEffectChorus::get_voice_count); - ClassDB::bind_method(_MD("set_voice_delay_ms","voice_idx","delay_ms"),&AudioEffectChorus::set_voice_delay_ms); - ClassDB::bind_method(_MD("get_voice_delay_ms","voice_idx"),&AudioEffectChorus::get_voice_delay_ms); + ClassDB::bind_method(D_METHOD("set_voice_delay_ms","voice_idx","delay_ms"),&AudioEffectChorus::set_voice_delay_ms); + ClassDB::bind_method(D_METHOD("get_voice_delay_ms","voice_idx"),&AudioEffectChorus::get_voice_delay_ms); - ClassDB::bind_method(_MD("set_voice_rate_hz","voice_idx","rate_hz"),&AudioEffectChorus::set_voice_rate_hz); - ClassDB::bind_method(_MD("get_voice_rate_hz","voice_idx"),&AudioEffectChorus::get_voice_rate_hz); + ClassDB::bind_method(D_METHOD("set_voice_rate_hz","voice_idx","rate_hz"),&AudioEffectChorus::set_voice_rate_hz); + ClassDB::bind_method(D_METHOD("get_voice_rate_hz","voice_idx"),&AudioEffectChorus::get_voice_rate_hz); - ClassDB::bind_method(_MD("set_voice_depth_ms","voice_idx","depth_ms"),&AudioEffectChorus::set_voice_depth_ms); - ClassDB::bind_method(_MD("get_voice_depth_ms","voice_idx"),&AudioEffectChorus::get_voice_depth_ms); + ClassDB::bind_method(D_METHOD("set_voice_depth_ms","voice_idx","depth_ms"),&AudioEffectChorus::set_voice_depth_ms); + ClassDB::bind_method(D_METHOD("get_voice_depth_ms","voice_idx"),&AudioEffectChorus::get_voice_depth_ms); - ClassDB::bind_method(_MD("set_voice_level_db","voice_idx","level_db"),&AudioEffectChorus::set_voice_level_db); - ClassDB::bind_method(_MD("get_voice_level_db","voice_idx"),&AudioEffectChorus::get_voice_level_db); + ClassDB::bind_method(D_METHOD("set_voice_level_db","voice_idx","level_db"),&AudioEffectChorus::set_voice_level_db); + ClassDB::bind_method(D_METHOD("get_voice_level_db","voice_idx"),&AudioEffectChorus::get_voice_level_db); - ClassDB::bind_method(_MD("set_voice_cutoff_hz","voice_idx","cutoff_hz"),&AudioEffectChorus::set_voice_cutoff_hz); - ClassDB::bind_method(_MD("get_voice_cutoff_hz","voice_idx"),&AudioEffectChorus::get_voice_cutoff_hz); + ClassDB::bind_method(D_METHOD("set_voice_cutoff_hz","voice_idx","cutoff_hz"),&AudioEffectChorus::set_voice_cutoff_hz); + ClassDB::bind_method(D_METHOD("get_voice_cutoff_hz","voice_idx"),&AudioEffectChorus::get_voice_cutoff_hz); - ClassDB::bind_method(_MD("set_voice_pan","voice_idx","pan"),&AudioEffectChorus::set_voice_pan); - ClassDB::bind_method(_MD("get_voice_pan","voice_idx"),&AudioEffectChorus::get_voice_pan); + ClassDB::bind_method(D_METHOD("set_voice_pan","voice_idx","pan"),&AudioEffectChorus::set_voice_pan); + ClassDB::bind_method(D_METHOD("get_voice_pan","voice_idx"),&AudioEffectChorus::get_voice_pan); - ClassDB::bind_method(_MD("set_wet","amount"),&AudioEffectChorus::set_wet); - ClassDB::bind_method(_MD("get_wet"),&AudioEffectChorus::get_wet); + ClassDB::bind_method(D_METHOD("set_wet","amount"),&AudioEffectChorus::set_wet); + ClassDB::bind_method(D_METHOD("get_wet"),&AudioEffectChorus::get_wet); - ClassDB::bind_method(_MD("set_dry","amount"),&AudioEffectChorus::set_dry); - ClassDB::bind_method(_MD("get_dry"),&AudioEffectChorus::get_dry); + ClassDB::bind_method(D_METHOD("set_dry","amount"),&AudioEffectChorus::set_dry); + ClassDB::bind_method(D_METHOD("get_dry"),&AudioEffectChorus::get_dry); - ADD_PROPERTY(PropertyInfo(Variant::INT,"voice_count",PROPERTY_HINT_RANGE,"1,4,1"),_SCS("set_voice_count"),_SCS("get_voice_count")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"dry",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_dry"),_SCS("get_dry")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"wet",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_wet"),_SCS("get_wet")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"voice_count",PROPERTY_HINT_RANGE,"1,4,1"),"set_voice_count","get_voice_count"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dry",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_dry","get_dry"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"wet",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_wet","get_wet"); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/delay_ms",PROPERTY_HINT_RANGE,"0,50,0.01"),_SCS("set_voice_delay_ms"),_SCS("get_voice_delay_ms"),0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/rate_hz",PROPERTY_HINT_RANGE,"0.1,20,0.1"),_SCS("set_voice_rate_hz"),_SCS("get_voice_rate_hz"),0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/depth_ms",PROPERTY_HINT_RANGE,"0,20,0.01"),_SCS("set_voice_depth_ms"),_SCS("get_voice_depth_ms"),0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/level_db",PROPERTY_HINT_RANGE,"-60,24,0.1"),_SCS("set_voice_level_db"),_SCS("get_voice_level_db"),0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/cutoff_hz",PROPERTY_HINT_RANGE,"1,16000,1"),_SCS("set_voice_cutoff_hz"),_SCS("get_voice_cutoff_hz"),0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_voice_pan"),_SCS("get_voice_pan"),0); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/delay_ms",PROPERTY_HINT_RANGE,"0,50,0.01"),"set_voice_delay_ms","get_voice_delay_ms",0); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/rate_hz",PROPERTY_HINT_RANGE,"0.1,20,0.1"),"set_voice_rate_hz","get_voice_rate_hz",0); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/depth_ms",PROPERTY_HINT_RANGE,"0,20,0.01"),"set_voice_depth_ms","get_voice_depth_ms",0); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/level_db",PROPERTY_HINT_RANGE,"-60,24,0.1"),"set_voice_level_db","get_voice_level_db",0); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/cutoff_hz",PROPERTY_HINT_RANGE,"1,16000,1"),"set_voice_cutoff_hz","get_voice_cutoff_hz",0); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/1/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),"set_voice_pan","get_voice_pan",0); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/delay_ms",PROPERTY_HINT_RANGE,"0,50,0.01"),_SCS("set_voice_delay_ms"),_SCS("get_voice_delay_ms"),1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/rate_hz",PROPERTY_HINT_RANGE,"0.1,20,0.1"),_SCS("set_voice_rate_hz"),_SCS("get_voice_rate_hz"),1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/depth_ms",PROPERTY_HINT_RANGE,"0,20,0.01"),_SCS("set_voice_depth_ms"),_SCS("get_voice_depth_ms"),1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/level_db",PROPERTY_HINT_RANGE,"-60,24,0.1"),_SCS("set_voice_level_db"),_SCS("get_voice_level_db"),1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/cutoff_hz",PROPERTY_HINT_RANGE,"1,16000,1"),_SCS("set_voice_cutoff_hz"),_SCS("get_voice_cutoff_hz"),1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_voice_pan"),_SCS("get_voice_pan"),1); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/delay_ms",PROPERTY_HINT_RANGE,"0,50,0.01"),"set_voice_delay_ms","get_voice_delay_ms",1); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/rate_hz",PROPERTY_HINT_RANGE,"0.1,20,0.1"),"set_voice_rate_hz","get_voice_rate_hz",1); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/depth_ms",PROPERTY_HINT_RANGE,"0,20,0.01"),"set_voice_depth_ms","get_voice_depth_ms",1); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/level_db",PROPERTY_HINT_RANGE,"-60,24,0.1"),"set_voice_level_db","get_voice_level_db",1); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/cutoff_hz",PROPERTY_HINT_RANGE,"1,16000,1"),"set_voice_cutoff_hz","get_voice_cutoff_hz",1); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/2/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),"set_voice_pan","get_voice_pan",1); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/delay_ms",PROPERTY_HINT_RANGE,"0,50,0.01"),_SCS("set_voice_delay_ms"),_SCS("get_voice_delay_ms"),2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/rate_hz",PROPERTY_HINT_RANGE,"0.1,20,0.1"),_SCS("set_voice_rate_hz"),_SCS("get_voice_rate_hz"),2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/depth_ms",PROPERTY_HINT_RANGE,"0,20,0.01"),_SCS("set_voice_depth_ms"),_SCS("get_voice_depth_ms"),2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/level_db",PROPERTY_HINT_RANGE,"-60,24,0.1"),_SCS("set_voice_level_db"),_SCS("get_voice_level_db"),2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/cutoff_hz",PROPERTY_HINT_RANGE,"1,16000,1"),_SCS("set_voice_cutoff_hz"),_SCS("get_voice_cutoff_hz"),2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_voice_pan"),_SCS("get_voice_pan"),2); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/delay_ms",PROPERTY_HINT_RANGE,"0,50,0.01"),"set_voice_delay_ms","get_voice_delay_ms",2); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/rate_hz",PROPERTY_HINT_RANGE,"0.1,20,0.1"),"set_voice_rate_hz","get_voice_rate_hz",2); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/depth_ms",PROPERTY_HINT_RANGE,"0,20,0.01"),"set_voice_depth_ms","get_voice_depth_ms",2); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/level_db",PROPERTY_HINT_RANGE,"-60,24,0.1"),"set_voice_level_db","get_voice_level_db",2); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/cutoff_hz",PROPERTY_HINT_RANGE,"1,16000,1"),"set_voice_cutoff_hz","get_voice_cutoff_hz",2); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/3/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),"set_voice_pan","get_voice_pan",2); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/delay_ms",PROPERTY_HINT_RANGE,"0,50,0.01"),_SCS("set_voice_delay_ms"),_SCS("get_voice_delay_ms"),3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/rate_hz",PROPERTY_HINT_RANGE,"0.1,20,0.1"),_SCS("set_voice_rate_hz"),_SCS("get_voice_rate_hz"),3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/depth_ms",PROPERTY_HINT_RANGE,"0,20,0.01"),_SCS("set_voice_depth_ms"),_SCS("get_voice_depth_ms"),3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/level_db",PROPERTY_HINT_RANGE,"-60,24,0.1"),_SCS("set_voice_level_db"),_SCS("get_voice_level_db"),3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/cutoff_hz",PROPERTY_HINT_RANGE,"1,16000,1"),_SCS("set_voice_cutoff_hz"),_SCS("get_voice_cutoff_hz"),3); - ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_voice_pan"),_SCS("get_voice_pan"),3); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/delay_ms",PROPERTY_HINT_RANGE,"0,50,0.01"),"set_voice_delay_ms","get_voice_delay_ms",3); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/rate_hz",PROPERTY_HINT_RANGE,"0.1,20,0.1"),"set_voice_rate_hz","get_voice_rate_hz",3); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/depth_ms",PROPERTY_HINT_RANGE,"0,20,0.01"),"set_voice_depth_ms","get_voice_depth_ms",3); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/level_db",PROPERTY_HINT_RANGE,"-60,24,0.1"),"set_voice_level_db","get_voice_level_db",3); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/cutoff_hz",PROPERTY_HINT_RANGE,"1,16000,1"),"set_voice_cutoff_hz","get_voice_cutoff_hz",3); + ADD_PROPERTYI(PropertyInfo(Variant::REAL,"voice/4/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),"set_voice_pan","get_voice_pan",3); } diff --git a/servers/audio/effects/audio_effect_chorus.h b/servers/audio/effects/audio_effect_chorus.h index 4cfba5d61a..ae0964bd53 100644 --- a/servers/audio/effects/audio_effect_chorus.h +++ b/servers/audio/effects/audio_effect_chorus.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_chorus.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECTCHORUS_H #define AUDIOEFFECTCHORUS_H diff --git a/servers/audio/effects/audio_effect_compressor.cpp b/servers/audio/effects/audio_effect_compressor.cpp index 5d116a9543..c08302c58e 100644 --- a/servers/audio/effects/audio_effect_compressor.cpp +++ b/servers/audio/effects/audio_effect_compressor.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_compressor.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_compressor.h" #include "servers/audio_server.h" @@ -185,34 +213,34 @@ void AudioEffectCompressor::_validate_property(PropertyInfo& property) const { void AudioEffectCompressor::_bind_methods() { - ClassDB::bind_method(_MD("set_treshold","treshold"),&AudioEffectCompressor::set_treshold); - ClassDB::bind_method(_MD("get_treshold"),&AudioEffectCompressor::get_treshold); + ClassDB::bind_method(D_METHOD("set_treshold","treshold"),&AudioEffectCompressor::set_treshold); + ClassDB::bind_method(D_METHOD("get_treshold"),&AudioEffectCompressor::get_treshold); - ClassDB::bind_method(_MD("set_ratio","ratio"),&AudioEffectCompressor::set_ratio); - ClassDB::bind_method(_MD("get_ratio"),&AudioEffectCompressor::get_ratio); + ClassDB::bind_method(D_METHOD("set_ratio","ratio"),&AudioEffectCompressor::set_ratio); + ClassDB::bind_method(D_METHOD("get_ratio"),&AudioEffectCompressor::get_ratio); - ClassDB::bind_method(_MD("set_gain","gain"),&AudioEffectCompressor::set_gain); - ClassDB::bind_method(_MD("get_gain"),&AudioEffectCompressor::get_gain); + ClassDB::bind_method(D_METHOD("set_gain","gain"),&AudioEffectCompressor::set_gain); + ClassDB::bind_method(D_METHOD("get_gain"),&AudioEffectCompressor::get_gain); - ClassDB::bind_method(_MD("set_attack_us","attack_us"),&AudioEffectCompressor::set_attack_us); - ClassDB::bind_method(_MD("get_attack_us"),&AudioEffectCompressor::get_attack_us); + ClassDB::bind_method(D_METHOD("set_attack_us","attack_us"),&AudioEffectCompressor::set_attack_us); + ClassDB::bind_method(D_METHOD("get_attack_us"),&AudioEffectCompressor::get_attack_us); - ClassDB::bind_method(_MD("set_release_ms","release_ms"),&AudioEffectCompressor::set_release_ms); - ClassDB::bind_method(_MD("get_release_ms"),&AudioEffectCompressor::get_release_ms); + ClassDB::bind_method(D_METHOD("set_release_ms","release_ms"),&AudioEffectCompressor::set_release_ms); + ClassDB::bind_method(D_METHOD("get_release_ms"),&AudioEffectCompressor::get_release_ms); - ClassDB::bind_method(_MD("set_mix","mix"),&AudioEffectCompressor::set_mix); - ClassDB::bind_method(_MD("get_mix"),&AudioEffectCompressor::get_mix); + ClassDB::bind_method(D_METHOD("set_mix","mix"),&AudioEffectCompressor::set_mix); + ClassDB::bind_method(D_METHOD("get_mix"),&AudioEffectCompressor::get_mix); - ClassDB::bind_method(_MD("set_sidechain","sidechain"),&AudioEffectCompressor::set_sidechain); - ClassDB::bind_method(_MD("get_sidechain"),&AudioEffectCompressor::get_sidechain); + ClassDB::bind_method(D_METHOD("set_sidechain","sidechain"),&AudioEffectCompressor::set_sidechain); + ClassDB::bind_method(D_METHOD("get_sidechain"),&AudioEffectCompressor::get_sidechain); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"treshold",PROPERTY_HINT_RANGE,"-60,0,0.1"),_SCS("set_treshold"),_SCS("get_treshold")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ratio",PROPERTY_HINT_RANGE,"1,48,0.1"),_SCS("set_ratio"),_SCS("get_ratio")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"gain",PROPERTY_HINT_RANGE,"-20,20,0.1"),_SCS("set_gain"),_SCS("get_gain")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"attack_us",PROPERTY_HINT_RANGE,"20,2000,1"),_SCS("set_attack_us"),_SCS("get_attack_us")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"release_ms",PROPERTY_HINT_RANGE,"20,2000,1"),_SCS("set_release_ms"),_SCS("get_release_ms")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"mix",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_mix"),_SCS("get_mix")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"sidechain",PROPERTY_HINT_ENUM),_SCS("set_sidechain"),_SCS("get_sidechain")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"treshold",PROPERTY_HINT_RANGE,"-60,0,0.1"),"set_treshold","get_treshold"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ratio",PROPERTY_HINT_RANGE,"1,48,0.1"),"set_ratio","get_ratio"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"gain",PROPERTY_HINT_RANGE,"-20,20,0.1"),"set_gain","get_gain"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"attack_us",PROPERTY_HINT_RANGE,"20,2000,1"),"set_attack_us","get_attack_us"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"release_ms",PROPERTY_HINT_RANGE,"20,2000,1"),"set_release_ms","get_release_ms"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"mix",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_mix","get_mix"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"sidechain",PROPERTY_HINT_ENUM),"set_sidechain","get_sidechain"); } diff --git a/servers/audio/effects/audio_effect_compressor.h b/servers/audio/effects/audio_effect_compressor.h index eb06b3db77..3988ad1526 100644 --- a/servers/audio/effects/audio_effect_compressor.h +++ b/servers/audio/effects/audio_effect_compressor.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_compressor.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECTCOMPRESSOR_H #define AUDIOEFFECTCOMPRESSOR_H diff --git a/servers/audio/effects/audio_effect_delay.cpp b/servers/audio/effects/audio_effect_delay.cpp index aae2657a63..a6d2048896 100644 --- a/servers/audio/effects/audio_effect_delay.cpp +++ b/servers/audio/effects/audio_effect_delay.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_delay.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_delay.h" #include "servers/audio_server.h" #include "math_funcs.h" @@ -244,62 +272,62 @@ float AudioEffectDelay::get_feedback_lowpass() const{ void AudioEffectDelay::_bind_methods() { - ClassDB::bind_method(_MD("set_dry","amount"),&AudioEffectDelay::set_dry); - ClassDB::bind_method(_MD("get_dry"),&AudioEffectDelay::get_dry); + ClassDB::bind_method(D_METHOD("set_dry","amount"),&AudioEffectDelay::set_dry); + ClassDB::bind_method(D_METHOD("get_dry"),&AudioEffectDelay::get_dry); - ClassDB::bind_method(_MD("set_tap1_active","amount"),&AudioEffectDelay::set_tap1_active); - ClassDB::bind_method(_MD("is_tap1_active"),&AudioEffectDelay::is_tap1_active); + ClassDB::bind_method(D_METHOD("set_tap1_active","amount"),&AudioEffectDelay::set_tap1_active); + ClassDB::bind_method(D_METHOD("is_tap1_active"),&AudioEffectDelay::is_tap1_active); - ClassDB::bind_method(_MD("set_tap1_delay_ms","amount"),&AudioEffectDelay::set_tap1_delay_ms); - ClassDB::bind_method(_MD("get_tap1_delay_ms"),&AudioEffectDelay::get_tap1_delay_ms); + ClassDB::bind_method(D_METHOD("set_tap1_delay_ms","amount"),&AudioEffectDelay::set_tap1_delay_ms); + ClassDB::bind_method(D_METHOD("get_tap1_delay_ms"),&AudioEffectDelay::get_tap1_delay_ms); - ClassDB::bind_method(_MD("set_tap1_level_db","amount"),&AudioEffectDelay::set_tap1_level_db); - ClassDB::bind_method(_MD("get_tap1_level_db"),&AudioEffectDelay::get_tap1_level_db); + ClassDB::bind_method(D_METHOD("set_tap1_level_db","amount"),&AudioEffectDelay::set_tap1_level_db); + ClassDB::bind_method(D_METHOD("get_tap1_level_db"),&AudioEffectDelay::get_tap1_level_db); - ClassDB::bind_method(_MD("set_tap1_pan","amount"),&AudioEffectDelay::set_tap1_pan); - ClassDB::bind_method(_MD("get_tap1_pan"),&AudioEffectDelay::get_tap1_pan); + ClassDB::bind_method(D_METHOD("set_tap1_pan","amount"),&AudioEffectDelay::set_tap1_pan); + ClassDB::bind_method(D_METHOD("get_tap1_pan"),&AudioEffectDelay::get_tap1_pan); - ClassDB::bind_method(_MD("set_tap2_active","amount"),&AudioEffectDelay::set_tap2_active); - ClassDB::bind_method(_MD("is_tap2_active"),&AudioEffectDelay::is_tap2_active); + ClassDB::bind_method(D_METHOD("set_tap2_active","amount"),&AudioEffectDelay::set_tap2_active); + ClassDB::bind_method(D_METHOD("is_tap2_active"),&AudioEffectDelay::is_tap2_active); - ClassDB::bind_method(_MD("set_tap2_delay_ms","amount"),&AudioEffectDelay::set_tap2_delay_ms); - ClassDB::bind_method(_MD("get_tap2_delay_ms"),&AudioEffectDelay::get_tap2_delay_ms); + ClassDB::bind_method(D_METHOD("set_tap2_delay_ms","amount"),&AudioEffectDelay::set_tap2_delay_ms); + ClassDB::bind_method(D_METHOD("get_tap2_delay_ms"),&AudioEffectDelay::get_tap2_delay_ms); - ClassDB::bind_method(_MD("set_tap2_level_db","amount"),&AudioEffectDelay::set_tap2_level_db); - ClassDB::bind_method(_MD("get_tap2_level_db"),&AudioEffectDelay::get_tap2_level_db); + ClassDB::bind_method(D_METHOD("set_tap2_level_db","amount"),&AudioEffectDelay::set_tap2_level_db); + ClassDB::bind_method(D_METHOD("get_tap2_level_db"),&AudioEffectDelay::get_tap2_level_db); - ClassDB::bind_method(_MD("set_tap2_pan","amount"),&AudioEffectDelay::set_tap2_pan); - ClassDB::bind_method(_MD("get_tap2_pan"),&AudioEffectDelay::get_tap2_pan); + ClassDB::bind_method(D_METHOD("set_tap2_pan","amount"),&AudioEffectDelay::set_tap2_pan); + ClassDB::bind_method(D_METHOD("get_tap2_pan"),&AudioEffectDelay::get_tap2_pan); - ClassDB::bind_method(_MD("set_feedback_active","amount"),&AudioEffectDelay::set_feedback_active); - ClassDB::bind_method(_MD("is_feedback_active"),&AudioEffectDelay::is_feedback_active); + ClassDB::bind_method(D_METHOD("set_feedback_active","amount"),&AudioEffectDelay::set_feedback_active); + ClassDB::bind_method(D_METHOD("is_feedback_active"),&AudioEffectDelay::is_feedback_active); - ClassDB::bind_method(_MD("set_feedback_delay_ms","amount"),&AudioEffectDelay::set_feedback_delay_ms); - ClassDB::bind_method(_MD("get_feedback_delay_ms"),&AudioEffectDelay::get_feedback_delay_ms); + ClassDB::bind_method(D_METHOD("set_feedback_delay_ms","amount"),&AudioEffectDelay::set_feedback_delay_ms); + ClassDB::bind_method(D_METHOD("get_feedback_delay_ms"),&AudioEffectDelay::get_feedback_delay_ms); - ClassDB::bind_method(_MD("set_feedback_level_db","amount"),&AudioEffectDelay::set_feedback_level_db); - ClassDB::bind_method(_MD("get_feedback_level_db"),&AudioEffectDelay::get_feedback_level_db); + ClassDB::bind_method(D_METHOD("set_feedback_level_db","amount"),&AudioEffectDelay::set_feedback_level_db); + ClassDB::bind_method(D_METHOD("get_feedback_level_db"),&AudioEffectDelay::get_feedback_level_db); - ClassDB::bind_method(_MD("set_feedback_lowpass","amount"),&AudioEffectDelay::set_feedback_lowpass); - ClassDB::bind_method(_MD("get_feedback_lowpass"),&AudioEffectDelay::get_feedback_lowpass); + ClassDB::bind_method(D_METHOD("set_feedback_lowpass","amount"),&AudioEffectDelay::set_feedback_lowpass); + ClassDB::bind_method(D_METHOD("get_feedback_lowpass"),&AudioEffectDelay::get_feedback_lowpass); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"dry",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_dry"),_SCS("get_dry")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dry",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_dry","get_dry"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"tap1/active"),_SCS("set_tap1_active"),_SCS("is_tap1_active")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap1/delay_ms",PROPERTY_HINT_RANGE,"0,1500,1"),_SCS("set_tap1_delay_ms"),_SCS("get_tap1_delay_ms")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap1/level_db",PROPERTY_HINT_RANGE,"-60,0,0.01"),_SCS("set_tap1_level_db"),_SCS("get_tap1_level_db")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap1/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_tap1_pan"),_SCS("get_tap1_pan")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"tap1/active"),"set_tap1_active","is_tap1_active"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap1/delay_ms",PROPERTY_HINT_RANGE,"0,1500,1"),"set_tap1_delay_ms","get_tap1_delay_ms"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap1/level_db",PROPERTY_HINT_RANGE,"-60,0,0.01"),"set_tap1_level_db","get_tap1_level_db"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap1/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),"set_tap1_pan","get_tap1_pan"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"tap2/active"),_SCS("set_tap2_active"),_SCS("is_tap2_active")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap2/delay_ms",PROPERTY_HINT_RANGE,"0,1500,1"),_SCS("set_tap2_delay_ms"),_SCS("get_tap2_delay_ms")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap2/level_db",PROPERTY_HINT_RANGE,"-60,0,0.01"),_SCS("set_tap2_level_db"),_SCS("get_tap2_level_db")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap2/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_tap2_pan"),_SCS("get_tap2_pan")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"tap2/active"),"set_tap2_active","is_tap2_active"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap2/delay_ms",PROPERTY_HINT_RANGE,"0,1500,1"),"set_tap2_delay_ms","get_tap2_delay_ms"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap2/level_db",PROPERTY_HINT_RANGE,"-60,0,0.01"),"set_tap2_level_db","get_tap2_level_db"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"tap2/pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),"set_tap2_pan","get_tap2_pan"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"feedback/active"),_SCS("set_feedback_active"),_SCS("is_feedback_active")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"feedback/delay_ms",PROPERTY_HINT_RANGE,"0,1500,1"),_SCS("set_feedback_delay_ms"),_SCS("get_feedback_delay_ms")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"feedback/level_db",PROPERTY_HINT_RANGE,"-60,0,0.01"),_SCS("set_feedback_level_db"),_SCS("get_feedback_level_db")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"feedback/lowpass",PROPERTY_HINT_RANGE,"1,16000,1"),_SCS("set_feedback_lowpass"),_SCS("get_feedback_lowpass")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"feedback/active"),"set_feedback_active","is_feedback_active"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"feedback/delay_ms",PROPERTY_HINT_RANGE,"0,1500,1"),"set_feedback_delay_ms","get_feedback_delay_ms"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"feedback/level_db",PROPERTY_HINT_RANGE,"-60,0,0.01"),"set_feedback_level_db","get_feedback_level_db"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"feedback/lowpass",PROPERTY_HINT_RANGE,"1,16000,1"),"set_feedback_lowpass","get_feedback_lowpass"); } diff --git a/servers/audio/effects/audio_effect_delay.h b/servers/audio/effects/audio_effect_delay.h index 645561138b..3e9f7f0584 100644 --- a/servers/audio/effects/audio_effect_delay.h +++ b/servers/audio/effects/audio_effect_delay.h @@ -1,5 +1,33 @@ -#ifndef AUDIOEFFECTECHO_H -#define AUDIOEFFECTECHO_H +/*************************************************************************/ +/* audio_effect_delay.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECTDELAY_H +#define AUDIOEFFECTDELAY_H #include "servers/audio/audio_effect.h" @@ -109,4 +137,4 @@ public: }; -#endif // AUDIOEFFECTECHO_H +#endif // AUDIOEFFECTDELAY_H diff --git a/servers/audio/effects/audio_effect_distortion.cpp b/servers/audio/effects/audio_effect_distortion.cpp index 3ba409b0a5..b72cd8e0a6 100644 --- a/servers/audio/effects/audio_effect_distortion.cpp +++ b/servers/audio/effects/audio_effect_distortion.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_distortion.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_distortion.h" #include "servers/audio_server.h" #include "math_funcs.h" @@ -137,27 +165,27 @@ float AudioEffectDistortion::get_post_gain() const{ void AudioEffectDistortion::_bind_methods() { - ClassDB::bind_method(_MD("set_mode","mode"),&AudioEffectDistortion::set_mode); - ClassDB::bind_method(_MD("get_mode"),&AudioEffectDistortion::get_mode); + ClassDB::bind_method(D_METHOD("set_mode","mode"),&AudioEffectDistortion::set_mode); + ClassDB::bind_method(D_METHOD("get_mode"),&AudioEffectDistortion::get_mode); - ClassDB::bind_method(_MD("set_pre_gain","pre_gain"),&AudioEffectDistortion::set_pre_gain); - ClassDB::bind_method(_MD("get_pre_gain"),&AudioEffectDistortion::get_pre_gain); + ClassDB::bind_method(D_METHOD("set_pre_gain","pre_gain"),&AudioEffectDistortion::set_pre_gain); + ClassDB::bind_method(D_METHOD("get_pre_gain"),&AudioEffectDistortion::get_pre_gain); - ClassDB::bind_method(_MD("set_keep_hf_hz","keep_hf_hz"),&AudioEffectDistortion::set_keep_hf_hz); - ClassDB::bind_method(_MD("get_keep_hf_hz"),&AudioEffectDistortion::get_keep_hf_hz); + ClassDB::bind_method(D_METHOD("set_keep_hf_hz","keep_hf_hz"),&AudioEffectDistortion::set_keep_hf_hz); + ClassDB::bind_method(D_METHOD("get_keep_hf_hz"),&AudioEffectDistortion::get_keep_hf_hz); - ClassDB::bind_method(_MD("set_drive","drive"),&AudioEffectDistortion::set_drive); - ClassDB::bind_method(_MD("get_drive"),&AudioEffectDistortion::get_drive); + ClassDB::bind_method(D_METHOD("set_drive","drive"),&AudioEffectDistortion::set_drive); + ClassDB::bind_method(D_METHOD("get_drive"),&AudioEffectDistortion::get_drive); - ClassDB::bind_method(_MD("set_post_gain","post_gain"),&AudioEffectDistortion::set_post_gain); - ClassDB::bind_method(_MD("get_post_gain"),&AudioEffectDistortion::get_post_gain); + ClassDB::bind_method(D_METHOD("set_post_gain","post_gain"),&AudioEffectDistortion::set_post_gain); + ClassDB::bind_method(D_METHOD("get_post_gain"),&AudioEffectDistortion::get_post_gain); - ADD_PROPERTY(PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Clip,ATan,LoFi,Overdrive,WaveShape"),_SCS("set_mode"),_SCS("get_mode")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"pre_gain",PROPERTY_HINT_RANGE,"-60,60,0.01"),_SCS("set_pre_gain"),_SCS("get_pre_gain")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"keep_hf_hz",PROPERTY_HINT_RANGE,"1,20000,1"),_SCS("set_keep_hf_hz"),_SCS("get_keep_hf_hz")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"drive",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drive"),_SCS("get_drive")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"post_gain",PROPERTY_HINT_RANGE,"-80,24,0.01"),_SCS("set_post_gain"),_SCS("get_post_gain")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Clip,ATan,LoFi,Overdrive,WaveShape"),"set_mode","get_mode"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"pre_gain",PROPERTY_HINT_RANGE,"-60,60,0.01"),"set_pre_gain","get_pre_gain"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"keep_hf_hz",PROPERTY_HINT_RANGE,"1,20000,1"),"set_keep_hf_hz","get_keep_hf_hz"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"drive",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_drive","get_drive"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"post_gain",PROPERTY_HINT_RANGE,"-80,24,0.01"),"set_post_gain","get_post_gain"); } AudioEffectDistortion::AudioEffectDistortion() diff --git a/servers/audio/effects/audio_effect_distortion.h b/servers/audio/effects/audio_effect_distortion.h index 1d2433faeb..c4388f0256 100644 --- a/servers/audio/effects/audio_effect_distortion.h +++ b/servers/audio/effects/audio_effect_distortion.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_distortion.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECTDISTORTION_H #define AUDIOEFFECTDISTORTION_H diff --git a/servers/audio/effects/audio_effect_eq.cpp b/servers/audio/effects/audio_effect_eq.cpp index 3c6a684224..2caec9e49e 100644 --- a/servers/audio/effects/audio_effect_eq.cpp +++ b/servers/audio/effects/audio_effect_eq.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_eq.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_eq.h" #include "servers/audio_server.h" @@ -100,9 +128,9 @@ void AudioEffectEQ::_get_property_list( List<PropertyInfo> *p_list) const{ void AudioEffectEQ::_bind_methods() { - ClassDB::bind_method(_MD("set_band_gain_db","band_idx","volume_db"),&AudioEffectEQ::set_band_gain_db); - ClassDB::bind_method(_MD("get_band_gain_db","band_idx"),&AudioEffectEQ::get_band_gain_db); - ClassDB::bind_method(_MD("get_band_count"),&AudioEffectEQ::get_band_count); + ClassDB::bind_method(D_METHOD("set_band_gain_db","band_idx","volume_db"),&AudioEffectEQ::set_band_gain_db); + ClassDB::bind_method(D_METHOD("get_band_gain_db","band_idx"),&AudioEffectEQ::get_band_gain_db); + ClassDB::bind_method(D_METHOD("get_band_count"),&AudioEffectEQ::get_band_count); } diff --git a/servers/audio/effects/audio_effect_eq.h b/servers/audio/effects/audio_effect_eq.h index 3fcc2c0056..2f577ffd20 100644 --- a/servers/audio/effects/audio_effect_eq.h +++ b/servers/audio/effects/audio_effect_eq.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_eq.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECTEQ_H #define AUDIOEFFECTEQ_H diff --git a/servers/audio/effects/audio_effect_filter.cpp b/servers/audio/effects/audio_effect_filter.cpp index 4e54ea1f3e..c854842943 100644 --- a/servers/audio/effects/audio_effect_filter.cpp +++ b/servers/audio/effects/audio_effect_filter.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_filter.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_filter.h" #include "servers/audio_server.h" @@ -122,22 +150,22 @@ AudioEffectFilter::FilterDB AudioEffectFilter::get_db() const { void AudioEffectFilter::_bind_methods() { - ClassDB::bind_method(_MD("set_cutoff","freq"),&AudioEffectFilter::set_cutoff); - ClassDB::bind_method(_MD("get_cutoff"),&AudioEffectFilter::get_cutoff); + ClassDB::bind_method(D_METHOD("set_cutoff","freq"),&AudioEffectFilter::set_cutoff); + ClassDB::bind_method(D_METHOD("get_cutoff"),&AudioEffectFilter::get_cutoff); - ClassDB::bind_method(_MD("set_resonance","amount"),&AudioEffectFilter::set_resonance); - ClassDB::bind_method(_MD("get_resonance"),&AudioEffectFilter::get_resonance); + ClassDB::bind_method(D_METHOD("set_resonance","amount"),&AudioEffectFilter::set_resonance); + ClassDB::bind_method(D_METHOD("get_resonance"),&AudioEffectFilter::get_resonance); - ClassDB::bind_method(_MD("set_gain","amount"),&AudioEffectFilter::set_gain); - ClassDB::bind_method(_MD("get_gain"),&AudioEffectFilter::get_gain); + ClassDB::bind_method(D_METHOD("set_gain","amount"),&AudioEffectFilter::set_gain); + ClassDB::bind_method(D_METHOD("get_gain"),&AudioEffectFilter::get_gain); - ClassDB::bind_method(_MD("set_db","amount"),&AudioEffectFilter::set_db); - ClassDB::bind_method(_MD("get_db"),&AudioEffectFilter::get_db); + ClassDB::bind_method(D_METHOD("set_db","amount"),&AudioEffectFilter::set_db); + ClassDB::bind_method(D_METHOD("get_db"),&AudioEffectFilter::get_db); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"cutoff_hz",PROPERTY_HINT_RANGE,"1,40000,0.1"),_SCS("set_cutoff"),_SCS("get_cutoff")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"resonance",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_resonance"),_SCS("get_resonance")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"gain",PROPERTY_HINT_RANGE,"0,4,0.01"),_SCS("set_gain"),_SCS("get_gain")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"dB",PROPERTY_HINT_ENUM,"6db,12db,18db,24db"),_SCS("set_db"),_SCS("get_db")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"cutoff_hz",PROPERTY_HINT_RANGE,"1,40000,0.1"),"set_cutoff","get_cutoff"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"resonance",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_resonance","get_resonance"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"gain",PROPERTY_HINT_RANGE,"0,4,0.01"),"set_gain","get_gain"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"dB",PROPERTY_HINT_ENUM,"6db,12db,18db,24db"),"set_db","get_db"); } AudioEffectFilter::AudioEffectFilter(AudioFilterSW::Mode p_mode) diff --git a/servers/audio/effects/audio_effect_filter.h b/servers/audio/effects/audio_effect_filter.h index d0bc7a446a..0215f5a141 100644 --- a/servers/audio/effects/audio_effect_filter.h +++ b/servers/audio/effects/audio_effect_filter.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_filter.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECTFILTER_H #define AUDIOEFFECTFILTER_H diff --git a/servers/audio/effects/audio_effect_limiter.cpp b/servers/audio/effects/audio_effect_limiter.cpp index 5cd02682ab..a44bb51762 100644 --- a/servers/audio/effects/audio_effect_limiter.cpp +++ b/servers/audio/effects/audio_effect_limiter.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_limiter.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_limiter.h" void AudioEffectLimiterInstance::process(const AudioFrame *p_src_frames,AudioFrame *p_dst_frames,int p_frame_count) { @@ -97,22 +125,22 @@ float AudioEffectLimiter::get_soft_clip_ratio() const{ void AudioEffectLimiter::_bind_methods() { - ClassDB::bind_method(_MD("set_ceiling_db","ceiling"),&AudioEffectLimiter::set_ceiling_db); - ClassDB::bind_method(_MD("get_ceiling_db"),&AudioEffectLimiter::get_ceiling_db); + ClassDB::bind_method(D_METHOD("set_ceiling_db","ceiling"),&AudioEffectLimiter::set_ceiling_db); + ClassDB::bind_method(D_METHOD("get_ceiling_db"),&AudioEffectLimiter::get_ceiling_db); - ClassDB::bind_method(_MD("set_treshold_db","treshold"),&AudioEffectLimiter::set_treshold_db); - ClassDB::bind_method(_MD("get_treshold_db"),&AudioEffectLimiter::get_treshold_db); + ClassDB::bind_method(D_METHOD("set_treshold_db","treshold"),&AudioEffectLimiter::set_treshold_db); + ClassDB::bind_method(D_METHOD("get_treshold_db"),&AudioEffectLimiter::get_treshold_db); - ClassDB::bind_method(_MD("set_soft_clip_db","soft_clip"),&AudioEffectLimiter::set_soft_clip_db); - ClassDB::bind_method(_MD("get_soft_clip_db"),&AudioEffectLimiter::get_soft_clip_db); + ClassDB::bind_method(D_METHOD("set_soft_clip_db","soft_clip"),&AudioEffectLimiter::set_soft_clip_db); + ClassDB::bind_method(D_METHOD("get_soft_clip_db"),&AudioEffectLimiter::get_soft_clip_db); - ClassDB::bind_method(_MD("set_soft_clip_ratio","soft_clip"),&AudioEffectLimiter::set_soft_clip_ratio); - ClassDB::bind_method(_MD("get_soft_clip_ratio"),&AudioEffectLimiter::get_soft_clip_ratio); + ClassDB::bind_method(D_METHOD("set_soft_clip_ratio","soft_clip"),&AudioEffectLimiter::set_soft_clip_ratio); + ClassDB::bind_method(D_METHOD("get_soft_clip_ratio"),&AudioEffectLimiter::get_soft_clip_ratio); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"ceiling_db",PROPERTY_HINT_RANGE,"-20,-0.1,0.1"),_SCS("set_ceiling_db"),_SCS("get_ceiling_db")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"treshold_db",PROPERTY_HINT_RANGE,"-30,0,0.1"),_SCS("set_treshold_db"),_SCS("get_treshold_db")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"soft_clip_db",PROPERTY_HINT_RANGE,"0,6,0.1"),_SCS("set_soft_clip_db"),_SCS("get_soft_clip_db")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"soft_clip_ratio",PROPERTY_HINT_RANGE,"3,20,0.1"),_SCS("set_soft_clip_ratio"),_SCS("get_soft_clip_ratio")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ceiling_db",PROPERTY_HINT_RANGE,"-20,-0.1,0.1"),"set_ceiling_db","get_ceiling_db"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"treshold_db",PROPERTY_HINT_RANGE,"-30,0,0.1"),"set_treshold_db","get_treshold_db"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"soft_clip_db",PROPERTY_HINT_RANGE,"0,6,0.1"),"set_soft_clip_db","get_soft_clip_db"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"soft_clip_ratio",PROPERTY_HINT_RANGE,"3,20,0.1"),"set_soft_clip_ratio","get_soft_clip_ratio"); } AudioEffectLimiter::AudioEffectLimiter() diff --git a/servers/audio/effects/audio_effect_limiter.h b/servers/audio/effects/audio_effect_limiter.h index b0d7321205..12639498d9 100644 --- a/servers/audio/effects/audio_effect_limiter.h +++ b/servers/audio/effects/audio_effect_limiter.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_limiter.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIO_EFFECT_LIMITER_H #define AUDIO_EFFECT_LIMITER_H diff --git a/servers/audio/effects/audio_effect_panner.cpp b/servers/audio/effects/audio_effect_panner.cpp index e296b0d998..937575a5b5 100644 --- a/servers/audio/effects/audio_effect_panner.cpp +++ b/servers/audio/effects/audio_effect_panner.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_panner.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_panner.h" @@ -35,10 +63,10 @@ float AudioEffectPanner::get_pan() const { void AudioEffectPanner::_bind_methods() { - ClassDB::bind_method(_MD("set_pan","cpanume"),&AudioEffectPanner::set_pan); - ClassDB::bind_method(_MD("get_pan"),&AudioEffectPanner::get_pan); + ClassDB::bind_method(D_METHOD("set_pan","cpanume"),&AudioEffectPanner::set_pan); + ClassDB::bind_method(D_METHOD("get_pan"),&AudioEffectPanner::get_pan); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_pan"),_SCS("get_pan")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"pan",PROPERTY_HINT_RANGE,"-1,1,0.01"),"set_pan","get_pan"); } AudioEffectPanner::AudioEffectPanner() diff --git a/servers/audio/effects/audio_effect_panner.h b/servers/audio/effects/audio_effect_panner.h index bc1bb00815..999b5f5649 100644 --- a/servers/audio/effects/audio_effect_panner.h +++ b/servers/audio/effects/audio_effect_panner.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_panner.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECTPANNER_H #define AUDIOEFFECTPANNER_H diff --git a/servers/audio/effects/audio_effect_phaser.cpp b/servers/audio/effects/audio_effect_phaser.cpp index bfce608603..c9576404f1 100644 --- a/servers/audio/effects/audio_effect_phaser.cpp +++ b/servers/audio/effects/audio_effect_phaser.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_phaser.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_phaser.h" #include "servers/audio_server.h" #include "math_funcs.h" @@ -115,26 +143,26 @@ float AudioEffectPhaser::get_depth() const { void AudioEffectPhaser::_bind_methods() { - ClassDB::bind_method(_MD("set_range_min_hz","hz"),&AudioEffectPhaser::set_range_min_hz); - ClassDB::bind_method(_MD("get_range_min_hz"),&AudioEffectPhaser::get_range_min_hz); + ClassDB::bind_method(D_METHOD("set_range_min_hz","hz"),&AudioEffectPhaser::set_range_min_hz); + ClassDB::bind_method(D_METHOD("get_range_min_hz"),&AudioEffectPhaser::get_range_min_hz); - ClassDB::bind_method(_MD("set_range_max_hz","hz"),&AudioEffectPhaser::set_range_max_hz); - ClassDB::bind_method(_MD("get_range_max_hz"),&AudioEffectPhaser::get_range_max_hz); + ClassDB::bind_method(D_METHOD("set_range_max_hz","hz"),&AudioEffectPhaser::set_range_max_hz); + ClassDB::bind_method(D_METHOD("get_range_max_hz"),&AudioEffectPhaser::get_range_max_hz); - ClassDB::bind_method(_MD("set_rate_hz","hz"),&AudioEffectPhaser::set_rate_hz); - ClassDB::bind_method(_MD("get_rate_hz"),&AudioEffectPhaser::get_rate_hz); + ClassDB::bind_method(D_METHOD("set_rate_hz","hz"),&AudioEffectPhaser::set_rate_hz); + ClassDB::bind_method(D_METHOD("get_rate_hz"),&AudioEffectPhaser::get_rate_hz); - ClassDB::bind_method(_MD("set_feedback","fbk"),&AudioEffectPhaser::set_feedback); - ClassDB::bind_method(_MD("get_feedback"),&AudioEffectPhaser::get_feedback); + ClassDB::bind_method(D_METHOD("set_feedback","fbk"),&AudioEffectPhaser::set_feedback); + ClassDB::bind_method(D_METHOD("get_feedback"),&AudioEffectPhaser::get_feedback); - ClassDB::bind_method(_MD("set_depth","depth"),&AudioEffectPhaser::set_depth); - ClassDB::bind_method(_MD("get_depth"),&AudioEffectPhaser::get_depth); + ClassDB::bind_method(D_METHOD("set_depth","depth"),&AudioEffectPhaser::set_depth); + ClassDB::bind_method(D_METHOD("get_depth"),&AudioEffectPhaser::get_depth); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"range_min_hz",PROPERTY_HINT_RANGE,"10,10000"),_SCS("set_range_min_hz"),_SCS("get_range_min_hz")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"range_max_hz",PROPERTY_HINT_RANGE,"10,10000"),_SCS("set_range_max_hz"),_SCS("get_range_max_hz")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"rate_hz",PROPERTY_HINT_RANGE,"0.01,20"),_SCS("set_rate_hz"),_SCS("get_rate_hz")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"feedback",PROPERTY_HINT_RANGE,"0.1,0.9,0.1"),_SCS("set_feedback"),_SCS("get_feedback")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"depth",PROPERTY_HINT_RANGE,"0.1,4,0.1"),_SCS("set_depth"),_SCS("get_depth")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"range_min_hz",PROPERTY_HINT_RANGE,"10,10000"),"set_range_min_hz","get_range_min_hz"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"range_max_hz",PROPERTY_HINT_RANGE,"10,10000"),"set_range_max_hz","get_range_max_hz"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"rate_hz",PROPERTY_HINT_RANGE,"0.01,20"),"set_rate_hz","get_rate_hz"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"feedback",PROPERTY_HINT_RANGE,"0.1,0.9,0.1"),"set_feedback","get_feedback"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"depth",PROPERTY_HINT_RANGE,"0.1,4,0.1"),"set_depth","get_depth"); } diff --git a/servers/audio/effects/audio_effect_phaser.h b/servers/audio/effects/audio_effect_phaser.h index 53a8ab8bd8..a7294183f6 100644 --- a/servers/audio/effects/audio_effect_phaser.h +++ b/servers/audio/effects/audio_effect_phaser.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_phaser.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIO_EFFECT_PHASER_H #define AUDIO_EFFECT_PHASER_H diff --git a/servers/audio/effects/audio_effect_pitch_shift.cpp b/servers/audio/effects/audio_effect_pitch_shift.cpp index 49a14cda04..e00755e1a0 100644 --- a/servers/audio/effects/audio_effect_pitch_shift.cpp +++ b/servers/audio/effects/audio_effect_pitch_shift.cpp @@ -1,6 +1,39 @@ +/*************************************************************************/ +/* audio_effect_pitch_shift.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_pitch_shift.h" + #include "servers/audio_server.h" #include "math_funcs.h" + +/* Thirdparty code, so disable clang-format with Godot style */ +/* clang-format off */ + /**************************************************************************** * * NAME: smbPitchShift.cpp @@ -39,7 +72,6 @@ * *****************************************************************************/ - void SMBPitchShift::PitchShift(float pitchShift, long numSampsToProcess, long fftFrameSize, long osamp, float sampleRate, float *indata, float *outdata,int stride) { @@ -220,7 +252,7 @@ void SMBPitchShift::smbFft(float *fftBuffer, long fftFrameSize, long sign) *p1 = *p2; *p2 = temp; } } - for (k = 0, le = 2; k < (long)(log(fftFrameSize)/log(2.)+.5); k++) { + for (k = 0, le = 2; k < (long)(log((double)fftFrameSize)/log(2.)+.5); k++) { le <<= 1; le2 = le>>1; ur = 1.0; @@ -246,6 +278,8 @@ void SMBPitchShift::smbFft(float *fftBuffer, long fftFrameSize, long sign) } } +/* Godot code again */ +/* clang-format on */ void AudioEffectPitchShiftInstance::process(const AudioFrame *p_src_frames,AudioFrame *p_dst_frames,int p_frame_count) { @@ -285,10 +319,10 @@ float AudioEffectPitchShift::get_pitch_scale() const { void AudioEffectPitchShift::_bind_methods() { - ClassDB::bind_method(_MD("set_pitch_scale","rate"),&AudioEffectPitchShift::set_pitch_scale); - ClassDB::bind_method(_MD("get_pitch_scale"),&AudioEffectPitchShift::get_pitch_scale); + ClassDB::bind_method(D_METHOD("set_pitch_scale","rate"),&AudioEffectPitchShift::set_pitch_scale); + ClassDB::bind_method(D_METHOD("get_pitch_scale"),&AudioEffectPitchShift::get_pitch_scale); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"pitch_scale",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_pitch_scale"),_SCS("get_pitch_scale")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"pitch_scale",PROPERTY_HINT_RANGE,"0.01,16,0.01"),"set_pitch_scale","get_pitch_scale"); } diff --git a/servers/audio/effects/audio_effect_pitch_shift.h b/servers/audio/effects/audio_effect_pitch_shift.h index d1343a0745..1320976f5f 100644 --- a/servers/audio/effects/audio_effect_pitch_shift.h +++ b/servers/audio/effects/audio_effect_pitch_shift.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_pitch_shift.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIO_EFFECT_PITCH_SHIFT_H #define AUDIO_EFFECT_PITCH_SHIFT_H diff --git a/servers/audio/effects/audio_effect_reverb.cpp b/servers/audio/effects/audio_effect_reverb.cpp index 749814fd76..d668c63e8e 100644 --- a/servers/audio/effects/audio_effect_reverb.cpp +++ b/servers/audio/effects/audio_effect_reverb.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_reverb.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_reverb.h" #include "servers/audio_server.h" void AudioEffectReverbInstance::process(const AudioFrame *p_src_frames,AudioFrame *p_dst_frames,int p_frame_count) { @@ -132,41 +160,41 @@ float AudioEffectReverb::get_hpf() const { void AudioEffectReverb::_bind_methods() { - ClassDB::bind_method(_MD("set_predelay_msec","msec"),&AudioEffectReverb::set_predelay_msec); - ClassDB::bind_method(_MD("get_predelay_msec"),&AudioEffectReverb::get_predelay_msec); + ClassDB::bind_method(D_METHOD("set_predelay_msec","msec"),&AudioEffectReverb::set_predelay_msec); + ClassDB::bind_method(D_METHOD("get_predelay_msec"),&AudioEffectReverb::get_predelay_msec); - ClassDB::bind_method(_MD("set_predelay_feedback","feedback"),&AudioEffectReverb::set_predelay_feedback); - ClassDB::bind_method(_MD("get_predelay_feedback"),&AudioEffectReverb::get_predelay_feedback); + ClassDB::bind_method(D_METHOD("set_predelay_feedback","feedback"),&AudioEffectReverb::set_predelay_feedback); + ClassDB::bind_method(D_METHOD("get_predelay_feedback"),&AudioEffectReverb::get_predelay_feedback); - ClassDB::bind_method(_MD("set_room_size","size"),&AudioEffectReverb::set_room_size); - ClassDB::bind_method(_MD("get_room_size"),&AudioEffectReverb::get_room_size); + ClassDB::bind_method(D_METHOD("set_room_size","size"),&AudioEffectReverb::set_room_size); + ClassDB::bind_method(D_METHOD("get_room_size"),&AudioEffectReverb::get_room_size); - ClassDB::bind_method(_MD("set_damping","amount"),&AudioEffectReverb::set_damping); - ClassDB::bind_method(_MD("get_damping"),&AudioEffectReverb::get_damping); + ClassDB::bind_method(D_METHOD("set_damping","amount"),&AudioEffectReverb::set_damping); + ClassDB::bind_method(D_METHOD("get_damping"),&AudioEffectReverb::get_damping); - ClassDB::bind_method(_MD("set_spread","amount"),&AudioEffectReverb::set_spread); - ClassDB::bind_method(_MD("get_spread"),&AudioEffectReverb::get_spread); + ClassDB::bind_method(D_METHOD("set_spread","amount"),&AudioEffectReverb::set_spread); + ClassDB::bind_method(D_METHOD("get_spread"),&AudioEffectReverb::get_spread); - ClassDB::bind_method(_MD("set_dry","amount"),&AudioEffectReverb::set_dry); - ClassDB::bind_method(_MD("get_dry"),&AudioEffectReverb::get_dry); + ClassDB::bind_method(D_METHOD("set_dry","amount"),&AudioEffectReverb::set_dry); + ClassDB::bind_method(D_METHOD("get_dry"),&AudioEffectReverb::get_dry); - ClassDB::bind_method(_MD("set_wet","amount"),&AudioEffectReverb::set_wet); - ClassDB::bind_method(_MD("get_wet"),&AudioEffectReverb::get_wet); + ClassDB::bind_method(D_METHOD("set_wet","amount"),&AudioEffectReverb::set_wet); + ClassDB::bind_method(D_METHOD("get_wet"),&AudioEffectReverb::get_wet); - ClassDB::bind_method(_MD("set_hpf","amount"),&AudioEffectReverb::set_hpf); - ClassDB::bind_method(_MD("get_hpf"),&AudioEffectReverb::get_hpf); + ClassDB::bind_method(D_METHOD("set_hpf","amount"),&AudioEffectReverb::set_hpf); + ClassDB::bind_method(D_METHOD("get_hpf"),&AudioEffectReverb::get_hpf); ADD_GROUP("Predelay","predelay_"); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"predelay_msec",PROPERTY_HINT_RANGE,"20,500,1"),_SCS("set_predelay_msec"),_SCS("get_predelay_msec")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"predelay_feedback",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_predelay_msec"),_SCS("get_predelay_msec")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"predelay_msec",PROPERTY_HINT_RANGE,"20,500,1"),"set_predelay_msec","get_predelay_msec"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"predelay_feedback",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_predelay_msec","get_predelay_msec"); ADD_GROUP("",""); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"room_size",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_room_size"),_SCS("get_room_size")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"damping",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_damping"),_SCS("get_damping")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"spread",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_spread"),_SCS("get_spread")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"hipass",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_hpf"),_SCS("get_hpf")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"dry",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_dry"),_SCS("get_dry")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"wet",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_wet"),_SCS("get_wet")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"room_size",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_room_size","get_room_size"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"damping",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_damping","get_damping"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"spread",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_spread","get_spread"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"hipass",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_hpf","get_hpf"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dry",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_dry","get_dry"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"wet",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_wet","get_wet"); } AudioEffectReverb::AudioEffectReverb() { diff --git a/servers/audio/effects/audio_effect_reverb.h b/servers/audio/effects/audio_effect_reverb.h index e05ffe422f..41b4f15cf0 100644 --- a/servers/audio/effects/audio_effect_reverb.h +++ b/servers/audio/effects/audio_effect_reverb.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_reverb.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECTREVERB_H #define AUDIOEFFECTREVERB_H diff --git a/servers/audio/effects/audio_effect_stereo_enhance.cpp b/servers/audio/effects/audio_effect_stereo_enhance.cpp index c5968aa772..388c38ed17 100644 --- a/servers/audio/effects/audio_effect_stereo_enhance.cpp +++ b/servers/audio/effects/audio_effect_stereo_enhance.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_stereo_enhance.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "audio_effect_stereo_enhance.h" #include "servers/audio_server.h" void AudioEffectStereoEnhanceInstance::process(const AudioFrame *p_src_frames,AudioFrame *p_dst_frames,int p_frame_count) { @@ -113,18 +141,18 @@ float AudioEffectStereoEnhance::get_surround() const { void AudioEffectStereoEnhance::_bind_methods() { - ClassDB::bind_method(_MD("set_pan_pullout","amount"),&AudioEffectStereoEnhance::set_pan_pullout); - ClassDB::bind_method(_MD("get_pan_pullout"),&AudioEffectStereoEnhance::get_pan_pullout); + ClassDB::bind_method(D_METHOD("set_pan_pullout","amount"),&AudioEffectStereoEnhance::set_pan_pullout); + ClassDB::bind_method(D_METHOD("get_pan_pullout"),&AudioEffectStereoEnhance::get_pan_pullout); - ClassDB::bind_method(_MD("set_time_pullout","amount"),&AudioEffectStereoEnhance::set_time_pullout); - ClassDB::bind_method(_MD("get_time_pullout"),&AudioEffectStereoEnhance::get_time_pullout); + ClassDB::bind_method(D_METHOD("set_time_pullout","amount"),&AudioEffectStereoEnhance::set_time_pullout); + ClassDB::bind_method(D_METHOD("get_time_pullout"),&AudioEffectStereoEnhance::get_time_pullout); - ClassDB::bind_method(_MD("set_surround","amount"),&AudioEffectStereoEnhance::set_surround); - ClassDB::bind_method(_MD("get_surround"),&AudioEffectStereoEnhance::get_surround); + ClassDB::bind_method(D_METHOD("set_surround","amount"),&AudioEffectStereoEnhance::set_surround); + ClassDB::bind_method(D_METHOD("get_surround"),&AudioEffectStereoEnhance::get_surround); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"pan_pullout",PROPERTY_HINT_RANGE,"0,4,0.01"),_SCS("set_pan_pullout"),_SCS("get_pan_pullout")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"time_pullout_ms",PROPERTY_HINT_RANGE,"0,50,0.01"),_SCS("set_time_pullout"),_SCS("get_time_pullout")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"surround",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_surround"),_SCS("get_surround")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"pan_pullout",PROPERTY_HINT_RANGE,"0,4,0.01"),"set_pan_pullout","get_pan_pullout"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"time_pullout_ms",PROPERTY_HINT_RANGE,"0,50,0.01"),"set_time_pullout","get_time_pullout"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"surround",PROPERTY_HINT_RANGE,"0,1,0.01"),"set_surround","get_surround"); } AudioEffectStereoEnhance::AudioEffectStereoEnhance() diff --git a/servers/audio/effects/audio_effect_stereo_enhance.h b/servers/audio/effects/audio_effect_stereo_enhance.h index 06762acbf3..5eef8a33b2 100644 --- a/servers/audio/effects/audio_effect_stereo_enhance.h +++ b/servers/audio/effects/audio_effect_stereo_enhance.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_effect_stereo_enhance.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 AUDIOEFFECTSTEREOENHANCE_H #define AUDIOEFFECTSTEREOENHANCE_H diff --git a/servers/audio/effects/eq.cpp b/servers/audio/effects/eq.cpp index a6499a66b4..4b461e97bb 100644 --- a/servers/audio/effects/eq.cpp +++ b/servers/audio/effects/eq.cpp @@ -1,14 +1,34 @@ -// -// C++ Interface: eq -// -// Description: -// -// +/*************************************************************************/ +/* eq.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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. */ +/*************************************************************************/ + // Author: reduzio@gmail.com (C) 2006 -// -// Copyright: See COPYING file that comes with this distribution -// -// + #include "eq.h" #include <math.h> #include "error_macros.h" @@ -47,7 +67,7 @@ EQ::BandProcess::BandProcess() { void EQ::recalculate_band_coefficients() { -#define BAND_LOG( m_f ) ( log((m_f)) / log(2) ) +#define BAND_LOG( m_f ) ( log((m_f)) / log(2.) ) for (int i=0;i<band.size();i++) { diff --git a/servers/audio/effects/eq.h b/servers/audio/effects/eq.h index 2c4668cd0b..1a568ee213 100644 --- a/servers/audio/effects/eq.h +++ b/servers/audio/effects/eq.h @@ -1,14 +1,34 @@ -// -// C++ Interface: eq -// -// Description: -// -// +/*************************************************************************/ +/* eq.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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. */ +/*************************************************************************/ + // Author: reduzio@gmail.com (C) 2006 -// -// Copyright: See COPYING file that comes with this distribution -// -// + #ifndef EQ_FILTER_H #define EQ_FILTER_H diff --git a/servers/audio/effects/reverb.cpp b/servers/audio/effects/reverb.cpp index 43ea0edb3a..bc3212201f 100644 --- a/servers/audio/effects/reverb.cpp +++ b/servers/audio/effects/reverb.cpp @@ -1,14 +1,33 @@ -// -// C++ Interface: reverb -// -// Description: -// -// +/*************************************************************************/ +/* reverb.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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. */ +/*************************************************************************/ + // Author: Juan Linietsky <reduzio@gmail.com>, (C) 2006 -// -// Copyright: See COPYING file that comes with this distribution -// -// #include "reverb.h" #include <math.h> diff --git a/servers/audio/effects/reverb.h b/servers/audio/effects/reverb.h index 2c82be9156..f0a0466f8a 100644 --- a/servers/audio/effects/reverb.h +++ b/servers/audio/effects/reverb.h @@ -1,14 +1,34 @@ -// -// C++ Interface: reverb -// -// Description: -// -// +/*************************************************************************/ +/* reverb.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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. */ +/*************************************************************************/ + // Author: Juan Linietsky <reduzio@gmail.com>, (C) 2006 -// -// Copyright: See COPYING file that comes with this distribution -// -// + #ifndef REVERB_H #define REVERB_H diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 8a8b9ebf76..192d958a64 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "audio_server.h" -#include "globals.h" +#include "global_config.h" #include "os/os.h" #include "servers/audio/effects/audio_effect_compressor.h" #include "io/resource_loader.h" @@ -1019,52 +1019,52 @@ Ref<AudioBusLayout> AudioServer::generate_bus_layout() const { void AudioServer::_bind_methods() { - ClassDB::bind_method(_MD("set_bus_count","amount"),&AudioServer::set_bus_count); - ClassDB::bind_method(_MD("get_bus_count"),&AudioServer::get_bus_count); + ClassDB::bind_method(D_METHOD("set_bus_count","amount"),&AudioServer::set_bus_count); + ClassDB::bind_method(D_METHOD("get_bus_count"),&AudioServer::get_bus_count); - ClassDB::bind_method(_MD("remove_bus","index"),&AudioServer::remove_bus); - ClassDB::bind_method(_MD("add_bus","at_pos"),&AudioServer::add_bus,DEFVAL(-1)); - ClassDB::bind_method(_MD("move_bus","index","to_index"),&AudioServer::move_bus); + ClassDB::bind_method(D_METHOD("remove_bus","index"),&AudioServer::remove_bus); + ClassDB::bind_method(D_METHOD("add_bus","at_pos"),&AudioServer::add_bus,DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("move_bus","index","to_index"),&AudioServer::move_bus); - ClassDB::bind_method(_MD("set_bus_name","bus_idx","name"),&AudioServer::set_bus_name); - ClassDB::bind_method(_MD("get_bus_name","bus_idx"),&AudioServer::get_bus_name); + ClassDB::bind_method(D_METHOD("set_bus_name","bus_idx","name"),&AudioServer::set_bus_name); + ClassDB::bind_method(D_METHOD("get_bus_name","bus_idx"),&AudioServer::get_bus_name); - ClassDB::bind_method(_MD("set_bus_volume_db","bus_idx","volume_db"),&AudioServer::set_bus_volume_db); - ClassDB::bind_method(_MD("get_bus_volume_db","bus_idx"),&AudioServer::get_bus_volume_db); + ClassDB::bind_method(D_METHOD("set_bus_volume_db","bus_idx","volume_db"),&AudioServer::set_bus_volume_db); + ClassDB::bind_method(D_METHOD("get_bus_volume_db","bus_idx"),&AudioServer::get_bus_volume_db); - ClassDB::bind_method(_MD("set_bus_send","bus_idx","send"),&AudioServer::set_bus_send); - ClassDB::bind_method(_MD("get_bus_send","bus_idx"),&AudioServer::get_bus_send); + ClassDB::bind_method(D_METHOD("set_bus_send","bus_idx","send"),&AudioServer::set_bus_send); + ClassDB::bind_method(D_METHOD("get_bus_send","bus_idx"),&AudioServer::get_bus_send); - ClassDB::bind_method(_MD("set_bus_solo","bus_idx","enable"),&AudioServer::set_bus_solo); - ClassDB::bind_method(_MD("is_bus_solo","bus_idx"),&AudioServer::is_bus_solo); + ClassDB::bind_method(D_METHOD("set_bus_solo","bus_idx","enable"),&AudioServer::set_bus_solo); + ClassDB::bind_method(D_METHOD("is_bus_solo","bus_idx"),&AudioServer::is_bus_solo); - ClassDB::bind_method(_MD("set_bus_mute","bus_idx","enable"),&AudioServer::set_bus_mute); - ClassDB::bind_method(_MD("is_bus_mute","bus_idx"),&AudioServer::is_bus_mute); + ClassDB::bind_method(D_METHOD("set_bus_mute","bus_idx","enable"),&AudioServer::set_bus_mute); + ClassDB::bind_method(D_METHOD("is_bus_mute","bus_idx"),&AudioServer::is_bus_mute); - ClassDB::bind_method(_MD("set_bus_bypass_effects","bus_idx","enable"),&AudioServer::set_bus_bypass_effects); - ClassDB::bind_method(_MD("is_bus_bypassing_effects","bus_idx"),&AudioServer::is_bus_bypassing_effects); + ClassDB::bind_method(D_METHOD("set_bus_bypass_effects","bus_idx","enable"),&AudioServer::set_bus_bypass_effects); + ClassDB::bind_method(D_METHOD("is_bus_bypassing_effects","bus_idx"),&AudioServer::is_bus_bypassing_effects); - ClassDB::bind_method(_MD("add_bus_effect","bus_idx","effect:AudioEffect"),&AudioServer::add_bus_effect,DEFVAL(-1)); - ClassDB::bind_method(_MD("remove_bus_effect","bus_idx","effect_idx"),&AudioServer::remove_bus_effect); + ClassDB::bind_method(D_METHOD("add_bus_effect","bus_idx","effect:AudioEffect"),&AudioServer::add_bus_effect,DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("remove_bus_effect","bus_idx","effect_idx"),&AudioServer::remove_bus_effect); - ClassDB::bind_method(_MD("get_bus_effect_count","bus_idx"),&AudioServer::add_bus_effect); - ClassDB::bind_method(_MD("get_bus_effect:AudioEffect","bus_idx","effect_idx"),&AudioServer::get_bus_effect); - ClassDB::bind_method(_MD("swap_bus_effects","bus_idx","effect_idx","by_effect_idx"),&AudioServer::swap_bus_effects); + ClassDB::bind_method(D_METHOD("get_bus_effect_count","bus_idx"),&AudioServer::add_bus_effect); + ClassDB::bind_method(D_METHOD("get_bus_effect:AudioEffect","bus_idx","effect_idx"),&AudioServer::get_bus_effect); + ClassDB::bind_method(D_METHOD("swap_bus_effects","bus_idx","effect_idx","by_effect_idx"),&AudioServer::swap_bus_effects); - ClassDB::bind_method(_MD("set_bus_effect_enabled","bus_idx","effect_idx","enabled"),&AudioServer::set_bus_effect_enabled); - ClassDB::bind_method(_MD("is_bus_effect_enabled","bus_idx","effect_idx"),&AudioServer::is_bus_effect_enabled); + ClassDB::bind_method(D_METHOD("set_bus_effect_enabled","bus_idx","effect_idx","enabled"),&AudioServer::set_bus_effect_enabled); + ClassDB::bind_method(D_METHOD("is_bus_effect_enabled","bus_idx","effect_idx"),&AudioServer::is_bus_effect_enabled); - ClassDB::bind_method(_MD("get_bus_peak_volume_left_db","bus_idx","channel"),&AudioServer::get_bus_peak_volume_left_db); - ClassDB::bind_method(_MD("get_bus_peak_volume_right_db","bus_idx","channel"),&AudioServer::get_bus_peak_volume_right_db); + ClassDB::bind_method(D_METHOD("get_bus_peak_volume_left_db","bus_idx","channel"),&AudioServer::get_bus_peak_volume_left_db); + ClassDB::bind_method(D_METHOD("get_bus_peak_volume_right_db","bus_idx","channel"),&AudioServer::get_bus_peak_volume_right_db); - ClassDB::bind_method(_MD("lock"),&AudioServer::lock); - ClassDB::bind_method(_MD("unlock"),&AudioServer::unlock); + ClassDB::bind_method(D_METHOD("lock"),&AudioServer::lock); + ClassDB::bind_method(D_METHOD("unlock"),&AudioServer::unlock); - ClassDB::bind_method(_MD("get_speaker_mode"),&AudioServer::get_speaker_mode); - ClassDB::bind_method(_MD("get_mix_rate"),&AudioServer::get_mix_rate); + ClassDB::bind_method(D_METHOD("get_speaker_mode"),&AudioServer::get_speaker_mode); + ClassDB::bind_method(D_METHOD("get_mix_rate"),&AudioServer::get_mix_rate); - ClassDB::bind_method(_MD("set_state","state:AudioServerState"),&AudioServer::set_bus_layout); - ClassDB::bind_method(_MD("generate_state:AudioServerState"),&AudioServer::generate_bus_layout); + ClassDB::bind_method(D_METHOD("set_state","state:AudioServerState"),&AudioServer::set_bus_layout); + ClassDB::bind_method(D_METHOD("generate_state:AudioServerState"),&AudioServer::generate_bus_layout); ADD_SIGNAL(MethodInfo("bus_layout_changed") ); } diff --git a/servers/physics/area_pair_sw.cpp b/servers/physics/area_pair_sw.cpp index e95c85d751..3aa0816b06 100644 --- a/servers/physics/area_pair_sw.cpp +++ b/servers/physics/area_pair_sw.cpp @@ -30,7 +30,7 @@ #include "collision_solver_sw.h" -bool AreaPairSW::setup(float p_step) { +bool AreaPairSW::setup(real_t p_step) { if (!area->test_collision_mask(body)) { colliding = false; @@ -64,7 +64,7 @@ bool AreaPairSW::setup(float p_step) { return false; //never do any post solving } -void AreaPairSW::solve(float p_step) { +void AreaPairSW::solve(real_t p_step) { } @@ -103,7 +103,7 @@ AreaPairSW::~AreaPairSW() { -bool Area2PairSW::setup(float p_step) { +bool Area2PairSW::setup(real_t p_step) { if (!area_a->test_collision_mask(area_b)) { colliding = false; @@ -139,7 +139,7 @@ bool Area2PairSW::setup(float p_step) { return false; //never do any post solving } -void Area2PairSW::solve(float p_step) { +void Area2PairSW::solve(real_t p_step) { } diff --git a/servers/physics/area_pair_sw.h b/servers/physics/area_pair_sw.h index 17477dcbd2..637976a095 100644 --- a/servers/physics/area_pair_sw.h +++ b/servers/physics/area_pair_sw.h @@ -42,8 +42,8 @@ class AreaPairSW : public ConstraintSW { bool colliding; public: - bool setup(float p_step); - void solve(float p_step); + bool setup(real_t p_step); + void solve(real_t p_step); AreaPairSW(BodySW *p_body,int p_body_shape, AreaSW *p_area,int p_area_shape); ~AreaPairSW(); @@ -59,8 +59,8 @@ class Area2PairSW : public ConstraintSW { bool colliding; public: - bool setup(float p_step); - void solve(float p_step); + bool setup(real_t p_step); + void solve(real_t p_step); Area2PairSW(AreaSW *p_area_a,int p_shape_a, AreaSW *p_area_b,int p_shape_b); ~Area2PairSW(); diff --git a/servers/physics/area_sw.h b/servers/physics/area_sw.h index 5ac6985409..4e6f1c5a51 100644 --- a/servers/physics/area_sw.h +++ b/servers/physics/area_sw.h @@ -42,13 +42,13 @@ class AreaSW : public CollisionObjectSW{ PhysicsServer::AreaSpaceOverrideMode space_override_mode; - float gravity; + real_t gravity; Vector3 gravity_vector; bool gravity_is_point; - float gravity_distance_scale; - float point_attenuation; - float linear_damp; - float angular_damp; + real_t gravity_distance_scale; + real_t point_attenuation; + real_t linear_damp; + real_t angular_damp; int priority; bool monitorable; @@ -131,8 +131,8 @@ public: void set_space_override_mode(PhysicsServer::AreaSpaceOverrideMode p_mode); PhysicsServer::AreaSpaceOverrideMode get_space_override_mode() const { return space_override_mode; } - _FORCE_INLINE_ void set_gravity(float p_gravity) { gravity=p_gravity; } - _FORCE_INLINE_ float get_gravity() const { return gravity; } + _FORCE_INLINE_ void set_gravity(real_t p_gravity) { gravity=p_gravity; } + _FORCE_INLINE_ real_t get_gravity() const { return gravity; } _FORCE_INLINE_ void set_gravity_vector(const Vector3& p_gravity) { gravity_vector=p_gravity; } _FORCE_INLINE_ Vector3 get_gravity_vector() const { return gravity_vector; } @@ -140,17 +140,17 @@ public: _FORCE_INLINE_ void set_gravity_as_point(bool p_enable) { gravity_is_point=p_enable; } _FORCE_INLINE_ bool is_gravity_point() const { return gravity_is_point; } - _FORCE_INLINE_ void set_gravity_distance_scale(float scale) { gravity_distance_scale=scale; } - _FORCE_INLINE_ float get_gravity_distance_scale() const { return gravity_distance_scale; } + _FORCE_INLINE_ void set_gravity_distance_scale(real_t scale) { gravity_distance_scale=scale; } + _FORCE_INLINE_ real_t get_gravity_distance_scale() const { return gravity_distance_scale; } - _FORCE_INLINE_ void set_point_attenuation(float p_point_attenuation) { point_attenuation=p_point_attenuation; } - _FORCE_INLINE_ float get_point_attenuation() const { return point_attenuation; } + _FORCE_INLINE_ void set_point_attenuation(real_t p_point_attenuation) { point_attenuation=p_point_attenuation; } + _FORCE_INLINE_ real_t get_point_attenuation() const { return point_attenuation; } - _FORCE_INLINE_ void set_linear_damp(float p_linear_damp) { linear_damp=p_linear_damp; } - _FORCE_INLINE_ float get_linear_damp() const { return linear_damp; } + _FORCE_INLINE_ void set_linear_damp(real_t p_linear_damp) { linear_damp=p_linear_damp; } + _FORCE_INLINE_ real_t get_linear_damp() const { return linear_damp; } - _FORCE_INLINE_ void set_angular_damp(float p_angular_damp) { angular_damp=p_angular_damp; } - _FORCE_INLINE_ float get_angular_damp() const { return angular_damp; } + _FORCE_INLINE_ void set_angular_damp(real_t p_angular_damp) { angular_damp=p_angular_damp; } + _FORCE_INLINE_ real_t get_angular_damp() const { return angular_damp; } _FORCE_INLINE_ void set_priority(int p_priority) { priority=p_priority; } _FORCE_INLINE_ int get_priority() const { return priority; } diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp index 7defa87bb1..7fb3def387 100644 --- a/servers/physics/body_pair_sw.cpp +++ b/servers/physics/body_pair_sw.cpp @@ -105,7 +105,7 @@ void BodyPairSW::contact_added_callback(const Vector3& p_point_A,const Vector3& // remove the contact with the minimum depth int least_deep=-1; - float min_depth=1e10; + real_t min_depth=1e10; for (int i=0;i<=contact_count;i++) { @@ -114,7 +114,7 @@ void BodyPairSW::contact_added_callback(const Vector3& p_point_A,const Vector3& Vector3 global_B = B->get_transform().basis.xform(c.local_B)+offset_B; Vector3 axis = global_A - global_B; - float depth = axis.dot( c.normal ); + real_t depth = axis.dot( c.normal ); if (depth<min_depth) { @@ -154,7 +154,7 @@ void BodyPairSW::validate_contacts() { Vector3 global_A = A->get_transform().basis.xform(c.local_A); Vector3 global_B = B->get_transform().basis.xform(c.local_B)+offset_B; Vector3 axis = global_A - global_B; - float depth = axis.dot( c.normal ); + real_t depth = axis.dot( c.normal ); if (depth < -contact_max_separation || (global_B + c.normal * depth - global_A).length() > contact_max_separation) { // contact no longer needed, remove @@ -173,7 +173,7 @@ void BodyPairSW::validate_contacts() { } -bool BodyPairSW::_test_ccd(float p_step,BodySW *p_A, int p_shape_A,const Transform& p_xform_A,BodySW *p_B, int p_shape_B,const Transform& p_xform_B) { +bool BodyPairSW::_test_ccd(real_t p_step,BodySW *p_A, int p_shape_A,const Transform& p_xform_A,BodySW *p_B, int p_shape_B,const Transform& p_xform_B) { @@ -211,14 +211,14 @@ bool BodyPairSW::_test_ccd(float p_step,BodySW *p_A, int p_shape_A,const Transfo //shorten the linear velocity so it does not hit, but gets close enough, next frame will hit softly or soft enough Vector3 hitpos = p_xform_B.xform(rpos); - float newlen = hitpos.distance_to(from)-(max-min)*0.01; + real_t newlen = hitpos.distance_to(from)-(max-min)*0.01; p_A->set_linear_velocity((mnormal*newlen)/p_step); return true; } -bool BodyPairSW::setup(float p_step) { +bool BodyPairSW::setup(real_t p_step) { //cannot collide if (!A->test_collision_mask(B) || A->has_exception(B->get_self()) || B->has_exception(A->get_self()) || (A->get_mode()<=PhysicsServer::BODY_MODE_KINEMATIC && B->get_mode()<=PhysicsServer::BODY_MODE_KINEMATIC && A->get_max_contacts_reported()==0 && B->get_max_contacts_reported()==0)) { @@ -264,7 +264,7 @@ bool BodyPairSW::setup(float p_step) { real_t max_penetration = space->get_contact_max_allowed_penetration(); - float bias = 0.3f; + real_t bias = (real_t)0.3; if (shape_A_ptr->get_custom_bias() || shape_B_ptr->get_custom_bias()) { @@ -356,7 +356,7 @@ bool BodyPairSW::setup(float p_step) { if (depth > max_penetration) { c.bias = (depth - max_penetration) * (1.0/(p_step*(1.0/RELAXATION_TIMESTEPS))); } else { - float approach = -0.1f * (depth - max_penetration) / (CMP_EPSILON + max_penetration); + real_t approach = -0.1 * (depth - max_penetration) / (CMP_EPSILON + max_penetration); approach = CLAMP( approach, CMP_EPSILON, 1.0 ); c.bias = approach * (depth - max_penetration) * (1.0/p_step); } @@ -387,7 +387,7 @@ bool BodyPairSW::setup(float p_step) { return true; } -void BodyPairSW::solve(float p_step) { +void BodyPairSW::solve(real_t p_step) { if (!collided) return; diff --git a/servers/physics/body_pair_sw.h b/servers/physics/body_pair_sw.h index a37f75d13c..f282a56b9e 100644 --- a/servers/physics/body_pair_sw.h +++ b/servers/physics/body_pair_sw.h @@ -82,14 +82,14 @@ class BodyPairSW : public ConstraintSW { void contact_added_callback(const Vector3& p_point_A,const Vector3& p_point_B); void validate_contacts(); - bool _test_ccd(float p_step,BodySW *p_A, int p_shape_A,const Transform& p_xform_A,BodySW *p_B, int p_shape_B,const Transform& p_xform_B); + bool _test_ccd(real_t p_step,BodySW *p_A, int p_shape_A,const Transform& p_xform_A,BodySW *p_B, int p_shape_B,const Transform& p_xform_B); SpaceSW *space; public: - bool setup(float p_step); - void solve(float p_step); + bool setup(real_t p_step); + void solve(real_t p_step); BodyPairSW(BodySW *p_A, int p_shape_A,BodySW *p_B, int p_shape_B); ~BodyPairSW(); diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index a67dda3a01..7fcd767268 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -59,7 +59,7 @@ void BodySW::update_inertias() { case PhysicsServer::BODY_MODE_RIGID: { //update tensor for all shapes, not the best way but should be somehow OK. (inspired from bullet) - float total_area=0; + real_t total_area=0; for (int i=0;i<get_shape_count();i++) { @@ -70,9 +70,9 @@ void BodySW::update_inertias() { center_of_mass_local.zero(); for (int i=0; i<get_shape_count(); i++) { - float area=get_shape_area(i); + real_t area=get_shape_area(i); - float mass = area * this->mass / total_area; + real_t mass = area * this->mass / total_area; // NOTE: we assume that the shape origin is also its center of mass center_of_mass_local += mass * get_shape_transform(i).origin; @@ -88,9 +88,9 @@ void BodySW::update_inertias() { const ShapeSW* shape=get_shape(i); - float area=get_shape_area(i); + real_t area=get_shape_area(i); - float mass = area * this->mass / total_area; + real_t mass = area * this->mass / total_area; Basis shape_inertia_tensor=shape->get_moment_of_inertia(mass).to_diagonal_matrix(); Transform shape_transform=get_shape_transform(i); @@ -170,7 +170,7 @@ void BodySW::set_active(bool p_active) { -void BodySW::set_param(PhysicsServer::BodyParameter p_param, float p_value) { +void BodySW::set_param(PhysicsServer::BodyParameter p_param, real_t p_value) { switch(p_param) { case PhysicsServer::BODY_PARAM_BOUNCE: { @@ -202,7 +202,7 @@ void BodySW::set_param(PhysicsServer::BodyParameter p_param, float p_value) { } } -float BodySW::get_param(PhysicsServer::BodyParameter p_param) const { +real_t BodySW::get_param(PhysicsServer::BodyParameter p_param) const { switch(p_param) { case PhysicsServer::BODY_PARAM_BOUNCE: { @@ -511,7 +511,7 @@ void BodySW::integrate_forces(real_t p_step) { //compute a FAKE angular velocity, not so easy Basis rot=new_transform.basis.orthonormalized().transposed() * get_transform().basis.orthonormalized(); Vector3 axis; - float angle; + real_t angle; rot.get_axis_and_angle(axis,angle); axis.normalize(); @@ -615,7 +615,7 @@ void BodySW::integrate_velocities(real_t p_step) { - float ang_vel = total_angular_velocity.length(); + real_t ang_vel = total_angular_velocity.length(); Transform transform = get_transform(); @@ -666,7 +666,7 @@ void BodySW::simulate_motion(const Transform& p_xform,real_t p_step) { //compute a FAKE angular velocity, not so easy Matrix3 rot=get_transform().basis.orthonormalized().transposed() * p_xform.basis.orthonormalized(); Vector3 axis; - float angle; + real_t angle; rot.get_axis_and_angle(axis,angle); axis.normalize(); diff --git a/servers/physics/body_sw.h b/servers/physics/body_sw.h index e6ed3e75e5..2383d2d688 100644 --- a/servers/physics/body_sw.h +++ b/servers/physics/body_sw.h @@ -75,8 +75,8 @@ class BodySW : public CollisionObjectSW { Vector3 applied_force; Vector3 applied_torque; - float area_angular_damp; - float area_linear_damp; + real_t area_angular_damp; + real_t area_linear_damp; SelfList<BodySW> active_list; @@ -115,7 +115,7 @@ class BodySW : public CollisionObjectSW { Vector3 local_pos; Vector3 local_normal; - float depth; + real_t depth; int local_shape; Vector3 collider_pos; int collider_shape; @@ -174,7 +174,7 @@ public: _FORCE_INLINE_ int get_max_contacts_reported() const { return contacts.size(); } _FORCE_INLINE_ bool can_report_contacts() const { return !contacts.empty(); } - _FORCE_INLINE_ void add_contact(const Vector3& p_local_pos,const Vector3& p_local_normal, float p_depth, int p_local_shape, const Vector3& p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID& p_collider,const Vector3& p_collider_velocity_at_pos); + _FORCE_INLINE_ void add_contact(const Vector3& p_local_pos,const Vector3& p_local_normal, real_t p_depth, int p_local_shape, const Vector3& p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID& p_collider,const Vector3& p_collider_velocity_at_pos); _FORCE_INLINE_ void add_exception(const RID& p_exception) { exceptions.insert(p_exception);} @@ -248,8 +248,8 @@ public: set_active(true); } - void set_param(PhysicsServer::BodyParameter p_param, float); - float get_param(PhysicsServer::BodyParameter p_param) const; + void set_param(PhysicsServer::BodyParameter p_param, real_t); + real_t get_param(PhysicsServer::BodyParameter p_param) const; void set_mode(PhysicsServer::BodyMode p_mode); PhysicsServer::BodyMode get_mode() const; @@ -319,7 +319,7 @@ public: //add contact inline -void BodySW::add_contact(const Vector3& p_local_pos,const Vector3& p_local_normal, float p_depth, int p_local_shape, const Vector3& p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID& p_collider,const Vector3& p_collider_velocity_at_pos) { +void BodySW::add_contact(const Vector3& p_local_pos,const Vector3& p_local_normal, real_t p_depth, int p_local_shape, const Vector3& p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID& p_collider,const Vector3& p_collider_velocity_at_pos) { int c_max=contacts.size(); @@ -335,7 +335,7 @@ void BodySW::add_contact(const Vector3& p_local_pos,const Vector3& p_local_norma idx=contact_count++; } else { - float least_depth=1e20; + real_t least_depth=1e20; int least_deep=-1; for(int i=0;i<c_max;i++) { @@ -377,13 +377,13 @@ public: real_t step; virtual Vector3 get_total_gravity() const { return body->gravity; } // get gravity vector working on this body space/area - virtual float get_total_angular_damp() const { return body->area_angular_damp; } // get density of this body space/area - virtual float get_total_linear_damp() const { return body->area_linear_damp; } // get density of this body space/area + virtual real_t get_total_angular_damp() const { return body->area_angular_damp; } // get density of this body space/area + virtual real_t get_total_linear_damp() const { return body->area_linear_damp; } // get density of this body space/area virtual Vector3 get_center_of_mass() const { return body->get_center_of_mass(); } virtual Basis get_principal_inertia_axes() const { return body->get_principal_inertia_axes(); } - virtual float get_inverse_mass() const { return body->get_inv_mass(); } // get the mass + virtual real_t get_inverse_mass() const { return body->get_inv_mass(); } // get the mass virtual Vector3 get_inverse_inertia() const { return body->get_inv_inertia(); } // get density of this body space virtual Basis get_inverse_inertia_tensor() const { return body->get_inv_inertia_tensor(); } // get density of this body space diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp index d41012caa4..9d3e1db47b 100644 --- a/servers/physics/collision_solver_sat.cpp +++ b/servers/physics/collision_solver_sat.cpp @@ -122,9 +122,9 @@ static void _generate_contacts_edge_edge(const Vector3 * p_points_A,int p_point_ Vector3 base_B = p_points_B[0] - axis * axis.dot(p_points_B[0]); //sort all 4 points in axis - float dvec[4]={ axis.dot(p_points_A[0]), axis.dot(p_points_A[1]), axis.dot(p_points_B[0]), axis.dot(p_points_B[1]) }; + real_t dvec[4]={ axis.dot(p_points_A[0]), axis.dot(p_points_A[1]), axis.dot(p_points_B[0]), axis.dot(p_points_B[1]) }; - SortArray<float> sa; + SortArray<real_t> sa; sa.sort(dvec,4); //use the middle ones as contacts @@ -234,7 +234,7 @@ static void _generate_contacts_face_face(const Vector3 * p_points_A,int p_point_ for (int i=0;i<clipbuf_len;i++) { - float d = plane_B.distance_to(clipbuf_src[i]); + real_t d = plane_B.distance_to(clipbuf_src[i]); /* if (d>CMP_EPSILON) continue; @@ -476,11 +476,11 @@ public: /****** SAT TESTS *******/ -typedef void (*CollisionFunc)(const ShapeSW*,const Transform&,const ShapeSW*,const Transform&,_CollectorCallback *p_callback,float,float); +typedef void (*CollisionFunc)(const ShapeSW*,const Transform&,const ShapeSW*,const Transform&,_CollectorCallback *p_callback,real_t,real_t); template<bool withMargin> -static void _collision_sphere_sphere(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_sphere_sphere(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const SphereShapeSW *sphere_A = static_cast<const SphereShapeSW*>(p_a); @@ -500,7 +500,7 @@ static void _collision_sphere_sphere(const ShapeSW *p_a,const Transform &p_trans } template<bool withMargin> -static void _collision_sphere_box(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_sphere_box(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const SphereShapeSW *sphere_A = static_cast<const SphereShapeSW*>(p_a); @@ -555,7 +555,7 @@ static void _collision_sphere_box(const ShapeSW *p_a,const Transform &p_transfor } template<bool withMargin> -static void _collision_sphere_capsule(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_sphere_capsule(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const SphereShapeSW *sphere_A = static_cast<const SphereShapeSW*>(p_a); const CapsuleShapeSW *capsule_B = static_cast<const CapsuleShapeSW*>(p_b); @@ -595,7 +595,7 @@ static void _collision_sphere_capsule(const ShapeSW *p_a,const Transform &p_tran } template<bool withMargin> -static void _collision_sphere_convex_polygon(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_sphere_convex_polygon(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const SphereShapeSW *sphere_A = static_cast<const SphereShapeSW*>(p_a); @@ -666,7 +666,7 @@ static void _collision_sphere_convex_polygon(const ShapeSW *p_a,const Transform } template<bool withMargin> -static void _collision_sphere_face(const ShapeSW *p_a,const Transform &p_transform_a, const ShapeSW *p_b,const Transform& p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_sphere_face(const ShapeSW *p_a,const Transform &p_transform_a, const ShapeSW *p_b,const Transform& p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const SphereShapeSW *sphere_A = static_cast<const SphereShapeSW*>(p_a); const FaceShapeSW *face_B = static_cast<const FaceShapeSW*>(p_b); @@ -710,7 +710,7 @@ static void _collision_sphere_face(const ShapeSW *p_a,const Transform &p_transfo template<bool withMargin> -static void _collision_box_box(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_box_box(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const BoxShapeSW *box_A = static_cast<const BoxShapeSW*>(p_a); @@ -818,7 +818,7 @@ static void _collision_box_box(const ShapeSW *p_a,const Transform &p_transform_a } template<bool withMargin> -static void _collision_box_capsule(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_box_capsule(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const BoxShapeSW *box_A = static_cast<const BoxShapeSW*>(p_a); const CapsuleShapeSW *capsule_B = static_cast<const CapsuleShapeSW*>(p_b); @@ -918,7 +918,7 @@ static void _collision_box_capsule(const ShapeSW *p_a,const Transform &p_transfo } template<bool withMargin> -static void _collision_box_convex_polygon(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_box_convex_polygon(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { @@ -1046,7 +1046,7 @@ static void _collision_box_convex_polygon(const ShapeSW *p_a,const Transform &p_ template<bool withMargin> -static void _collision_box_face(const ShapeSW *p_a,const Transform &p_transform_a, const ShapeSW *p_b,const Transform& p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_box_face(const ShapeSW *p_a,const Transform &p_transform_a, const ShapeSW *p_b,const Transform& p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const BoxShapeSW *box_A = static_cast<const BoxShapeSW*>(p_a); @@ -1158,7 +1158,7 @@ static void _collision_box_face(const ShapeSW *p_a,const Transform &p_transform_ template<bool withMargin> -static void _collision_capsule_capsule(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_capsule_capsule(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const CapsuleShapeSW *capsule_A = static_cast<const CapsuleShapeSW*>(p_a); const CapsuleShapeSW *capsule_B = static_cast<const CapsuleShapeSW*>(p_b); @@ -1216,7 +1216,7 @@ static void _collision_capsule_capsule(const ShapeSW *p_a,const Transform &p_tra } template<bool withMargin> -static void _collision_capsule_convex_polygon(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_capsule_convex_polygon(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const CapsuleShapeSW *capsule_A = static_cast<const CapsuleShapeSW*>(p_a); @@ -1287,7 +1287,7 @@ static void _collision_capsule_convex_polygon(const ShapeSW *p_a,const Transform template<bool withMargin> -static void _collision_capsule_face(const ShapeSW *p_a,const Transform &p_transform_a, const ShapeSW *p_b,const Transform& p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_capsule_face(const ShapeSW *p_a,const Transform &p_transform_a, const ShapeSW *p_b,const Transform& p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const CapsuleShapeSW *capsule_A = static_cast<const CapsuleShapeSW*>(p_a); const FaceShapeSW *face_B = static_cast<const FaceShapeSW*>(p_b); @@ -1350,7 +1350,7 @@ static void _collision_capsule_face(const ShapeSW *p_a,const Transform &p_transf template<bool withMargin> -static void _collision_convex_polygon_convex_polygon(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_convex_polygon_convex_polygon(const ShapeSW *p_a,const Transform &p_transform_a,const ShapeSW *p_b,const Transform &p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const ConvexPolygonShapeSW *convex_polygon_A = static_cast<const ConvexPolygonShapeSW*>(p_a); @@ -1474,7 +1474,7 @@ static void _collision_convex_polygon_convex_polygon(const ShapeSW *p_a,const Tr template<bool withMargin> -static void _collision_convex_polygon_face(const ShapeSW *p_a,const Transform &p_transform_a, const ShapeSW *p_b,const Transform& p_transform_b,_CollectorCallback *p_collector,float p_margin_a,float p_margin_b) { +static void _collision_convex_polygon_face(const ShapeSW *p_a,const Transform &p_transform_a, const ShapeSW *p_b,const Transform& p_transform_b,_CollectorCallback *p_collector,real_t p_margin_a,real_t p_margin_b) { const ConvexPolygonShapeSW *convex_polygon_A = static_cast<const ConvexPolygonShapeSW*>(p_a); @@ -1585,7 +1585,7 @@ static void _collision_convex_polygon_face(const ShapeSW *p_a,const Transform &p } -bool sat_calculate_penetration(const ShapeSW *p_shape_A, const Transform& p_transform_A, const ShapeSW *p_shape_B, const Transform& p_transform_B, CollisionSolverSW::CallbackResult p_result_callback,void *p_userdata,bool p_swap,Vector3* r_prev_axis,float p_margin_a,float p_margin_b) { +bool sat_calculate_penetration(const ShapeSW *p_shape_A, const Transform& p_transform_A, const ShapeSW *p_shape_B, const Transform& p_transform_B, CollisionSolverSW::CallbackResult p_result_callback,void *p_userdata,bool p_swap,Vector3* r_prev_axis,real_t p_margin_a,real_t p_margin_b) { PhysicsServer::ShapeType type_A=p_shape_A->get_type(); @@ -1667,8 +1667,8 @@ bool sat_calculate_penetration(const ShapeSW *p_shape_A, const Transform& p_tran const ShapeSW *B=p_shape_B; const Transform *transform_A=&p_transform_A; const Transform *transform_B=&p_transform_B; - float margin_A=p_margin_a; - float margin_B=p_margin_b; + real_t margin_A=p_margin_a; + real_t margin_B=p_margin_b; if (type_A > type_B) { SWAP(A,B); diff --git a/servers/physics/collision_solver_sat.h b/servers/physics/collision_solver_sat.h index 60387a978d..15fe7dc34a 100644 --- a/servers/physics/collision_solver_sat.h +++ b/servers/physics/collision_solver_sat.h @@ -32,6 +32,6 @@ #include "collision_solver_sw.h" -bool sat_calculate_penetration(const ShapeSW *p_shape_A, const Transform& p_transform_A, const ShapeSW *p_shape_B, const Transform& p_transform_B, CollisionSolverSW::CallbackResult p_result_callback,void *p_userdata, bool p_swap=false,Vector3* r_prev_axis=NULL,float p_margin_a=0,float p_margin_b=0); +bool sat_calculate_penetration(const ShapeSW *p_shape_A, const Transform& p_transform_A, const ShapeSW *p_shape_B, const Transform& p_transform_B, CollisionSolverSW::CallbackResult p_result_callback,void *p_userdata, bool p_swap=false,Vector3* r_prev_axis=NULL,real_t p_margin_a=0,real_t p_margin_b=0); #endif // COLLISION_SOLVER_SAT_H diff --git a/servers/physics/collision_solver_sw.cpp b/servers/physics/collision_solver_sw.cpp index 3399849ab7..f0ddde3a76 100644 --- a/servers/physics/collision_solver_sw.cpp +++ b/servers/physics/collision_solver_sw.cpp @@ -115,8 +115,8 @@ struct _ConcaveCollisionInfo { int aabb_tests; int collisions; bool tested; - float margin_A; - float margin_B; + real_t margin_A; + real_t margin_B; Vector3 close_A,close_B; }; @@ -136,7 +136,7 @@ void CollisionSolverSW::concave_callback(void *p_userdata, ShapeSW *p_convex) { } -bool CollisionSolverSW::solve_concave(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,float p_margin_A,float p_margin_B) { +bool CollisionSolverSW::solve_concave(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,real_t p_margin_A,real_t p_margin_B) { const ConcaveShapeSW *concave_B=static_cast<const ConcaveShapeSW*>(p_shape_B); @@ -164,10 +164,10 @@ bool CollisionSolverSW::solve_concave(const ShapeSW *p_shape_A,const Transform& for(int i=0;i<3;i++) { Vector3 axis( p_transform_B.basis.get_axis(i) ); - float axis_scale = 1.0/axis.length(); + real_t axis_scale = 1.0/axis.length(); axis*=axis_scale; - float smin,smax; + real_t smin,smax; p_shape_A->project_range(axis,rel_transform,smin,smax); smin-=p_margin_A; smax+=p_margin_A; @@ -186,7 +186,7 @@ bool CollisionSolverSW::solve_concave(const ShapeSW *p_shape_A,const Transform& } -bool CollisionSolverSW::solve_static(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,Vector3 *r_sep_axis,float p_margin_A,float p_margin_B) { +bool CollisionSolverSW::solve_static(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,Vector3 *r_sep_axis,real_t p_margin_A,real_t p_margin_B) { PhysicsServer::ShapeType type_A=p_shape_A->get_type(); @@ -291,7 +291,7 @@ bool CollisionSolverSW::solve_distance_plane(const ShapeSW *p_shape_A,const Tran bool collided=false; Vector3 closest; - float closest_d; + real_t closest_d; for(int i=0;i<support_count;i++) { @@ -362,10 +362,10 @@ bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A,const Transform& for(int i=0;i<3;i++) { Vector3 axis( p_transform_B.basis.get_axis(i) ); - float axis_scale = 1.0/axis.length(); + real_t axis_scale = ((real_t)1.0)/axis.length(); axis*=axis_scale; - float smin,smax; + real_t smin,smax; if (use_cc_hint) { cc_hint_aabb.project_range_in_plane(Plane(axis,0),smin,smax); diff --git a/servers/physics/collision_solver_sw.h b/servers/physics/collision_solver_sw.h index 16d2b92d70..b8d37a8a96 100644 --- a/servers/physics/collision_solver_sw.h +++ b/servers/physics/collision_solver_sw.h @@ -40,14 +40,14 @@ private: static void concave_callback(void *p_userdata, ShapeSW *p_convex); static bool solve_static_plane(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result); static bool solve_ray(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result); - static bool solve_concave(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,float p_margin_A=0,float p_margin_B=0); + static bool solve_concave(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,real_t p_margin_A=0,real_t p_margin_B=0); static void concave_distance_callback(void *p_userdata, ShapeSW *p_convex); static bool solve_distance_plane(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,Vector3& r_point_A,Vector3& r_point_B); public: - static bool solve_static(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,Vector3 *r_sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); + static bool solve_static(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,Vector3 *r_sep_axis=NULL,real_t p_margin_A=0,real_t p_margin_B=0); static bool solve_distance(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,Vector3& r_point_A,Vector3& r_point_B,const Rect3& p_concave_hint,Vector3 *r_sep_axis=NULL); }; diff --git a/servers/physics/constraint_sw.h b/servers/physics/constraint_sw.h index adc17cb753..f5bbe4bbd0 100644 --- a/servers/physics/constraint_sw.h +++ b/servers/physics/constraint_sw.h @@ -67,8 +67,8 @@ public: _FORCE_INLINE_ int get_priority() const { return priority; } - virtual bool setup(float p_step)=0; - virtual void solve(float p_step)=0; + virtual bool setup(real_t p_step)=0; + virtual void solve(real_t p_step)=0; virtual ~ConstraintSW() {} }; diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp index cbf444f1e8..d78bcbd16d 100644 --- a/servers/physics/joints/cone_twist_joint_sw.cpp +++ b/servers/physics/joints/cone_twist_joint_sw.cpp @@ -96,7 +96,7 @@ ConeTwistJointSW::ConeTwistJointSW(BodySW* rbA,BodySW* rbB,const Transform& rbAF } -bool ConeTwistJointSW::setup(float p_step) { +bool ConeTwistJointSW::setup(real_t p_step) { m_appliedImpulse = real_t(0.); //set bias, sign, clear accumulator @@ -318,7 +318,7 @@ void ConeTwistJointSW::solve(real_t timeStep) } -void ConeTwistJointSW::set_param(PhysicsServer::ConeTwistJointParam p_param, float p_value) { +void ConeTwistJointSW::set_param(PhysicsServer::ConeTwistJointParam p_param, real_t p_value) { switch(p_param) { case PhysicsServer::CONE_TWIST_JOINT_SWING_SPAN: { @@ -345,7 +345,7 @@ void ConeTwistJointSW::set_param(PhysicsServer::ConeTwistJointParam p_param, flo } } -float ConeTwistJointSW::get_param(PhysicsServer::ConeTwistJointParam p_param) const{ +real_t ConeTwistJointSW::get_param(PhysicsServer::ConeTwistJointParam p_param) const{ switch(p_param) { case PhysicsServer::CONE_TWIST_JOINT_SWING_SPAN: { diff --git a/servers/physics/joints/cone_twist_joint_sw.h b/servers/physics/joints/cone_twist_joint_sw.h index 0d64d67443..eb7a5cd1b1 100644 --- a/servers/physics/joints/cone_twist_joint_sw.h +++ b/servers/physics/joints/cone_twist_joint_sw.h @@ -109,8 +109,8 @@ public: virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_CONE_TWIST; } - virtual bool setup(float p_step); - virtual void solve(float p_step); + virtual bool setup(real_t p_step); + virtual void solve(real_t p_step); ConeTwistJointSW(BodySW* rbA,BodySW* rbB,const Transform& rbAFrame, const Transform& rbBFrame); @@ -146,8 +146,8 @@ public: return m_twistLimitSign; } - void set_param(PhysicsServer::ConeTwistJointParam p_param, float p_value); - float get_param(PhysicsServer::ConeTwistJointParam p_param) const; + void set_param(PhysicsServer::ConeTwistJointParam p_param, real_t p_value); + real_t get_param(PhysicsServer::ConeTwistJointParam p_param) const; }; diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp index 8d3fc4721a..bd07f3122a 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.cpp +++ b/servers/physics/joints/generic_6dof_joint_sw.cpp @@ -38,54 +38,6 @@ See corresponding header file for licensing info. #define GENERIC_D6_DISABLE_WARMSTARTING 1 -real_t btGetMatrixElem(const Basis& mat, int index); -real_t btGetMatrixElem(const Basis& mat, int index) -{ - int i = index%3; - int j = index/3; - return mat[i][j]; -} - -///MatrixToEulerXYZ from http://www.geometrictools.com/LibFoundation/Mathematics/Wm4Matrix3.inl.html -bool matrixToEulerXYZ(const Basis& mat,Vector3& xyz); -bool matrixToEulerXYZ(const Basis& mat,Vector3& xyz) -{ - // rot = cy*cz -cy*sz sy - // cz*sx*sy+cx*sz cx*cz-sx*sy*sz -cy*sx - // -cx*cz*sy+sx*sz cz*sx+cx*sy*sz cx*cy - - if (btGetMatrixElem(mat,2) < real_t(1.0)) - { - if (btGetMatrixElem(mat,2) > real_t(-1.0)) - { - xyz[0] = Math::atan2(-btGetMatrixElem(mat,5),btGetMatrixElem(mat,8)); - xyz[1] = Math::asin(btGetMatrixElem(mat,2)); - xyz[2] = Math::atan2(-btGetMatrixElem(mat,1),btGetMatrixElem(mat,0)); - return true; - } - else - { - // WARNING. Not unique. XA - ZA = -atan2(r10,r11) - xyz[0] = -Math::atan2(btGetMatrixElem(mat,3),btGetMatrixElem(mat,4)); - xyz[1] = -Math_PI*0.5; - xyz[2] = real_t(0.0); - return false; - } - } - else - { - // WARNING. Not unique. XAngle + ZAngle = atan2(r10,r11) - xyz[0] = Math::atan2(btGetMatrixElem(mat,3),btGetMatrixElem(mat,4)); - xyz[1] = Math_PI*0.5; - xyz[2] = 0.0; - - } - - - return false; -} - - //////////////////////////// G6DOFRotationalLimitMotorSW //////////////////////////////////// @@ -297,7 +249,7 @@ void Generic6DOFJointSW::calculateAngleInfo() { Basis relative_frame = m_calculatedTransformA.basis.inverse()*m_calculatedTransformB.basis; - matrixToEulerXYZ(relative_frame,m_calculatedAxisAngleDiff); + m_calculatedAxisAngleDiff = relative_frame.get_euler(); @@ -385,7 +337,7 @@ bool Generic6DOFJointSW::testAngularLimitMotor(int axis_index) return m_angularLimits[axis_index].needApplyTorques(); } -bool Generic6DOFJointSW::setup(float p_step) { +bool Generic6DOFJointSW::setup(real_t p_step) { // Clear accumulated impulses for the next simulation step m_linearLimits.m_accumulatedImpulse=Vector3(real_t(0.), real_t(0.), real_t(0.)); @@ -531,7 +483,7 @@ void Generic6DOFJointSW::calcAnchorPos(void) } // Generic6DOFJointSW::calcAnchorPos() -void Generic6DOFJointSW::set_param(Vector3::Axis p_axis,PhysicsServer::G6DOFJointAxisParam p_param, float p_value) { +void Generic6DOFJointSW::set_param(Vector3::Axis p_axis,PhysicsServer::G6DOFJointAxisParam p_param, real_t p_value) { ERR_FAIL_INDEX(p_axis,3); switch(p_param) { @@ -607,7 +559,7 @@ void Generic6DOFJointSW::set_param(Vector3::Axis p_axis,PhysicsServer::G6DOFJoin } } -float Generic6DOFJointSW::get_param(Vector3::Axis p_axis,PhysicsServer::G6DOFJointAxisParam p_param) const{ +real_t Generic6DOFJointSW::get_param(Vector3::Axis p_axis,PhysicsServer::G6DOFJointAxisParam p_param) const{ ERR_FAIL_INDEX_V(p_axis,3,0); switch(p_param) { case PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT: { diff --git a/servers/physics/joints/generic_6dof_joint_sw.h b/servers/physics/joints/generic_6dof_joint_sw.h index 4ac727c124..207ae85a45 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.h +++ b/servers/physics/joints/generic_6dof_joint_sw.h @@ -295,8 +295,8 @@ public: virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_6DOF; } - virtual bool setup(float p_step); - virtual void solve(float p_step); + virtual bool setup(real_t p_step); + virtual void solve(real_t p_step); //! Calcs global transform of the offsets @@ -449,8 +449,8 @@ public: virtual void calcAnchorPos(void); // overridable - void set_param(Vector3::Axis p_axis,PhysicsServer::G6DOFJointAxisParam p_param, float p_value); - float get_param(Vector3::Axis p_axis,PhysicsServer::G6DOFJointAxisParam p_param) const; + void set_param(Vector3::Axis p_axis,PhysicsServer::G6DOFJointAxisParam p_param, real_t p_value); + real_t get_param(Vector3::Axis p_axis,PhysicsServer::G6DOFJointAxisParam p_param) const; void set_flag(Vector3::Axis p_axis,PhysicsServer::G6DOFJointAxisFlag p_flag, bool p_value); bool get_flag(Vector3::Axis p_axis,PhysicsServer::G6DOFJointAxisFlag p_flag) const; diff --git a/servers/physics/joints/hinge_joint_sw.cpp b/servers/physics/joints/hinge_joint_sw.cpp index d50d5a1a73..9617eb8794 100644 --- a/servers/physics/joints/hinge_joint_sw.cpp +++ b/servers/physics/joints/hinge_joint_sw.cpp @@ -148,7 +148,7 @@ HingeJointSW::HingeJointSW(BodySW* rbA,BodySW* rbB, const Vector3& pivotInA,cons -bool HingeJointSW::setup(float p_step) { +bool HingeJointSW::setup(real_t p_step) { m_appliedImpulse = real_t(0.); @@ -262,7 +262,7 @@ bool HingeJointSW::setup(float p_step) { return true; } -void HingeJointSW::solve(float p_step) { +void HingeJointSW::solve(real_t p_step) { Vector3 pivotAInW = A->get_transform().xform(m_rbAFrame.origin); Vector3 pivotBInW = B->get_transform().xform(m_rbBFrame.origin); @@ -418,7 +418,7 @@ real_t HingeJointSW::get_hinge_angle() { } -void HingeJointSW::set_param(PhysicsServer::HingeJointParam p_param, float p_value) { +void HingeJointSW::set_param(PhysicsServer::HingeJointParam p_param, real_t p_value) { switch (p_param) { @@ -434,7 +434,7 @@ void HingeJointSW::set_param(PhysicsServer::HingeJointParam p_param, float p_val } } -float HingeJointSW::get_param(PhysicsServer::HingeJointParam p_param) const{ +real_t HingeJointSW::get_param(PhysicsServer::HingeJointParam p_param) const{ switch (p_param) { diff --git a/servers/physics/joints/hinge_joint_sw.h b/servers/physics/joints/hinge_joint_sw.h index 60203e3cc4..8469fd1ca0 100644 --- a/servers/physics/joints/hinge_joint_sw.h +++ b/servers/physics/joints/hinge_joint_sw.h @@ -103,13 +103,13 @@ public: virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_HINGE; } - virtual bool setup(float p_step); - virtual void solve(float p_step); + virtual bool setup(real_t p_step); + virtual void solve(real_t p_step); real_t get_hinge_angle(); - void set_param(PhysicsServer::HingeJointParam p_param, float p_value); - float get_param(PhysicsServer::HingeJointParam p_param) const; + void set_param(PhysicsServer::HingeJointParam p_param, real_t p_value); + real_t get_param(PhysicsServer::HingeJointParam p_param) const; void set_flag(PhysicsServer::HingeJointFlag p_flag, bool p_value); bool get_flag(PhysicsServer::HingeJointFlag p_flag) const; diff --git a/servers/physics/joints/pin_joint_sw.cpp b/servers/physics/joints/pin_joint_sw.cpp index 9c7fe65684..b545ae630b 100644 --- a/servers/physics/joints/pin_joint_sw.cpp +++ b/servers/physics/joints/pin_joint_sw.cpp @@ -34,7 +34,7 @@ See corresponding header file for licensing info. #include "pin_joint_sw.h" -bool PinJointSW::setup(float p_step) { +bool PinJointSW::setup(real_t p_step) { m_appliedImpulse = real_t(0.); @@ -59,7 +59,7 @@ bool PinJointSW::setup(float p_step) { return true; } -void PinJointSW::solve(float p_step){ +void PinJointSW::solve(real_t p_step){ Vector3 pivotAInW = A->get_transform().xform(m_pivotInA); Vector3 pivotBInW = B->get_transform().xform(m_pivotInB); @@ -116,7 +116,7 @@ void PinJointSW::solve(float p_step){ } } -void PinJointSW::set_param(PhysicsServer::PinJointParam p_param,float p_value) { +void PinJointSW::set_param(PhysicsServer::PinJointParam p_param,real_t p_value) { switch(p_param) { case PhysicsServer::PIN_JOINT_BIAS: m_tau=p_value; break; @@ -125,7 +125,7 @@ void PinJointSW::set_param(PhysicsServer::PinJointParam p_param,float p_value) { } } -float PinJointSW::get_param(PhysicsServer::PinJointParam p_param) const{ +real_t PinJointSW::get_param(PhysicsServer::PinJointParam p_param) const{ switch(p_param) { case PhysicsServer::PIN_JOINT_BIAS: return m_tau; diff --git a/servers/physics/joints/pin_joint_sw.h b/servers/physics/joints/pin_joint_sw.h index 6797972496..b72b21219d 100644 --- a/servers/physics/joints/pin_joint_sw.h +++ b/servers/physics/joints/pin_joint_sw.h @@ -79,11 +79,11 @@ public: virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_PIN; } - virtual bool setup(float p_step); - virtual void solve(float p_step); + virtual bool setup(real_t p_step); + virtual void solve(real_t p_step); - void set_param(PhysicsServer::PinJointParam p_param,float p_value); - float get_param(PhysicsServer::PinJointParam p_param) const; + void set_param(PhysicsServer::PinJointParam p_param,real_t p_value); + real_t get_param(PhysicsServer::PinJointParam p_param) const; void set_pos_A(const Vector3& p_pos) { m_pivotInA=p_pos; } void set_pos_B(const Vector3& p_pos) { m_pivotInB=p_pos; } diff --git a/servers/physics/joints/slider_joint_sw.cpp b/servers/physics/joints/slider_joint_sw.cpp index bdcae08ca4..fc728ed0ba 100644 --- a/servers/physics/joints/slider_joint_sw.cpp +++ b/servers/physics/joints/slider_joint_sw.cpp @@ -112,7 +112,7 @@ SliderJointSW::SliderJointSW(BodySW* rbA, BodySW* rbB, const Transform& frameInA //----------------------------------------------------------------------------- -bool SliderJointSW::setup(float p_step) +bool SliderJointSW::setup(real_t p_step) { //calculate transforms @@ -406,7 +406,7 @@ Vector3 SliderJointSW::getAncorInB(void) return ancorInB; } // SliderJointSW::getAncorInB(); -void SliderJointSW::set_param(PhysicsServer::SliderJointParam p_param, float p_value) { +void SliderJointSW::set_param(PhysicsServer::SliderJointParam p_param, real_t p_value) { switch(p_param) { case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER: m_upperLinLimit=p_value; break; @@ -437,7 +437,7 @@ void SliderJointSW::set_param(PhysicsServer::SliderJointParam p_param, float p_v } -float SliderJointSW::get_param(PhysicsServer::SliderJointParam p_param) const { +real_t SliderJointSW::get_param(PhysicsServer::SliderJointParam p_param) const { switch(p_param) { case PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER: return m_upperLinLimit; diff --git a/servers/physics/joints/slider_joint_sw.h b/servers/physics/joints/slider_joint_sw.h index 4e697e6f64..d01038df59 100644 --- a/servers/physics/joints/slider_joint_sw.h +++ b/servers/physics/joints/slider_joint_sw.h @@ -237,11 +237,11 @@ public: Vector3 getAncorInA(void); Vector3 getAncorInB(void); - void set_param(PhysicsServer::SliderJointParam p_param, float p_value); - float get_param(PhysicsServer::SliderJointParam p_param) const; + void set_param(PhysicsServer::SliderJointParam p_param, real_t p_value); + real_t get_param(PhysicsServer::SliderJointParam p_param) const; - bool setup(float p_step); - void solve(float p_step); + bool setup(real_t p_step); + void solve(real_t p_step); virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_SLIDER; } diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp index b71eae54b0..67e3b27852 100644 --- a/servers/physics/physics_server_sw.cpp +++ b/servers/physics/physics_server_sw.cpp @@ -727,7 +727,7 @@ uint32_t PhysicsServerSW::body_get_user_flags(RID p_body, uint32_t p_flags) cons return 0; }; -void PhysicsServerSW::body_set_param(RID p_body, BodyParameter p_param, float p_value) { +void PhysicsServerSW::body_set_param(RID p_body, BodyParameter p_param, real_t p_value) { BodySW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); @@ -735,7 +735,7 @@ void PhysicsServerSW::body_set_param(RID p_body, BodyParameter p_param, float p_ body->set_param(p_param,p_value); }; -float PhysicsServerSW::body_get_param(RID p_body, BodyParameter p_param) const { +real_t PhysicsServerSW::body_get_param(RID p_body, BodyParameter p_param) const { BodySW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body,0); @@ -879,14 +879,14 @@ void PhysicsServerSW::body_get_collision_exceptions(RID p_body, List<RID> *p_exc }; -void PhysicsServerSW::body_set_contacts_reported_depth_treshold(RID p_body, float p_treshold) { +void PhysicsServerSW::body_set_contacts_reported_depth_treshold(RID p_body, real_t p_treshold) { BodySW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); }; -float PhysicsServerSW::body_get_contacts_reported_depth_treshold(RID p_body) const { +real_t PhysicsServerSW::body_get_contacts_reported_depth_treshold(RID p_body) const { BodySW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body,0); @@ -971,7 +971,7 @@ RID PhysicsServerSW::joint_create_pin(RID p_body_A,const Vector3& p_local_A,RID return rid; } -void PhysicsServerSW::pin_joint_set_param(RID p_joint,PinJointParam p_param, float p_value){ +void PhysicsServerSW::pin_joint_set_param(RID p_joint,PinJointParam p_param, real_t p_value){ JointSW *joint = joint_owner.get(p_joint); ERR_FAIL_COND(!joint); @@ -980,7 +980,7 @@ void PhysicsServerSW::pin_joint_set_param(RID p_joint,PinJointParam p_param, flo pin_joint->set_param(p_param,p_value); } -float PhysicsServerSW::pin_joint_get_param(RID p_joint,PinJointParam p_param) const{ +real_t PhysicsServerSW::pin_joint_get_param(RID p_joint,PinJointParam p_param) const{ JointSW *joint = joint_owner.get(p_joint); ERR_FAIL_COND_V(!joint,0); @@ -1074,7 +1074,7 @@ RID PhysicsServerSW::joint_create_hinge_simple(RID p_body_A,const Vector3& p_piv } -void PhysicsServerSW::hinge_joint_set_param(RID p_joint,HingeJointParam p_param, float p_value){ +void PhysicsServerSW::hinge_joint_set_param(RID p_joint,HingeJointParam p_param, real_t p_value){ JointSW *joint = joint_owner.get(p_joint); ERR_FAIL_COND(!joint); @@ -1083,7 +1083,7 @@ void PhysicsServerSW::hinge_joint_set_param(RID p_joint,HingeJointParam p_param, hinge_joint->set_param(p_param,p_value); } -float PhysicsServerSW::hinge_joint_get_param(RID p_joint,HingeJointParam p_param) const{ +real_t PhysicsServerSW::hinge_joint_get_param(RID p_joint,HingeJointParam p_param) const{ JointSW *joint = joint_owner.get(p_joint); ERR_FAIL_COND_V(!joint,0); @@ -1154,7 +1154,7 @@ RID PhysicsServerSW::joint_create_slider(RID p_body_A,const Transform& p_local_f return rid; } -void PhysicsServerSW::slider_joint_set_param(RID p_joint,SliderJointParam p_param, float p_value){ +void PhysicsServerSW::slider_joint_set_param(RID p_joint,SliderJointParam p_param, real_t p_value){ JointSW *joint = joint_owner.get(p_joint); ERR_FAIL_COND(!joint); @@ -1162,7 +1162,7 @@ void PhysicsServerSW::slider_joint_set_param(RID p_joint,SliderJointParam p_para SliderJointSW *slider_joint = static_cast<SliderJointSW*>(joint); slider_joint->set_param(p_param,p_value); } -float PhysicsServerSW::slider_joint_get_param(RID p_joint,SliderJointParam p_param) const{ +real_t PhysicsServerSW::slider_joint_get_param(RID p_joint,SliderJointParam p_param) const{ JointSW *joint = joint_owner.get(p_joint); ERR_FAIL_COND_V(!joint,0); @@ -1193,7 +1193,7 @@ RID PhysicsServerSW::joint_create_cone_twist(RID p_body_A,const Transform& p_loc return rid; } -void PhysicsServerSW::cone_twist_joint_set_param(RID p_joint,ConeTwistJointParam p_param, float p_value) { +void PhysicsServerSW::cone_twist_joint_set_param(RID p_joint,ConeTwistJointParam p_param, real_t p_value) { JointSW *joint = joint_owner.get(p_joint); ERR_FAIL_COND(!joint); @@ -1201,7 +1201,7 @@ void PhysicsServerSW::cone_twist_joint_set_param(RID p_joint,ConeTwistJointParam ConeTwistJointSW *cone_twist_joint = static_cast<ConeTwistJointSW*>(joint); cone_twist_joint->set_param(p_param,p_value); } -float PhysicsServerSW::cone_twist_joint_get_param(RID p_joint,ConeTwistJointParam p_param) const { +real_t PhysicsServerSW::cone_twist_joint_get_param(RID p_joint,ConeTwistJointParam p_param) const { JointSW *joint = joint_owner.get(p_joint); ERR_FAIL_COND_V(!joint,0); @@ -1232,7 +1232,7 @@ RID PhysicsServerSW::joint_create_generic_6dof(RID p_body_A,const Transform& p_l return rid; } -void PhysicsServerSW::generic_6dof_joint_set_param(RID p_joint,Vector3::Axis p_axis,G6DOFJointAxisParam p_param, float p_value){ +void PhysicsServerSW::generic_6dof_joint_set_param(RID p_joint,Vector3::Axis p_axis,G6DOFJointAxisParam p_param, real_t p_value){ JointSW *joint = joint_owner.get(p_joint); ERR_FAIL_COND(!joint); @@ -1240,7 +1240,7 @@ void PhysicsServerSW::generic_6dof_joint_set_param(RID p_joint,Vector3::Axis p_a Generic6DOFJointSW *generic_6dof_joint = static_cast<Generic6DOFJointSW*>(joint); generic_6dof_joint->set_param(p_axis,p_param,p_value); } -float PhysicsServerSW::generic_6dof_joint_get_param(RID p_joint,Vector3::Axis p_axis,G6DOFJointAxisParam p_param){ +real_t PhysicsServerSW::generic_6dof_joint_get_param(RID p_joint,Vector3::Axis p_axis,G6DOFJointAxisParam p_param){ JointSW *joint = joint_owner.get(p_joint); ERR_FAIL_COND_V(!joint,0); @@ -1488,7 +1488,7 @@ void PhysicsServerSW::init() { }; -void PhysicsServerSW::step(float p_step) { +void PhysicsServerSW::step(real_t p_step) { if (!active) @@ -1611,11 +1611,11 @@ void PhysicsServerSW::_shape_col_cbk(const Vector3& p_point_A,const Vector3& p_p if (cbk->amount == cbk->max) { //find least deep - float min_depth=1e20; + real_t min_depth=1e20; int min_depth_idx=0; for(int i=0;i<cbk->amount;i++) { - float d = cbk->ptr[i*2+0].distance_squared_to(cbk->ptr[i*2+1]); + real_t d = cbk->ptr[i*2+0].distance_squared_to(cbk->ptr[i*2+1]); if (d<min_depth) { min_depth=d; min_depth_idx=i; @@ -1623,7 +1623,7 @@ void PhysicsServerSW::_shape_col_cbk(const Vector3& p_point_A,const Vector3& p_p } - float d = p_point_A.distance_squared_to(p_point_B); + real_t d = p_point_A.distance_squared_to(p_point_B); if (d<min_depth) return; cbk->ptr[min_depth_idx*2+0]=p_point_A; diff --git a/servers/physics/physics_server_sw.h b/servers/physics/physics_server_sw.h index 72b133c4b9..6e20474350 100644 --- a/servers/physics/physics_server_sw.h +++ b/servers/physics/physics_server_sw.h @@ -180,8 +180,8 @@ public: virtual void body_set_user_flags(RID p_body, uint32_t p_flags); virtual uint32_t body_get_user_flags(RID p_body, uint32_t p_flags) const; - virtual void body_set_param(RID p_body, BodyParameter p_param, float p_value); - virtual float body_get_param(RID p_body, BodyParameter p_param) const; + virtual void body_set_param(RID p_body, BodyParameter p_param, real_t p_value); + virtual real_t body_get_param(RID p_body, BodyParameter p_param) const; virtual void body_set_state(RID p_body, BodyState p_state, const Variant& p_variant); virtual Variant body_get_state(RID p_body, BodyState p_state) const; @@ -203,8 +203,8 @@ public: virtual void body_remove_collision_exception(RID p_body, RID p_body_b); virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions); - virtual void body_set_contacts_reported_depth_treshold(RID p_body, float p_treshold); - virtual float body_get_contacts_reported_depth_treshold(RID p_body) const; + virtual void body_set_contacts_reported_depth_treshold(RID p_body, real_t p_treshold); + virtual real_t body_get_contacts_reported_depth_treshold(RID p_body) const; virtual void body_set_omit_force_integration(RID p_body,bool p_omit); virtual bool body_is_omitting_force_integration(RID p_body) const; @@ -221,8 +221,8 @@ public: virtual RID joint_create_pin(RID p_body_A,const Vector3& p_local_A,RID p_body_B,const Vector3& p_local_B); - virtual void pin_joint_set_param(RID p_joint,PinJointParam p_param, float p_value); - virtual float pin_joint_get_param(RID p_joint,PinJointParam p_param) const; + virtual void pin_joint_set_param(RID p_joint,PinJointParam p_param, real_t p_value); + virtual real_t pin_joint_get_param(RID p_joint,PinJointParam p_param) const; virtual void pin_joint_set_local_A(RID p_joint, const Vector3& p_A); virtual Vector3 pin_joint_get_local_A(RID p_joint) const; @@ -233,8 +233,8 @@ public: virtual RID joint_create_hinge(RID p_body_A,const Transform& p_frame_A,RID p_body_B,const Transform& p_frame_B); virtual RID joint_create_hinge_simple(RID p_body_A,const Vector3& p_pivot_A,const Vector3& p_axis_A,RID p_body_B,const Vector3& p_pivot_B,const Vector3& p_axis_B); - virtual void hinge_joint_set_param(RID p_joint,HingeJointParam p_param, float p_value); - virtual float hinge_joint_get_param(RID p_joint,HingeJointParam p_param) const; + virtual void hinge_joint_set_param(RID p_joint,HingeJointParam p_param, real_t p_value); + virtual real_t hinge_joint_get_param(RID p_joint,HingeJointParam p_param) const; virtual void hinge_joint_set_flag(RID p_joint,HingeJointFlag p_flag, bool p_value); virtual bool hinge_joint_get_flag(RID p_joint,HingeJointFlag p_flag) const; @@ -242,18 +242,18 @@ public: virtual RID joint_create_slider(RID p_body_A,const Transform& p_local_frame_A,RID p_body_B,const Transform& p_local_frame_B); //reference frame is A - virtual void slider_joint_set_param(RID p_joint,SliderJointParam p_param, float p_value); - virtual float slider_joint_get_param(RID p_joint,SliderJointParam p_param) const; + virtual void slider_joint_set_param(RID p_joint,SliderJointParam p_param, real_t p_value); + virtual real_t slider_joint_get_param(RID p_joint,SliderJointParam p_param) const; virtual RID joint_create_cone_twist(RID p_body_A,const Transform& p_local_frame_A,RID p_body_B,const Transform& p_local_frame_B); //reference frame is A - virtual void cone_twist_joint_set_param(RID p_joint,ConeTwistJointParam p_param, float p_value); - virtual float cone_twist_joint_get_param(RID p_joint,ConeTwistJointParam p_param) const; + virtual void cone_twist_joint_set_param(RID p_joint,ConeTwistJointParam p_param, real_t p_value); + virtual real_t cone_twist_joint_get_param(RID p_joint,ConeTwistJointParam p_param) const; virtual RID joint_create_generic_6dof(RID p_body_A,const Transform& p_local_frame_A,RID p_body_B,const Transform& p_local_frame_B); //reference frame is A - virtual void generic_6dof_joint_set_param(RID p_joint,Vector3::Axis,G6DOFJointAxisParam p_param, float p_value); - virtual float generic_6dof_joint_get_param(RID p_joint,Vector3::Axis,G6DOFJointAxisParam p_param); + virtual void generic_6dof_joint_set_param(RID p_joint,Vector3::Axis,G6DOFJointAxisParam p_param, real_t p_value); + virtual real_t generic_6dof_joint_get_param(RID p_joint,Vector3::Axis,G6DOFJointAxisParam p_param); virtual void generic_6dof_joint_set_flag(RID p_joint,Vector3::Axis,G6DOFJointAxisFlag p_flag, bool p_enable); virtual bool generic_6dof_joint_get_flag(RID p_joint,Vector3::Axis,G6DOFJointAxisFlag p_flag); @@ -281,7 +281,7 @@ public: virtual void set_active(bool p_active); virtual void init(); - virtual void step(float p_step); + virtual void step(real_t p_step); virtual void sync(); virtual void flush_queries(); virtual void finish(); diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index 4114980b82..dec1c75d9f 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -125,7 +125,7 @@ bool PlaneShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_end return inters; } -Vector3 PlaneShapeSW::get_moment_of_inertia(float p_mass) const { +Vector3 PlaneShapeSW::get_moment_of_inertia(real_t p_mass) const { return Vector3(); //wtf } @@ -154,7 +154,7 @@ PlaneShapeSW::PlaneShapeSW() { // -float RayShapeSW::get_length() const { +real_t RayShapeSW::get_length() const { return length; } @@ -181,7 +181,7 @@ void RayShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector3 *r_suppo r_amount=2; r_supports[0]=Vector3(0,0,0); r_supports[1]=Vector3(0,0,length); - } if (p_normal.z>0) { + } else if (p_normal.z>0) { r_amount=1; *r_supports=Vector3(0,0,length); } else { @@ -196,12 +196,12 @@ bool RayShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_end,V return false; //simply not possible } -Vector3 RayShapeSW::get_moment_of_inertia(float p_mass) const { +Vector3 RayShapeSW::get_moment_of_inertia(real_t p_mass) const { return Vector3(); } -void RayShapeSW::_setup(float p_length) { +void RayShapeSW::_setup(real_t p_length) { length=p_length; configure(Rect3(Vector3(0,0,0),Vector3(0.1,0.1,length))); @@ -234,11 +234,11 @@ real_t SphereShapeSW::get_radius() const { void SphereShapeSW::project_range(const Vector3& p_normal, const Transform& p_transform, real_t &r_min, real_t &r_max) const { - float d = p_normal.dot( p_transform.origin ); + real_t d = p_normal.dot( p_transform.origin ); // figure out scale at point Vector3 local_normal = p_transform.basis.xform_inv(p_normal); - float scale = local_normal.length(); + real_t scale = local_normal.length(); r_min = d - (radius) * scale; r_max = d + (radius) * scale; @@ -261,9 +261,9 @@ bool SphereShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_en return Geometry::segment_intersects_sphere(p_begin,p_end,Vector3(),radius,&r_result,&r_normal); } -Vector3 SphereShapeSW::get_moment_of_inertia(float p_mass) const { +Vector3 SphereShapeSW::get_moment_of_inertia(real_t p_mass) const { - float s = 0.4 * p_mass * radius * radius; + real_t s = 0.4 * p_mass * radius * radius; return Vector3(s,s,s); } @@ -299,8 +299,8 @@ void BoxShapeSW::project_range(const Vector3& p_normal, const Transform& p_trans // no matter the angle, the box is mirrored anyway Vector3 local_normal=p_transform.basis.xform_inv(p_normal); - float length = local_normal.abs().dot(half_extents); - float distance = p_normal.dot( p_transform.origin ); + real_t length = local_normal.abs().dot(half_extents); + real_t distance = p_normal.dot( p_transform.origin ); r_min = distance - length; r_max = distance + length; @@ -329,7 +329,7 @@ void BoxShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector3 *r_suppo Vector3 axis; axis[i]=1.0; - float dot = p_normal.dot( axis ); + real_t dot = p_normal.dot( axis ); if ( Math::abs( dot ) > _FACE_IS_VALID_SUPPORT_TRESHOLD ) { //Vector3 axis_b; @@ -343,7 +343,7 @@ void BoxShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector3 *r_suppo int i_n=next[i]; int i_n2=next2[i]; - static const float sign[4][2]={ + static const real_t sign[4][2]={ {-1.0, 1.0}, { 1.0, 1.0}, @@ -418,11 +418,11 @@ bool BoxShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_end,V } -Vector3 BoxShapeSW::get_moment_of_inertia(float p_mass) const { +Vector3 BoxShapeSW::get_moment_of_inertia(real_t p_mass) const { - float lx=half_extents.x; - float ly=half_extents.y; - float lz=half_extents.z; + real_t lx=half_extents.x; + real_t ly=half_extents.y; + real_t lz=half_extents.z; return Vector3( (p_mass/3.0) * (ly*ly + lz*lz), (p_mass/3.0) * (lx*lx + lz*lz), (p_mass/3.0) * (lx*lx + ly*ly) ); @@ -460,7 +460,7 @@ BoxShapeSW::BoxShapeSW() { void CapsuleShapeSW::project_range(const Vector3& p_normal, const Transform& p_transform, real_t &r_min, real_t &r_max) const { Vector3 n=p_transform.basis.xform_inv(p_normal).normalized(); - float h = (n.z > 0) ? height : -height; + real_t h = (n.z > 0) ? height : -height; n *= radius; n.z += h * 0.5; @@ -471,8 +471,8 @@ void CapsuleShapeSW::project_range(const Vector3& p_normal, const Transform& p_t n = p_transform.basis.xform(n); - float distance = p_normal.dot( p_transform.origin ); - float length = Math::abs(p_normal.dot(n)); + real_t distance = p_normal.dot( p_transform.origin ); + real_t length = Math::abs(p_normal.dot(n)); r_min = distance - length; r_max = distance + length; @@ -484,7 +484,7 @@ Vector3 CapsuleShapeSW::get_support(const Vector3& p_normal) const { Vector3 n=p_normal; - float h = (n.z > 0) ? height : -height; + real_t h = (n.z > 0) ? height : -height; n*=radius; n.z += h*0.5; @@ -496,7 +496,7 @@ void CapsuleShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector3 *r_s Vector3 n=p_normal; - float d = n.z; + real_t d = n.z; if (Math::abs( d )<_EDGE_IS_VALID_SUPPORT_TRESHOLD ) { @@ -513,7 +513,7 @@ void CapsuleShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector3 *r_s } else { - float h = (d > 0) ? height : -height; + real_t h = (d > 0) ? height : -height; n*=radius; n.z += h*0.5; @@ -528,7 +528,7 @@ void CapsuleShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector3 *r_s bool CapsuleShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const { Vector3 norm=(p_end-p_begin).normalized(); - float min_d=1e20; + real_t min_d=1e20; Vector3 res,n; @@ -542,7 +542,7 @@ bool CapsuleShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_e collided = Geometry::segment_intersects_cylinder(p_begin,p_end,height,radius,&auxres,&auxn); if (collided) { - float d=norm.dot(auxres); + real_t d=norm.dot(auxres); if (d<min_d) { min_d=d; res=auxres; @@ -554,7 +554,7 @@ bool CapsuleShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_e collided = Geometry::segment_intersects_sphere(p_begin,p_end,Vector3(0,0,height*0.5),radius,&auxres,&auxn); if (collided) { - float d=norm.dot(auxres); + real_t d=norm.dot(auxres); if (d<min_d) { min_d=d; res=auxres; @@ -566,7 +566,7 @@ bool CapsuleShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_e collided = Geometry::segment_intersects_sphere(p_begin,p_end,Vector3(0,0,height*-0.5),radius,&auxres,&auxn); if (collided) { - float d=norm.dot(auxres); + real_t d=norm.dot(auxres); if (d<min_d) { min_d=d; @@ -584,7 +584,7 @@ bool CapsuleShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_e return collision; } -Vector3 CapsuleShapeSW::get_moment_of_inertia(float p_mass) const { +Vector3 CapsuleShapeSW::get_moment_of_inertia(real_t p_mass) const { // use crappy AABB approximation Vector3 extents=get_aabb().size*0.5; @@ -647,7 +647,7 @@ void ConvexPolygonShapeSW::project_range(const Vector3& p_normal, const Transfor for (int i=0;i<vertex_count;i++) { - float d=p_normal.dot( p_transform.xform( vrts[i] ) ); + real_t d=p_normal.dot( p_transform.xform( vrts[i] ) ); if (i==0 || d > r_max) r_max=d; @@ -661,7 +661,7 @@ Vector3 ConvexPolygonShapeSW::get_support(const Vector3& p_normal) const { Vector3 n=p_normal; int vert_support_idx=-1; - float support_max; + real_t support_max; int vertex_count=mesh.vertices.size(); if (vertex_count==0) @@ -671,7 +671,7 @@ Vector3 ConvexPolygonShapeSW::get_support(const Vector3& p_normal) const { for (int i=0;i<vertex_count;i++) { - float d=n.dot(vrts[i]); + real_t d=n.dot(vrts[i]); if (i==0 || d > support_max) { support_max=d; @@ -702,7 +702,7 @@ void ConvexPolygonShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector for (int i=0;i<vc;i++) { - float d=p_normal.dot(vertices[i]); + real_t d=p_normal.dot(vertices[i]); if (i==0 || d > max) { max=d; @@ -742,7 +742,7 @@ void ConvexPolygonShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector for(int i=0;i<ec;i++) { - float dot=(vertices[edges[i].a]-vertices[edges[i].b]).normalized().dot(p_normal); + real_t dot=(vertices[edges[i].a]-vertices[edges[i].b]).normalized().dot(p_normal); dot=ABS(dot); if (dot < _EDGE_IS_VALID_SUPPORT_TRESHOLD && (edges[i].a==vtx || edges[i].b==vtx)) { @@ -768,7 +768,7 @@ bool ConvexPolygonShapeSW::intersect_segment(const Vector3& p_begin,const Vector const Vector3 *vertices = mesh.vertices.ptr(); Vector3 n = p_end-p_begin; - float min = 1e20; + real_t min = 1e20; bool col=false; for(int i=0;i<fc;i++) { @@ -784,7 +784,7 @@ bool ConvexPolygonShapeSW::intersect_segment(const Vector3& p_begin,const Vector Face3 f(vertices[ind[0]],vertices[ind[j]],vertices[ind[j+1]]); Vector3 result; if (f.intersects_segment(p_begin,p_end,&result)) { - float d = n.dot(result); + real_t d = n.dot(result); if (d<min) { min=d; r_result=result; @@ -802,7 +802,7 @@ bool ConvexPolygonShapeSW::intersect_segment(const Vector3& p_begin,const Vector } -Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(float p_mass) const { +Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(real_t p_mass) const { // use crappy AABB approximation Vector3 extents=get_aabb().size*0.5; @@ -859,7 +859,7 @@ void FaceShapeSW::project_range(const Vector3& p_normal, const Transform& p_tran for (int i=0;i<3;i++) { Vector3 v=p_transform.xform(vertex[i]); - float d=p_normal.dot(v); + real_t d=p_normal.dot(v); if (i==0 || d > r_max) r_max=d; @@ -873,11 +873,11 @@ Vector3 FaceShapeSW::get_support(const Vector3& p_normal) const { int vert_support_idx=-1; - float support_max; + real_t support_max; for (int i=0;i<3;i++) { - float d=p_normal.dot(vertex[i]); + real_t d=p_normal.dot(vertex[i]); if (i==0 || d > support_max) { support_max=d; @@ -907,11 +907,11 @@ void FaceShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector3 *r_supp /** FIND SUPPORT VERTEX **/ int vert_support_idx=-1; - float support_max; + real_t support_max; for (int i=0;i<3;i++) { - float d=n.dot(vertex[i]); + real_t d=n.dot(vertex[i]); if (i==0 || d > support_max) { support_max=d; @@ -928,7 +928,7 @@ void FaceShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector3 *r_supp continue; // check if edge is valid as a support - float dot=(vertex[i]-vertex[nx]).normalized().dot(n); + real_t dot=(vertex[i]-vertex[nx]).normalized().dot(n); dot=ABS(dot); if (dot < _EDGE_IS_VALID_SUPPORT_TRESHOLD) { @@ -957,7 +957,7 @@ bool FaceShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_end, return c; } -Vector3 FaceShapeSW::get_moment_of_inertia(float p_mass) const { +Vector3 FaceShapeSW::get_moment_of_inertia(real_t p_mass) const { return Vector3(); // Sorry, but i don't think anyone cares, FaceShape! @@ -1003,7 +1003,7 @@ void ConcavePolygonShapeSW::project_range(const Vector3& p_normal, const Transfo for (int i=0;i<count;i++) { - float d=p_normal.dot( p_transform.xform( vptr[i] ) ); + real_t d=p_normal.dot( p_transform.xform( vptr[i] ) ); if (i==0 || d > r_max) r_max=d; @@ -1026,11 +1026,11 @@ Vector3 ConcavePolygonShapeSW::get_support(const Vector3& p_normal) const { Vector3 n=p_normal; int vert_support_idx=-1; - float support_max; + real_t support_max; for (int i=0;i<count;i++) { - float d=n.dot(vptr[i]); + real_t d=n.dot(vptr[i]); if (i==0 || d > support_max) { support_max=d; @@ -1080,7 +1080,7 @@ void ConcavePolygonShapeSW::_cull_segment(int p_idx,_SegmentCullParams *p_params &res)) { - float d=p_params->dir.dot(res) - p_params->dir.dot(p_params->from); + real_t d=p_params->dir.dot(res) - p_params->dir.dot(p_params->from); //TODO, seems segmen/triangle intersection is broken :( if (d>0 && d<p_params->min_d) { @@ -1206,7 +1206,7 @@ void ConcavePolygonShapeSW::cull(const Rect3& p_local_aabb,Callback p_callback,v } -Vector3 ConcavePolygonShapeSW::get_moment_of_inertia(float p_mass) const { +Vector3 ConcavePolygonShapeSW::get_moment_of_inertia(real_t p_mass) const { // use crappy AABB approximation Vector3 extents=get_aabb().size*0.5; @@ -1555,7 +1555,7 @@ ConcavePolygonShapeSW::ConcavePolygonShapeSW() { /* HEIGHT MAP SHAPE */ -PoolVector<float> HeightMapShapeSW::get_heights() const { +PoolVector<real_t> HeightMapShapeSW::get_heights() const { return heights; } @@ -1567,7 +1567,7 @@ int HeightMapShapeSW::get_depth() const { return depth; } -float HeightMapShapeSW::get_cell_size() const { +real_t HeightMapShapeSW::get_cell_size() const { return cell_size; } @@ -1602,7 +1602,7 @@ void HeightMapShapeSW::cull(const Rect3& p_local_aabb,Callback p_callback,void* } -Vector3 HeightMapShapeSW::get_moment_of_inertia(float p_mass) const { +Vector3 HeightMapShapeSW::get_moment_of_inertia(real_t p_mass) const { // use crappy AABB approximation @@ -1631,7 +1631,7 @@ void HeightMapShapeSW::_setup(PoolVector<real_t> p_heights,int p_width,int p_dep for(int j=0;j<width;j++) { - float h = r[i*width+j]; + real_t h = r[i*width+j]; Vector3 pos( j*cell_size, h, i*cell_size ); if (i==0 || j==0) @@ -1657,8 +1657,8 @@ void HeightMapShapeSW::set_data(const Variant& p_data) { int width=d["width"]; int depth=d["depth"]; - float cell_size=d["cell_size"]; - PoolVector<float> heights=d["heights"]; + real_t cell_size=d["cell_size"]; + PoolVector<real_t> heights=d["heights"]; ERR_FAIL_COND( width<= 0); ERR_FAIL_COND( depth<= 0); diff --git a/servers/physics/shape_sw.h b/servers/physics/shape_sw.h index 919c681105..55daa5856d 100644 --- a/servers/physics/shape_sw.h +++ b/servers/physics/shape_sw.h @@ -35,8 +35,8 @@ /* SHAPE_LINE, ///< plane:"plane" -SHAPE_SEGMENT, ///< float:"length" -SHAPE_CIRCLE, ///< float:"radius" +SHAPE_SEGMENT, ///< real_t:"length" +SHAPE_CIRCLE, ///< real_t:"radius" SHAPE_RECTANGLE, ///< vec3:"extents" SHAPE_CONVEX_POLYGON, ///< array of planes:"planes" SHAPE_CONCAVE_POLYGON, ///< Vector3 array:"triangles" , or Dictionary with "indices" (int array) and "triangles" (Vector3 array) @@ -90,7 +90,7 @@ public: virtual void get_supports(const Vector3& p_normal,int p_max,Vector3 *r_supports,int & r_amount) const=0; virtual bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_point, Vector3 &r_normal) const=0; - virtual Vector3 get_moment_of_inertia(float p_mass) const=0; + virtual Vector3 get_moment_of_inertia(real_t p_mass) const=0; virtual void set_data(const Variant& p_data)=0; virtual Variant get_data() const=0; @@ -130,7 +130,7 @@ public: Plane get_plane() const; - virtual real_t get_area() const { return INFINITY; } + virtual real_t get_area() const { return Math_INF; } virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_PLANE; } virtual void project_range(const Vector3& p_normal, const Transform& p_transform, real_t &r_min, real_t &r_max) const; virtual Vector3 get_support(const Vector3& p_normal) const; @@ -138,7 +138,7 @@ public: virtual bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const; - virtual Vector3 get_moment_of_inertia(float p_mass) const; + virtual Vector3 get_moment_of_inertia(real_t p_mass) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -148,12 +148,12 @@ public: class RayShapeSW : public ShapeSW { - float length; + real_t length; - void _setup(float p_length); + void _setup(real_t p_length); public: - float get_length() const; + real_t get_length() const; virtual real_t get_area() const { return 0.0; } virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_RAY; } @@ -163,7 +163,7 @@ public: virtual bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const; - virtual Vector3 get_moment_of_inertia(float p_mass) const; + virtual Vector3 get_moment_of_inertia(real_t p_mass) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -189,7 +189,7 @@ public: virtual void get_supports(const Vector3& p_normal,int p_max,Vector3 *r_supports,int & r_amount) const; virtual bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const; - virtual Vector3 get_moment_of_inertia(float p_mass) const; + virtual Vector3 get_moment_of_inertia(real_t p_mass) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -213,7 +213,7 @@ public: virtual void get_supports(const Vector3& p_normal,int p_max,Vector3 *r_supports,int & r_amount) const; virtual bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const; - virtual Vector3 get_moment_of_inertia(float p_mass) const; + virtual Vector3 get_moment_of_inertia(real_t p_mass) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -242,7 +242,7 @@ public: virtual void get_supports(const Vector3& p_normal,int p_max,Vector3 *r_supports,int & r_amount) const; virtual bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const; - virtual Vector3 get_moment_of_inertia(float p_mass) const; + virtual Vector3 get_moment_of_inertia(real_t p_mass) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -266,7 +266,7 @@ public: virtual void get_supports(const Vector3& p_normal,int p_max,Vector3 *r_supports,int & r_amount) const; virtual bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const; - virtual Vector3 get_moment_of_inertia(float p_mass) const; + virtual Vector3 get_moment_of_inertia(real_t p_mass) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -349,7 +349,7 @@ public: virtual void cull(const Rect3& p_local_aabb,Callback p_callback,void* p_userdata) const; - virtual Vector3 get_moment_of_inertia(float p_mass) const; + virtual Vector3 get_moment_of_inertia(real_t p_mass) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -364,18 +364,18 @@ struct HeightMapShapeSW : public ConcaveShapeSW { PoolVector<real_t> heights; int width; int depth; - float cell_size; + real_t cell_size; //void _cull_segment(int p_idx,_SegmentCullParams *p_params) const; //void _cull(int p_idx,_CullParams *p_params) const; - void _setup(PoolVector<float> p_heights,int p_width,int p_depth,float p_cell_size); + void _setup(PoolVector<real_t> p_heights,int p_width,int p_depth,real_t p_cell_size); public: PoolVector<real_t> get_heights() const; int get_width() const; int get_depth() const; - float get_cell_size() const; + real_t get_cell_size() const; virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_HEIGHTMAP; } @@ -385,7 +385,7 @@ public: virtual void cull(const Rect3& p_local_aabb,Callback p_callback,void* p_userdata) const; - virtual Vector3 get_moment_of_inertia(float p_mass) const; + virtual Vector3 get_moment_of_inertia(real_t p_mass) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -409,7 +409,7 @@ struct FaceShapeSW : public ShapeSW { virtual void get_supports(const Vector3& p_normal,int p_max,Vector3 *r_supports,int & r_amount) const; bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const; - Vector3 get_moment_of_inertia(float p_mass) const; + Vector3 get_moment_of_inertia(real_t p_mass) const; virtual void set_data(const Variant& p_data) {} virtual Variant get_data() const { return Variant(); } @@ -450,7 +450,7 @@ struct MotionShapeSW : public ShapeSW { virtual void get_supports(const Vector3& p_normal,int p_max,Vector3 *r_supports,int & r_amount) const { r_amount=0; } bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const { return false; } - Vector3 get_moment_of_inertia(float p_mass) const { return Vector3(); } + Vector3 get_moment_of_inertia(real_t p_mass) const { return Vector3(); } virtual void set_data(const Variant& p_data) {} virtual Variant get_data() const { return Variant(); } diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index eaa3d3194c..0bc11041de 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -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. */ /*************************************************************************/ -#include "globals.h" +#include "global_config.h" #include "space_sw.h" #include "collision_solver_sw.h" #include "physics_server_sw.h" @@ -138,7 +138,7 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3& p_from, const Vecto } -int PhysicsDirectSpaceStateSW::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,uint32_t p_layer_mask,uint32_t p_object_type_mask) { +int PhysicsDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Transform& p_xform,real_t p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { if (p_result_max<=0) return 0; @@ -193,7 +193,7 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Transfo } -bool PhysicsDirectSpaceStateSW::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,uint32_t p_layer_mask,uint32_t p_object_type_mask,ShapeRestInfo *r_info) { +bool PhysicsDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform& p_xform,const Vector3& p_motion,real_t p_margin,real_t &p_closest_safe,real_t &p_closest_unsafe, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask,ShapeRestInfo *r_info) { @@ -211,8 +211,8 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform& int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,SpaceSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results); - float best_safe=1; - float best_unsafe=1; + real_t best_safe=1; + real_t best_unsafe=1; Transform xform_inv = p_xform.affine_inverse(); MotionShapeSW mshape; @@ -264,13 +264,13 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform& //just do kinematic solving - float low=0; - float hi=1; + real_t low=0; + real_t hi=1; Vector3 mnormal=p_motion.normalized(); for(int i=0;i<8;i++) { //steps should be customizable.. - float ofs = (low+hi)*0.5; + real_t ofs = (low+hi)*0.5; Vector3 sep=mnormal; //important optimization for this to work fast enough @@ -323,7 +323,7 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform& return true; } -bool PhysicsDirectSpaceStateSW::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,uint32_t p_layer_mask,uint32_t p_object_type_mask){ +bool PhysicsDirectSpaceStateSW::collide_shape(RID p_shape, const Transform& p_shape_xform,real_t p_margin,Vector3 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask){ if (p_result_max<=0) return 0; @@ -388,7 +388,7 @@ struct _RestCallbackData { int best_shape; Vector3 best_contact; Vector3 best_normal; - float best_len; + real_t best_len; }; static void _rest_cbk_result(const Vector3& p_point_A,const Vector3& p_point_B,void *p_userdata) { @@ -397,7 +397,7 @@ static void _rest_cbk_result(const Vector3& p_point_A,const Vector3& p_point_B,v _RestCallbackData *rd=(_RestCallbackData*)p_userdata; Vector3 contact_rel = p_point_B - p_point_A; - float len = contact_rel.length(); + real_t len = contact_rel.length(); if (len <= rd->best_len) return; @@ -408,7 +408,7 @@ static void _rest_cbk_result(const Vector3& p_point_A,const Vector3& p_point_B,v rd->best_shape=rd->shape; } -bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform& p_shape_xform,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { +bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform& p_shape_xform,real_t p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { ShapeSW *shape = static_cast<PhysicsServerSW*>(PhysicsServer::get_singleton())->shape_owner.get(p_shape); diff --git a/servers/physics/space_sw.h b/servers/physics/space_sw.h index 0abc4726ea..208831914f 100644 --- a/servers/physics/space_sw.h +++ b/servers/physics/space_sw.h @@ -37,7 +37,7 @@ #include "area_pair_sw.h" #include "broad_phase_sw.h" #include "collision_object_sw.h" -#include "globals.h" +#include "global_config.h" class PhysicsDirectSpaceStateSW : public PhysicsDirectSpaceState { @@ -48,10 +48,10 @@ 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,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); - virtual bool rest_info(RID p_shape, const Transform& p_shape_xform,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); + virtual int intersect_shape(const RID& p_shape, const Transform& p_xform,real_t 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,real_t p_margin,real_t &p_closest_safe,real_t &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,real_t 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); + virtual bool rest_info(RID p_shape, const Transform& p_shape_xform,real_t p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); PhysicsDirectSpaceStateSW(); }; @@ -105,10 +105,10 @@ private: CollisionObjectSW *intersection_query_results[INTERSECTION_QUERY_MAX]; int intersection_query_subindex_results[INTERSECTION_QUERY_MAX]; - float body_linear_velocity_sleep_threshold; - float body_angular_velocity_sleep_threshold; - float body_time_to_sleep; - float body_angular_velocity_damp_ratio; + real_t body_linear_velocity_sleep_threshold; + real_t body_angular_velocity_sleep_threshold; + real_t body_time_to_sleep; + real_t body_angular_velocity_damp_ratio; bool locked; diff --git a/servers/physics/step_sw.cpp b/servers/physics/step_sw.cpp index 30ee33a7de..0bd5a874ea 100644 --- a/servers/physics/step_sw.cpp +++ b/servers/physics/step_sw.cpp @@ -58,7 +58,7 @@ void StepSW::_populate_island(BodySW* p_body,BodySW** p_island,ConstraintSW **p_ } } -void StepSW::_setup_island(ConstraintSW *p_island,float p_delta) { +void StepSW::_setup_island(ConstraintSW *p_island,real_t p_delta) { ConstraintSW *ci=p_island; while(ci) { @@ -68,7 +68,7 @@ void StepSW::_setup_island(ConstraintSW *p_island,float p_delta) { } } -void StepSW::_solve_island(ConstraintSW *p_island,int p_iterations,float p_delta){ +void StepSW::_solve_island(ConstraintSW *p_island,int p_iterations,real_t p_delta){ int at_priority=1; @@ -107,7 +107,7 @@ void StepSW::_solve_island(ConstraintSW *p_island,int p_iterations,float p_delta } -void StepSW::_check_suspend(BodySW *p_island,float p_delta) { +void StepSW::_check_suspend(BodySW *p_island,real_t p_delta) { bool can_sleep=true; @@ -145,7 +145,7 @@ void StepSW::_check_suspend(BodySW *p_island,float p_delta) { } } -void StepSW::step(SpaceSW* p_space,float p_delta,int p_iterations) { +void StepSW::step(SpaceSW* p_space,real_t p_delta,int p_iterations) { p_space->lock(); // can't access space during this diff --git a/servers/physics/step_sw.h b/servers/physics/step_sw.h index 2f67b3c8df..7048a76937 100644 --- a/servers/physics/step_sw.h +++ b/servers/physics/step_sw.h @@ -36,12 +36,12 @@ class StepSW { uint64_t _step; void _populate_island(BodySW* p_body,BodySW** p_island,ConstraintSW **p_constraint_island); - void _setup_island(ConstraintSW *p_island,float p_delta); - void _solve_island(ConstraintSW *p_island,int p_iterations,float p_delta); - void _check_suspend(BodySW *p_island,float p_delta); + void _setup_island(ConstraintSW *p_island,real_t p_delta); + void _solve_island(ConstraintSW *p_island,int p_iterations,real_t p_delta); + void _check_suspend(BodySW *p_island,real_t p_delta); public: - void step(SpaceSW* p_space,float p_delta,int p_iterations); + void step(SpaceSW* p_space,real_t p_delta,int p_iterations); StepSW(); }; diff --git a/servers/physics_2d/area_2d_sw.h b/servers/physics_2d/area_2d_sw.h index 6e79b28afc..02a65962e5 100644 --- a/servers/physics_2d/area_2d_sw.h +++ b/servers/physics_2d/area_2d_sw.h @@ -43,13 +43,13 @@ class Area2DSW : public CollisionObject2DSW{ Physics2DServer::AreaSpaceOverrideMode space_override_mode; - float gravity; + real_t gravity; Vector2 gravity_vector; bool gravity_is_point; - float gravity_distance_scale; - float point_attenuation; - float linear_damp; - float angular_damp; + real_t gravity_distance_scale; + real_t point_attenuation; + real_t linear_damp; + real_t angular_damp; int priority; bool monitorable; @@ -131,8 +131,8 @@ public: void set_space_override_mode(Physics2DServer::AreaSpaceOverrideMode p_mode); Physics2DServer::AreaSpaceOverrideMode get_space_override_mode() const { return space_override_mode; } - _FORCE_INLINE_ void set_gravity(float p_gravity) { gravity=p_gravity; } - _FORCE_INLINE_ float get_gravity() const { return gravity; } + _FORCE_INLINE_ void set_gravity(real_t p_gravity) { gravity=p_gravity; } + _FORCE_INLINE_ real_t get_gravity() const { return gravity; } _FORCE_INLINE_ void set_gravity_vector(const Vector2& p_gravity) { gravity_vector=p_gravity; } _FORCE_INLINE_ Vector2 get_gravity_vector() const { return gravity_vector; } @@ -140,17 +140,17 @@ public: _FORCE_INLINE_ void set_gravity_as_point(bool p_enable) { gravity_is_point=p_enable; } _FORCE_INLINE_ bool is_gravity_point() const { return gravity_is_point; } - _FORCE_INLINE_ void set_gravity_distance_scale(float scale) { gravity_distance_scale=scale; } - _FORCE_INLINE_ float get_gravity_distance_scale() const { return gravity_distance_scale; } + _FORCE_INLINE_ void set_gravity_distance_scale(real_t scale) { gravity_distance_scale=scale; } + _FORCE_INLINE_ real_t get_gravity_distance_scale() const { return gravity_distance_scale; } - _FORCE_INLINE_ void set_point_attenuation(float p_point_attenuation) { point_attenuation=p_point_attenuation; } - _FORCE_INLINE_ float get_point_attenuation() const { return point_attenuation; } + _FORCE_INLINE_ void set_point_attenuation(real_t p_point_attenuation) { point_attenuation=p_point_attenuation; } + _FORCE_INLINE_ real_t get_point_attenuation() const { return point_attenuation; } - _FORCE_INLINE_ void set_linear_damp(float p_linear_damp) { linear_damp=p_linear_damp; } - _FORCE_INLINE_ float get_linear_damp() const { return linear_damp; } + _FORCE_INLINE_ void set_linear_damp(real_t p_linear_damp) { linear_damp=p_linear_damp; } + _FORCE_INLINE_ real_t get_linear_damp() const { return linear_damp; } - _FORCE_INLINE_ void set_angular_damp(float p_angular_damp) { angular_damp=p_angular_damp; } - _FORCE_INLINE_ float get_angular_damp() const { return angular_damp; } + _FORCE_INLINE_ void set_angular_damp(real_t p_angular_damp) { angular_damp=p_angular_damp; } + _FORCE_INLINE_ real_t get_angular_damp() const { return angular_damp; } _FORCE_INLINE_ void set_priority(int p_priority) { priority=p_priority; } _FORCE_INLINE_ int get_priority() const { return priority; } diff --git a/servers/physics_2d/area_pair_2d_sw.cpp b/servers/physics_2d/area_pair_2d_sw.cpp index c26f6c45fd..cb91caf626 100644 --- a/servers/physics_2d/area_pair_2d_sw.cpp +++ b/servers/physics_2d/area_pair_2d_sw.cpp @@ -30,7 +30,7 @@ #include "collision_solver_2d_sw.h" -bool AreaPair2DSW::setup(float p_step) { +bool AreaPair2DSW::setup(real_t p_step) { bool result = area->test_collision_mask(body) && CollisionSolver2DSW::solve(body->get_shape(body_shape),body->get_transform() * body->get_shape_transform(body_shape),Vector2(),area->get_shape(area_shape),area->get_transform() * area->get_shape_transform(area_shape),Vector2(),NULL,this); @@ -59,7 +59,7 @@ bool AreaPair2DSW::setup(float p_step) { return false; //never do any post solving } -void AreaPair2DSW::solve(float p_step) { +void AreaPair2DSW::solve(real_t p_step) { } @@ -100,7 +100,7 @@ AreaPair2DSW::~AreaPair2DSW() { -bool Area2Pair2DSW::setup(float p_step) { +bool Area2Pair2DSW::setup(real_t p_step) { bool result = area_a->test_collision_mask(area_b) && CollisionSolver2DSW::solve(area_a->get_shape(shape_a),area_a->get_transform() * area_a->get_shape_transform(shape_a),Vector2(),area_b->get_shape(shape_b),area_b->get_transform() * area_b->get_shape_transform(shape_b),Vector2(),NULL,this); @@ -130,7 +130,7 @@ bool Area2Pair2DSW::setup(float p_step) { return false; //never do any post solving } -void Area2Pair2DSW::solve(float p_step) { +void Area2Pair2DSW::solve(real_t p_step) { } diff --git a/servers/physics_2d/area_pair_2d_sw.h b/servers/physics_2d/area_pair_2d_sw.h index db77bff5d4..219ca30c4b 100644 --- a/servers/physics_2d/area_pair_2d_sw.h +++ b/servers/physics_2d/area_pair_2d_sw.h @@ -42,8 +42,8 @@ class AreaPair2DSW : public Constraint2DSW { bool colliding; public: - bool setup(float p_step); - void solve(float p_step); + bool setup(real_t p_step); + void solve(real_t p_step); AreaPair2DSW(Body2DSW *p_body,int p_body_shape, Area2DSW *p_area,int p_area_shape); ~AreaPair2DSW(); @@ -59,8 +59,8 @@ class Area2Pair2DSW : public Constraint2DSW { bool colliding; public: - bool setup(float p_step); - void solve(float p_step); + bool setup(real_t p_step); + void solve(real_t p_step); Area2Pair2DSW(Area2DSW *p_area_a,int p_shape_a, Area2DSW *p_area_b,int p_shape_b); ~Area2Pair2DSW(); diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index 093f69a169..0dab534ef9 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -51,7 +51,7 @@ void Body2DSW::update_inertias() { if(user_inertia) break; //update tensor for allshapes, not the best way but should be somehow OK. (inspired from bullet) - float total_area=0; + real_t total_area=0; for (int i=0;i<get_shape_count();i++) { @@ -64,9 +64,9 @@ void Body2DSW::update_inertias() { const Shape2DSW* shape=get_shape(i); - float area=get_shape_aabb(i).get_area(); + real_t area=get_shape_aabb(i).get_area(); - float mass = area * this->mass / total_area; + real_t mass = area * this->mass / total_area; Transform2D mtx = get_shape_transform(i); Vector2 scale = mtx.get_scale(); @@ -142,7 +142,7 @@ void Body2DSW::set_active(bool p_active) { -void Body2DSW::set_param(Physics2DServer::BodyParameter p_param, float p_value) { +void Body2DSW::set_param(Physics2DServer::BodyParameter p_param, real_t p_value) { switch(p_param) { case Physics2DServer::BODY_PARAM_BOUNCE: { @@ -183,7 +183,7 @@ void Body2DSW::set_param(Physics2DServer::BodyParameter p_param, float p_value) } } -float Body2DSW::get_param(Physics2DServer::BodyParameter p_param) const { +real_t Body2DSW::get_param(Physics2DServer::BodyParameter p_param) const { switch(p_param) { case Physics2DServer::BODY_PARAM_BOUNCE: { diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h index bf9dcaa9b0..3fb01959a9 100644 --- a/servers/physics_2d/body_2d_sw.h +++ b/servers/physics_2d/body_2d_sw.h @@ -69,7 +69,7 @@ class Body2DSW : public CollisionObject2DSW { real_t applied_torque; Vector2 one_way_collision_direction; - float one_way_collision_max_depth; + real_t one_way_collision_max_depth; SelfList<Body2DSW> active_list; @@ -109,7 +109,7 @@ class Body2DSW : public CollisionObject2DSW { Vector2 local_pos; Vector2 local_normal; - float depth; + real_t depth; int local_shape; Vector2 collider_pos; int collider_shape; @@ -168,7 +168,7 @@ public: _FORCE_INLINE_ int get_max_contacts_reported() const { return contacts.size(); } _FORCE_INLINE_ bool can_report_contacts() const { return !contacts.empty(); } - _FORCE_INLINE_ void add_contact(const Vector2& p_local_pos,const Vector2& p_local_normal, float p_depth, int p_local_shape, const Vector2& p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID& p_collider,const Vector2& p_collider_velocity_at_pos); + _FORCE_INLINE_ void add_contact(const Vector2& p_local_pos,const Vector2& p_local_normal, real_t p_depth, int p_local_shape, const Vector2& p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID& p_collider,const Vector2& p_collider_velocity_at_pos); _FORCE_INLINE_ void add_exception(const RID& p_exception) { exceptions.insert(p_exception);} @@ -229,8 +229,8 @@ public: - void set_param(Physics2DServer::BodyParameter p_param, float); - float get_param(Physics2DServer::BodyParameter p_param) const; + void set_param(Physics2DServer::BodyParameter p_param, real_t); + real_t get_param(Physics2DServer::BodyParameter p_param) const; void set_mode(Physics2DServer::BodyMode p_mode); Physics2DServer::BodyMode get_mode() const; @@ -259,8 +259,8 @@ public: } Vector2 get_one_way_collision_direction() const { return one_way_collision_direction; } - void set_one_way_collision_max_depth(float p_depth) { one_way_collision_max_depth=p_depth; } - float get_one_way_collision_max_depth() const { return one_way_collision_max_depth; } + void set_one_way_collision_max_depth(real_t p_depth) { one_way_collision_max_depth=p_depth; } + real_t get_one_way_collision_max_depth() const { return one_way_collision_max_depth; } _FORCE_INLINE_ bool is_using_one_way_collision() const { return using_one_way_cache; } @@ -303,7 +303,7 @@ public: //add contact inline -void Body2DSW::add_contact(const Vector2& p_local_pos,const Vector2& p_local_normal, float p_depth, int p_local_shape, const Vector2& p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID& p_collider,const Vector2& p_collider_velocity_at_pos) { +void Body2DSW::add_contact(const Vector2& p_local_pos,const Vector2& p_local_normal, real_t p_depth, int p_local_shape, const Vector2& p_collider_pos, int p_collider_shape, ObjectID p_collider_instance_id, const RID& p_collider,const Vector2& p_collider_velocity_at_pos) { int c_max=contacts.size(); @@ -319,7 +319,7 @@ void Body2DSW::add_contact(const Vector2& p_local_pos,const Vector2& p_local_nor idx=contact_count++; } else { - float least_depth=1e20; + real_t least_depth=1e20; int least_deep=-1; for(int i=0;i<c_max;i++) { @@ -361,10 +361,10 @@ public: real_t step; virtual Vector2 get_total_gravity() const { return body->gravity; } // get gravity vector working on this body space/area - virtual float get_total_angular_damp() const { return body->area_angular_damp; } // get density of this body space/area - virtual float get_total_linear_damp() const { return body->area_linear_damp; } // get density of this body space/area + virtual real_t get_total_angular_damp() const { return body->area_angular_damp; } // get density of this body space/area + virtual real_t get_total_linear_damp() const { return body->area_linear_damp; } // get density of this body space/area - virtual float get_inverse_mass() const { return body->get_inv_mass(); } // get the mass + virtual real_t get_inverse_mass() const { return body->get_inv_mass(); } // get the mass virtual real_t get_inverse_inertia() const { return body->get_inv_inertia(); } // get density of this body space virtual void set_linear_velocity(const Vector2& p_velocity) { body->set_linear_velocity(p_velocity); } diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp index e6b62ffa66..c05d61b658 100644 --- a/servers/physics_2d/body_pair_2d_sw.cpp +++ b/servers/physics_2d/body_pair_2d_sw.cpp @@ -99,7 +99,7 @@ void BodyPair2DSW::_contact_added_callback(const Vector2& p_point_A,const Vector Vector2 global_B = B->get_transform().basis_xform(c.local_B)+offset_B; Vector2 axis = global_A - global_B; - float depth = axis.dot( c.normal ); + real_t depth = axis.dot( c.normal ); if (depth<min_depth) { @@ -149,7 +149,7 @@ void BodyPair2DSW::_validate_contacts() { Vector2 global_A = A->get_transform().basis_xform(c.local_A); Vector2 global_B = B->get_transform().basis_xform(c.local_B)+offset_B; Vector2 axis = global_A - global_B; - float depth = axis.dot( c.normal ); + real_t depth = axis.dot( c.normal ); @@ -175,7 +175,7 @@ void BodyPair2DSW::_validate_contacts() { } -bool BodyPair2DSW::_test_ccd(float p_step,Body2DSW *p_A, int p_shape_A,const Transform2D& p_xform_A,Body2DSW *p_B, int p_shape_B,const Transform2D& p_xform_B,bool p_swap_result) { +bool BodyPair2DSW::_test_ccd(real_t p_step,Body2DSW *p_A, int p_shape_A,const Transform2D& p_xform_A,Body2DSW *p_B, int p_shape_B,const Transform2D& p_xform_B,bool p_swap_result) { @@ -230,7 +230,7 @@ bool BodyPair2DSW::_test_ccd(float p_step,Body2DSW *p_A, int p_shape_A,const Tra return true; } -bool BodyPair2DSW::setup(float p_step) { +bool BodyPair2DSW::setup(real_t p_step) { //cannot collide @@ -343,7 +343,7 @@ bool BodyPair2DSW::setup(float p_step) { real_t max_penetration = space->get_contact_max_allowed_penetration(); - float bias = 0.3f; + real_t bias = 0.3; if (shape_A_ptr->get_custom_bias() || shape_B_ptr->get_custom_bias()) { if (shape_A_ptr->get_custom_bias()==0) @@ -464,7 +464,7 @@ bool BodyPair2DSW::setup(float p_step) { return do_process; } -void BodyPair2DSW::solve(float p_step) { +void BodyPair2DSW::solve(real_t p_step) { if (!collided) return; diff --git a/servers/physics_2d/body_pair_2d_sw.h b/servers/physics_2d/body_pair_2d_sw.h index b9ff1bd758..7a4771782a 100644 --- a/servers/physics_2d/body_pair_2d_sw.h +++ b/servers/physics_2d/body_pair_2d_sw.h @@ -66,7 +66,7 @@ class BodyPair2DSW : public Constraint2DSW { bool active; Vector2 rA,rB; bool reused; - float bounce; + real_t bounce; }; @@ -80,15 +80,15 @@ class BodyPair2DSW : public Constraint2DSW { int cc; - bool _test_ccd(float p_step,Body2DSW *p_A, int p_shape_A,const Transform2D& p_xform_A,Body2DSW *p_B, int p_shape_B,const Transform2D& p_xform_B,bool p_swap_result=false); + bool _test_ccd(real_t p_step,Body2DSW *p_A, int p_shape_A,const Transform2D& p_xform_A,Body2DSW *p_B, int p_shape_B,const Transform2D& p_xform_B,bool p_swap_result=false); void _validate_contacts(); static void _add_contact(const Vector2& p_point_A,const Vector2& p_point_B,void *p_self); _FORCE_INLINE_ void _contact_added_callback(const Vector2& p_point_A,const Vector2& p_point_B); public: - bool setup(float p_step); - void solve(float p_step); + bool setup(real_t p_step); + void solve(real_t p_step); BodyPair2DSW(Body2DSW *p_A, int p_shape_A,Body2DSW *p_B, int p_shape_B); ~BodyPair2DSW(); diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index 8b7a410b3d..06eead64cd 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "broad_phase_2d_hash_grid.h" -#include "globals.h" +#include "global_config.h" #define LARGE_ELEMENT_FI 1.01239812 diff --git a/servers/physics_2d/collision_solver_2d_sat.cpp b/servers/physics_2d/collision_solver_2d_sat.cpp index a09574a94c..4c116cee3f 100644 --- a/servers/physics_2d/collision_solver_2d_sat.cpp +++ b/servers/physics_2d/collision_solver_2d_sat.cpp @@ -81,7 +81,7 @@ _FORCE_INLINE_ static void _generate_contacts_point_edge(const Vector2 * p_point struct _generate_contacts_Pair { bool a; int idx; - float d; + real_t d; _FORCE_INLINE_ bool operator <(const _generate_contacts_Pair& l) const { return d< l.d; } }; @@ -108,7 +108,7 @@ _FORCE_INLINE_ static void _generate_contacts_edge_edge(const Vector2 * p_points SWAP(pA[0],pA[1]); } - float dB[2]={t.dot(p_points_B[0]),t.dot(p_points_B[1])}; + real_t dB[2]={t.dot(p_points_B[0]),t.dot(p_points_B[1])}; Vector2 pB[2]={p_points_B[0],p_points_B[1]}; if (dB[0]>dB[1]) { SWAP(dB[0],dB[1]); @@ -265,10 +265,10 @@ _FORCE_INLINE_ static void _generate_contacts_edge_edge(const Vector2 * p_points Vector2 base_B = p_points_B[0] - axis * axis.dot(p_points_B[0]); //sort all 4 points in axis - float dvec[4]={ axis.dot(p_points_A[0]), axis.dot(p_points_A[1]), axis.dot(p_points_B[0]), axis.dot(p_points_B[1]) }; + real_t dvec[4]={ axis.dot(p_points_A[0]), axis.dot(p_points_A[1]), axis.dot(p_points_B[0]), axis.dot(p_points_B[1]) }; //todo , find max/min and then use 2 central points - SortArray<float> sa; + SortArray<real_t> sa; sa.sort(dvec,4); //use the middle ones as contacts @@ -596,11 +596,11 @@ public: (castA && castB && !separator.test_axis(((m_a)+p_motion_a-((m_b)+p_motion_b)).normalized())) ) -typedef void (*CollisionFunc)(const Shape2DSW*,const Transform2D&,const Shape2DSW*,const Transform2D&,_CollectorCallback2D *p_collector,const Vector2&,const Vector2&,float,float); +typedef void (*CollisionFunc)(const Shape2DSW*,const Transform2D&,const Shape2DSW*,const Transform2D&,_CollectorCallback2D *p_collector,const Vector2&,const Vector2&,real_t,real_t); template<bool castA, bool castB,bool withMargin> -static void _collision_segment_segment(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_segment_segment(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const SegmentShape2DSW *segment_A = static_cast<const SegmentShape2DSW*>(p_a); const SegmentShape2DSW *segment_B = static_cast<const SegmentShape2DSW*>(p_b); @@ -645,7 +645,7 @@ static void _collision_segment_segment(const Shape2DSW* p_a,const Transform2D& p } template<bool castA, bool castB,bool withMargin> -static void _collision_segment_circle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_segment_circle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const SegmentShape2DSW *segment_A = static_cast<const SegmentShape2DSW*>(p_a); @@ -678,7 +678,7 @@ static void _collision_segment_circle(const Shape2DSW* p_a,const Transform2D& p_ } template<bool castA, bool castB,bool withMargin> -static void _collision_segment_rectangle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_segment_rectangle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const SegmentShape2DSW *segment_A = static_cast<const SegmentShape2DSW*>(p_a); const RectangleShape2DSW *rectangle_B = static_cast<const RectangleShape2DSW*>(p_b); @@ -743,7 +743,7 @@ static void _collision_segment_rectangle(const Shape2DSW* p_a,const Transform2D& } template<bool castA, bool castB,bool withMargin> -static void _collision_segment_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_segment_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const SegmentShape2DSW *segment_A = static_cast<const SegmentShape2DSW*>(p_a); const CapsuleShape2DSW *capsule_B = static_cast<const CapsuleShape2DSW*>(p_b); @@ -775,7 +775,7 @@ static void _collision_segment_capsule(const Shape2DSW* p_a,const Transform2D& p } template<bool castA, bool castB,bool withMargin> -static void _collision_segment_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_segment_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const SegmentShape2DSW *segment_A = static_cast<const SegmentShape2DSW*>(p_a); const ConvexPolygonShape2DSW *convex_B = static_cast<const ConvexPolygonShape2DSW*>(p_b); @@ -815,7 +815,7 @@ static void _collision_segment_convex_polygon(const Shape2DSW* p_a,const Transfo ///////// template<bool castA, bool castB,bool withMargin> -static void _collision_circle_circle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_circle_circle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const CircleShape2DSW *circle_A = static_cast<const CircleShape2DSW*>(p_a); const CircleShape2DSW *circle_B = static_cast<const CircleShape2DSW*>(p_b); @@ -838,7 +838,7 @@ static void _collision_circle_circle(const Shape2DSW* p_a,const Transform2D& p_t } template<bool castA, bool castB,bool withMargin> -static void _collision_circle_rectangle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_circle_rectangle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const CircleShape2DSW *circle_A = static_cast<const CircleShape2DSW*>(p_a); const RectangleShape2DSW *rectangle_B = static_cast<const RectangleShape2DSW*>(p_b); @@ -894,7 +894,7 @@ static void _collision_circle_rectangle(const Shape2DSW* p_a,const Transform2D& } template<bool castA, bool castB,bool withMargin> -static void _collision_circle_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_circle_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const CircleShape2DSW *circle_A = static_cast<const CircleShape2DSW*>(p_a); const CapsuleShape2DSW *capsule_B = static_cast<const CapsuleShape2DSW*>(p_b); @@ -924,7 +924,7 @@ static void _collision_circle_capsule(const Shape2DSW* p_a,const Transform2D& p_ } template<bool castA, bool castB,bool withMargin> -static void _collision_circle_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_circle_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const CircleShape2DSW *circle_A = static_cast<const CircleShape2DSW*>(p_a); const ConvexPolygonShape2DSW *convex_B = static_cast<const ConvexPolygonShape2DSW*>(p_b); @@ -956,7 +956,7 @@ static void _collision_circle_convex_polygon(const Shape2DSW* p_a,const Transfor ///////// template<bool castA, bool castB,bool withMargin> -static void _collision_rectangle_rectangle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_rectangle_rectangle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const RectangleShape2DSW *rectangle_A = static_cast<const RectangleShape2DSW*>(p_a); const RectangleShape2DSW *rectangle_B = static_cast<const RectangleShape2DSW*>(p_b); @@ -1027,7 +1027,7 @@ static void _collision_rectangle_rectangle(const Shape2DSW* p_a,const Transform2 } template<bool castA, bool castB,bool withMargin> -static void _collision_rectangle_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_rectangle_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const RectangleShape2DSW *rectangle_A = static_cast<const RectangleShape2DSW*>(p_a); const CapsuleShape2DSW *capsule_B = static_cast<const CapsuleShape2DSW*>(p_b); @@ -1100,7 +1100,7 @@ static void _collision_rectangle_capsule(const Shape2DSW* p_a,const Transform2D& } template<bool castA, bool castB,bool withMargin> -static void _collision_rectangle_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_rectangle_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const RectangleShape2DSW *rectangle_A = static_cast<const RectangleShape2DSW*>(p_a); const ConvexPolygonShape2DSW *convex_B = static_cast<const ConvexPolygonShape2DSW*>(p_b); @@ -1162,7 +1162,7 @@ static void _collision_rectangle_convex_polygon(const Shape2DSW* p_a,const Trans ///////// template<bool castA, bool castB,bool withMargin> -static void _collision_capsule_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_capsule_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const CapsuleShape2DSW *capsule_A = static_cast<const CapsuleShape2DSW*>(p_a); const CapsuleShape2DSW *capsule_B = static_cast<const CapsuleShape2DSW*>(p_b); @@ -1205,7 +1205,7 @@ static void _collision_capsule_capsule(const Shape2DSW* p_a,const Transform2D& p } template<bool castA, bool castB,bool withMargin> -static void _collision_capsule_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_capsule_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const CapsuleShape2DSW *capsule_A = static_cast<const CapsuleShape2DSW*>(p_a); const ConvexPolygonShape2DSW *convex_B = static_cast<const ConvexPolygonShape2DSW*>(p_b); @@ -1251,7 +1251,7 @@ static void _collision_capsule_convex_polygon(const Shape2DSW* p_a,const Transfo template<bool castA, bool castB,bool withMargin> -static void _collision_convex_polygon_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_convex_polygon_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,real_t p_margin_A,real_t p_margin_B) { const ConvexPolygonShape2DSW *convex_A = static_cast<const ConvexPolygonShape2DSW*>(p_a); @@ -1298,7 +1298,7 @@ static void _collision_convex_polygon_convex_polygon(const Shape2DSW* p_a,const //////// -bool sat_2d_calculate_penetration(const Shape2DSW *p_shape_A, const Transform2D& p_transform_A, const Vector2& p_motion_A, const Shape2DSW *p_shape_B, const Transform2D& p_transform_B,const Vector2& p_motion_B, CollisionSolver2DSW::CallbackResult p_result_callback,void *p_userdata, bool p_swap,Vector2 *sep_axis,float p_margin_A,float p_margin_B) { +bool sat_2d_calculate_penetration(const Shape2DSW *p_shape_A, const Transform2D& p_transform_A, const Vector2& p_motion_A, const Shape2DSW *p_shape_B, const Transform2D& p_transform_B,const Vector2& p_motion_B, CollisionSolver2DSW::CallbackResult p_result_callback,void *p_userdata, bool p_swap,Vector2 *sep_axis,real_t p_margin_A,real_t p_margin_B) { Physics2DServer::ShapeType type_A=p_shape_A->get_type(); diff --git a/servers/physics_2d/collision_solver_2d_sat.h b/servers/physics_2d/collision_solver_2d_sat.h index 01acf319c7..6b698a09f2 100644 --- a/servers/physics_2d/collision_solver_2d_sat.h +++ b/servers/physics_2d/collision_solver_2d_sat.h @@ -32,6 +32,6 @@ #include "collision_solver_2d_sw.h" -bool sat_2d_calculate_penetration(const Shape2DSW *p_shape_A, const Transform2D& p_transform_A, const Vector2& p_motion_A,const Shape2DSW *p_shape_B, const Transform2D& p_transform_B,const Vector2& p_motion_B, CollisionSolver2DSW::CallbackResult p_result_callback,void *p_userdata, bool p_swap=false,Vector2 *sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); +bool sat_2d_calculate_penetration(const Shape2DSW *p_shape_A, const Transform2D& p_transform_A, const Vector2& p_motion_A,const Shape2DSW *p_shape_B, const Transform2D& p_transform_B,const Vector2& p_motion_B, CollisionSolver2DSW::CallbackResult p_result_callback,void *p_userdata, bool p_swap=false,Vector2 *sep_axis=NULL,real_t p_margin_A=0,real_t p_margin_B=0); #endif // COLLISION_SOLVER_2D_SAT_H diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp index 20a5934eb8..3fdecdf413 100644 --- a/servers/physics_2d/collision_solver_2d_sw.cpp +++ b/servers/physics_2d/collision_solver_2d_sw.cpp @@ -181,7 +181,7 @@ void CollisionSolver2DSW::concave_callback(void *p_userdata, Shape2DSW *p_convex } -bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis,float p_margin_A,float p_margin_B) { +bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis,real_t p_margin_A,real_t p_margin_B) { const ConcaveShape2DSW *concave_B=static_cast<const ConcaveShape2DSW*>(p_shape_B); @@ -211,10 +211,10 @@ bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A,const Transfo for(int i=0;i<2;i++) { Vector2 axis( p_transform_B.elements[i] ); - float axis_scale = 1.0/axis.length(); + real_t axis_scale = 1.0/axis.length(); axis*=axis_scale; - float smin,smax; + real_t smin,smax; p_shape_A->project_rangev(axis,rel_transform,smin,smax); smin*=axis_scale; smax*=axis_scale; @@ -231,7 +231,7 @@ bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A,const Transfo } -bool CollisionSolver2DSW::solve(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,Vector2 *sep_axis,float p_margin_A,float p_margin_B) { +bool CollisionSolver2DSW::solve(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,Vector2 *sep_axis,real_t p_margin_A,real_t p_margin_B) { diff --git a/servers/physics_2d/collision_solver_2d_sw.h b/servers/physics_2d/collision_solver_2d_sw.h index 085d3a49fb..2a5fc9fe1d 100644 --- a/servers/physics_2d/collision_solver_2d_sw.h +++ b/servers/physics_2d/collision_solver_2d_sw.h @@ -37,14 +37,14 @@ public: private: static bool solve_static_line(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result); static void concave_callback(void *p_userdata, Shape2DSW *p_convex); - static bool solve_concave(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); + static bool solve_concave(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis=NULL,real_t p_margin_A=0,real_t p_margin_B=0); static bool solve_raycast(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis=NULL); public: - static bool solve(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,Vector2 *sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); + static bool solve(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,Vector2 *sep_axis=NULL,real_t p_margin_A=0,real_t p_margin_B=0); }; diff --git a/servers/physics_2d/constraint_2d_sw.h b/servers/physics_2d/constraint_2d_sw.h index 4436f1f689..cce668405c 100644 --- a/servers/physics_2d/constraint_2d_sw.h +++ b/servers/physics_2d/constraint_2d_sw.h @@ -63,8 +63,8 @@ public: _FORCE_INLINE_ int get_body_count() const { return _body_count; } - virtual bool setup(float p_step)=0; - virtual void solve(float p_step)=0; + virtual bool setup(real_t p_step)=0; + virtual void solve(real_t p_step)=0; virtual ~Constraint2DSW() {} }; diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp index f0703a0894..76adf06429 100644 --- a/servers/physics_2d/joints_2d_sw.cpp +++ b/servers/physics_2d/joints_2d_sw.cpp @@ -91,7 +91,7 @@ normal_relative_velocity(Body2DSW *a, Body2DSW *b, Vector2 rA, Vector2 rB, Vecto #if 0 -bool PinJoint2DSW::setup(float p_step) { +bool PinJoint2DSW::setup(real_t p_step) { Space2DSW *space = A->get_space(); ERR_FAIL_COND_V(!space,false;) @@ -136,7 +136,7 @@ bool PinJoint2DSW::setup(float p_step) { -void PinJoint2DSW::solve(float p_step){ +void PinJoint2DSW::solve(real_t p_step){ if (!correct) return; @@ -189,7 +189,7 @@ PinJoint2DSW::~PinJoint2DSW() { #else -bool PinJoint2DSW::setup(float p_step) { +bool PinJoint2DSW::setup(real_t p_step) { Space2DSW *space = A->get_space(); ERR_FAIL_COND_V(!space,false;) @@ -257,7 +257,7 @@ bool PinJoint2DSW::setup(float p_step) { return true; } -void PinJoint2DSW::solve(float p_step){ +void PinJoint2DSW::solve(real_t p_step){ // compute relative velocity @@ -370,7 +370,7 @@ mult_k(const Vector2& vr, const Vector2 &k1, const Vector2 &k2) return Vector2(vr.dot(k1), vr.dot(k2)); } -bool GrooveJoint2DSW::setup(float p_step) { +bool GrooveJoint2DSW::setup(real_t p_step) { // calculate endpoints in worldspace @@ -412,7 +412,7 @@ bool GrooveJoint2DSW::setup(float p_step) { Vector2 delta = (B->get_transform().get_origin() +rB) - (A->get_transform().get_origin() + rA); - float _b = get_bias(); + real_t _b = get_bias(); _b=0.001; gbias=(delta*-(_b==0?space->get_constraint_bias():_b)*(1.0/p_step)).clamped(get_max_bias()); @@ -424,7 +424,7 @@ bool GrooveJoint2DSW::setup(float p_step) { return true; } -void GrooveJoint2DSW::solve(float p_step){ +void GrooveJoint2DSW::solve(real_t p_step){ // compute impulse @@ -470,7 +470,7 @@ GrooveJoint2DSW::~GrooveJoint2DSW() { ////////////////////////////////////////////// -bool DampedSpringJoint2DSW::setup(float p_step) { +bool DampedSpringJoint2DSW::setup(real_t p_step) { rA = A->get_transform().basis_xform(anchor_A); rB = B->get_transform().basis_xform(anchor_B); @@ -500,7 +500,7 @@ bool DampedSpringJoint2DSW::setup(float p_step) { return true; } -void DampedSpringJoint2DSW::solve(float p_step) { +void DampedSpringJoint2DSW::solve(real_t p_step) { // compute relative velocity real_t vrn = normal_relative_velocity(A, B, rA, rB, n) - target_vrn; diff --git a/servers/physics_2d/joints_2d_sw.h b/servers/physics_2d/joints_2d_sw.h index 91113fa26d..1be15e4edc 100644 --- a/servers/physics_2d/joints_2d_sw.h +++ b/servers/physics_2d/joints_2d_sw.h @@ -85,8 +85,8 @@ public: virtual Physics2DServer::JointType get_type() const { return Physics2DServer::JOINT_PIN; } - virtual bool setup(float p_step); - virtual void solve(float p_step); + virtual bool setup(real_t p_step); + virtual void solve(real_t p_step); PinJoint2DSW(const Vector2& p_pos,Body2DSW* p_body_a,Body2DSW* p_body_b=NULL); @@ -118,8 +118,8 @@ public: virtual Physics2DServer::JointType get_type() const { return Physics2DServer::JOINT_PIN; } - virtual bool setup(float p_step); - virtual void solve(float p_step); + virtual bool setup(real_t p_step); + virtual void solve(real_t p_step); void set_param(Physics2DServer::PinJointParam p_param, real_t p_value); real_t get_param(Physics2DServer::PinJointParam p_param) const; @@ -160,8 +160,8 @@ public: virtual Physics2DServer::JointType get_type() const { return Physics2DServer::JOINT_GROOVE; } - virtual bool setup(float p_step); - virtual void solve(float p_step); + virtual bool setup(real_t p_step); + virtual void solve(real_t p_step); GrooveJoint2DSW(const Vector2& p_a_groove1,const Vector2& p_a_groove2, const Vector2& p_b_anchor, Body2DSW* p_body_a,Body2DSW* p_body_b); @@ -198,8 +198,8 @@ public: virtual Physics2DServer::JointType get_type() const { return Physics2DServer::JOINT_DAMPED_SPRING; } - virtual bool setup(float p_step); - virtual void solve(float p_step); + virtual bool setup(real_t p_step); + virtual void solve(real_t p_step); void set_param(Physics2DServer::DampedStringParam p_param, real_t p_value); real_t get_param(Physics2DServer::DampedStringParam p_param) const; diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp index d134ce7ea8..920742ea0b 100644 --- a/servers/physics_2d/physics_2d_server_sw.cpp +++ b/servers/physics_2d/physics_2d_server_sw.cpp @@ -30,7 +30,7 @@ #include "broad_phase_2d_basic.h" #include "broad_phase_2d_hash_grid.h" #include "collision_solver_2d_sw.h" -#include "globals.h" +#include "global_config.h" #include "script_language.h" #include "os/os.h" @@ -158,11 +158,11 @@ void Physics2DServerSW::_shape_col_cbk(const Vector2& p_point_A,const Vector2& p if (cbk->amount == cbk->max) { //find least deep - float min_depth=1e20; + real_t min_depth=1e20; int min_depth_idx=0; for(int i=0;i<cbk->amount;i++) { - float d = cbk->ptr[i*2+0].distance_squared_to(cbk->ptr[i*2+1]); + real_t d = cbk->ptr[i*2+0].distance_squared_to(cbk->ptr[i*2+1]); if (d<min_depth) { min_depth=d; min_depth_idx=i; @@ -170,7 +170,7 @@ void Physics2DServerSW::_shape_col_cbk(const Vector2& p_point_A,const Vector2& p } - float d = p_point_A.distance_squared_to(p_point_B); + real_t d = p_point_A.distance_squared_to(p_point_B); if (d<min_depth) return; cbk->ptr[min_depth_idx*2+0]=p_point_A; @@ -785,7 +785,7 @@ uint32_t Physics2DServerSW::body_get_collision_mask(RID p_body) const { return body->get_collision_mask(); }; -void Physics2DServerSW::body_set_param(RID p_body, BodyParameter p_param, float p_value) { +void Physics2DServerSW::body_set_param(RID p_body, BodyParameter p_param, real_t p_value) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); @@ -793,7 +793,7 @@ void Physics2DServerSW::body_set_param(RID p_body, BodyParameter p_param, float body->set_param(p_param,p_value); }; -float Physics2DServerSW::body_get_param(RID p_body, BodyParameter p_param) const { +real_t Physics2DServerSW::body_get_param(RID p_body, BodyParameter p_param) const { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body,0); @@ -837,7 +837,7 @@ Vector2 Physics2DServerSW::body_get_applied_force(RID p_body) const { return body->get_applied_force(); }; -void Physics2DServerSW::body_set_applied_torque(RID p_body, float p_torque) { +void Physics2DServerSW::body_set_applied_torque(RID p_body, real_t p_torque) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); @@ -846,7 +846,7 @@ void Physics2DServerSW::body_set_applied_torque(RID p_body, float p_torque) { body->wakeup(); }; -float Physics2DServerSW::body_get_applied_torque(RID p_body) const { +real_t Physics2DServerSW::body_get_applied_torque(RID p_body) const { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body,0); @@ -915,14 +915,14 @@ void Physics2DServerSW::body_get_collision_exceptions(RID p_body, List<RID> *p_e }; -void Physics2DServerSW::body_set_contacts_reported_depth_treshold(RID p_body, float p_treshold) { +void Physics2DServerSW::body_set_contacts_reported_depth_treshold(RID p_body, real_t p_treshold) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); }; -float Physics2DServerSW::body_get_contacts_reported_depth_treshold(RID p_body) const { +real_t Physics2DServerSW::body_get_contacts_reported_depth_treshold(RID p_body) const { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body,0); @@ -973,7 +973,7 @@ Vector2 Physics2DServerSW::body_get_one_way_collision_direction(RID p_body) cons } -void Physics2DServerSW::body_set_one_way_collision_max_depth(RID p_body,float p_max_depth) { +void Physics2DServerSW::body_set_one_way_collision_max_depth(RID p_body,real_t p_max_depth) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); @@ -981,7 +981,7 @@ void Physics2DServerSW::body_set_one_way_collision_max_depth(RID p_body,float p_ } -float Physics2DServerSW::body_get_one_way_collision_max_depth(RID p_body) const { +real_t Physics2DServerSW::body_get_one_way_collision_max_depth(RID p_body) const { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body,0); @@ -1016,7 +1016,7 @@ void Physics2DServerSW::body_set_pickable(RID p_body,bool p_pickable) { } -bool Physics2DServerSW::body_test_motion(RID p_body, const Transform2D &p_from, const Vector2& p_motion, float p_margin, MotionResult *r_result) { +bool Physics2DServerSW::body_test_motion(RID p_body, const Transform2D &p_from, const Vector2& p_motion, real_t p_margin, MotionResult *r_result) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body,false); @@ -1263,7 +1263,7 @@ void Physics2DServerSW::init() { }; -void Physics2DServerSW::step(float p_step) { +void Physics2DServerSW::step(real_t p_step) { if (!active) diff --git a/servers/physics_2d/physics_2d_server_sw.h b/servers/physics_2d/physics_2d_server_sw.h index 1da7d65dc8..e33e2d78c7 100644 --- a/servers/physics_2d/physics_2d_server_sw.h +++ b/servers/physics_2d/physics_2d_server_sw.h @@ -76,7 +76,7 @@ public: struct CollCbkData { Vector2 valid_dir; - float valid_depth; + real_t valid_depth; int max; int amount; Vector2 *ptr; @@ -193,8 +193,8 @@ public: virtual void body_set_collision_mask(RID p_body, uint32_t p_mask); virtual uint32_t body_get_collision_mask(RID p_) const; - virtual void body_set_param(RID p_body, BodyParameter p_param, float p_value); - virtual float body_get_param(RID p_body, BodyParameter p_param) const; + virtual void body_set_param(RID p_body, BodyParameter p_param, real_t p_value); + virtual real_t body_get_param(RID p_body, BodyParameter p_param) const; virtual void body_set_state(RID p_body, BodyState p_state, const Variant& p_variant); @@ -203,8 +203,8 @@ public: virtual void body_set_applied_force(RID p_body, const Vector2& p_force); virtual Vector2 body_get_applied_force(RID p_body) const; - virtual void body_set_applied_torque(RID p_body, float p_torque); - virtual float body_get_applied_torque(RID p_body) const; + virtual void body_set_applied_torque(RID p_body, real_t p_torque); + virtual real_t body_get_applied_torque(RID p_body) const; virtual void body_add_force(RID p_body, const Vector2& p_offset, const Vector2& p_force); @@ -215,8 +215,8 @@ public: virtual void body_remove_collision_exception(RID p_body, RID p_body_b); virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions); - virtual void body_set_contacts_reported_depth_treshold(RID p_body, float p_treshold); - virtual float body_get_contacts_reported_depth_treshold(RID p_body) const; + virtual void body_set_contacts_reported_depth_treshold(RID p_body, real_t p_treshold); + virtual real_t body_get_contacts_reported_depth_treshold(RID p_body) const; virtual void body_set_omit_force_integration(RID p_body,bool p_omit); virtual bool body_is_omitting_force_integration(RID p_body) const; @@ -227,8 +227,8 @@ public: virtual void body_set_one_way_collision_direction(RID p_body,const Vector2& p_direction); virtual Vector2 body_get_one_way_collision_direction(RID p_body) const; - virtual void body_set_one_way_collision_max_depth(RID p_body,float p_max_depth); - virtual float body_get_one_way_collision_max_depth(RID p_body) const; + virtual void body_set_one_way_collision_max_depth(RID p_body,real_t p_max_depth); + virtual real_t body_get_one_way_collision_max_depth(RID p_body) const; virtual void body_set_force_integration_callback(RID p_body,Object *p_receiver,const StringName& p_method,const Variant& p_udata=Variant()); @@ -236,7 +236,7 @@ public: virtual void body_set_pickable(RID p_body,bool p_pickable); - virtual bool body_test_motion(RID p_body,const Transform2D& p_from,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL); + virtual bool body_test_motion(RID p_body,const Transform2D& p_from,const Vector2& p_motion,real_t p_margin=0.001,MotionResult *r_result=NULL); /* JOINT API */ @@ -260,7 +260,7 @@ public: virtual void set_active(bool p_active); virtual void init(); - virtual void step(float p_step); + virtual void step(real_t p_step); virtual void sync(); virtual void flush_queries(); virtual void end_sync(); diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index 027f318d2d..34ba149d23 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -35,7 +35,7 @@ void Physics2DServerWrapMT::thread_exit() { exit=true; } -void Physics2DServerWrapMT::thread_step(float p_delta) { +void Physics2DServerWrapMT::thread_step(real_t p_delta) { physics_2d_server->step(p_delta); step_sem->post(); @@ -75,7 +75,7 @@ void Physics2DServerWrapMT::thread_loop() { /* EVENT QUEUING */ -void Physics2DServerWrapMT::step(float p_step) { +void Physics2DServerWrapMT::step(real_t p_step) { if (create_thread) { diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.h b/servers/physics_2d/physics_2d_server_wrap_mt.h index 851ba901ec..f8b533080e 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.h +++ b/servers/physics_2d/physics_2d_server_wrap_mt.h @@ -33,7 +33,7 @@ #include "servers/physics_2d_server.h" #include "command_queue_mt.h" #include "os/thread.h" -#include "globals.h" +#include "global_config.h" #ifdef DEBUG_SYNC #define SYNC_DEBUG print_line("sync on: "+String(__FUNCTION__)); @@ -60,7 +60,7 @@ class Physics2DServerWrapMT : public Physics2DServer { Semaphore *step_sem; int step_pending; - void thread_step(float p_delta); + void thread_step(real_t p_delta); void thread_flush(); void thread_exit(); @@ -220,8 +220,8 @@ public: FUNC1RC(uint32_t,body_get_collision_mask,RID); - FUNC3(body_set_param,RID,BodyParameter,float); - FUNC2RC(float,body_get_param,RID,BodyParameter); + FUNC3(body_set_param,RID,BodyParameter,real_t); + FUNC2RC(real_t,body_get_param,RID,BodyParameter); FUNC3(body_set_state,RID,BodyState,const Variant&); @@ -230,8 +230,8 @@ public: FUNC2(body_set_applied_force,RID,const Vector2&); FUNC1RC(Vector2,body_get_applied_force,RID); - FUNC2(body_set_applied_torque,RID,float); - FUNC1RC(float,body_get_applied_torque,RID); + FUNC2(body_set_applied_torque,RID,real_t); + FUNC1RC(real_t,body_get_applied_torque,RID); FUNC3(body_add_force,RID,const Vector2&,const Vector2&); FUNC3(body_apply_impulse,RID,const Vector2&,const Vector2&); @@ -247,12 +247,12 @@ public: FUNC2(body_set_one_way_collision_direction,RID,const Vector2&); FUNC1RC(Vector2,body_get_one_way_collision_direction,RID); - FUNC2(body_set_one_way_collision_max_depth,RID,float); - FUNC1RC(float,body_get_one_way_collision_max_depth,RID); + FUNC2(body_set_one_way_collision_max_depth,RID,real_t); + FUNC1RC(real_t,body_get_one_way_collision_max_depth,RID); - FUNC2(body_set_contacts_reported_depth_treshold,RID,float); - FUNC1RC(float,body_get_contacts_reported_depth_treshold,RID); + FUNC2(body_set_contacts_reported_depth_treshold,RID,real_t); + FUNC1RC(real_t,body_get_contacts_reported_depth_treshold,RID); FUNC2(body_set_omit_force_integration,RID,bool); FUNC1RC(bool,body_is_omitting_force_integration,RID); @@ -266,7 +266,7 @@ public: FUNC2(body_set_pickable,RID,bool); - bool body_test_motion(RID p_body,const Transform2D& p_from,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL) { + bool body_test_motion(RID p_body,const Transform2D& p_from,const Vector2& p_motion,real_t p_margin=0.001,MotionResult *r_result=NULL) { ERR_FAIL_COND_V(main_thread!=Thread::get_caller_ID(),false); return physics_2d_server->body_test_motion(p_body,p_from,p_motion,p_margin,r_result); @@ -303,7 +303,7 @@ public: FUNC1(set_active,bool); virtual void init(); - virtual void step(float p_step); + virtual void step(real_t p_step); virtual void sync(); virtual void end_sync(); virtual void flush_queries(); diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index 886ae7730b..b6eb427131 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -136,7 +136,7 @@ bool LineShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p_en return true; } -real_t LineShape2DSW::get_moment_of_inertia(float p_mass, const Size2 &p_scale) const { +real_t LineShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 &p_scale) const { return 0; } @@ -191,7 +191,7 @@ bool RayShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p_end } -real_t RayShape2DSW::get_moment_of_inertia(float p_mass, const Size2 &p_scale) const { +real_t RayShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 &p_scale) const { return 0; //rays are mass-less } @@ -224,7 +224,7 @@ void SegmentShape2DSW::get_supports(const Vector2& p_normal,Vector2 *r_supports, } - float dp=p_normal.dot(b-a); + real_t dp=p_normal.dot(b-a); if (dp>0) *r_supports=b; else @@ -252,14 +252,14 @@ bool SegmentShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p return true; } -real_t SegmentShape2DSW::get_moment_of_inertia(float p_mass, const Size2 &p_scale) const { +real_t SegmentShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 &p_scale) const { Vector2 s[2]={a*p_scale,b*p_scale}; real_t l = s[1].distance_to(s[0]); Vector2 ofs = (s[0]+s[1])*0.5; - return p_mass*(l*l/12.0f + ofs.length_squared()); + return p_mass*(l*l/12.0 + ofs.length_squared()); } void SegmentShape2DSW::set_data(const Variant& p_data) { @@ -336,7 +336,7 @@ bool CircleShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p_ return true; } -real_t CircleShape2DSW::get_moment_of_inertia(float p_mass, const Size2 &p_scale) const { +real_t CircleShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 &p_scale) const { return (radius*radius)*(p_scale.x*0.5+p_scale.y*0.5); @@ -367,11 +367,11 @@ void RectangleShape2DSW::get_supports(const Vector2& p_normal,Vector2 *r_support Vector2 ag; ag[i]=1.0; - float dp = ag.dot(p_normal); + real_t dp = ag.dot(p_normal); if (Math::abs(dp)<_SEGMENT_IS_VALID_SUPPORT_TRESHOLD) continue; - float sgn = dp>0 ? 1.0 : -1.0; + real_t sgn = dp>0 ? 1.0 : -1.0; r_amount=2; @@ -407,10 +407,10 @@ bool RectangleShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& return get_aabb().intersects_segment(p_begin,p_end,&r_point,&r_normal); } -real_t RectangleShape2DSW::get_moment_of_inertia(float p_mass,const Size2& p_scale) const { +real_t RectangleShape2DSW::get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const { Vector2 he2=half_extents*2*p_scale; - return p_mass*he2.dot(he2)/12.0f; + return p_mass*he2.dot(he2)/12.0; } void RectangleShape2DSW::set_data(const Variant& p_data) { @@ -438,7 +438,7 @@ void CapsuleShape2DSW::get_supports(const Vector2& p_normal,Vector2 *r_supports, Vector2 n=p_normal; - float d = n.y; + real_t d = n.y; if (Math::abs( d )<(1.0-_SEGMENT_IS_VALID_SUPPORT_TRESHOLD) ) { @@ -455,7 +455,7 @@ void CapsuleShape2DSW::get_supports(const Vector2& p_normal,Vector2 *r_supports, } else { - float h = (d > 0) ? height : -height; + real_t h = (d > 0) ? height : -height; n*=radius; n.y += h*0.5; @@ -479,7 +479,7 @@ bool CapsuleShape2DSW::contains_point(const Vector2& p_point) const { bool CapsuleShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const { - float d = 1e10; + real_t d = 1e10; Vector2 n = (p_end-p_begin).normalized(); bool collided=false; @@ -488,7 +488,7 @@ bool CapsuleShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p Vector2 begin = p_begin; Vector2 end = p_end; - float ofs = (i==0)?-height*0.5:height*0.5; + real_t ofs = (i==0)?-height*0.5:height*0.5; begin.y+=ofs; end.y+=ofs; @@ -540,10 +540,10 @@ bool CapsuleShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p return collided; //todo } -real_t CapsuleShape2DSW::get_moment_of_inertia(float p_mass, const Size2 &p_scale) const { +real_t CapsuleShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 &p_scale) const { Vector2 he2=Vector2(radius*2,height+radius*2)*p_scale; - return p_mass*he2.dot(he2)/12.0f; + return p_mass*he2.dot(he2)/12.0; } void CapsuleShape2DSW::set_data(const Variant& p_data) { @@ -619,7 +619,7 @@ bool ConvexPolygonShape2DSW::contains_point(const Vector2& p_point) const { for(int i=0;i<point_count;i++) { - float d = points[i].normal.dot(p_point) - points[i].normal.dot(points[i].pos); + real_t d = points[i].normal.dot(p_point) - points[i].normal.dot(points[i].pos); if (d>0) out=true; else @@ -650,7 +650,7 @@ bool ConvexPolygonShape2DSW::intersect_segment(const Vector2& p_begin,const Vect if (!Geometry::segment_intersects_segment_2d(p_begin,p_end,points[i].pos,points[(i+1)%point_count].pos,&res)) continue; - float nd = n.dot(res); + real_t nd = n.dot(res); if (nd<d) { d=nd; @@ -672,7 +672,7 @@ bool ConvexPolygonShape2DSW::intersect_segment(const Vector2& p_begin,const Vect return inters; //todo } -real_t ConvexPolygonShape2DSW::get_moment_of_inertia(float p_mass,const Size2& p_scale) const { +real_t ConvexPolygonShape2DSW::get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const { Rect2 aabb; aabb.pos=points[0].pos*p_scale; @@ -681,7 +681,7 @@ real_t ConvexPolygonShape2DSW::get_moment_of_inertia(float p_mass,const Size2& p aabb.expand_to(points[i].pos*p_scale); } - return p_mass*aabb.size.dot(aabb.size)/12.0f + p_mass * (aabb.pos+aabb.size*0.5).length_squared(); + return p_mass*aabb.size.dot(aabb.size)/12.0 + p_mass * (aabb.pos+aabb.size*0.5).length_squared(); } void ConvexPolygonShape2DSW::set_data(const Variant& p_data) { @@ -859,7 +859,7 @@ bool ConcavePolygonShape2DSW::intersect_segment(const Vector2& p_begin,const Vec if (Geometry::segment_intersects_segment_2d(p_begin,p_end,a,b,&res)) { - float nd = n.dot(res); + real_t nd = n.dot(res); if (nd<d) { d=nd; diff --git a/servers/physics_2d/shape_2d_sw.h b/servers/physics_2d/shape_2d_sw.h index 07a9d84ec8..c04cdfa456 100644 --- a/servers/physics_2d/shape_2d_sw.h +++ b/servers/physics_2d/shape_2d_sw.h @@ -35,8 +35,8 @@ /* SHAPE_LINE, ///< plane:"plane" -SHAPE_SEGMENT, ///< float:"length" -SHAPE_CIRCLE, ///< float:"radius" +SHAPE_SEGMENT, ///< real_t:"length" +SHAPE_CIRCLE, ///< real_t:"radius" SHAPE_RECTANGLE, ///< vec3:"extents" SHAPE_CONVEX_POLYGON, ///< array of planes:"planes" SHAPE_CONCAVE_POLYGON, ///< Vector2 array:"triangles" , or Dictionary with "indices" (int array) and "triangles" (Vector2 array) @@ -86,7 +86,7 @@ public: virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const=0; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const=0; - virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const=0; + virtual real_t get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const=0; virtual void set_data(const Variant& p_data)=0; virtual Variant get_data() const=0; @@ -175,7 +175,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; + virtual real_t get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -218,7 +218,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; + virtual real_t get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -266,7 +266,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; + virtual real_t get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -304,7 +304,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; + virtual real_t get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -344,7 +344,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; + virtual real_t get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -432,7 +432,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; + virtual real_t get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -440,7 +440,7 @@ public: _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { // no matter the angle, the box is mirrored anyway Vector2 n=p_transform.basis_xform_inv(p_normal).normalized(); - float h = (n.y > 0) ? height : -height; + real_t h = (n.y > 0) ? height : -height; n *= radius; n.y += h * 0.5; @@ -495,7 +495,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; + virtual real_t get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -506,7 +506,7 @@ public: r_min = r_max = p_normal.dot(p_transform.xform(points[0].pos)); for(int i=1;i<point_count;i++) { - float d = p_normal.dot(p_transform.xform(points[i].pos)); + real_t d = p_normal.dot(p_transform.xform(points[i].pos)); if (d>r_max) r_max=d; if (d<r_min) @@ -584,7 +584,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const { return 0; } + virtual real_t get_moment_of_inertia(real_t p_mass,const Size2& p_scale) const { return 0; } virtual void set_data(const Variant& p_data); virtual Variant get_data() const; diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index a48b6d3827..9bced50061 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -190,7 +190,7 @@ bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2& p_from, const Vec } -int Physics2DDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { +int Physics2DDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,real_t p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { if (p_result_max<=0) return 0; @@ -237,7 +237,7 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Trans -bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { +bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,real_t p_margin,real_t &p_closest_safe,real_t &p_closest_unsafe, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { @@ -255,8 +255,8 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transfor int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,Space2DSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results); - float best_safe=1; - float best_unsafe=1; + real_t best_safe=1; + real_t best_unsafe=1; for(int i=0;i<amount;i++) { @@ -305,13 +305,13 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transfor //just do kinematic solving - float low=0; - float hi=1; + real_t low=0; + real_t hi=1; Vector2 mnormal=p_motion.normalized(); for(int i=0;i<8;i++) { //steps should be customizable.. - float ofs = (low+hi)*0.5; + real_t ofs = (low+hi)*0.5; Vector2 sep=mnormal; //important optimization for this to work fast enough bool collided = CollisionSolver2DSW::solve(shape,p_xform,p_motion*ofs,col_obj->get_shape(shape_idx),col_obj_xform,Vector2(),NULL,NULL,&sep,p_margin); @@ -364,7 +364,7 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transfor } -bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,Vector2 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { +bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,real_t p_margin,Vector2 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { if (p_result_max<=0) @@ -436,9 +436,9 @@ struct _RestCallbackData2D { int best_shape; Vector2 best_contact; Vector2 best_normal; - float best_len; + real_t best_len; Vector2 valid_dir; - float valid_depth; + real_t valid_depth; }; static void _rest_cbk_result(const Vector2& p_point_A,const Vector2& p_point_B,void *p_userdata) { @@ -458,7 +458,7 @@ static void _rest_cbk_result(const Vector2& p_point_A,const Vector2& p_point_B,v } Vector2 contact_rel = p_point_B - p_point_A; - float len = contact_rel.length(); + real_t len = contact_rel.length(); if (len <= rd->best_len) return; @@ -473,7 +473,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 Transform2D& 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) { +bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,real_t p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape); @@ -594,7 +594,7 @@ int Space2DSW::_cull_aabb_for_body(Body2DSW *p_body,const Rect2& p_aabb) { return amount; } -bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, const Vector2&p_motion, float p_margin, Physics2DServer::MotionResult *r_result) { +bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, const Vector2&p_motion, real_t p_margin, Physics2DServer::MotionResult *r_result) { //give me back regular physics engine logic //this is madness @@ -622,6 +622,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co Transform2D body_transform = p_from; + { //STEP 1, FREE BODY IF STUCK @@ -645,6 +646,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co bool collided=false; + int amount = _cull_aabb_for_body(p_body,body_aabb); for(int j=0;j<p_body->get_shape_count();j++) { @@ -682,11 +684,13 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co } - if (!collided) + if (!collided) { break; + } Vector2 recover_motion; + for(int i=0;i<cbk.amount;i++) { Vector2 a = sr[i*2+0]; @@ -694,15 +698,15 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co #if 0 Vector2 rel = b-a; - float d = rel.length(); + real_t d = rel.length(); if (d==0) continue; Vector2 n = rel/d; - float traveled = n.dot(recover_motion); + real_t traveled = n.dot(recover_motion); a+=n*traveled; - float d = a.distance_to(b); + real_t d = a.distance_to(b); if (d<margin) continue; #endif @@ -724,8 +728,8 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co - float safe = 1.0; - float unsafe = 1.0; + real_t safe = 1.0; + real_t unsafe = 1.0; int best_shape=-1; { @@ -747,8 +751,8 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co bool stuck=false; - float best_safe=1; - float best_unsafe=1; + real_t best_safe=1; + real_t best_unsafe=1; for(int i=0;i<amount;i++) { @@ -780,13 +784,13 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co //just do kinematic solving - float low=0; - float hi=1; + real_t low=0; + real_t hi=1; Vector2 mnormal=p_motion.normalized(); for(int i=0;i<8;i++) { //steps should be customizable.. - float ofs = (low+hi)*0.5; + real_t ofs = (low+hi)*0.5; Vector2 sep=mnormal; //important optimization for this to work fast enough bool collided = CollisionSolver2DSW::solve(body_shape,body_shape_xform,p_motion*ofs,col_obj->get_shape(shape_idx),col_obj_xform,Vector2(),NULL,NULL,&sep,0); @@ -1000,7 +1004,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co Vector2 a = sr[i*2+0]; Vector2 b = sr[i*2+1]; - float d = a.distance_to(b); + real_t d = a.distance_to(b); /* if (d<margin) @@ -1024,8 +1028,8 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co //move second - float safe = 1.0; - float unsafe = 1.0; + real_t safe = 1.0; + real_t unsafe = 1.0; int best_shape=-1; for(int i=0;i<get_shape_count();i++) { @@ -1033,7 +1037,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co if (is_shape_set_as_trigger(i)) continue; - float lsafe,lunsafe; + real_t lsafe,lunsafe; bool valid = dss->cast_motion(get_shape(i)->get_rid(), get_global_transform() * get_shape_transform(i), p_motion, 0,lsafe,lunsafe,exclude,get_layer_mask(),mask); //print_line("shape: "+itos(i)+" travel:"+rtos(ltravel)); if (!valid) { diff --git a/servers/physics_2d/space_2d_sw.h b/servers/physics_2d/space_2d_sw.h index 5dee3dea5a..071aa7bdfb 100644 --- a/servers/physics_2d/space_2d_sw.h +++ b/servers/physics_2d/space_2d_sw.h @@ -37,7 +37,7 @@ #include "area_pair_2d_sw.h" #include "broad_phase_2d_sw.h" #include "collision_object_2d_sw.h" -#include "globals.h" +#include "global_config.h" class Physics2DDirectSpaceStateSW : public Physics2DDirectSpaceState { @@ -49,10 +49,10 @@ public: virtual int intersect_point(const Vector2& p_point,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, bool p_pick_point=false); virtual bool intersect_ray(const Vector2& p_from, const Vector2& 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 int intersect_shape(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,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 Transform2D& p_xform,const Vector2& 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); - virtual bool collide_shape(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,Vector2 *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); - virtual bool rest_info(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); + virtual int intersect_shape(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,real_t 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 Transform2D& p_xform,const Vector2& p_motion,real_t p_margin,real_t &p_closest_safe,real_t &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); + virtual bool collide_shape(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,real_t p_margin,Vector2 *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); + virtual bool rest_info(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,real_t p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); Physics2DDirectSpaceStateSW(); }; @@ -106,9 +106,9 @@ private: CollisionObject2DSW *intersection_query_results[INTERSECTION_QUERY_MAX]; int intersection_query_subindex_results[INTERSECTION_QUERY_MAX]; - float body_linear_velocity_sleep_treshold; - float body_angular_velocity_sleep_treshold; - float body_time_to_sleep; + real_t body_linear_velocity_sleep_treshold; + real_t body_angular_velocity_sleep_treshold; + real_t body_time_to_sleep; bool locked; @@ -185,7 +185,7 @@ public: int get_collision_pairs() const { return collision_pairs; } - bool test_body_motion(Body2DSW *p_body, const Transform2D &p_from, const Vector2&p_motion, float p_margin, Physics2DServer::MotionResult *r_result); + bool test_body_motion(Body2DSW *p_body, const Transform2D &p_from, const Vector2&p_motion, real_t p_margin, Physics2DServer::MotionResult *r_result); void set_debug_contacts(int p_amount) { contact_debug.resize(p_amount); } diff --git a/servers/physics_2d/step_2d_sw.cpp b/servers/physics_2d/step_2d_sw.cpp index 8be4e2b5d5..355cc25a69 100644 --- a/servers/physics_2d/step_2d_sw.cpp +++ b/servers/physics_2d/step_2d_sw.cpp @@ -56,7 +56,7 @@ void Step2DSW::_populate_island(Body2DSW* p_body,Body2DSW** p_island,Constraint2 } } -bool Step2DSW::_setup_island(Constraint2DSW *p_island,float p_delta) { +bool Step2DSW::_setup_island(Constraint2DSW *p_island,real_t p_delta) { Constraint2DSW *ci=p_island; Constraint2DSW *prev_ci=NULL; @@ -81,7 +81,7 @@ bool Step2DSW::_setup_island(Constraint2DSW *p_island,float p_delta) { return removed_root; } -void Step2DSW::_solve_island(Constraint2DSW *p_island,int p_iterations,float p_delta){ +void Step2DSW::_solve_island(Constraint2DSW *p_island,int p_iterations,real_t p_delta){ for(int i=0;i<p_iterations;i++) { @@ -94,7 +94,7 @@ void Step2DSW::_solve_island(Constraint2DSW *p_island,int p_iterations,float p_d } } -void Step2DSW::_check_suspend(Body2DSW *p_island,float p_delta) { +void Step2DSW::_check_suspend(Body2DSW *p_island,real_t p_delta) { bool can_sleep=true; @@ -132,7 +132,7 @@ void Step2DSW::_check_suspend(Body2DSW *p_island,float p_delta) { } } -void Step2DSW::step(Space2DSW* p_space,float p_delta,int p_iterations) { +void Step2DSW::step(Space2DSW* p_space,real_t p_delta,int p_iterations) { p_space->lock(); // can't access space during this diff --git a/servers/physics_2d/step_2d_sw.h b/servers/physics_2d/step_2d_sw.h index 917d69e7f1..0896e1016d 100644 --- a/servers/physics_2d/step_2d_sw.h +++ b/servers/physics_2d/step_2d_sw.h @@ -36,12 +36,12 @@ class Step2DSW { uint64_t _step; void _populate_island(Body2DSW* p_body,Body2DSW** p_island,Constraint2DSW **p_constraint_island); - 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); + bool _setup_island(Constraint2DSW *p_island,real_t p_delta); + void _solve_island(Constraint2DSW *p_island,int p_iterations,real_t p_delta); + void _check_suspend(Body2DSW *p_island,real_t p_delta); public: - void step(Space2DSW* p_space,float p_delta,int p_iterations); + void step(Space2DSW* p_space,real_t p_delta,int p_iterations); Step2DSW(); }; diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp index 39b790111b..bdbe85612f 100644 --- a/servers/physics_2d_server.cpp +++ b/servers/physics_2d_server.cpp @@ -73,40 +73,40 @@ Physics2DServer * Physics2DServer::get_singleton() { void Physics2DDirectBodyState::_bind_methods() { - ClassDB::bind_method(_MD("get_total_gravity"),&Physics2DDirectBodyState::get_total_gravity); - ClassDB::bind_method(_MD("get_total_linear_damp"),&Physics2DDirectBodyState::get_total_linear_damp); - ClassDB::bind_method(_MD("get_total_angular_damp"),&Physics2DDirectBodyState::get_total_angular_damp); + ClassDB::bind_method(D_METHOD("get_total_gravity"),&Physics2DDirectBodyState::get_total_gravity); + ClassDB::bind_method(D_METHOD("get_total_linear_damp"),&Physics2DDirectBodyState::get_total_linear_damp); + ClassDB::bind_method(D_METHOD("get_total_angular_damp"),&Physics2DDirectBodyState::get_total_angular_damp); - ClassDB::bind_method(_MD("get_inverse_mass"),&Physics2DDirectBodyState::get_inverse_mass); - ClassDB::bind_method(_MD("get_inverse_inertia"),&Physics2DDirectBodyState::get_inverse_inertia); + ClassDB::bind_method(D_METHOD("get_inverse_mass"),&Physics2DDirectBodyState::get_inverse_mass); + ClassDB::bind_method(D_METHOD("get_inverse_inertia"),&Physics2DDirectBodyState::get_inverse_inertia); - ClassDB::bind_method(_MD("set_linear_velocity","velocity"),&Physics2DDirectBodyState::set_linear_velocity); - ClassDB::bind_method(_MD("get_linear_velocity"),&Physics2DDirectBodyState::get_linear_velocity); + ClassDB::bind_method(D_METHOD("set_linear_velocity","velocity"),&Physics2DDirectBodyState::set_linear_velocity); + ClassDB::bind_method(D_METHOD("get_linear_velocity"),&Physics2DDirectBodyState::get_linear_velocity); - ClassDB::bind_method(_MD("set_angular_velocity","velocity"),&Physics2DDirectBodyState::set_angular_velocity); - ClassDB::bind_method(_MD("get_angular_velocity"),&Physics2DDirectBodyState::get_angular_velocity); + ClassDB::bind_method(D_METHOD("set_angular_velocity","velocity"),&Physics2DDirectBodyState::set_angular_velocity); + ClassDB::bind_method(D_METHOD("get_angular_velocity"),&Physics2DDirectBodyState::get_angular_velocity); - ClassDB::bind_method(_MD("set_transform","transform"),&Physics2DDirectBodyState::set_transform); - ClassDB::bind_method(_MD("get_transform"),&Physics2DDirectBodyState::get_transform); + ClassDB::bind_method(D_METHOD("set_transform","transform"),&Physics2DDirectBodyState::set_transform); + ClassDB::bind_method(D_METHOD("get_transform"),&Physics2DDirectBodyState::get_transform); - ClassDB::bind_method(_MD("set_sleep_state","enabled"),&Physics2DDirectBodyState::set_sleep_state); - ClassDB::bind_method(_MD("is_sleeping"),&Physics2DDirectBodyState::is_sleeping); + ClassDB::bind_method(D_METHOD("set_sleep_state","enabled"),&Physics2DDirectBodyState::set_sleep_state); + ClassDB::bind_method(D_METHOD("is_sleeping"),&Physics2DDirectBodyState::is_sleeping); - ClassDB::bind_method(_MD("get_contact_count"),&Physics2DDirectBodyState::get_contact_count); + ClassDB::bind_method(D_METHOD("get_contact_count"),&Physics2DDirectBodyState::get_contact_count); - ClassDB::bind_method(_MD("get_contact_local_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_local_pos); - ClassDB::bind_method(_MD("get_contact_local_normal","contact_idx"),&Physics2DDirectBodyState::get_contact_local_normal); - ClassDB::bind_method(_MD("get_contact_local_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_local_shape); - ClassDB::bind_method(_MD("get_contact_collider","contact_idx"),&Physics2DDirectBodyState::get_contact_collider); - ClassDB::bind_method(_MD("get_contact_collider_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_pos); - ClassDB::bind_method(_MD("get_contact_collider_id","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_id); - ClassDB::bind_method(_MD("get_contact_collider_object","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_object); - ClassDB::bind_method(_MD("get_contact_collider_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape); - ClassDB::bind_method(_MD("get_contact_collider_shape_metadata:Variant","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape_metadata); - ClassDB::bind_method(_MD("get_contact_collider_velocity_at_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_velocity_at_pos); - ClassDB::bind_method(_MD("get_step"),&Physics2DDirectBodyState::get_step); - ClassDB::bind_method(_MD("integrate_forces"),&Physics2DDirectBodyState::integrate_forces); - ClassDB::bind_method(_MD("get_space_state:Physics2DDirectSpaceState"),&Physics2DDirectBodyState::get_space_state); + ClassDB::bind_method(D_METHOD("get_contact_local_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_local_pos); + ClassDB::bind_method(D_METHOD("get_contact_local_normal","contact_idx"),&Physics2DDirectBodyState::get_contact_local_normal); + ClassDB::bind_method(D_METHOD("get_contact_local_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_local_shape); + ClassDB::bind_method(D_METHOD("get_contact_collider","contact_idx"),&Physics2DDirectBodyState::get_contact_collider); + ClassDB::bind_method(D_METHOD("get_contact_collider_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_pos); + ClassDB::bind_method(D_METHOD("get_contact_collider_id","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_id); + ClassDB::bind_method(D_METHOD("get_contact_collider_object","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_object); + ClassDB::bind_method(D_METHOD("get_contact_collider_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape); + ClassDB::bind_method(D_METHOD("get_contact_collider_shape_metadata:Variant","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape_metadata); + ClassDB::bind_method(D_METHOD("get_contact_collider_velocity_at_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_velocity_at_pos); + ClassDB::bind_method(D_METHOD("get_step"),&Physics2DDirectBodyState::get_step); + ClassDB::bind_method(D_METHOD("integrate_forces"),&Physics2DDirectBodyState::integrate_forces); + ClassDB::bind_method(D_METHOD("get_space_state:Physics2DDirectSpaceState"),&Physics2DDirectBodyState::get_space_state); } @@ -198,27 +198,27 @@ Vector<RID> Physics2DShapeQueryParameters::get_exclude() const{ void Physics2DShapeQueryParameters::_bind_methods() { - ClassDB::bind_method(_MD("set_shape","shape:Shape2D"),&Physics2DShapeQueryParameters::set_shape); - ClassDB::bind_method(_MD("set_shape_rid","shape"),&Physics2DShapeQueryParameters::set_shape_rid); - ClassDB::bind_method(_MD("get_shape_rid"),&Physics2DShapeQueryParameters::get_shape_rid); + ClassDB::bind_method(D_METHOD("set_shape","shape:Shape2D"),&Physics2DShapeQueryParameters::set_shape); + ClassDB::bind_method(D_METHOD("set_shape_rid","shape"),&Physics2DShapeQueryParameters::set_shape_rid); + ClassDB::bind_method(D_METHOD("get_shape_rid"),&Physics2DShapeQueryParameters::get_shape_rid); - ClassDB::bind_method(_MD("set_transform","transform"),&Physics2DShapeQueryParameters::set_transform); - ClassDB::bind_method(_MD("get_transform"),&Physics2DShapeQueryParameters::get_transform); + ClassDB::bind_method(D_METHOD("set_transform","transform"),&Physics2DShapeQueryParameters::set_transform); + ClassDB::bind_method(D_METHOD("get_transform"),&Physics2DShapeQueryParameters::get_transform); - ClassDB::bind_method(_MD("set_motion","motion"),&Physics2DShapeQueryParameters::set_motion); - ClassDB::bind_method(_MD("get_motion"),&Physics2DShapeQueryParameters::get_motion); + ClassDB::bind_method(D_METHOD("set_motion","motion"),&Physics2DShapeQueryParameters::set_motion); + ClassDB::bind_method(D_METHOD("get_motion"),&Physics2DShapeQueryParameters::get_motion); - ClassDB::bind_method(_MD("set_margin","margin"),&Physics2DShapeQueryParameters::set_margin); - ClassDB::bind_method(_MD("get_margin"),&Physics2DShapeQueryParameters::get_margin); + ClassDB::bind_method(D_METHOD("set_margin","margin"),&Physics2DShapeQueryParameters::set_margin); + ClassDB::bind_method(D_METHOD("get_margin"),&Physics2DShapeQueryParameters::get_margin); - ClassDB::bind_method(_MD("set_layer_mask","layer_mask"),&Physics2DShapeQueryParameters::set_layer_mask); - ClassDB::bind_method(_MD("get_layer_mask"),&Physics2DShapeQueryParameters::get_layer_mask); + ClassDB::bind_method(D_METHOD("set_layer_mask","layer_mask"),&Physics2DShapeQueryParameters::set_layer_mask); + ClassDB::bind_method(D_METHOD("get_layer_mask"),&Physics2DShapeQueryParameters::get_layer_mask); - ClassDB::bind_method(_MD("set_object_type_mask","object_type_mask"),&Physics2DShapeQueryParameters::set_object_type_mask); - ClassDB::bind_method(_MD("get_object_type_mask"),&Physics2DShapeQueryParameters::get_object_type_mask); + ClassDB::bind_method(D_METHOD("set_object_type_mask","object_type_mask"),&Physics2DShapeQueryParameters::set_object_type_mask); + ClassDB::bind_method(D_METHOD("get_object_type_mask"),&Physics2DShapeQueryParameters::get_object_type_mask); - ClassDB::bind_method(_MD("set_exclude","exclude"),&Physics2DShapeQueryParameters::set_exclude); - ClassDB::bind_method(_MD("get_exclude"),&Physics2DShapeQueryParameters::get_exclude); + ClassDB::bind_method(D_METHOD("set_exclude","exclude"),&Physics2DShapeQueryParameters::set_exclude); + ClassDB::bind_method(D_METHOD("get_exclude"),&Physics2DShapeQueryParameters::get_exclude); } @@ -366,13 +366,13 @@ Physics2DDirectSpaceState::Physics2DDirectSpaceState() { void Physics2DDirectSpaceState::_bind_methods() { - ClassDB::bind_method(_MD("intersect_point","point","max_results","exclude","layer_mask","type_mask"),&Physics2DDirectSpaceState::_intersect_point,DEFVAL(32),DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); - ClassDB::bind_method(_MD("intersect_ray:Dictionary","from","to","exclude","layer_mask","type_mask"),&Physics2DDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); - ClassDB::bind_method(_MD("intersect_shape","shape:Physics2DShapeQueryParameters","max_results"),&Physics2DDirectSpaceState::_intersect_shape,DEFVAL(32)); - ClassDB::bind_method(_MD("cast_motion","shape:Physics2DShapeQueryParameters"),&Physics2DDirectSpaceState::_cast_motion); - ClassDB::bind_method(_MD("collide_shape","shape:Physics2DShapeQueryParameters","max_results"),&Physics2DDirectSpaceState::_collide_shape,DEFVAL(32)); - ClassDB::bind_method(_MD("get_rest_info","shape:Physics2DShapeQueryParameters"),&Physics2DDirectSpaceState::_get_rest_info); - //ClassDB::bind_method(_MD("cast_motion","shape","xform","motion","exclude","umask"),&Physics2DDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0)); + ClassDB::bind_method(D_METHOD("intersect_point","point","max_results","exclude","layer_mask","type_mask"),&Physics2DDirectSpaceState::_intersect_point,DEFVAL(32),DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); + ClassDB::bind_method(D_METHOD("intersect_ray:Dictionary","from","to","exclude","layer_mask","type_mask"),&Physics2DDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); + ClassDB::bind_method(D_METHOD("intersect_shape","shape:Physics2DShapeQueryParameters","max_results"),&Physics2DDirectSpaceState::_intersect_shape,DEFVAL(32)); + ClassDB::bind_method(D_METHOD("cast_motion","shape:Physics2DShapeQueryParameters"),&Physics2DDirectSpaceState::_cast_motion); + ClassDB::bind_method(D_METHOD("collide_shape","shape:Physics2DShapeQueryParameters","max_results"),&Physics2DDirectSpaceState::_collide_shape,DEFVAL(32)); + ClassDB::bind_method(D_METHOD("get_rest_info","shape:Physics2DShapeQueryParameters"),&Physics2DDirectSpaceState::_get_rest_info); + //ClassDB::bind_method(D_METHOD("cast_motion","shape","xform","motion","exclude","umask"),&Physics2DDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0)); BIND_CONSTANT( TYPE_MASK_STATIC_BODY ); BIND_CONSTANT( TYPE_MASK_KINEMATIC_BODY ); @@ -412,11 +412,11 @@ Physics2DShapeQueryResult::Physics2DShapeQueryResult() { void Physics2DShapeQueryResult::_bind_methods() { - ClassDB::bind_method(_MD("get_result_count"),&Physics2DShapeQueryResult::get_result_count); - ClassDB::bind_method(_MD("get_result_rid","idx"),&Physics2DShapeQueryResult::get_result_rid); - ClassDB::bind_method(_MD("get_result_object_id","idx"),&Physics2DShapeQueryResult::get_result_object_id); - ClassDB::bind_method(_MD("get_result_object","idx"),&Physics2DShapeQueryResult::get_result_object); - ClassDB::bind_method(_MD("get_result_object_shape","idx"),&Physics2DShapeQueryResult::get_result_object_shape); + ClassDB::bind_method(D_METHOD("get_result_count"),&Physics2DShapeQueryResult::get_result_count); + ClassDB::bind_method(D_METHOD("get_result_rid","idx"),&Physics2DShapeQueryResult::get_result_rid); + ClassDB::bind_method(D_METHOD("get_result_object_id","idx"),&Physics2DShapeQueryResult::get_result_object_id); + ClassDB::bind_method(D_METHOD("get_result_object","idx"),&Physics2DShapeQueryResult::get_result_object); + ClassDB::bind_method(D_METHOD("get_result_object_shape","idx"),&Physics2DShapeQueryResult::get_result_object_shape); } @@ -468,16 +468,16 @@ int Physics2DTestMotionResult::get_collider_shape() const{ void Physics2DTestMotionResult::_bind_methods() { - //ClassDB::bind_method(_MD("is_colliding"),&Physics2DTestMotionResult::is_colliding); - ClassDB::bind_method(_MD("get_motion"),&Physics2DTestMotionResult::get_motion); - ClassDB::bind_method(_MD("get_motion_remainder"),&Physics2DTestMotionResult::get_motion_remainder); - ClassDB::bind_method(_MD("get_collision_point"),&Physics2DTestMotionResult::get_collision_point); - ClassDB::bind_method(_MD("get_collision_normal"),&Physics2DTestMotionResult::get_collision_normal); - ClassDB::bind_method(_MD("get_collider_velocity"),&Physics2DTestMotionResult::get_collider_velocity); - ClassDB::bind_method(_MD("get_collider_id"),&Physics2DTestMotionResult::get_collider_id); - ClassDB::bind_method(_MD("get_collider_rid"),&Physics2DTestMotionResult::get_collider_rid); - ClassDB::bind_method(_MD("get_collider"),&Physics2DTestMotionResult::get_collider); - ClassDB::bind_method(_MD("get_collider_shape"),&Physics2DTestMotionResult::get_collider_shape); + //ClassDB::bind_method(D_METHOD("is_colliding"),&Physics2DTestMotionResult::is_colliding); + ClassDB::bind_method(D_METHOD("get_motion"),&Physics2DTestMotionResult::get_motion); + ClassDB::bind_method(D_METHOD("get_motion_remainder"),&Physics2DTestMotionResult::get_motion_remainder); + ClassDB::bind_method(D_METHOD("get_collision_point"),&Physics2DTestMotionResult::get_collision_point); + ClassDB::bind_method(D_METHOD("get_collision_normal"),&Physics2DTestMotionResult::get_collision_normal); + ClassDB::bind_method(D_METHOD("get_collider_velocity"),&Physics2DTestMotionResult::get_collider_velocity); + ClassDB::bind_method(D_METHOD("get_collider_id"),&Physics2DTestMotionResult::get_collider_id); + ClassDB::bind_method(D_METHOD("get_collider_rid"),&Physics2DTestMotionResult::get_collider_rid); + ClassDB::bind_method(D_METHOD("get_collider"),&Physics2DTestMotionResult::get_collider); + ClassDB::bind_method(D_METHOD("get_collider_shape"),&Physics2DTestMotionResult::get_collider_shape); } @@ -504,147 +504,147 @@ bool Physics2DServer::_body_test_motion(RID p_body,const Transform2D& p_from,con void Physics2DServer::_bind_methods() { - ClassDB::bind_method(_MD("shape_create","type"),&Physics2DServer::shape_create); - ClassDB::bind_method(_MD("shape_set_data","shape","data"),&Physics2DServer::shape_set_data); + ClassDB::bind_method(D_METHOD("shape_create","type"),&Physics2DServer::shape_create); + ClassDB::bind_method(D_METHOD("shape_set_data","shape","data"),&Physics2DServer::shape_set_data); - ClassDB::bind_method(_MD("shape_get_type","shape"),&Physics2DServer::shape_get_type); - ClassDB::bind_method(_MD("shape_get_data","shape"),&Physics2DServer::shape_get_data); + ClassDB::bind_method(D_METHOD("shape_get_type","shape"),&Physics2DServer::shape_get_type); + ClassDB::bind_method(D_METHOD("shape_get_data","shape"),&Physics2DServer::shape_get_data); - ClassDB::bind_method(_MD("space_create"),&Physics2DServer::space_create); - ClassDB::bind_method(_MD("space_set_active","space","active"),&Physics2DServer::space_set_active); - ClassDB::bind_method(_MD("space_is_active","space"),&Physics2DServer::space_is_active); - ClassDB::bind_method(_MD("space_set_param","space","param","value"),&Physics2DServer::space_set_param); - ClassDB::bind_method(_MD("space_get_param","space","param"),&Physics2DServer::space_get_param); - ClassDB::bind_method(_MD("space_get_direct_state:Physics2DDirectSpaceState","space"),&Physics2DServer::space_get_direct_state); + ClassDB::bind_method(D_METHOD("space_create"),&Physics2DServer::space_create); + ClassDB::bind_method(D_METHOD("space_set_active","space","active"),&Physics2DServer::space_set_active); + ClassDB::bind_method(D_METHOD("space_is_active","space"),&Physics2DServer::space_is_active); + ClassDB::bind_method(D_METHOD("space_set_param","space","param","value"),&Physics2DServer::space_set_param); + ClassDB::bind_method(D_METHOD("space_get_param","space","param"),&Physics2DServer::space_get_param); + ClassDB::bind_method(D_METHOD("space_get_direct_state:Physics2DDirectSpaceState","space"),&Physics2DServer::space_get_direct_state); - ClassDB::bind_method(_MD("area_create"),&Physics2DServer::area_create); - ClassDB::bind_method(_MD("area_set_space","area","space"),&Physics2DServer::area_set_space); - ClassDB::bind_method(_MD("area_get_space","area"),&Physics2DServer::area_get_space); + ClassDB::bind_method(D_METHOD("area_create"),&Physics2DServer::area_create); + ClassDB::bind_method(D_METHOD("area_set_space","area","space"),&Physics2DServer::area_set_space); + ClassDB::bind_method(D_METHOD("area_get_space","area"),&Physics2DServer::area_get_space); - ClassDB::bind_method(_MD("area_set_space_override_mode","area","mode"),&Physics2DServer::area_set_space_override_mode); - ClassDB::bind_method(_MD("area_get_space_override_mode","area"),&Physics2DServer::area_get_space_override_mode); + ClassDB::bind_method(D_METHOD("area_set_space_override_mode","area","mode"),&Physics2DServer::area_set_space_override_mode); + ClassDB::bind_method(D_METHOD("area_get_space_override_mode","area"),&Physics2DServer::area_get_space_override_mode); - ClassDB::bind_method(_MD("area_add_shape","area","shape","transform"),&Physics2DServer::area_add_shape,DEFVAL(Transform2D())); - ClassDB::bind_method(_MD("area_set_shape","area","shape_idx","shape"),&Physics2DServer::area_set_shape); - ClassDB::bind_method(_MD("area_set_shape_transform","area","shape_idx","transform"),&Physics2DServer::area_set_shape_transform); + ClassDB::bind_method(D_METHOD("area_add_shape","area","shape","transform"),&Physics2DServer::area_add_shape,DEFVAL(Transform2D())); + ClassDB::bind_method(D_METHOD("area_set_shape","area","shape_idx","shape"),&Physics2DServer::area_set_shape); + ClassDB::bind_method(D_METHOD("area_set_shape_transform","area","shape_idx","transform"),&Physics2DServer::area_set_shape_transform); - ClassDB::bind_method(_MD("area_get_shape_count","area"),&Physics2DServer::area_get_shape_count); - ClassDB::bind_method(_MD("area_get_shape","area","shape_idx"),&Physics2DServer::area_get_shape); - ClassDB::bind_method(_MD("area_get_shape_transform","area","shape_idx"),&Physics2DServer::area_get_shape_transform); + ClassDB::bind_method(D_METHOD("area_get_shape_count","area"),&Physics2DServer::area_get_shape_count); + ClassDB::bind_method(D_METHOD("area_get_shape","area","shape_idx"),&Physics2DServer::area_get_shape); + ClassDB::bind_method(D_METHOD("area_get_shape_transform","area","shape_idx"),&Physics2DServer::area_get_shape_transform); - ClassDB::bind_method(_MD("area_remove_shape","area","shape_idx"),&Physics2DServer::area_remove_shape); - ClassDB::bind_method(_MD("area_clear_shapes","area"),&Physics2DServer::area_clear_shapes); + ClassDB::bind_method(D_METHOD("area_remove_shape","area","shape_idx"),&Physics2DServer::area_remove_shape); + ClassDB::bind_method(D_METHOD("area_clear_shapes","area"),&Physics2DServer::area_clear_shapes); - ClassDB::bind_method(_MD("area_set_layer_mask","area","mask"),&Physics2DServer::area_set_layer_mask); - ClassDB::bind_method(_MD("area_set_collision_mask","area","mask"),&Physics2DServer::area_set_collision_mask); + ClassDB::bind_method(D_METHOD("area_set_layer_mask","area","mask"),&Physics2DServer::area_set_layer_mask); + ClassDB::bind_method(D_METHOD("area_set_collision_mask","area","mask"),&Physics2DServer::area_set_collision_mask); - ClassDB::bind_method(_MD("area_set_param","area","param","value"),&Physics2DServer::area_set_param); - ClassDB::bind_method(_MD("area_set_transform","area","transform"),&Physics2DServer::area_set_transform); + ClassDB::bind_method(D_METHOD("area_set_param","area","param","value"),&Physics2DServer::area_set_param); + ClassDB::bind_method(D_METHOD("area_set_transform","area","transform"),&Physics2DServer::area_set_transform); - ClassDB::bind_method(_MD("area_get_param","area","param"),&Physics2DServer::area_get_param); - ClassDB::bind_method(_MD("area_get_transform","area"),&Physics2DServer::area_get_transform); + ClassDB::bind_method(D_METHOD("area_get_param","area","param"),&Physics2DServer::area_get_param); + ClassDB::bind_method(D_METHOD("area_get_transform","area"),&Physics2DServer::area_get_transform); - ClassDB::bind_method(_MD("area_attach_object_instance_ID","area","id"),&Physics2DServer::area_attach_object_instance_ID); - ClassDB::bind_method(_MD("area_get_object_instance_ID","area"),&Physics2DServer::area_get_object_instance_ID); + ClassDB::bind_method(D_METHOD("area_attach_object_instance_ID","area","id"),&Physics2DServer::area_attach_object_instance_ID); + ClassDB::bind_method(D_METHOD("area_get_object_instance_ID","area"),&Physics2DServer::area_get_object_instance_ID); - ClassDB::bind_method(_MD("area_set_monitor_callback","area","receiver","method"),&Physics2DServer::area_set_monitor_callback); + ClassDB::bind_method(D_METHOD("area_set_monitor_callback","area","receiver","method"),&Physics2DServer::area_set_monitor_callback); - ClassDB::bind_method(_MD("body_create","mode","init_sleeping"),&Physics2DServer::body_create,DEFVAL(BODY_MODE_RIGID),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("body_create","mode","init_sleeping"),&Physics2DServer::body_create,DEFVAL(BODY_MODE_RIGID),DEFVAL(false)); - ClassDB::bind_method(_MD("body_set_space","body","space"),&Physics2DServer::body_set_space); - ClassDB::bind_method(_MD("body_get_space","body"),&Physics2DServer::body_get_space); + ClassDB::bind_method(D_METHOD("body_set_space","body","space"),&Physics2DServer::body_set_space); + ClassDB::bind_method(D_METHOD("body_get_space","body"),&Physics2DServer::body_get_space); - ClassDB::bind_method(_MD("body_set_mode","body","mode"),&Physics2DServer::body_set_mode); - ClassDB::bind_method(_MD("body_get_mode","body"),&Physics2DServer::body_get_mode); + ClassDB::bind_method(D_METHOD("body_set_mode","body","mode"),&Physics2DServer::body_set_mode); + ClassDB::bind_method(D_METHOD("body_get_mode","body"),&Physics2DServer::body_get_mode); - ClassDB::bind_method(_MD("body_add_shape","body","shape","transform"),&Physics2DServer::body_add_shape,DEFVAL(Transform2D())); - ClassDB::bind_method(_MD("body_set_shape","body","shape_idx","shape"),&Physics2DServer::body_set_shape); - ClassDB::bind_method(_MD("body_set_shape_transform","body","shape_idx","transform"),&Physics2DServer::body_set_shape_transform); - ClassDB::bind_method(_MD("body_set_shape_metadata","body","shape_idx","metadata"),&Physics2DServer::body_set_shape_metadata); + ClassDB::bind_method(D_METHOD("body_add_shape","body","shape","transform"),&Physics2DServer::body_add_shape,DEFVAL(Transform2D())); + ClassDB::bind_method(D_METHOD("body_set_shape","body","shape_idx","shape"),&Physics2DServer::body_set_shape); + ClassDB::bind_method(D_METHOD("body_set_shape_transform","body","shape_idx","transform"),&Physics2DServer::body_set_shape_transform); + ClassDB::bind_method(D_METHOD("body_set_shape_metadata","body","shape_idx","metadata"),&Physics2DServer::body_set_shape_metadata); - ClassDB::bind_method(_MD("body_get_shape_count","body"),&Physics2DServer::body_get_shape_count); - ClassDB::bind_method(_MD("body_get_shape","body","shape_idx"),&Physics2DServer::body_get_shape); - ClassDB::bind_method(_MD("body_get_shape_transform","body","shape_idx"),&Physics2DServer::body_get_shape_transform); - ClassDB::bind_method(_MD("body_get_shape_metadata","body","shape_idx"),&Physics2DServer::body_get_shape_metadata); + ClassDB::bind_method(D_METHOD("body_get_shape_count","body"),&Physics2DServer::body_get_shape_count); + ClassDB::bind_method(D_METHOD("body_get_shape","body","shape_idx"),&Physics2DServer::body_get_shape); + ClassDB::bind_method(D_METHOD("body_get_shape_transform","body","shape_idx"),&Physics2DServer::body_get_shape_transform); + ClassDB::bind_method(D_METHOD("body_get_shape_metadata","body","shape_idx"),&Physics2DServer::body_get_shape_metadata); - ClassDB::bind_method(_MD("body_remove_shape","body","shape_idx"),&Physics2DServer::body_remove_shape); - ClassDB::bind_method(_MD("body_clear_shapes","body"),&Physics2DServer::body_clear_shapes); + ClassDB::bind_method(D_METHOD("body_remove_shape","body","shape_idx"),&Physics2DServer::body_remove_shape); + ClassDB::bind_method(D_METHOD("body_clear_shapes","body"),&Physics2DServer::body_clear_shapes); - ClassDB::bind_method(_MD("body_set_shape_as_trigger","body","shape_idx","enable"),&Physics2DServer::body_set_shape_as_trigger); - ClassDB::bind_method(_MD("body_is_shape_set_as_trigger","body","shape_idx"),&Physics2DServer::body_is_shape_set_as_trigger); + ClassDB::bind_method(D_METHOD("body_set_shape_as_trigger","body","shape_idx","enable"),&Physics2DServer::body_set_shape_as_trigger); + ClassDB::bind_method(D_METHOD("body_is_shape_set_as_trigger","body","shape_idx"),&Physics2DServer::body_is_shape_set_as_trigger); - ClassDB::bind_method(_MD("body_attach_object_instance_ID","body","id"),&Physics2DServer::body_attach_object_instance_ID); - ClassDB::bind_method(_MD("body_get_object_instance_ID","body"),&Physics2DServer::body_get_object_instance_ID); + ClassDB::bind_method(D_METHOD("body_attach_object_instance_ID","body","id"),&Physics2DServer::body_attach_object_instance_ID); + ClassDB::bind_method(D_METHOD("body_get_object_instance_ID","body"),&Physics2DServer::body_get_object_instance_ID); - ClassDB::bind_method(_MD("body_set_continuous_collision_detection_mode","body","mode"),&Physics2DServer::body_set_continuous_collision_detection_mode); - ClassDB::bind_method(_MD("body_get_continuous_collision_detection_mode","body"),&Physics2DServer::body_get_continuous_collision_detection_mode); + ClassDB::bind_method(D_METHOD("body_set_continuous_collision_detection_mode","body","mode"),&Physics2DServer::body_set_continuous_collision_detection_mode); + ClassDB::bind_method(D_METHOD("body_get_continuous_collision_detection_mode","body"),&Physics2DServer::body_get_continuous_collision_detection_mode); - ClassDB::bind_method(_MD("body_set_layer_mask","body","mask"),&Physics2DServer::body_set_layer_mask); - ClassDB::bind_method(_MD("body_get_layer_mask","body"),&Physics2DServer::body_get_layer_mask); + ClassDB::bind_method(D_METHOD("body_set_layer_mask","body","mask"),&Physics2DServer::body_set_layer_mask); + ClassDB::bind_method(D_METHOD("body_get_layer_mask","body"),&Physics2DServer::body_get_layer_mask); - ClassDB::bind_method(_MD("body_set_collision_mask","body","mask"),&Physics2DServer::body_set_collision_mask); - ClassDB::bind_method(_MD("body_get_collision_mask","body"),&Physics2DServer::body_get_collision_mask); + ClassDB::bind_method(D_METHOD("body_set_collision_mask","body","mask"),&Physics2DServer::body_set_collision_mask); + ClassDB::bind_method(D_METHOD("body_get_collision_mask","body"),&Physics2DServer::body_get_collision_mask); - ClassDB::bind_method(_MD("body_set_param","body","param","value"),&Physics2DServer::body_set_param); - ClassDB::bind_method(_MD("body_get_param","body","param"),&Physics2DServer::body_get_param); + ClassDB::bind_method(D_METHOD("body_set_param","body","param","value"),&Physics2DServer::body_set_param); + ClassDB::bind_method(D_METHOD("body_get_param","body","param"),&Physics2DServer::body_get_param); - ClassDB::bind_method(_MD("body_set_state","body","state","value"),&Physics2DServer::body_set_state); - ClassDB::bind_method(_MD("body_get_state","body","state"),&Physics2DServer::body_get_state); + ClassDB::bind_method(D_METHOD("body_set_state","body","state","value"),&Physics2DServer::body_set_state); + ClassDB::bind_method(D_METHOD("body_get_state","body","state"),&Physics2DServer::body_get_state); - ClassDB::bind_method(_MD("body_apply_impulse","body","pos","impulse"),&Physics2DServer::body_apply_impulse); - ClassDB::bind_method(_MD("body_add_force","body","offset","force"),&Physics2DServer::body_add_force); - ClassDB::bind_method(_MD("body_set_axis_velocity","body","axis_velocity"),&Physics2DServer::body_set_axis_velocity); + ClassDB::bind_method(D_METHOD("body_apply_impulse","body","pos","impulse"),&Physics2DServer::body_apply_impulse); + ClassDB::bind_method(D_METHOD("body_add_force","body","offset","force"),&Physics2DServer::body_add_force); + ClassDB::bind_method(D_METHOD("body_set_axis_velocity","body","axis_velocity"),&Physics2DServer::body_set_axis_velocity); - ClassDB::bind_method(_MD("body_add_collision_exception","body","excepted_body"),&Physics2DServer::body_add_collision_exception); - ClassDB::bind_method(_MD("body_remove_collision_exception","body","excepted_body"),&Physics2DServer::body_remove_collision_exception); + ClassDB::bind_method(D_METHOD("body_add_collision_exception","body","excepted_body"),&Physics2DServer::body_add_collision_exception); + ClassDB::bind_method(D_METHOD("body_remove_collision_exception","body","excepted_body"),&Physics2DServer::body_remove_collision_exception); //virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions)=0; - ClassDB::bind_method(_MD("body_set_max_contacts_reported","body","amount"),&Physics2DServer::body_set_max_contacts_reported); - ClassDB::bind_method(_MD("body_get_max_contacts_reported","body"),&Physics2DServer::body_get_max_contacts_reported); + ClassDB::bind_method(D_METHOD("body_set_max_contacts_reported","body","amount"),&Physics2DServer::body_set_max_contacts_reported); + ClassDB::bind_method(D_METHOD("body_get_max_contacts_reported","body"),&Physics2DServer::body_get_max_contacts_reported); - ClassDB::bind_method(_MD("body_set_one_way_collision_direction","body","normal"),&Physics2DServer::body_set_one_way_collision_direction); - ClassDB::bind_method(_MD("body_get_one_way_collision_direction","body"),&Physics2DServer::body_get_one_way_collision_direction); + ClassDB::bind_method(D_METHOD("body_set_one_way_collision_direction","body","normal"),&Physics2DServer::body_set_one_way_collision_direction); + ClassDB::bind_method(D_METHOD("body_get_one_way_collision_direction","body"),&Physics2DServer::body_get_one_way_collision_direction); - ClassDB::bind_method(_MD("body_set_one_way_collision_max_depth","body","depth"),&Physics2DServer::body_set_one_way_collision_max_depth); - ClassDB::bind_method(_MD("body_get_one_way_collision_max_depth","body"),&Physics2DServer::body_get_one_way_collision_max_depth); + ClassDB::bind_method(D_METHOD("body_set_one_way_collision_max_depth","body","depth"),&Physics2DServer::body_set_one_way_collision_max_depth); + ClassDB::bind_method(D_METHOD("body_get_one_way_collision_max_depth","body"),&Physics2DServer::body_get_one_way_collision_max_depth); - ClassDB::bind_method(_MD("body_set_omit_force_integration","body","enable"),&Physics2DServer::body_set_omit_force_integration); - ClassDB::bind_method(_MD("body_is_omitting_force_integration","body"),&Physics2DServer::body_is_omitting_force_integration); + ClassDB::bind_method(D_METHOD("body_set_omit_force_integration","body","enable"),&Physics2DServer::body_set_omit_force_integration); + ClassDB::bind_method(D_METHOD("body_is_omitting_force_integration","body"),&Physics2DServer::body_is_omitting_force_integration); - ClassDB::bind_method(_MD("body_set_force_integration_callback","body","receiver","method","userdata"),&Physics2DServer::body_set_force_integration_callback,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("body_set_force_integration_callback","body","receiver","method","userdata"),&Physics2DServer::body_set_force_integration_callback,DEFVAL(Variant())); - ClassDB::bind_method(_MD("body_test_motion","body","from","motion","margin","result:Physics2DTestMotionResult"),&Physics2DServer::_body_test_motion,DEFVAL(0.08),DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("body_test_motion","body","from","motion","margin","result:Physics2DTestMotionResult"),&Physics2DServer::_body_test_motion,DEFVAL(0.08),DEFVAL(Variant())); /* JOINT API */ - ClassDB::bind_method(_MD("joint_set_param","joint","param","value"),&Physics2DServer::joint_set_param); - ClassDB::bind_method(_MD("joint_get_param","joint","param"),&Physics2DServer::joint_get_param); + ClassDB::bind_method(D_METHOD("joint_set_param","joint","param","value"),&Physics2DServer::joint_set_param); + ClassDB::bind_method(D_METHOD("joint_get_param","joint","param"),&Physics2DServer::joint_get_param); - ClassDB::bind_method(_MD("pin_joint_create","anchor","body_a","body_b"),&Physics2DServer::pin_joint_create,DEFVAL(RID())); - ClassDB::bind_method(_MD("groove_joint_create","groove1_a","groove2_a","anchor_b","body_a","body_b"),&Physics2DServer::groove_joint_create,DEFVAL(RID()),DEFVAL(RID())); - ClassDB::bind_method(_MD("damped_spring_joint_create","anchor_a","anchor_b","body_a","body_b"),&Physics2DServer::damped_spring_joint_create,DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("pin_joint_create","anchor","body_a","body_b"),&Physics2DServer::pin_joint_create,DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("groove_joint_create","groove1_a","groove2_a","anchor_b","body_a","body_b"),&Physics2DServer::groove_joint_create,DEFVAL(RID()),DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("damped_spring_joint_create","anchor_a","anchor_b","body_a","body_b"),&Physics2DServer::damped_spring_joint_create,DEFVAL(RID())); - ClassDB::bind_method(_MD("damped_string_joint_set_param","joint","param","value"),&Physics2DServer::damped_string_joint_set_param); - ClassDB::bind_method(_MD("damped_string_joint_get_param","joint","param"),&Physics2DServer::damped_string_joint_get_param); + ClassDB::bind_method(D_METHOD("damped_string_joint_set_param","joint","param","value"),&Physics2DServer::damped_string_joint_set_param); + ClassDB::bind_method(D_METHOD("damped_string_joint_get_param","joint","param"),&Physics2DServer::damped_string_joint_get_param); - ClassDB::bind_method(_MD("joint_get_type","joint"),&Physics2DServer::joint_get_type); + ClassDB::bind_method(D_METHOD("joint_get_type","joint"),&Physics2DServer::joint_get_type); - ClassDB::bind_method(_MD("free_rid","rid"),&Physics2DServer::free); + ClassDB::bind_method(D_METHOD("free_rid","rid"),&Physics2DServer::free); - ClassDB::bind_method(_MD("set_active","active"),&Physics2DServer::set_active); + ClassDB::bind_method(D_METHOD("set_active","active"),&Physics2DServer::set_active); - ClassDB::bind_method(_MD("get_process_info","process_info"),&Physics2DServer::get_process_info); + ClassDB::bind_method(D_METHOD("get_process_info","process_info"),&Physics2DServer::get_process_info); - //ClassDB::bind_method(_MD("init"),&Physics2DServer::init); - //ClassDB::bind_method(_MD("step"),&Physics2DServer::step); - //ClassDB::bind_method(_MD("sync"),&Physics2DServer::sync); - //ClassDB::bind_method(_MD("flush_queries"),&Physics2DServer::flush_queries); + //ClassDB::bind_method(D_METHOD("init"),&Physics2DServer::init); + //ClassDB::bind_method(D_METHOD("step"),&Physics2DServer::step); + //ClassDB::bind_method(D_METHOD("sync"),&Physics2DServer::sync); + //ClassDB::bind_method(D_METHOD("flush_queries"),&Physics2DServer::flush_queries); BIND_CONSTANT( SPACE_PARAM_CONTACT_RECYCLE_RADIUS ); BIND_CONSTANT( SPACE_PARAM_CONTACT_MAX_SEPARATION ); diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp index ab13e2b3a5..e76bfd113c 100644 --- a/servers/physics_server.cpp +++ b/servers/physics_server.cpp @@ -74,46 +74,46 @@ PhysicsServer * PhysicsServer::get_singleton() { void PhysicsDirectBodyState::_bind_methods() { - ClassDB::bind_method(_MD("get_total_gravity"),&PhysicsDirectBodyState::get_total_gravity); - ClassDB::bind_method(_MD("get_total_linear_damp"),&PhysicsDirectBodyState::get_total_linear_damp); - ClassDB::bind_method(_MD("get_total_angular_damp"),&PhysicsDirectBodyState::get_total_angular_damp); + ClassDB::bind_method(D_METHOD("get_total_gravity"),&PhysicsDirectBodyState::get_total_gravity); + ClassDB::bind_method(D_METHOD("get_total_linear_damp"),&PhysicsDirectBodyState::get_total_linear_damp); + ClassDB::bind_method(D_METHOD("get_total_angular_damp"),&PhysicsDirectBodyState::get_total_angular_damp); - ClassDB::bind_method(_MD("get_center_of_mass"),&PhysicsDirectBodyState::get_center_of_mass); - ClassDB::bind_method(_MD("get_principal_inetria_axes"),&PhysicsDirectBodyState::get_principal_inertia_axes); + ClassDB::bind_method(D_METHOD("get_center_of_mass"),&PhysicsDirectBodyState::get_center_of_mass); + ClassDB::bind_method(D_METHOD("get_principal_inetria_axes"),&PhysicsDirectBodyState::get_principal_inertia_axes); - ClassDB::bind_method(_MD("get_inverse_mass"),&PhysicsDirectBodyState::get_inverse_mass); - ClassDB::bind_method(_MD("get_inverse_inertia"),&PhysicsDirectBodyState::get_inverse_inertia); + ClassDB::bind_method(D_METHOD("get_inverse_mass"),&PhysicsDirectBodyState::get_inverse_mass); + ClassDB::bind_method(D_METHOD("get_inverse_inertia"),&PhysicsDirectBodyState::get_inverse_inertia); - ClassDB::bind_method(_MD("set_linear_velocity","velocity"),&PhysicsDirectBodyState::set_linear_velocity); - ClassDB::bind_method(_MD("get_linear_velocity"),&PhysicsDirectBodyState::get_linear_velocity); + ClassDB::bind_method(D_METHOD("set_linear_velocity","velocity"),&PhysicsDirectBodyState::set_linear_velocity); + ClassDB::bind_method(D_METHOD("get_linear_velocity"),&PhysicsDirectBodyState::get_linear_velocity); - ClassDB::bind_method(_MD("set_angular_velocity","velocity"),&PhysicsDirectBodyState::set_angular_velocity); - ClassDB::bind_method(_MD("get_angular_velocity"),&PhysicsDirectBodyState::get_angular_velocity); + ClassDB::bind_method(D_METHOD("set_angular_velocity","velocity"),&PhysicsDirectBodyState::set_angular_velocity); + ClassDB::bind_method(D_METHOD("get_angular_velocity"),&PhysicsDirectBodyState::get_angular_velocity); - ClassDB::bind_method(_MD("set_transform","transform"),&PhysicsDirectBodyState::set_transform); - ClassDB::bind_method(_MD("get_transform"),&PhysicsDirectBodyState::get_transform); + ClassDB::bind_method(D_METHOD("set_transform","transform"),&PhysicsDirectBodyState::set_transform); + ClassDB::bind_method(D_METHOD("get_transform"),&PhysicsDirectBodyState::get_transform); - ClassDB::bind_method(_MD("add_force","force","pos"),&PhysicsDirectBodyState::add_force); - ClassDB::bind_method(_MD("apply_impulse","pos","j"),&PhysicsDirectBodyState::apply_impulse); - ClassDB::bind_method(_MD("apply_torqe_impulse","j"),&PhysicsDirectBodyState::apply_torque_impulse); + ClassDB::bind_method(D_METHOD("add_force","force","pos"),&PhysicsDirectBodyState::add_force); + ClassDB::bind_method(D_METHOD("apply_impulse","pos","j"),&PhysicsDirectBodyState::apply_impulse); + ClassDB::bind_method(D_METHOD("apply_torqe_impulse","j"),&PhysicsDirectBodyState::apply_torque_impulse); - ClassDB::bind_method(_MD("set_sleep_state","enabled"),&PhysicsDirectBodyState::set_sleep_state); - ClassDB::bind_method(_MD("is_sleeping"),&PhysicsDirectBodyState::is_sleeping); + ClassDB::bind_method(D_METHOD("set_sleep_state","enabled"),&PhysicsDirectBodyState::set_sleep_state); + ClassDB::bind_method(D_METHOD("is_sleeping"),&PhysicsDirectBodyState::is_sleeping); - ClassDB::bind_method(_MD("get_contact_count"),&PhysicsDirectBodyState::get_contact_count); + ClassDB::bind_method(D_METHOD("get_contact_count"),&PhysicsDirectBodyState::get_contact_count); - ClassDB::bind_method(_MD("get_contact_local_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_local_pos); - ClassDB::bind_method(_MD("get_contact_local_normal","contact_idx"),&PhysicsDirectBodyState::get_contact_local_normal); - ClassDB::bind_method(_MD("get_contact_local_shape","contact_idx"),&PhysicsDirectBodyState::get_contact_local_shape); - ClassDB::bind_method(_MD("get_contact_collider","contact_idx"),&PhysicsDirectBodyState::get_contact_collider); - ClassDB::bind_method(_MD("get_contact_collider_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_pos); - ClassDB::bind_method(_MD("get_contact_collider_id","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_id); - ClassDB::bind_method(_MD("get_contact_collider_object","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_object); - ClassDB::bind_method(_MD("get_contact_collider_shape","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_shape); - ClassDB::bind_method(_MD("get_contact_collider_velocity_at_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_velocity_at_pos); - ClassDB::bind_method(_MD("get_step"),&PhysicsDirectBodyState::get_step); - ClassDB::bind_method(_MD("integrate_forces"),&PhysicsDirectBodyState::integrate_forces); - ClassDB::bind_method(_MD("get_space_state:PhysicsDirectSpaceState"),&PhysicsDirectBodyState::get_space_state); + ClassDB::bind_method(D_METHOD("get_contact_local_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_local_pos); + ClassDB::bind_method(D_METHOD("get_contact_local_normal","contact_idx"),&PhysicsDirectBodyState::get_contact_local_normal); + ClassDB::bind_method(D_METHOD("get_contact_local_shape","contact_idx"),&PhysicsDirectBodyState::get_contact_local_shape); + ClassDB::bind_method(D_METHOD("get_contact_collider","contact_idx"),&PhysicsDirectBodyState::get_contact_collider); + ClassDB::bind_method(D_METHOD("get_contact_collider_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_pos); + ClassDB::bind_method(D_METHOD("get_contact_collider_id","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_id); + ClassDB::bind_method(D_METHOD("get_contact_collider_object","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_object); + ClassDB::bind_method(D_METHOD("get_contact_collider_shape","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_shape); + ClassDB::bind_method(D_METHOD("get_contact_collider_velocity_at_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_velocity_at_pos); + ClassDB::bind_method(D_METHOD("get_step"),&PhysicsDirectBodyState::get_step); + ClassDB::bind_method(D_METHOD("integrate_forces"),&PhysicsDirectBodyState::integrate_forces); + ClassDB::bind_method(D_METHOD("get_space_state:PhysicsDirectSpaceState"),&PhysicsDirectBodyState::get_space_state); } @@ -197,24 +197,24 @@ Vector<RID> PhysicsShapeQueryParameters::get_exclude() const{ void PhysicsShapeQueryParameters::_bind_methods() { - ClassDB::bind_method(_MD("set_shape","shape:Shape"),&PhysicsShapeQueryParameters::set_shape); - ClassDB::bind_method(_MD("set_shape_rid","shape"),&PhysicsShapeQueryParameters::set_shape_rid); - ClassDB::bind_method(_MD("get_shape_rid"),&PhysicsShapeQueryParameters::get_shape_rid); + ClassDB::bind_method(D_METHOD("set_shape","shape:Shape"),&PhysicsShapeQueryParameters::set_shape); + ClassDB::bind_method(D_METHOD("set_shape_rid","shape"),&PhysicsShapeQueryParameters::set_shape_rid); + ClassDB::bind_method(D_METHOD("get_shape_rid"),&PhysicsShapeQueryParameters::get_shape_rid); - ClassDB::bind_method(_MD("set_transform","transform"),&PhysicsShapeQueryParameters::set_transform); - ClassDB::bind_method(_MD("get_transform"),&PhysicsShapeQueryParameters::get_transform); + ClassDB::bind_method(D_METHOD("set_transform","transform"),&PhysicsShapeQueryParameters::set_transform); + ClassDB::bind_method(D_METHOD("get_transform"),&PhysicsShapeQueryParameters::get_transform); - ClassDB::bind_method(_MD("set_margin","margin"),&PhysicsShapeQueryParameters::set_margin); - ClassDB::bind_method(_MD("get_margin"),&PhysicsShapeQueryParameters::get_margin); + ClassDB::bind_method(D_METHOD("set_margin","margin"),&PhysicsShapeQueryParameters::set_margin); + ClassDB::bind_method(D_METHOD("get_margin"),&PhysicsShapeQueryParameters::get_margin); - ClassDB::bind_method(_MD("set_layer_mask","layer_mask"),&PhysicsShapeQueryParameters::set_layer_mask); - ClassDB::bind_method(_MD("get_layer_mask"),&PhysicsShapeQueryParameters::get_layer_mask); + ClassDB::bind_method(D_METHOD("set_layer_mask","layer_mask"),&PhysicsShapeQueryParameters::set_layer_mask); + ClassDB::bind_method(D_METHOD("get_layer_mask"),&PhysicsShapeQueryParameters::get_layer_mask); - ClassDB::bind_method(_MD("set_object_type_mask","object_type_mask"),&PhysicsShapeQueryParameters::set_object_type_mask); - ClassDB::bind_method(_MD("get_object_type_mask"),&PhysicsShapeQueryParameters::get_object_type_mask); + ClassDB::bind_method(D_METHOD("set_object_type_mask","object_type_mask"),&PhysicsShapeQueryParameters::set_object_type_mask); + ClassDB::bind_method(D_METHOD("get_object_type_mask"),&PhysicsShapeQueryParameters::get_object_type_mask); - ClassDB::bind_method(_MD("set_exclude","exclude"),&PhysicsShapeQueryParameters::set_exclude); - ClassDB::bind_method(_MD("get_exclude"),&PhysicsShapeQueryParameters::get_exclude); + ClassDB::bind_method(D_METHOD("set_exclude","exclude"),&PhysicsShapeQueryParameters::set_exclude); + ClassDB::bind_method(D_METHOD("get_exclude"),&PhysicsShapeQueryParameters::get_exclude); } @@ -363,14 +363,14 @@ PhysicsDirectSpaceState::PhysicsDirectSpaceState() { void PhysicsDirectSpaceState::_bind_methods() { - //ClassDB::bind_method(_MD("intersect_ray","from","to","exclude","umask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0)); - //ClassDB::bind_method(_MD("intersect_shape:PhysicsShapeQueryResult","shape","xform","result_max","exclude","umask"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0)); + //ClassDB::bind_method(D_METHOD("intersect_ray","from","to","exclude","umask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0)); + //ClassDB::bind_method(D_METHOD("intersect_shape:PhysicsShapeQueryResult","shape","xform","result_max","exclude","umask"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0)); - ClassDB::bind_method(_MD("intersect_ray:Dictionary","from","to","exclude","layer_mask","type_mask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); - ClassDB::bind_method(_MD("intersect_shape","shape:PhysicsShapeQueryParameters","max_results"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(32)); - ClassDB::bind_method(_MD("cast_motion","shape:PhysicsShapeQueryParameters","motion"),&PhysicsDirectSpaceState::_cast_motion); - ClassDB::bind_method(_MD("collide_shape","shape:PhysicsShapeQueryParameters","max_results"),&PhysicsDirectSpaceState::_collide_shape,DEFVAL(32)); - ClassDB::bind_method(_MD("get_rest_info","shape:PhysicsShapeQueryParameters"),&PhysicsDirectSpaceState::_get_rest_info); + ClassDB::bind_method(D_METHOD("intersect_ray:Dictionary","from","to","exclude","layer_mask","type_mask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); + ClassDB::bind_method(D_METHOD("intersect_shape","shape:PhysicsShapeQueryParameters","max_results"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(32)); + ClassDB::bind_method(D_METHOD("cast_motion","shape:PhysicsShapeQueryParameters","motion"),&PhysicsDirectSpaceState::_cast_motion); + ClassDB::bind_method(D_METHOD("collide_shape","shape:PhysicsShapeQueryParameters","max_results"),&PhysicsDirectSpaceState::_collide_shape,DEFVAL(32)); + ClassDB::bind_method(D_METHOD("get_rest_info","shape:PhysicsShapeQueryParameters"),&PhysicsDirectSpaceState::_get_rest_info); BIND_CONSTANT( TYPE_MASK_STATIC_BODY ); @@ -411,11 +411,11 @@ PhysicsShapeQueryResult::PhysicsShapeQueryResult() { void PhysicsShapeQueryResult::_bind_methods() { - ClassDB::bind_method(_MD("get_result_count"),&PhysicsShapeQueryResult::get_result_count); - ClassDB::bind_method(_MD("get_result_rid","idx"),&PhysicsShapeQueryResult::get_result_rid); - ClassDB::bind_method(_MD("get_result_object_id","idx"),&PhysicsShapeQueryResult::get_result_object_id); - ClassDB::bind_method(_MD("get_result_object","idx"),&PhysicsShapeQueryResult::get_result_object); - ClassDB::bind_method(_MD("get_result_object_shape","idx"),&PhysicsShapeQueryResult::get_result_object_shape); + ClassDB::bind_method(D_METHOD("get_result_count"),&PhysicsShapeQueryResult::get_result_count); + ClassDB::bind_method(D_METHOD("get_result_rid","idx"),&PhysicsShapeQueryResult::get_result_rid); + ClassDB::bind_method(D_METHOD("get_result_object_id","idx"),&PhysicsShapeQueryResult::get_result_object_id); + ClassDB::bind_method(D_METHOD("get_result_object","idx"),&PhysicsShapeQueryResult::get_result_object); + ClassDB::bind_method(D_METHOD("get_result_object_shape","idx"),&PhysicsShapeQueryResult::get_result_object_shape); } @@ -429,118 +429,118 @@ void PhysicsShapeQueryResult::_bind_methods() { void PhysicsServer::_bind_methods() { - ClassDB::bind_method(_MD("shape_create","type"),&PhysicsServer::shape_create); - ClassDB::bind_method(_MD("shape_set_data","shape","data"),&PhysicsServer::shape_set_data); + ClassDB::bind_method(D_METHOD("shape_create","type"),&PhysicsServer::shape_create); + ClassDB::bind_method(D_METHOD("shape_set_data","shape","data"),&PhysicsServer::shape_set_data); - ClassDB::bind_method(_MD("shape_get_type","shape"),&PhysicsServer::shape_get_type); - ClassDB::bind_method(_MD("shape_get_data","shape"),&PhysicsServer::shape_get_data); + ClassDB::bind_method(D_METHOD("shape_get_type","shape"),&PhysicsServer::shape_get_type); + ClassDB::bind_method(D_METHOD("shape_get_data","shape"),&PhysicsServer::shape_get_data); - ClassDB::bind_method(_MD("space_create"),&PhysicsServer::space_create); - ClassDB::bind_method(_MD("space_set_active","space","active"),&PhysicsServer::space_set_active); - ClassDB::bind_method(_MD("space_is_active","space"),&PhysicsServer::space_is_active); - ClassDB::bind_method(_MD("space_set_param","space","param","value"),&PhysicsServer::space_set_param); - ClassDB::bind_method(_MD("space_get_param","space","param"),&PhysicsServer::space_get_param); - ClassDB::bind_method(_MD("space_get_direct_state:PhysicsDirectSpaceState","space"),&PhysicsServer::space_get_direct_state); + ClassDB::bind_method(D_METHOD("space_create"),&PhysicsServer::space_create); + ClassDB::bind_method(D_METHOD("space_set_active","space","active"),&PhysicsServer::space_set_active); + ClassDB::bind_method(D_METHOD("space_is_active","space"),&PhysicsServer::space_is_active); + ClassDB::bind_method(D_METHOD("space_set_param","space","param","value"),&PhysicsServer::space_set_param); + ClassDB::bind_method(D_METHOD("space_get_param","space","param"),&PhysicsServer::space_get_param); + ClassDB::bind_method(D_METHOD("space_get_direct_state:PhysicsDirectSpaceState","space"),&PhysicsServer::space_get_direct_state); - ClassDB::bind_method(_MD("area_create"),&PhysicsServer::area_create); - ClassDB::bind_method(_MD("area_set_space","area","space"),&PhysicsServer::area_set_space); - ClassDB::bind_method(_MD("area_get_space","area"),&PhysicsServer::area_get_space); + ClassDB::bind_method(D_METHOD("area_create"),&PhysicsServer::area_create); + ClassDB::bind_method(D_METHOD("area_set_space","area","space"),&PhysicsServer::area_set_space); + ClassDB::bind_method(D_METHOD("area_get_space","area"),&PhysicsServer::area_get_space); - ClassDB::bind_method(_MD("area_set_space_override_mode","area","mode"),&PhysicsServer::area_set_space_override_mode); - ClassDB::bind_method(_MD("area_get_space_override_mode","area"),&PhysicsServer::area_get_space_override_mode); + ClassDB::bind_method(D_METHOD("area_set_space_override_mode","area","mode"),&PhysicsServer::area_set_space_override_mode); + ClassDB::bind_method(D_METHOD("area_get_space_override_mode","area"),&PhysicsServer::area_get_space_override_mode); - ClassDB::bind_method(_MD("area_add_shape","area","shape","transform"),&PhysicsServer::area_add_shape,DEFVAL(Transform())); - ClassDB::bind_method(_MD("area_set_shape","area","shape_idx","shape"),&PhysicsServer::area_set_shape); - ClassDB::bind_method(_MD("area_set_shape_transform","area","shape_idx","transform"),&PhysicsServer::area_set_shape_transform); + ClassDB::bind_method(D_METHOD("area_add_shape","area","shape","transform"),&PhysicsServer::area_add_shape,DEFVAL(Transform())); + ClassDB::bind_method(D_METHOD("area_set_shape","area","shape_idx","shape"),&PhysicsServer::area_set_shape); + ClassDB::bind_method(D_METHOD("area_set_shape_transform","area","shape_idx","transform"),&PhysicsServer::area_set_shape_transform); - ClassDB::bind_method(_MD("area_get_shape_count","area"),&PhysicsServer::area_get_shape_count); - ClassDB::bind_method(_MD("area_get_shape","area","shape_idx"),&PhysicsServer::area_get_shape); - ClassDB::bind_method(_MD("area_get_shape_transform","area","shape_idx"),&PhysicsServer::area_get_shape_transform); + ClassDB::bind_method(D_METHOD("area_get_shape_count","area"),&PhysicsServer::area_get_shape_count); + ClassDB::bind_method(D_METHOD("area_get_shape","area","shape_idx"),&PhysicsServer::area_get_shape); + ClassDB::bind_method(D_METHOD("area_get_shape_transform","area","shape_idx"),&PhysicsServer::area_get_shape_transform); - ClassDB::bind_method(_MD("area_remove_shape","area","shape_idx"),&PhysicsServer::area_remove_shape); - ClassDB::bind_method(_MD("area_clear_shapes","area"),&PhysicsServer::area_clear_shapes); + ClassDB::bind_method(D_METHOD("area_remove_shape","area","shape_idx"),&PhysicsServer::area_remove_shape); + ClassDB::bind_method(D_METHOD("area_clear_shapes","area"),&PhysicsServer::area_clear_shapes); - ClassDB::bind_method(_MD("area_set_layer_mask","area","mask"),&PhysicsServer::area_set_layer_mask); - ClassDB::bind_method(_MD("area_set_collision_mask","area","mask"),&PhysicsServer::area_set_collision_mask); + ClassDB::bind_method(D_METHOD("area_set_layer_mask","area","mask"),&PhysicsServer::area_set_layer_mask); + ClassDB::bind_method(D_METHOD("area_set_collision_mask","area","mask"),&PhysicsServer::area_set_collision_mask); - ClassDB::bind_method(_MD("area_set_param","area","param","value"),&PhysicsServer::area_set_param); - ClassDB::bind_method(_MD("area_set_transform","area","transform"),&PhysicsServer::area_set_transform); + ClassDB::bind_method(D_METHOD("area_set_param","area","param","value"),&PhysicsServer::area_set_param); + ClassDB::bind_method(D_METHOD("area_set_transform","area","transform"),&PhysicsServer::area_set_transform); - ClassDB::bind_method(_MD("area_get_param","area","param"),&PhysicsServer::area_get_param); - ClassDB::bind_method(_MD("area_get_transform","area"),&PhysicsServer::area_get_transform); + ClassDB::bind_method(D_METHOD("area_get_param","area","param"),&PhysicsServer::area_get_param); + ClassDB::bind_method(D_METHOD("area_get_transform","area"),&PhysicsServer::area_get_transform); - ClassDB::bind_method(_MD("area_attach_object_instance_ID","area","id"),&PhysicsServer::area_attach_object_instance_ID); - ClassDB::bind_method(_MD("area_get_object_instance_ID","area"),&PhysicsServer::area_get_object_instance_ID); + ClassDB::bind_method(D_METHOD("area_attach_object_instance_ID","area","id"),&PhysicsServer::area_attach_object_instance_ID); + ClassDB::bind_method(D_METHOD("area_get_object_instance_ID","area"),&PhysicsServer::area_get_object_instance_ID); - ClassDB::bind_method(_MD("area_set_monitor_callback","area","receiver","method"),&PhysicsServer::area_set_monitor_callback); + ClassDB::bind_method(D_METHOD("area_set_monitor_callback","area","receiver","method"),&PhysicsServer::area_set_monitor_callback); - ClassDB::bind_method(_MD("area_set_ray_pickable","area","enable"),&PhysicsServer::area_set_ray_pickable); - ClassDB::bind_method(_MD("area_is_ray_pickable","area"),&PhysicsServer::area_is_ray_pickable); + ClassDB::bind_method(D_METHOD("area_set_ray_pickable","area","enable"),&PhysicsServer::area_set_ray_pickable); + ClassDB::bind_method(D_METHOD("area_is_ray_pickable","area"),&PhysicsServer::area_is_ray_pickable); - ClassDB::bind_method(_MD("body_create","mode","init_sleeping"),&PhysicsServer::body_create,DEFVAL(BODY_MODE_RIGID),DEFVAL(false)); + ClassDB::bind_method(D_METHOD("body_create","mode","init_sleeping"),&PhysicsServer::body_create,DEFVAL(BODY_MODE_RIGID),DEFVAL(false)); - ClassDB::bind_method(_MD("body_set_space","body","space"),&PhysicsServer::body_set_space); - ClassDB::bind_method(_MD("body_get_space","body"),&PhysicsServer::body_get_space); + ClassDB::bind_method(D_METHOD("body_set_space","body","space"),&PhysicsServer::body_set_space); + ClassDB::bind_method(D_METHOD("body_get_space","body"),&PhysicsServer::body_get_space); - ClassDB::bind_method(_MD("body_set_mode","body","mode"),&PhysicsServer::body_set_mode); - ClassDB::bind_method(_MD("body_get_mode","body"),&PhysicsServer::body_get_mode); + ClassDB::bind_method(D_METHOD("body_set_mode","body","mode"),&PhysicsServer::body_set_mode); + ClassDB::bind_method(D_METHOD("body_get_mode","body"),&PhysicsServer::body_get_mode); - ClassDB::bind_method(_MD("body_set_layer_mask","body","mask"),&PhysicsServer::body_set_layer_mask); - ClassDB::bind_method(_MD("body_get_layer_mask","body"),&PhysicsServer::body_get_layer_mask); + ClassDB::bind_method(D_METHOD("body_set_layer_mask","body","mask"),&PhysicsServer::body_set_layer_mask); + ClassDB::bind_method(D_METHOD("body_get_layer_mask","body"),&PhysicsServer::body_get_layer_mask); - ClassDB::bind_method(_MD("body_set_collision_mask","body","mask"),&PhysicsServer::body_set_collision_mask); - ClassDB::bind_method(_MD("body_get_collision_mask","body"),&PhysicsServer::body_get_collision_mask); + ClassDB::bind_method(D_METHOD("body_set_collision_mask","body","mask"),&PhysicsServer::body_set_collision_mask); + ClassDB::bind_method(D_METHOD("body_get_collision_mask","body"),&PhysicsServer::body_get_collision_mask); - ClassDB::bind_method(_MD("body_add_shape","body","shape","transform"),&PhysicsServer::body_add_shape,DEFVAL(Transform())); - ClassDB::bind_method(_MD("body_set_shape","body","shape_idx","shape"),&PhysicsServer::body_set_shape); - ClassDB::bind_method(_MD("body_set_shape_transform","body","shape_idx","transform"),&PhysicsServer::body_set_shape_transform); + ClassDB::bind_method(D_METHOD("body_add_shape","body","shape","transform"),&PhysicsServer::body_add_shape,DEFVAL(Transform())); + ClassDB::bind_method(D_METHOD("body_set_shape","body","shape_idx","shape"),&PhysicsServer::body_set_shape); + ClassDB::bind_method(D_METHOD("body_set_shape_transform","body","shape_idx","transform"),&PhysicsServer::body_set_shape_transform); - ClassDB::bind_method(_MD("body_get_shape_count","body"),&PhysicsServer::body_get_shape_count); - ClassDB::bind_method(_MD("body_get_shape","body","shape_idx"),&PhysicsServer::body_get_shape); - ClassDB::bind_method(_MD("body_get_shape_transform","body","shape_idx"),&PhysicsServer::body_get_shape_transform); + ClassDB::bind_method(D_METHOD("body_get_shape_count","body"),&PhysicsServer::body_get_shape_count); + ClassDB::bind_method(D_METHOD("body_get_shape","body","shape_idx"),&PhysicsServer::body_get_shape); + ClassDB::bind_method(D_METHOD("body_get_shape_transform","body","shape_idx"),&PhysicsServer::body_get_shape_transform); - ClassDB::bind_method(_MD("body_remove_shape","body","shape_idx"),&PhysicsServer::body_remove_shape); - ClassDB::bind_method(_MD("body_clear_shapes","body"),&PhysicsServer::body_clear_shapes); + ClassDB::bind_method(D_METHOD("body_remove_shape","body","shape_idx"),&PhysicsServer::body_remove_shape); + ClassDB::bind_method(D_METHOD("body_clear_shapes","body"),&PhysicsServer::body_clear_shapes); - ClassDB::bind_method(_MD("body_attach_object_instance_ID","body","id"),&PhysicsServer::body_attach_object_instance_ID); - ClassDB::bind_method(_MD("body_get_object_instance_ID","body"),&PhysicsServer::body_get_object_instance_ID); + ClassDB::bind_method(D_METHOD("body_attach_object_instance_ID","body","id"),&PhysicsServer::body_attach_object_instance_ID); + ClassDB::bind_method(D_METHOD("body_get_object_instance_ID","body"),&PhysicsServer::body_get_object_instance_ID); - ClassDB::bind_method(_MD("body_set_enable_continuous_collision_detection","body","enable"),&PhysicsServer::body_set_enable_continuous_collision_detection); - ClassDB::bind_method(_MD("body_is_continuous_collision_detection_enabled","body"),&PhysicsServer::body_is_continuous_collision_detection_enabled); + ClassDB::bind_method(D_METHOD("body_set_enable_continuous_collision_detection","body","enable"),&PhysicsServer::body_set_enable_continuous_collision_detection); + ClassDB::bind_method(D_METHOD("body_is_continuous_collision_detection_enabled","body"),&PhysicsServer::body_is_continuous_collision_detection_enabled); - //ClassDB::bind_method(_MD("body_set_user_flags","flags""),&PhysicsServer::body_set_shape,DEFVAL(Transform)); - //ClassDB::bind_method(_MD("body_get_user_flags","body","shape_idx","shape"),&PhysicsServer::body_get_shape); + //ClassDB::bind_method(D_METHOD("body_set_user_flags","flags""),&PhysicsServer::body_set_shape,DEFVAL(Transform)); + //ClassDB::bind_method(D_METHOD("body_get_user_flags","body","shape_idx","shape"),&PhysicsServer::body_get_shape); - ClassDB::bind_method(_MD("body_set_param","body","param","value"),&PhysicsServer::body_set_param); - ClassDB::bind_method(_MD("body_get_param","body","param"),&PhysicsServer::body_get_param); + ClassDB::bind_method(D_METHOD("body_set_param","body","param","value"),&PhysicsServer::body_set_param); + ClassDB::bind_method(D_METHOD("body_get_param","body","param"),&PhysicsServer::body_get_param); - ClassDB::bind_method(_MD("body_set_state","body","state","value"),&PhysicsServer::body_set_state); - ClassDB::bind_method(_MD("body_get_state","body","state"),&PhysicsServer::body_get_state); + ClassDB::bind_method(D_METHOD("body_set_state","body","state","value"),&PhysicsServer::body_set_state); + ClassDB::bind_method(D_METHOD("body_get_state","body","state"),&PhysicsServer::body_get_state); - ClassDB::bind_method(_MD("body_apply_impulse","body","pos","impulse"),&PhysicsServer::body_apply_impulse); - ClassDB::bind_method(_MD("body_apply_torque_impulse","body","impulse"),&PhysicsServer::body_apply_torque_impulse); - ClassDB::bind_method(_MD("body_set_axis_velocity","body","axis_velocity"),&PhysicsServer::body_set_axis_velocity); + ClassDB::bind_method(D_METHOD("body_apply_impulse","body","pos","impulse"),&PhysicsServer::body_apply_impulse); + ClassDB::bind_method(D_METHOD("body_apply_torque_impulse","body","impulse"),&PhysicsServer::body_apply_torque_impulse); + ClassDB::bind_method(D_METHOD("body_set_axis_velocity","body","axis_velocity"),&PhysicsServer::body_set_axis_velocity); - ClassDB::bind_method(_MD("body_set_axis_lock","body","axis"),&PhysicsServer::body_set_axis_lock); - ClassDB::bind_method(_MD("body_get_axis_lock","body"),&PhysicsServer::body_get_axis_lock); + ClassDB::bind_method(D_METHOD("body_set_axis_lock","body","axis"),&PhysicsServer::body_set_axis_lock); + ClassDB::bind_method(D_METHOD("body_get_axis_lock","body"),&PhysicsServer::body_get_axis_lock); - ClassDB::bind_method(_MD("body_add_collision_exception","body","excepted_body"),&PhysicsServer::body_add_collision_exception); - ClassDB::bind_method(_MD("body_remove_collision_exception","body","excepted_body"),&PhysicsServer::body_remove_collision_exception); + ClassDB::bind_method(D_METHOD("body_add_collision_exception","body","excepted_body"),&PhysicsServer::body_add_collision_exception); + ClassDB::bind_method(D_METHOD("body_remove_collision_exception","body","excepted_body"),&PhysicsServer::body_remove_collision_exception); //virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions)=0; - ClassDB::bind_method(_MD("body_set_max_contacts_reported","body","amount"),&PhysicsServer::body_set_max_contacts_reported); - ClassDB::bind_method(_MD("body_get_max_contacts_reported","body"),&PhysicsServer::body_get_max_contacts_reported); + ClassDB::bind_method(D_METHOD("body_set_max_contacts_reported","body","amount"),&PhysicsServer::body_set_max_contacts_reported); + ClassDB::bind_method(D_METHOD("body_get_max_contacts_reported","body"),&PhysicsServer::body_get_max_contacts_reported); - ClassDB::bind_method(_MD("body_set_omit_force_integration","body","enable"),&PhysicsServer::body_set_omit_force_integration); - ClassDB::bind_method(_MD("body_is_omitting_force_integration","body"),&PhysicsServer::body_is_omitting_force_integration); + ClassDB::bind_method(D_METHOD("body_set_omit_force_integration","body","enable"),&PhysicsServer::body_set_omit_force_integration); + ClassDB::bind_method(D_METHOD("body_is_omitting_force_integration","body"),&PhysicsServer::body_is_omitting_force_integration); - ClassDB::bind_method(_MD("body_set_force_integration_callback","body","receiver","method","userdata"),&PhysicsServer::body_set_force_integration_callback,DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("body_set_force_integration_callback","body","receiver","method","userdata"),&PhysicsServer::body_set_force_integration_callback,DEFVAL(Variant())); - ClassDB::bind_method(_MD("body_set_ray_pickable","body","enable"),&PhysicsServer::body_set_ray_pickable); - ClassDB::bind_method(_MD("body_is_ray_pickable","body"),&PhysicsServer::body_is_ray_pickable); + ClassDB::bind_method(D_METHOD("body_set_ray_pickable","body","enable"),&PhysicsServer::body_set_ray_pickable); + ClassDB::bind_method(D_METHOD("body_is_ray_pickable","body"),&PhysicsServer::body_is_ray_pickable); /* JOINT API */ @@ -550,15 +550,15 @@ void PhysicsServer::_bind_methods() { BIND_CONSTANT( JOINT_CONE_TWIST ); BIND_CONSTANT( JOINT_6DOF ); - ClassDB::bind_method(_MD("joint_create_pin","body_A","local_A","body_B","local_B"),&PhysicsServer::joint_create_pin); - ClassDB::bind_method(_MD("pin_joint_set_param","joint","param","value"),&PhysicsServer::pin_joint_set_param); - ClassDB::bind_method(_MD("pin_joint_get_param","joint","param"),&PhysicsServer::pin_joint_get_param); + ClassDB::bind_method(D_METHOD("joint_create_pin","body_A","local_A","body_B","local_B"),&PhysicsServer::joint_create_pin); + ClassDB::bind_method(D_METHOD("pin_joint_set_param","joint","param","value"),&PhysicsServer::pin_joint_set_param); + ClassDB::bind_method(D_METHOD("pin_joint_get_param","joint","param"),&PhysicsServer::pin_joint_get_param); - ClassDB::bind_method(_MD("pin_joint_set_local_A","joint","local_A"),&PhysicsServer::pin_joint_set_local_A); - ClassDB::bind_method(_MD("pin_joint_get_local_A","joint"),&PhysicsServer::pin_joint_get_local_A); + ClassDB::bind_method(D_METHOD("pin_joint_set_local_A","joint","local_A"),&PhysicsServer::pin_joint_set_local_A); + ClassDB::bind_method(D_METHOD("pin_joint_get_local_A","joint"),&PhysicsServer::pin_joint_get_local_A); - ClassDB::bind_method(_MD("pin_joint_set_local_B","joint","local_B"),&PhysicsServer::pin_joint_set_local_B); - ClassDB::bind_method(_MD("pin_joint_get_local_B","joint"),&PhysicsServer::pin_joint_get_local_B); + ClassDB::bind_method(D_METHOD("pin_joint_set_local_B","joint","local_B"),&PhysicsServer::pin_joint_set_local_B); + ClassDB::bind_method(D_METHOD("pin_joint_get_local_B","joint"),&PhysicsServer::pin_joint_get_local_B); BIND_CONSTANT(PIN_JOINT_BIAS ); BIND_CONSTANT(PIN_JOINT_DAMPING ); @@ -576,18 +576,18 @@ void PhysicsServer::_bind_methods() { BIND_CONSTANT(HINGE_JOINT_FLAG_USE_LIMIT); BIND_CONSTANT(HINGE_JOINT_FLAG_ENABLE_MOTOR); - ClassDB::bind_method(_MD("joint_create_hinge","body_A","hinge_A","body_B","hinge_B"),&PhysicsServer::joint_create_hinge); + ClassDB::bind_method(D_METHOD("joint_create_hinge","body_A","hinge_A","body_B","hinge_B"),&PhysicsServer::joint_create_hinge); - ClassDB::bind_method(_MD("hinge_joint_set_param","joint","param","value"),&PhysicsServer::hinge_joint_set_param); - ClassDB::bind_method(_MD("hinge_joint_get_param","joint","param"),&PhysicsServer::hinge_joint_get_param); + ClassDB::bind_method(D_METHOD("hinge_joint_set_param","joint","param","value"),&PhysicsServer::hinge_joint_set_param); + ClassDB::bind_method(D_METHOD("hinge_joint_get_param","joint","param"),&PhysicsServer::hinge_joint_get_param); - ClassDB::bind_method(_MD("hinge_joint_set_flag","joint","flag","enabled"),&PhysicsServer::hinge_joint_set_flag); - ClassDB::bind_method(_MD("hinge_joint_get_flag","joint","flag"),&PhysicsServer::hinge_joint_get_flag); + ClassDB::bind_method(D_METHOD("hinge_joint_set_flag","joint","flag","enabled"),&PhysicsServer::hinge_joint_set_flag); + ClassDB::bind_method(D_METHOD("hinge_joint_get_flag","joint","flag"),&PhysicsServer::hinge_joint_get_flag); - ClassDB::bind_method(_MD("joint_create_slider","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_slider); + ClassDB::bind_method(D_METHOD("joint_create_slider","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_slider); - ClassDB::bind_method(_MD("slider_joint_set_param","joint","param","value"),&PhysicsServer::slider_joint_set_param); - ClassDB::bind_method(_MD("slider_joint_get_param","joint","param"),&PhysicsServer::slider_joint_get_param); + ClassDB::bind_method(D_METHOD("slider_joint_set_param","joint","param","value"),&PhysicsServer::slider_joint_set_param); + ClassDB::bind_method(D_METHOD("slider_joint_get_param","joint","param"),&PhysicsServer::slider_joint_get_param); BIND_CONSTANT( SLIDER_JOINT_LINEAR_LIMIT_UPPER ); BIND_CONSTANT( SLIDER_JOINT_LINEAR_LIMIT_LOWER ); @@ -615,10 +615,10 @@ void PhysicsServer::_bind_methods() { BIND_CONSTANT( SLIDER_JOINT_MAX ); - ClassDB::bind_method(_MD("joint_create_cone_twist","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_cone_twist); + ClassDB::bind_method(D_METHOD("joint_create_cone_twist","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_cone_twist); - ClassDB::bind_method(_MD("cone_twist_joint_set_param","joint","param","value"),&PhysicsServer::cone_twist_joint_set_param); - ClassDB::bind_method(_MD("cone_twist_joint_get_param","joint","param"),&PhysicsServer::cone_twist_joint_get_param); + ClassDB::bind_method(D_METHOD("cone_twist_joint_set_param","joint","param","value"),&PhysicsServer::cone_twist_joint_set_param); + ClassDB::bind_method(D_METHOD("cone_twist_joint_get_param","joint","param"),&PhysicsServer::cone_twist_joint_get_param); BIND_CONSTANT( CONE_TWIST_JOINT_SWING_SPAN ); BIND_CONSTANT( CONE_TWIST_JOINT_TWIST_SPAN ); @@ -647,44 +647,44 @@ void PhysicsServer::_bind_methods() { BIND_CONSTANT( G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT ); BIND_CONSTANT( G6DOF_JOINT_FLAG_ENABLE_MOTOR ); - ClassDB::bind_method(_MD("joint_get_type","joint"),&PhysicsServer::joint_get_type); + ClassDB::bind_method(D_METHOD("joint_get_type","joint"),&PhysicsServer::joint_get_type); - ClassDB::bind_method(_MD("joint_set_solver_priority","joint","priority"),&PhysicsServer::joint_set_solver_priority); - ClassDB::bind_method(_MD("joint_get_solver_priority","joint"),&PhysicsServer::joint_get_solver_priority); + ClassDB::bind_method(D_METHOD("joint_set_solver_priority","joint","priority"),&PhysicsServer::joint_set_solver_priority); + ClassDB::bind_method(D_METHOD("joint_get_solver_priority","joint"),&PhysicsServer::joint_get_solver_priority); - ClassDB::bind_method(_MD("joint_create_generic_6dof","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_generic_6dof); + ClassDB::bind_method(D_METHOD("joint_create_generic_6dof","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_generic_6dof); - ClassDB::bind_method(_MD("generic_6dof_joint_set_param","joint","axis","param","value"),&PhysicsServer::generic_6dof_joint_set_param); - ClassDB::bind_method(_MD("generic_6dof_joint_get_param","joint","axis","param"),&PhysicsServer::generic_6dof_joint_get_param); + ClassDB::bind_method(D_METHOD("generic_6dof_joint_set_param","joint","axis","param","value"),&PhysicsServer::generic_6dof_joint_set_param); + ClassDB::bind_method(D_METHOD("generic_6dof_joint_get_param","joint","axis","param"),&PhysicsServer::generic_6dof_joint_get_param); - ClassDB::bind_method(_MD("generic_6dof_joint_set_flag","joint","axis","flag","enable"),&PhysicsServer::generic_6dof_joint_set_flag); - ClassDB::bind_method(_MD("generic_6dof_joint_get_flag","joint","axis","flag"),&PhysicsServer::generic_6dof_joint_get_flag); + ClassDB::bind_method(D_METHOD("generic_6dof_joint_set_flag","joint","axis","flag","enable"),&PhysicsServer::generic_6dof_joint_set_flag); + ClassDB::bind_method(D_METHOD("generic_6dof_joint_get_flag","joint","axis","flag"),&PhysicsServer::generic_6dof_joint_get_flag); /* - ClassDB::bind_method(_MD("joint_set_param","joint","param","value"),&PhysicsServer::joint_set_param); - ClassDB::bind_method(_MD("joint_get_param","joint","param"),&PhysicsServer::joint_get_param); + ClassDB::bind_method(D_METHOD("joint_set_param","joint","param","value"),&PhysicsServer::joint_set_param); + ClassDB::bind_method(D_METHOD("joint_get_param","joint","param"),&PhysicsServer::joint_get_param); - ClassDB::bind_method(_MD("pin_joint_create","anchor","body_a","body_b"),&PhysicsServer::pin_joint_create,DEFVAL(RID())); - ClassDB::bind_method(_MD("groove_joint_create","groove1_a","groove2_a","anchor_b","body_a","body_b"),&PhysicsServer::groove_joint_create,DEFVAL(RID()),DEFVAL(RID())); - ClassDB::bind_method(_MD("damped_spring_joint_create","anchor_a","anchor_b","body_a","body_b"),&PhysicsServer::damped_spring_joint_create,DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("pin_joint_create","anchor","body_a","body_b"),&PhysicsServer::pin_joint_create,DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("groove_joint_create","groove1_a","groove2_a","anchor_b","body_a","body_b"),&PhysicsServer::groove_joint_create,DEFVAL(RID()),DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("damped_spring_joint_create","anchor_a","anchor_b","body_a","body_b"),&PhysicsServer::damped_spring_joint_create,DEFVAL(RID())); - ClassDB::bind_method(_MD("damped_string_joint_set_param","joint","param","value"),&PhysicsServer::damped_string_joint_set_param,DEFVAL(RID())); - ClassDB::bind_method(_MD("damped_string_joint_get_param","joint","param"),&PhysicsServer::damped_string_joint_get_param); + ClassDB::bind_method(D_METHOD("damped_string_joint_set_param","joint","param","value"),&PhysicsServer::damped_string_joint_set_param,DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("damped_string_joint_get_param","joint","param"),&PhysicsServer::damped_string_joint_get_param); - ClassDB::bind_method(_MD("joint_get_type","joint"),&PhysicsServer::joint_get_type); + ClassDB::bind_method(D_METHOD("joint_get_type","joint"),&PhysicsServer::joint_get_type); */ - ClassDB::bind_method(_MD("free_rid","rid"),&PhysicsServer::free); + ClassDB::bind_method(D_METHOD("free_rid","rid"),&PhysicsServer::free); - ClassDB::bind_method(_MD("set_active","active"),&PhysicsServer::set_active); + ClassDB::bind_method(D_METHOD("set_active","active"),&PhysicsServer::set_active); - //ClassDB::bind_method(_MD("init"),&PhysicsServer::init); - //ClassDB::bind_method(_MD("step"),&PhysicsServer::step); - //ClassDB::bind_method(_MD("sync"),&PhysicsServer::sync); - //ClassDB::bind_method(_MD("flush_queries"),&PhysicsServer::flush_queries); + //ClassDB::bind_method(D_METHOD("init"),&PhysicsServer::init); + //ClassDB::bind_method(D_METHOD("step"),&PhysicsServer::step); + //ClassDB::bind_method(D_METHOD("sync"),&PhysicsServer::sync); + //ClassDB::bind_method(D_METHOD("flush_queries"),&PhysicsServer::flush_queries); - ClassDB::bind_method(_MD("get_process_info","process_info"),&PhysicsServer::get_process_info); + ClassDB::bind_method(D_METHOD("get_process_info","process_info"),&PhysicsServer::get_process_info); BIND_CONSTANT( SHAPE_PLANE ); BIND_CONSTANT( SHAPE_RAY ); diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 01f8ffa504..0d0619e880 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "register_server_types.h" -#include "globals.h" +#include "global_config.h" #include "visual_server.h" #include "audio_server.h" diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 21f7f0769f..dd22986865 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -432,6 +432,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range)=0; virtual float gi_probe_get_energy(RID p_probe) const=0; + virtual void gi_probe_set_bias(RID p_probe,float p_range)=0; + virtual float gi_probe_get_bias(RID p_probe) const=0; + virtual void gi_probe_set_propagation(RID p_probe,float p_range)=0; virtual float gi_probe_get_propagation(RID p_probe) const=0; @@ -519,6 +522,8 @@ public: virtual bool has_os_feature(const String& p_feature) const=0; + virtual void update_dirty_resources()=0; + static RasterizerStorage*base_signleton; RasterizerStorage(); virtual ~RasterizerStorage() {} diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 7dfd9822f7..c680013efa 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -307,7 +307,7 @@ ShaderLanguage::Token ShaderLanguage::_get_token() { } if (GETCHAR(0)=='*' && GETCHAR(1)=='/') { char_idx+=2; break; - } if (GETCHAR(0)=='\n') { + } else if (GETCHAR(0)=='\n') { tk_line++; } @@ -3241,7 +3241,7 @@ Error ShaderLanguage::_parse_shader(const Map< StringName, Map<StringName,DataTy _set_error("void datatype not allowed here"); return ERR_PARSE_ERROR; } - if (!uniform && type<TYPE_FLOAT && type>TYPE_VEC4) { + if (!uniform && type<TYPE_FLOAT && type>TYPE_VEC4) { // FIXME: always false! should it be || instead? _set_error("Invalid type for varying, only float,vec2,vec3,vec4 allowed."); return ERR_PARSE_ERROR; } diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp index 0eb3e0fc5a..d119e81a4b 100644 --- a/servers/visual/shader_types.cpp +++ b/servers/visual/shader_types.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* shader_types.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "shader_types.h" diff --git a/servers/visual/shader_types.h b/servers/visual/shader_types.h index 411d5790a9..b8a96af922 100644 --- a/servers/visual/shader_types.h +++ b/servers/visual/shader_types.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* shader_types.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 SHADERTYPES_H #define SHADERTYPES_H diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index f4031b711d..84cc1a968d 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_server_canvas.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_server_canvas.h" #include "visual_server_global.h" #include "visual_server_viewport.h" diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h index 035c48d9ef..b405bc804d 100644 --- a/servers/visual/visual_server_canvas.h +++ b/servers/visual/visual_server_canvas.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_server_canvas.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUALSERVERCANVAS_H #define VISUALSERVERCANVAS_H diff --git a/servers/visual/visual_server_global.cpp b/servers/visual/visual_server_global.cpp index 32b9710f42..3704192c7e 100644 --- a/servers/visual/visual_server_global.cpp +++ b/servers/visual/visual_server_global.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_server_global.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_server_global.h" RasterizerStorage *VisualServerGlobals::storage=NULL; diff --git a/servers/visual/visual_server_global.h b/servers/visual/visual_server_global.h index d413334ac4..f95aed3ffb 100644 --- a/servers/visual/visual_server_global.h +++ b/servers/visual/visual_server_global.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_server_global.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUALSERVERGLOBAL_H #define VISUALSERVERGLOBAL_H diff --git a/servers/visual/visual_server_light_baker.cpp b/servers/visual/visual_server_light_baker.cpp index 4956d78ab0..bdf20df618 100644 --- a/servers/visual/visual_server_light_baker.cpp +++ b/servers/visual/visual_server_light_baker.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_server_light_baker.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_server_light_baker.h" VisualServerLightBaker::VisualServerLightBaker() diff --git a/servers/visual/visual_server_light_baker.h b/servers/visual/visual_server_light_baker.h index 42f016f614..416c16ed3a 100644 --- a/servers/visual/visual_server_light_baker.h +++ b/servers/visual/visual_server_light_baker.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_server_light_baker.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUALSERVERLIGHTBAKER_H #define VISUALSERVERLIGHTBAKER_H diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 8f87425212..3a5ffda8f5 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "visual_server_raster.h" #include "os/os.h" -#include "globals.h" +#include "global_config.h" #include "default_mouse_cursor.xpm" #include "sort.h" #include "io/marshalls.h" diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index ad0cb664c5..7d547e1862 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -825,6 +825,9 @@ public: BIND2(gi_probe_set_energy,RID,float) BIND1RC(float,gi_probe_get_energy,RID) + BIND2(gi_probe_set_bias,RID,float) + BIND1RC(float,gi_probe_get_bias,RID) + BIND2(gi_probe_set_propagation,RID,float) BIND1RC(float,gi_probe_get_propagation,RID) diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 297413effd..e004103508 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_server_scene.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_server_scene.h" #include "visual_server_global.h" #include "os/os.h" @@ -1556,9 +1584,11 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance,const cull_count--; SWAP(instance_shadow_cull_result[j],instance_shadow_cull_result[cull_count]); j--; + continue; } + instance->transformed_aabb.project_range_in_plane(Plane(z_vec,0),min,max); if (max>z_max) z_max=max; @@ -2967,7 +2997,7 @@ void VisualServerScene::_bake_gi_downscale_light(int p_idx, int p_level, const G } - divisor=Math::lerp(8.0,divisor,p_propagate); + divisor=Math::lerp((float)8.0,divisor,p_propagate); sum[0]/=divisor; sum[1]/=divisor; sum[2]/=divisor; @@ -3475,6 +3505,7 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) { } else if (p_instance->base_type==VS::INSTANCE_MULTIMESH) { RID mesh = VSG::storage->multimesh_get_mesh(p_instance->base); if (mesh.is_valid()) { + bool cast_shadows=false; int sc = VSG::storage->mesh_get_surface_count(mesh); @@ -3491,6 +3522,7 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) { cast_shadows=true; break; } + } if (!cast_shadows) { @@ -3538,6 +3570,8 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) { void VisualServerScene::update_dirty_instances() { + VSG::storage->update_dirty_resources(); + while(_instance_update_list.first()) { _update_dirty_instance( _instance_update_list.first()->self() ); diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h index f9a5dde1ac..01ad400b80 100644 --- a/servers/visual/visual_server_scene.h +++ b/servers/visual/visual_server_scene.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_server_scene.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUALSERVERSCENE_H #define VISUALSERVERSCENE_H diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index d2ee32f9cc..a88fb69e93 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -1,8 +1,36 @@ +/*************************************************************************/ +/* visual_server_viewport.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 "visual_server_viewport.h" #include "visual_server_global.h" #include "visual_server_canvas.h" #include "visual_server_scene.h" -#include "globals.h" +#include "global_config.h" diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h index ff4bc2601d..1cee90b803 100644 --- a/servers/visual/visual_server_viewport.h +++ b/servers/visual/visual_server_viewport.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* visual_server_viewport.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan 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 VISUALSERVERVIEWPORT_H #define VISUALSERVERVIEWPORT_H diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 1799585576..5d231d208e 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "visual_server.h" -#include "globals.h" +#include "global_config.h" #include "method_bind_ext.inc" VisualServer *VisualServer::singleton=NULL; @@ -712,7 +712,7 @@ Error VisualServer::_surface_set_data(Array p_arrays,uint32_t p_format,uint32_t } break; case VS::ARRAY_BONES: { - ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::POOL_INT_ARRAY, ERR_INVALID_PARAMETER ); + ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::POOL_INT_ARRAY && p_arrays[ai].get_type() != Variant::POOL_REAL_ARRAY, ERR_INVALID_PARAMETER ); PoolVector<int> array = p_arrays[ai]; @@ -1566,17 +1566,17 @@ Array VisualServer::mesh_surface_get_arrays(RID p_mesh,int p_surface) const { void VisualServer::_bind_methods() { - ClassDB::bind_method(_MD("texture_create"),&VisualServer::texture_create); - ClassDB::bind_method(_MD("texture_create_from_image"),&VisualServer::texture_create_from_image,DEFVAL( TEXTURE_FLAGS_DEFAULT ) ); - //ClassDB::bind_method(_MD("texture_allocate"),&VisualServer::texture_allocate,DEFVAL( TEXTURE_FLAGS_DEFAULT ) ); - //ClassDB::bind_method(_MD("texture_set_data"),&VisualServer::texture_blit_rect,DEFVAL( CUBEMAP_LEFT ) ); - //ClassDB::bind_method(_MD("texture_get_rect"),&VisualServer::texture_get_rect ); - ClassDB::bind_method(_MD("texture_set_flags"),&VisualServer::texture_set_flags ); - ClassDB::bind_method(_MD("texture_get_flags"),&VisualServer::texture_get_flags ); - ClassDB::bind_method(_MD("texture_get_width"),&VisualServer::texture_get_width ); - ClassDB::bind_method(_MD("texture_get_height"),&VisualServer::texture_get_height ); + ClassDB::bind_method(D_METHOD("texture_create"),&VisualServer::texture_create); + ClassDB::bind_method(D_METHOD("texture_create_from_image"),&VisualServer::texture_create_from_image,DEFVAL( TEXTURE_FLAGS_DEFAULT ) ); + //ClassDB::bind_method(D_METHOD("texture_allocate"),&VisualServer::texture_allocate,DEFVAL( TEXTURE_FLAGS_DEFAULT ) ); + //ClassDB::bind_method(D_METHOD("texture_set_data"),&VisualServer::texture_blit_rect,DEFVAL( CUBEMAP_LEFT ) ); + //ClassDB::bind_method(D_METHOD("texture_get_rect"),&VisualServer::texture_get_rect ); + ClassDB::bind_method(D_METHOD("texture_set_flags"),&VisualServer::texture_set_flags ); + ClassDB::bind_method(D_METHOD("texture_get_flags"),&VisualServer::texture_get_flags ); + ClassDB::bind_method(D_METHOD("texture_get_width"),&VisualServer::texture_get_width ); + ClassDB::bind_method(D_METHOD("texture_get_height"),&VisualServer::texture_get_height ); - ClassDB::bind_method(_MD("texture_set_shrink_all_x2_on_set_data","shrink"),&VisualServer::texture_set_shrink_all_x2_on_set_data ); + ClassDB::bind_method(D_METHOD("texture_set_shrink_all_x2_on_set_data","shrink"),&VisualServer::texture_set_shrink_all_x2_on_set_data ); diff --git a/servers/visual_server.h b/servers/visual_server.h index 5c835c2287..08cf34a653 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -475,6 +475,9 @@ public: virtual void gi_probe_set_energy(RID p_probe,float p_range)=0; virtual float gi_probe_get_energy(RID p_probe) const=0; + virtual void gi_probe_set_bias(RID p_probe,float p_range)=0; + virtual float gi_probe_get_bias(RID p_probe) const=0; + virtual void gi_probe_set_propagation(RID p_probe,float p_range)=0; virtual float gi_probe_get_propagation(RID p_probe) const=0; diff --git a/thirdparty/README.md b/thirdparty/README.md index 54930c1ebe..8c2a3e6af3 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -124,15 +124,15 @@ Files extracted from upstream source: ## libwebp - Upstream: https://chromium.googlesource.com/webm/libwebp/ -- Version: 0.5.2 +- Version: 0.6.0 - License: BSD-3-Clause Files extracted from upstream source: -- `src/*` except from: .am and .in, files, extras/, `webp/extras.h` +- `src/*` except from: .am, .rc and .in files - AUTHORS, COPYING, PATENTS -Important: The files `utils/bit_reader.{c,h}` have Godot-made +Important: The files `utils/bit_reader_utils.{c,h}` have Godot-made changes to ensure they build for Javascript/HTML5. Those changes are marked with `// -- GODOT --` comments. diff --git a/thirdparty/libwebp/dec/alpha.c b/thirdparty/libwebp/dec/alpha_dec.c index d88f01d8de..83ffd4b609 100644 --- a/thirdparty/libwebp/dec/alpha.c +++ b/thirdparty/libwebp/dec/alpha_dec.c @@ -12,11 +12,11 @@ // Author: Skal (pascal.massimino@gmail.com) #include <stdlib.h> -#include "./alphai.h" -#include "./vp8i.h" -#include "./vp8li.h" +#include "./alphai_dec.h" +#include "./vp8i_dec.h" +#include "./vp8li_dec.h" #include "../dsp/dsp.h" -#include "../utils/quant_levels_dec.h" +#include "../utils/quant_levels_dec_utils.h" #include "../utils/utils.h" #include "../webp/format_constants.h" diff --git a/thirdparty/libwebp/dec/alphai.h b/thirdparty/libwebp/dec/alphai_dec.h index 69dd7c0f5d..561e8151ee 100644 --- a/thirdparty/libwebp/dec/alphai.h +++ b/thirdparty/libwebp/dec/alphai_dec.h @@ -14,8 +14,8 @@ #ifndef WEBP_DEC_ALPHAI_H_ #define WEBP_DEC_ALPHAI_H_ -#include "./webpi.h" -#include "../utils/filters.h" +#include "./webpi_dec.h" +#include "../utils/filters_utils.h" #ifdef __cplusplus extern "C" { diff --git a/thirdparty/libwebp/dec/buffer.c b/thirdparty/libwebp/dec/buffer_dec.c index 547e69b434..c685fd5646 100644 --- a/thirdparty/libwebp/dec/buffer.c +++ b/thirdparty/libwebp/dec/buffer_dec.c @@ -13,8 +13,8 @@ #include <stdlib.h> -#include "./vp8i.h" -#include "./webpi.h" +#include "./vp8i_dec.h" +#include "./webpi_dec.h" #include "../utils/utils.h" //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/dec/common.h b/thirdparty/libwebp/dec/common_dec.h index 6961e22470..6961e22470 100644 --- a/thirdparty/libwebp/dec/common.h +++ b/thirdparty/libwebp/dec/common_dec.h diff --git a/thirdparty/libwebp/dec/frame.c b/thirdparty/libwebp/dec/frame_dec.c index 22d291d2cd..f91e27f7c8 100644 --- a/thirdparty/libwebp/dec/frame.c +++ b/thirdparty/libwebp/dec/frame_dec.c @@ -12,7 +12,7 @@ // Author: Skal (pascal.massimino@gmail.com) #include <stdlib.h> -#include "./vp8i.h" +#include "./vp8i_dec.h" #include "../utils/utils.h" //------------------------------------------------------------------------------ @@ -723,7 +723,7 @@ static int AllocateMemory(VP8Decoder* const dec) { return VP8SetError(dec, VP8_STATUS_OUT_OF_MEMORY, "no memory during frame initialization."); } - // down-cast is ok, thanks to WebPSafeAlloc() above. + // down-cast is ok, thanks to WebPSafeMalloc() above. dec->mem_size_ = (size_t)needed; } diff --git a/thirdparty/libwebp/dec/idec.c b/thirdparty/libwebp/dec/idec_dec.c index 8de131916e..78fb2e7186 100644 --- a/thirdparty/libwebp/dec/idec.c +++ b/thirdparty/libwebp/dec/idec_dec.c @@ -15,9 +15,9 @@ #include <string.h> #include <stdlib.h> -#include "./alphai.h" -#include "./webpi.h" -#include "./vp8i.h" +#include "./alphai_dec.h" +#include "./webpi_dec.h" +#include "./vp8i_dec.h" #include "../utils/utils.h" // In append mode, buffer allocations increase as multiples of this value. diff --git a/thirdparty/libwebp/dec/io.c b/thirdparty/libwebp/dec/io_dec.c index 8d5c43f325..8bfab86959 100644 --- a/thirdparty/libwebp/dec/io.c +++ b/thirdparty/libwebp/dec/io_dec.c @@ -13,8 +13,8 @@ #include <assert.h> #include <stdlib.h> -#include "../dec/vp8i.h" -#include "./webpi.h" +#include "../dec/vp8i_dec.h" +#include "./webpi_dec.h" #include "../dsp/dsp.h" #include "../dsp/yuv.h" #include "../utils/utils.h" @@ -256,7 +256,7 @@ static int Rescale(const uint8_t* src, int src_stride, static int EmitRescaledYUV(const VP8Io* const io, WebPDecParams* const p) { const int mb_h = io->mb_h; const int uv_mb_h = (mb_h + 1) >> 1; - WebPRescaler* const scaler = &p->scaler_y; + WebPRescaler* const scaler = p->scaler_y; int num_lines_out = 0; if (WebPIsAlphaMode(p->output->colorspace) && io->a != NULL) { // Before rescaling, we premultiply the luma directly into the io->y @@ -267,29 +267,28 @@ static int EmitRescaledYUV(const VP8Io* const io, WebPDecParams* const p) { io->a, io->width, io->mb_w, mb_h, 0); } num_lines_out = Rescale(io->y, io->y_stride, mb_h, scaler); - Rescale(io->u, io->uv_stride, uv_mb_h, &p->scaler_u); - Rescale(io->v, io->uv_stride, uv_mb_h, &p->scaler_v); + Rescale(io->u, io->uv_stride, uv_mb_h, p->scaler_u); + Rescale(io->v, io->uv_stride, uv_mb_h, p->scaler_v); return num_lines_out; } static int EmitRescaledAlphaYUV(const VP8Io* const io, WebPDecParams* const p, int expected_num_lines_out) { const WebPYUVABuffer* const buf = &p->output->u.YUVA; + uint8_t* const dst_a = buf->a + p->last_y * buf->a_stride; if (io->a != NULL) { - uint8_t* dst_y = buf->y + p->last_y * buf->y_stride; - const uint8_t* src_a = buf->a + p->last_y * buf->a_stride; - const int num_lines_out = Rescale(io->a, io->width, io->mb_h, &p->scaler_a); - (void)expected_num_lines_out; + uint8_t* const dst_y = buf->y + p->last_y * buf->y_stride; + const int num_lines_out = Rescale(io->a, io->width, io->mb_h, p->scaler_a); assert(expected_num_lines_out == num_lines_out); if (num_lines_out > 0) { // unmultiply the Y - WebPMultRows(dst_y, buf->y_stride, src_a, buf->a_stride, - p->scaler_a.dst_width, num_lines_out, 1); + WebPMultRows(dst_y, buf->y_stride, dst_a, buf->a_stride, + p->scaler_a->dst_width, num_lines_out, 1); } } else if (buf->a != NULL) { // the user requested alpha, but there is none, set it to opaque. assert(p->last_y + expected_num_lines_out <= io->scaled_height); - FillAlphaPlane(buf->a + p->last_y * buf->a_stride, - io->scaled_width, expected_num_lines_out, buf->a_stride); + FillAlphaPlane(dst_a, io->scaled_width, expected_num_lines_out, + buf->a_stride); } return 0; } @@ -305,31 +304,42 @@ static int InitYUVRescaler(const VP8Io* const io, WebPDecParams* const p) { const int uv_in_height = (io->mb_h + 1) >> 1; const size_t work_size = 2 * out_width; // scratch memory for luma rescaler const size_t uv_work_size = 2 * uv_out_width; // and for each u/v ones - size_t tmp_size; + size_t tmp_size, rescaler_size; rescaler_t* work; + WebPRescaler* scalers; + const int num_rescalers = has_alpha ? 4 : 3; tmp_size = (work_size + 2 * uv_work_size) * sizeof(*work); if (has_alpha) { tmp_size += work_size * sizeof(*work); } - p->memory = WebPSafeMalloc(1ULL, tmp_size); + rescaler_size = num_rescalers * sizeof(*p->scaler_y) + WEBP_ALIGN_CST; + + p->memory = WebPSafeMalloc(1ULL, tmp_size + rescaler_size); if (p->memory == NULL) { return 0; // memory error } work = (rescaler_t*)p->memory; - WebPRescalerInit(&p->scaler_y, io->mb_w, io->mb_h, + + scalers = (WebPRescaler*)WEBP_ALIGN((const uint8_t*)work + tmp_size); + p->scaler_y = &scalers[0]; + p->scaler_u = &scalers[1]; + p->scaler_v = &scalers[2]; + p->scaler_a = has_alpha ? &scalers[3] : NULL; + + WebPRescalerInit(p->scaler_y, io->mb_w, io->mb_h, buf->y, out_width, out_height, buf->y_stride, 1, work); - WebPRescalerInit(&p->scaler_u, uv_in_width, uv_in_height, + WebPRescalerInit(p->scaler_u, uv_in_width, uv_in_height, buf->u, uv_out_width, uv_out_height, buf->u_stride, 1, work + work_size); - WebPRescalerInit(&p->scaler_v, uv_in_width, uv_in_height, + WebPRescalerInit(p->scaler_v, uv_in_width, uv_in_height, buf->v, uv_out_width, uv_out_height, buf->v_stride, 1, work + work_size + uv_work_size); p->emit = EmitRescaledYUV; if (has_alpha) { - WebPRescalerInit(&p->scaler_a, io->mb_w, io->mb_h, + WebPRescalerInit(p->scaler_a, io->mb_w, io->mb_h, buf->a, out_width, out_height, buf->a_stride, 1, work + work_size + 2 * uv_work_size); p->emit_alpha = EmitRescaledAlphaYUV; @@ -349,15 +359,15 @@ static int ExportRGB(WebPDecParams* const p, int y_pos) { int num_lines_out = 0; // For RGB rescaling, because of the YUV420, current scan position // U/V can be +1/-1 line from the Y one. Hence the double test. - while (WebPRescalerHasPendingOutput(&p->scaler_y) && - WebPRescalerHasPendingOutput(&p->scaler_u)) { + while (WebPRescalerHasPendingOutput(p->scaler_y) && + WebPRescalerHasPendingOutput(p->scaler_u)) { assert(y_pos + num_lines_out < p->output->height); - assert(p->scaler_u.y_accum == p->scaler_v.y_accum); - WebPRescalerExportRow(&p->scaler_y); - WebPRescalerExportRow(&p->scaler_u); - WebPRescalerExportRow(&p->scaler_v); - convert(p->scaler_y.dst, p->scaler_u.dst, p->scaler_v.dst, - dst, p->scaler_y.dst_width); + assert(p->scaler_u->y_accum == p->scaler_v->y_accum); + WebPRescalerExportRow(p->scaler_y); + WebPRescalerExportRow(p->scaler_u); + WebPRescalerExportRow(p->scaler_v); + convert(p->scaler_y->dst, p->scaler_u->dst, p->scaler_v->dst, + dst, p->scaler_y->dst_width); dst += buf->stride; ++num_lines_out; } @@ -371,15 +381,15 @@ static int EmitRescaledRGB(const VP8Io* const io, WebPDecParams* const p) { int num_lines_out = 0; while (j < mb_h) { const int y_lines_in = - WebPRescalerImport(&p->scaler_y, mb_h - j, + WebPRescalerImport(p->scaler_y, mb_h - j, io->y + j * io->y_stride, io->y_stride); j += y_lines_in; - if (WebPRescaleNeededLines(&p->scaler_u, uv_mb_h - uv_j)) { + if (WebPRescaleNeededLines(p->scaler_u, uv_mb_h - uv_j)) { const int u_lines_in = - WebPRescalerImport(&p->scaler_u, uv_mb_h - uv_j, + WebPRescalerImport(p->scaler_u, uv_mb_h - uv_j, io->u + uv_j * io->uv_stride, io->uv_stride); const int v_lines_in = - WebPRescalerImport(&p->scaler_v, uv_mb_h - uv_j, + WebPRescalerImport(p->scaler_v, uv_mb_h - uv_j, io->v + uv_j * io->uv_stride, io->uv_stride); (void)v_lines_in; // remove a gcc warning assert(u_lines_in == v_lines_in); @@ -400,13 +410,13 @@ static int ExportAlpha(WebPDecParams* const p, int y_pos, int max_lines_out) { int num_lines_out = 0; const int is_premult_alpha = WebPIsPremultipliedMode(colorspace); uint32_t non_opaque = 0; - const int width = p->scaler_a.dst_width; + const int width = p->scaler_a->dst_width; - while (WebPRescalerHasPendingOutput(&p->scaler_a) && + while (WebPRescalerHasPendingOutput(p->scaler_a) && num_lines_out < max_lines_out) { assert(y_pos + num_lines_out < p->output->height); - WebPRescalerExportRow(&p->scaler_a); - non_opaque |= WebPDispatchAlpha(p->scaler_a.dst, 0, width, 1, dst, 0); + WebPRescalerExportRow(p->scaler_a); + non_opaque |= WebPDispatchAlpha(p->scaler_a->dst, 0, width, 1, dst, 0); dst += buf->stride; ++num_lines_out; } @@ -428,18 +438,18 @@ static int ExportAlphaRGBA4444(WebPDecParams* const p, int y_pos, #endif int num_lines_out = 0; const WEBP_CSP_MODE colorspace = p->output->colorspace; - const int width = p->scaler_a.dst_width; + const int width = p->scaler_a->dst_width; const int is_premult_alpha = WebPIsPremultipliedMode(colorspace); uint32_t alpha_mask = 0x0f; - while (WebPRescalerHasPendingOutput(&p->scaler_a) && + while (WebPRescalerHasPendingOutput(p->scaler_a) && num_lines_out < max_lines_out) { int i; assert(y_pos + num_lines_out < p->output->height); - WebPRescalerExportRow(&p->scaler_a); + WebPRescalerExportRow(p->scaler_a); for (i = 0; i < width; ++i) { // Fill in the alpha value (converted to 4 bits). - const uint32_t alpha_value = p->scaler_a.dst[i] >> 4; + const uint32_t alpha_value = p->scaler_a->dst[i] >> 4; alpha_dst[2 * i] = (alpha_dst[2 * i] & 0xf0) | alpha_value; alpha_mask &= alpha_value; } @@ -455,7 +465,7 @@ static int ExportAlphaRGBA4444(WebPDecParams* const p, int y_pos, static int EmitRescaledAlphaRGB(const VP8Io* const io, WebPDecParams* const p, int expected_num_out_lines) { if (io->a != NULL) { - WebPRescaler* const scaler = &p->scaler_a; + WebPRescaler* const scaler = p->scaler_a; int lines_left = expected_num_out_lines; const int y_end = p->last_y + lines_left; while (lines_left > 0) { @@ -477,7 +487,9 @@ static int InitRGBRescaler(const VP8Io* const io, WebPDecParams* const p) { const size_t work_size = 2 * out_width; // scratch memory for one rescaler rescaler_t* work; // rescalers work area uint8_t* tmp; // tmp storage for scaled YUV444 samples before RGB conversion - size_t tmp_size1, tmp_size2, total_size; + size_t tmp_size1, tmp_size2, total_size, rescaler_size; + WebPRescaler* scalers; + const int num_rescalers = has_alpha ? 4 : 3; tmp_size1 = 3 * work_size; tmp_size2 = 3 * out_width; @@ -486,26 +498,35 @@ static int InitRGBRescaler(const VP8Io* const io, WebPDecParams* const p) { tmp_size2 += out_width; } total_size = tmp_size1 * sizeof(*work) + tmp_size2 * sizeof(*tmp); - p->memory = WebPSafeMalloc(1ULL, total_size); + rescaler_size = num_rescalers * sizeof(*p->scaler_y) + WEBP_ALIGN_CST; + + p->memory = WebPSafeMalloc(1ULL, total_size + rescaler_size); if (p->memory == NULL) { return 0; // memory error } work = (rescaler_t*)p->memory; tmp = (uint8_t*)(work + tmp_size1); - WebPRescalerInit(&p->scaler_y, io->mb_w, io->mb_h, + + scalers = (WebPRescaler*)WEBP_ALIGN((const uint8_t*)work + total_size); + p->scaler_y = &scalers[0]; + p->scaler_u = &scalers[1]; + p->scaler_v = &scalers[2]; + p->scaler_a = has_alpha ? &scalers[3] : NULL; + + WebPRescalerInit(p->scaler_y, io->mb_w, io->mb_h, tmp + 0 * out_width, out_width, out_height, 0, 1, work + 0 * work_size); - WebPRescalerInit(&p->scaler_u, uv_in_width, uv_in_height, + WebPRescalerInit(p->scaler_u, uv_in_width, uv_in_height, tmp + 1 * out_width, out_width, out_height, 0, 1, work + 1 * work_size); - WebPRescalerInit(&p->scaler_v, uv_in_width, uv_in_height, + WebPRescalerInit(p->scaler_v, uv_in_width, uv_in_height, tmp + 2 * out_width, out_width, out_height, 0, 1, work + 2 * work_size); p->emit = EmitRescaledRGB; WebPInitYUV444Converters(); if (has_alpha) { - WebPRescalerInit(&p->scaler_a, io->mb_w, io->mb_h, + WebPRescalerInit(p->scaler_a, io->mb_w, io->mb_h, tmp + 3 * out_width, out_width, out_height, 0, 1, work + 3 * work_size); p->emit_alpha = EmitRescaledAlphaRGB; diff --git a/thirdparty/libwebp/dec/quant.c b/thirdparty/libwebp/dec/quant_dec.c index 5b648f942c..14e3198946 100644 --- a/thirdparty/libwebp/dec/quant.c +++ b/thirdparty/libwebp/dec/quant_dec.c @@ -11,7 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) -#include "./vp8i.h" +#include "./vp8i_dec.h" static WEBP_INLINE int clip(int v, int M) { return v < 0 ? 0 : v > M ? M : v; diff --git a/thirdparty/libwebp/dec/tree.c b/thirdparty/libwebp/dec/tree_dec.c index c2007ea733..9e805f60f3 100644 --- a/thirdparty/libwebp/dec/tree.c +++ b/thirdparty/libwebp/dec/tree_dec.c @@ -11,10 +11,13 @@ // // Author: Skal (pascal.massimino@gmail.com) -#include "./vp8i.h" -#include "../utils/bit_reader_inl.h" +#include "./vp8i_dec.h" +#include "../utils/bit_reader_inl_utils.h" +#if !defined(__arm__) && !defined(_M_ARM) && !defined(__aarch64__) +// using a table is ~1-2% slower on ARM. Prefer the coded-tree approach then. #define USE_GENERIC_TREE +#endif #ifdef USE_GENERIC_TREE static const int8_t kYModesIntra4[18] = { diff --git a/thirdparty/libwebp/dec/vp8.c b/thirdparty/libwebp/dec/vp8_dec.c index 336680c38c..fad8d9cf35 100644 --- a/thirdparty/libwebp/dec/vp8.c +++ b/thirdparty/libwebp/dec/vp8_dec.c @@ -13,11 +13,11 @@ #include <stdlib.h> -#include "./alphai.h" -#include "./vp8i.h" -#include "./vp8li.h" -#include "./webpi.h" -#include "../utils/bit_reader_inl.h" +#include "./alphai_dec.h" +#include "./vp8i_dec.h" +#include "./vp8li_dec.h" +#include "./webpi_dec.h" +#include "../utils/bit_reader_inl_utils.h" #include "../utils/utils.h" //------------------------------------------------------------------------------ @@ -27,6 +27,16 @@ int WebPGetDecoderVersion(void) { } //------------------------------------------------------------------------------ +// Signature and pointer-to-function for GetCoeffs() variants below. + +typedef int (*GetCoeffsFunc)(VP8BitReader* const br, + const VP8BandProbas* const prob[], + int ctx, const quant_t dq, int n, int16_t* out); +static volatile GetCoeffsFunc GetCoeffs = NULL; + +static void InitGetCoeffs(void); + +//------------------------------------------------------------------------------ // VP8Decoder static void SetOk(VP8Decoder* const dec) { @@ -51,6 +61,7 @@ VP8Decoder* VP8New(void) { WebPGetWorkerInterface()->Init(&dec->worker_); dec->ready_ = 0; dec->num_parts_minus_one_ = 0; + InitGetCoeffs(); } return dec; } @@ -273,12 +284,14 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) { frm_hdr->profile_ = (bits >> 1) & 7; frm_hdr->show_ = (bits >> 4) & 1; frm_hdr->partition_length_ = (bits >> 5); - if (frm_hdr->profile_ > 3) + if (frm_hdr->profile_ > 3) { return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR, "Incorrect keyframe parameters."); - if (!frm_hdr->show_) + } + if (!frm_hdr->show_) { return VP8SetError(dec, VP8_STATUS_UNSUPPORTED_FEATURE, "Frame not displayable."); + } buf += 3; buf_size -= 3; } @@ -420,8 +433,9 @@ static int GetLargeValue(VP8BitReader* const br, const uint8_t* const p) { } // Returns the position of the last non-zero coeff plus one -static int GetCoeffs(VP8BitReader* const br, const VP8BandProbas* const prob[], - int ctx, const quant_t dq, int n, int16_t* out) { +static int GetCoeffsFast(VP8BitReader* const br, + const VP8BandProbas* const prob[], + int ctx, const quant_t dq, int n, int16_t* out) { const uint8_t* p = prob[n]->probas_[ctx]; for (; n < 16; ++n) { if (!VP8GetBit(br, p[0])) { @@ -447,6 +461,46 @@ static int GetCoeffs(VP8BitReader* const br, const VP8BandProbas* const prob[], return 16; } +// This version of GetCoeffs() uses VP8GetBitAlt() which is an alternate version +// of VP8GetBitAlt() targeting specific platforms. +static int GetCoeffsAlt(VP8BitReader* const br, + const VP8BandProbas* const prob[], + int ctx, const quant_t dq, int n, int16_t* out) { + const uint8_t* p = prob[n]->probas_[ctx]; + for (; n < 16; ++n) { + if (!VP8GetBitAlt(br, p[0])) { + return n; // previous coeff was last non-zero coeff + } + while (!VP8GetBitAlt(br, p[1])) { // sequence of zero coeffs + p = prob[++n]->probas_[0]; + if (n == 16) return 16; + } + { // non zero coeff + const VP8ProbaArray* const p_ctx = &prob[n + 1]->probas_[0]; + int v; + if (!VP8GetBitAlt(br, p[2])) { + v = 1; + p = p_ctx[1]; + } else { + v = GetLargeValue(br, p); + p = p_ctx[2]; + } + out[kZigzag[n]] = VP8GetSigned(br, v) * dq[n > 0]; + } + } + return 16; +} + +WEBP_TSAN_IGNORE_FUNCTION static void InitGetCoeffs(void) { + if (GetCoeffs == NULL) { + if (VP8GetCPUInfo != NULL && VP8GetCPUInfo(kSlowSSSE3)) { + GetCoeffs = GetCoeffsAlt; + } else { + GetCoeffs = GetCoeffsFast; + } + } +} + static WEBP_INLINE uint32_t NzCodeBits(uint32_t nz_coeffs, int nz, int dc_nz) { nz_coeffs <<= 2; nz_coeffs |= (nz > 3) ? 3 : (nz > 1) ? 2 : dc_nz; diff --git a/thirdparty/libwebp/dec/decode_vp8.h b/thirdparty/libwebp/dec/vp8_dec.h index b9337bbec0..b9337bbec0 100644 --- a/thirdparty/libwebp/dec/decode_vp8.h +++ b/thirdparty/libwebp/dec/vp8_dec.h diff --git a/thirdparty/libwebp/dec/vp8i.h b/thirdparty/libwebp/dec/vp8i_dec.h index 313d8a7b94..555853e8f8 100644 --- a/thirdparty/libwebp/dec/vp8i.h +++ b/thirdparty/libwebp/dec/vp8i_dec.h @@ -15,11 +15,11 @@ #define WEBP_DEC_VP8I_H_ #include <string.h> // for memcpy() -#include "./common.h" -#include "./vp8li.h" -#include "../utils/bit_reader.h" -#include "../utils/random.h" -#include "../utils/thread.h" +#include "./common_dec.h" +#include "./vp8li_dec.h" +#include "../utils/bit_reader_utils.h" +#include "../utils/random_utils.h" +#include "../utils/thread_utils.h" #include "../dsp/dsp.h" #ifdef __cplusplus @@ -31,8 +31,8 @@ extern "C" { // version numbers #define DEC_MAJ_VERSION 0 -#define DEC_MIN_VERSION 5 -#define DEC_REV_VERSION 2 +#define DEC_MIN_VERSION 6 +#define DEC_REV_VERSION 0 // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline). // Constraints are: We need to store one 16x16 block of luma samples (y), diff --git a/thirdparty/libwebp/dec/vp8l.c b/thirdparty/libwebp/dec/vp8l_dec.c index cb2e3176b6..ef359a91f0 100644 --- a/thirdparty/libwebp/dec/vp8l.c +++ b/thirdparty/libwebp/dec/vp8l_dec.c @@ -14,13 +14,14 @@ #include <stdlib.h> -#include "./alphai.h" -#include "./vp8li.h" +#include "./alphai_dec.h" +#include "./vp8li_dec.h" #include "../dsp/dsp.h" #include "../dsp/lossless.h" +#include "../dsp/lossless_common.h" #include "../dsp/yuv.h" -#include "../utils/endian_inl.h" -#include "../utils/huffman.h" +#include "../utils/endian_inl_utils.h" +#include "../utils/huffman_utils.h" #include "../utils/utils.h" #define NUM_ARGB_CACHE_ROWS 16 @@ -547,11 +548,14 @@ static int EmitRescaledRowsRGBA(const VP8LDecoder* const dec, uint8_t* const row_out = out + num_lines_out * out_stride; const int lines_left = mb_h - num_lines_in; const int needed_lines = WebPRescaleNeededLines(dec->rescaler, lines_left); + int lines_imported; assert(needed_lines > 0 && needed_lines <= lines_left); WebPMultARGBRows(row_in, in_stride, dec->rescaler->src_width, needed_lines, 0); - WebPRescalerImport(dec->rescaler, lines_left, row_in, in_stride); - num_lines_in += needed_lines; + lines_imported = + WebPRescalerImport(dec->rescaler, lines_left, row_in, in_stride); + assert(lines_imported == needed_lines); + num_lines_in += lines_imported; num_lines_out += Export(dec->rescaler, colorspace, out_stride, row_out); } return num_lines_out; @@ -623,9 +627,12 @@ static int EmitRescaledRowsYUVA(const VP8LDecoder* const dec, while (num_lines_in < mb_h) { const int lines_left = mb_h - num_lines_in; const int needed_lines = WebPRescaleNeededLines(dec->rescaler, lines_left); + int lines_imported; WebPMultARGBRows(in, in_stride, dec->rescaler->src_width, needed_lines, 0); - WebPRescalerImport(dec->rescaler, lines_left, in, in_stride); - num_lines_in += needed_lines; + lines_imported = + WebPRescalerImport(dec->rescaler, lines_left, in, in_stride); + assert(lines_imported == needed_lines); + num_lines_in += lines_imported; in += needed_lines * in_stride; y_pos += ExportYUVA(dec, y_pos); } @@ -705,13 +712,15 @@ static void ApplyInverseTransforms(VP8LDecoder* const dec, int num_rows, uint32_t* const rows_out = dec->argb_cache_; // Inverse transforms. - // TODO: most transforms only need to operate on the cropped region only. - memcpy(rows_out, rows_in, cache_pixs * sizeof(*rows_out)); while (n-- > 0) { VP8LTransform* const transform = &dec->transforms_[n]; VP8LInverseTransform(transform, start_row, end_row, rows_in, rows_out); rows_in = rows_out; } + if (rows_in != rows_out) { + // No transform called, hence just copy. + memcpy(rows_out, rows_in, cache_pixs * sizeof(*rows_out)); + } } // Processes (transforms, scales & color-converts) the rows decoded after the @@ -1210,8 +1219,9 @@ static int ExpandColorMap(int num_colors, VP8LTransform* const transform) { // Equivalent to AddPixelEq(), on a byte-basis. new_data[i] = (data[i] + new_data[i - 4]) & 0xff; } - for (; i < 4 * final_num_colors; ++i) + for (; i < 4 * final_num_colors; ++i) { new_data[i] = 0; // black tail. + } WebPSafeFree(transform->data_); transform->data_ = new_color_map; } @@ -1482,9 +1492,8 @@ static void ExtractAlphaRows(VP8LDecoder* const dec, int last_row) { const int cache_pixs = width * num_rows_to_process; uint8_t* const dst = output + width * cur_row; const uint32_t* const src = dec->argb_cache_; - int i; ApplyInverseTransforms(dec, num_rows_to_process, in); - for (i = 0; i < cache_pixs; ++i) dst[i] = (src[i] >> 8) & 0xff; + WebPExtractGreen(src, dst, cache_pixs); AlphaApplyFilter(alph_dec, cur_row, cur_row + num_rows_to_process, dst, width); num_rows -= num_rows_to_process; @@ -1552,6 +1561,8 @@ int VP8LDecodeAlphaImageStream(ALPHDecoder* const alph_dec, int last_row) { return 1; // done } + if (!alph_dec->use_8b_decode_) WebPInitAlphaProcessing(); + // Decode (with special row processing). return alph_dec->use_8b_decode_ ? DecodeAlphaData(dec, (uint8_t*)dec->pixels_, dec->width_, dec->height_, diff --git a/thirdparty/libwebp/dec/vp8li.h b/thirdparty/libwebp/dec/vp8li_dec.h index 9313bdc0af..097a9d0589 100644 --- a/thirdparty/libwebp/dec/vp8li.h +++ b/thirdparty/libwebp/dec/vp8li_dec.h @@ -16,10 +16,10 @@ #define WEBP_DEC_VP8LI_H_ #include <string.h> // for memcpy() -#include "./webpi.h" -#include "../utils/bit_reader.h" -#include "../utils/color_cache.h" -#include "../utils/huffman.h" +#include "./webpi_dec.h" +#include "../utils/bit_reader_utils.h" +#include "../utils/color_cache_utils.h" +#include "../utils/huffman_utils.h" #ifdef __cplusplus extern "C" { diff --git a/thirdparty/libwebp/dec/webp.c b/thirdparty/libwebp/dec/webp_dec.c index d0b912f02f..a8e9c2c510 100644 --- a/thirdparty/libwebp/dec/webp.c +++ b/thirdparty/libwebp/dec/webp_dec.c @@ -13,9 +13,9 @@ #include <stdlib.h> -#include "./vp8i.h" -#include "./vp8li.h" -#include "./webpi.h" +#include "./vp8i_dec.h" +#include "./vp8li_dec.h" +#include "./webpi_dec.h" #include "../utils/utils.h" #include "../webp/mux_types.h" // ALPHA_FLAG @@ -39,8 +39,8 @@ // 20..23 VP8X flags bit-map corresponding to the chunk-types present. // 24..26 Width of the Canvas Image. // 27..29 Height of the Canvas Image. -// There can be extra chunks after the "VP8X" chunk (ICCP, FRGM, ANMF, VP8, -// VP8L, XMP, EXIF ...) +// There can be extra chunks after the "VP8X" chunk (ICCP, ANMF, VP8, VP8L, +// XMP, EXIF ...) // All sizes are in little-endian order. // Note: chunk data size must be padded to multiple of 2 when written. @@ -289,7 +289,6 @@ static VP8StatusCode ParseHeadersInternal(const uint8_t* data, int found_riff = 0; int found_vp8x = 0; int animation_present = 0; - int fragments_present = 0; const int have_all_data = (headers != NULL) ? headers->have_all_data : 0; VP8StatusCode status; @@ -318,7 +317,6 @@ static VP8StatusCode ParseHeadersInternal(const uint8_t* data, return status; // Wrong VP8X / insufficient data. } animation_present = !!(flags & ANIMATION_FLAG); - fragments_present = !!(flags & FRAGMENTS_FLAG); if (!found_riff && found_vp8x) { // Note: This restriction may be removed in the future, if it becomes // necessary to send VP8X chunk to the decoder. @@ -330,8 +328,7 @@ static VP8StatusCode ParseHeadersInternal(const uint8_t* data, image_width = canvas_width; image_height = canvas_height; - if (found_vp8x && (animation_present || fragments_present) && - headers == NULL) { + if (found_vp8x && animation_present && headers == NULL) { status = VP8_STATUS_OK; goto ReturnWidthHeight; // Just return features from VP8X header. } @@ -362,7 +359,7 @@ static VP8StatusCode ParseHeadersInternal(const uint8_t* data, return VP8_STATUS_BITSTREAM_ERROR; } - if (format != NULL && !(animation_present || fragments_present)) { + if (format != NULL && !animation_present) { *format = hdrs.is_lossless ? 2 : 1; } diff --git a/thirdparty/libwebp/dec/webpi.h b/thirdparty/libwebp/dec/webpi_dec.h index 991b194c22..696abc1958 100644 --- a/thirdparty/libwebp/dec/webpi.h +++ b/thirdparty/libwebp/dec/webpi_dec.h @@ -18,8 +18,8 @@ extern "C" { #endif -#include "../utils/rescaler.h" -#include "./decode_vp8.h" +#include "../utils/rescaler_utils.h" +#include "./vp8_dec.h" //------------------------------------------------------------------------------ // WebPDecParams: Decoding output parameters. Transient internal object. @@ -38,27 +38,18 @@ struct WebPDecParams { int last_y; // coordinate of the line that was last output const WebPDecoderOptions* options; // if not NULL, use alt decoding features - // rescalers - WebPRescaler scaler_y, scaler_u, scaler_v, scaler_a; + + WebPRescaler* scaler_y, *scaler_u, *scaler_v, *scaler_a; // rescalers void* memory; // overall scratch memory for the output work. OutputFunc emit; // output RGB or YUV samples OutputAlphaFunc emit_alpha; // output alpha channel OutputRowFunc emit_alpha_row; // output one line of rescaled alpha values - - WebPDecBuffer* final_output; // In case the user supplied a slow-memory - // output, we decode image in temporary buffer - // (this::output) and copy it here. - WebPDecBuffer tmp_buffer; // this::output will point to this one in case - // of slow memory. }; // Should be called first, before any use of the WebPDecParams object. void WebPResetDecParams(WebPDecParams* const params); -// Delete all memory (after an error occurred, for instance) -void WebPFreeDecParams(WebPDecParams* const params); - //------------------------------------------------------------------------------ // Header parsing helpers diff --git a/thirdparty/libwebp/demux/demux.c b/thirdparty/libwebp/demux/demux.c index 1cb9bd5780..100eab8c01 100644 --- a/thirdparty/libwebp/demux/demux.c +++ b/thirdparty/libwebp/demux/demux.c @@ -25,7 +25,7 @@ #define DMUX_MAJ_VERSION 0 #define DMUX_MIN_VERSION 3 -#define DMUX_REV_VERSION 1 +#define DMUX_REV_VERSION 2 typedef struct { size_t start_; // start location of the data @@ -590,7 +590,6 @@ static int CheckFrameBounds(const Frame* const frame, int exact, static int IsValidExtendedFormat(const WebPDemuxer* const dmux) { const int is_animation = !!(dmux->feature_flags_ & ANIMATION_FLAG); - const int is_fragmented = !!(dmux->feature_flags_ & FRAGMENTS_FLAG); const Frame* f = dmux->frames_; if (dmux->state_ == WEBP_DEMUX_PARSING_HEADER) return 1; @@ -598,7 +597,7 @@ static int IsValidExtendedFormat(const WebPDemuxer* const dmux) { if (dmux->canvas_width_ <= 0 || dmux->canvas_height_ <= 0) return 0; if (dmux->loop_count_ < 0) return 0; if (dmux->state_ == WEBP_DEMUX_DONE && dmux->frames_ == NULL) return 0; - if (is_fragmented) return 0; + if (dmux->feature_flags_ & ~ALL_VALID_FLAGS) return 0; // invalid bitstream while (f != NULL) { const int cur_frame_set = f->frame_num_; diff --git a/thirdparty/libwebp/dsp/alpha_processing.c b/thirdparty/libwebp/dsp/alpha_processing.c index 1716cace8d..4b60e092be 100644 --- a/thirdparty/libwebp/dsp/alpha_processing.c +++ b/thirdparty/libwebp/dsp/alpha_processing.c @@ -284,9 +284,9 @@ static void ApplyAlphaMultiply_16b(uint8_t* rgba4444, #endif } -static int DispatchAlpha(const uint8_t* alpha, int alpha_stride, - int width, int height, - uint8_t* dst, int dst_stride) { +static int DispatchAlpha_C(const uint8_t* alpha, int alpha_stride, + int width, int height, + uint8_t* dst, int dst_stride) { uint32_t alpha_mask = 0xff; int i, j; @@ -303,9 +303,9 @@ static int DispatchAlpha(const uint8_t* alpha, int alpha_stride, return (alpha_mask != 0xff); } -static void DispatchAlphaToGreen(const uint8_t* alpha, int alpha_stride, - int width, int height, - uint32_t* dst, int dst_stride) { +static void DispatchAlphaToGreen_C(const uint8_t* alpha, int alpha_stride, + int width, int height, + uint32_t* dst, int dst_stride) { int i, j; for (j = 0; j < height; ++j) { for (i = 0; i < width; ++i) { @@ -316,9 +316,9 @@ static void DispatchAlphaToGreen(const uint8_t* alpha, int alpha_stride, } } -static int ExtractAlpha(const uint8_t* argb, int argb_stride, - int width, int height, - uint8_t* alpha, int alpha_stride) { +static int ExtractAlpha_C(const uint8_t* argb, int argb_stride, + int width, int height, + uint8_t* alpha, int alpha_stride) { uint8_t alpha_mask = 0xff; int i, j; @@ -334,11 +334,17 @@ static int ExtractAlpha(const uint8_t* argb, int argb_stride, return (alpha_mask == 0xff); } +static void ExtractGreen_C(const uint32_t* argb, uint8_t* alpha, int size) { + int i; + for (i = 0; i < size; ++i) alpha[i] = argb[i] >> 8; +} + void (*WebPApplyAlphaMultiply)(uint8_t*, int, int, int, int); void (*WebPApplyAlphaMultiply4444)(uint8_t*, int, int, int); int (*WebPDispatchAlpha)(const uint8_t*, int, int, int, uint8_t*, int); void (*WebPDispatchAlphaToGreen)(const uint8_t*, int, int, int, uint32_t*, int); int (*WebPExtractAlpha)(const uint8_t*, int, int, int, uint8_t*, int); +void (*WebPExtractGreen)(const uint32_t* argb, uint8_t* alpha, int size); //------------------------------------------------------------------------------ // Init function @@ -346,6 +352,7 @@ int (*WebPExtractAlpha)(const uint8_t*, int, int, int, uint8_t*, int); extern void WebPInitAlphaProcessingMIPSdspR2(void); extern void WebPInitAlphaProcessingSSE2(void); extern void WebPInitAlphaProcessingSSE41(void); +extern void WebPInitAlphaProcessingNEON(void); static volatile VP8CPUInfo alpha_processing_last_cpuinfo_used = (VP8CPUInfo)&alpha_processing_last_cpuinfo_used; @@ -357,9 +364,11 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessing(void) { WebPMultRow = WebPMultRowC; WebPApplyAlphaMultiply = ApplyAlphaMultiply; WebPApplyAlphaMultiply4444 = ApplyAlphaMultiply_16b; - WebPDispatchAlpha = DispatchAlpha; - WebPDispatchAlphaToGreen = DispatchAlphaToGreen; - WebPExtractAlpha = ExtractAlpha; + + WebPDispatchAlpha = DispatchAlpha_C; + WebPDispatchAlphaToGreen = DispatchAlphaToGreen_C; + WebPExtractAlpha = ExtractAlpha_C; + WebPExtractGreen = ExtractGreen_C; // If defined, use CPUInfo() to overwrite some pointers with faster versions. if (VP8GetCPUInfo != NULL) { @@ -373,6 +382,11 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessing(void) { #endif } #endif +#if defined(WEBP_USE_NEON) + if (VP8GetCPUInfo(kNEON)) { + WebPInitAlphaProcessingNEON(); + } +#endif #if defined(WEBP_USE_MIPS_DSP_R2) if (VP8GetCPUInfo(kMIPSdspR2)) { WebPInitAlphaProcessingMIPSdspR2(); diff --git a/thirdparty/libwebp/dsp/alpha_processing_neon.c b/thirdparty/libwebp/dsp/alpha_processing_neon.c new file mode 100644 index 0000000000..606a401cf7 --- /dev/null +++ b/thirdparty/libwebp/dsp/alpha_processing_neon.c @@ -0,0 +1,191 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Utilities for processing transparent channel, NEON version. +// +// Author: Skal (pascal.massimino@gmail.com) + +#include "./dsp.h" + +#if defined(WEBP_USE_NEON) + +#include "./neon.h" + +//------------------------------------------------------------------------------ + +#define MULTIPLIER(a) ((a) * 0x8081) +#define PREMULTIPLY(x, m) (((x) * (m)) >> 23) + +#define MULTIPLY_BY_ALPHA(V, ALPHA, OTHER) do { \ + const uint8x8_t alpha = (V).val[(ALPHA)]; \ + const uint16x8_t r1 = vmull_u8((V).val[1], alpha); \ + const uint16x8_t g1 = vmull_u8((V).val[2], alpha); \ + const uint16x8_t b1 = vmull_u8((V).val[(OTHER)], alpha); \ + /* we use: v / 255 = (v + 1 + (v >> 8)) >> 8 */ \ + const uint16x8_t r2 = vsraq_n_u16(r1, r1, 8); \ + const uint16x8_t g2 = vsraq_n_u16(g1, g1, 8); \ + const uint16x8_t b2 = vsraq_n_u16(b1, b1, 8); \ + const uint16x8_t r3 = vaddq_u16(r2, kOne); \ + const uint16x8_t g3 = vaddq_u16(g2, kOne); \ + const uint16x8_t b3 = vaddq_u16(b2, kOne); \ + (V).val[1] = vshrn_n_u16(r3, 8); \ + (V).val[2] = vshrn_n_u16(g3, 8); \ + (V).val[(OTHER)] = vshrn_n_u16(b3, 8); \ +} while (0) + +static void ApplyAlphaMultiply_NEON(uint8_t* rgba, int alpha_first, + int w, int h, int stride) { + const uint16x8_t kOne = vdupq_n_u16(1u); + while (h-- > 0) { + uint32_t* const rgbx = (uint32_t*)rgba; + int i = 0; + if (alpha_first) { + for (; i + 8 <= w; i += 8) { + // load aaaa...|rrrr...|gggg...|bbbb... + uint8x8x4_t RGBX = vld4_u8((const uint8_t*)(rgbx + i)); + MULTIPLY_BY_ALPHA(RGBX, 0, 3); + vst4_u8((uint8_t*)(rgbx + i), RGBX); + } + } else { + for (; i + 8 <= w; i += 8) { + uint8x8x4_t RGBX = vld4_u8((const uint8_t*)(rgbx + i)); + MULTIPLY_BY_ALPHA(RGBX, 3, 0); + vst4_u8((uint8_t*)(rgbx + i), RGBX); + } + } + // Finish with left-overs. + for (; i < w; ++i) { + uint8_t* const rgb = rgba + (alpha_first ? 1 : 0); + const uint8_t* const alpha = rgba + (alpha_first ? 0 : 3); + const uint32_t a = alpha[4 * i]; + if (a != 0xff) { + const uint32_t mult = MULTIPLIER(a); + rgb[4 * i + 0] = PREMULTIPLY(rgb[4 * i + 0], mult); + rgb[4 * i + 1] = PREMULTIPLY(rgb[4 * i + 1], mult); + rgb[4 * i + 2] = PREMULTIPLY(rgb[4 * i + 2], mult); + } + } + rgba += stride; + } +} +#undef MULTIPLY_BY_ALPHA +#undef MULTIPLIER +#undef PREMULTIPLY + +//------------------------------------------------------------------------------ + +static int DispatchAlpha_NEON(const uint8_t* alpha, int alpha_stride, + int width, int height, + uint8_t* dst, int dst_stride) { + uint32_t alpha_mask = 0xffffffffu; + uint8x8_t mask8 = vdup_n_u8(0xff); + uint32_t tmp[2]; + int i, j; + for (j = 0; j < height; ++j) { + // We don't know if alpha is first or last in dst[] (depending on rgbA/Argb + // mode). So we must be sure dst[4*i + 8 - 1] is writable for the store. + // Hence the test with 'width - 1' instead of just 'width'. + for (i = 0; i + 8 <= width - 1; i += 8) { + uint8x8x4_t rgbX = vld4_u8((const uint8_t*)(dst + 4 * i)); + const uint8x8_t alphas = vld1_u8(alpha + i); + rgbX.val[0] = alphas; + vst4_u8((uint8_t*)(dst + 4 * i), rgbX); + mask8 = vand_u8(mask8, alphas); + } + for (; i < width; ++i) { + const uint32_t alpha_value = alpha[i]; + dst[4 * i] = alpha_value; + alpha_mask &= alpha_value; + } + alpha += alpha_stride; + dst += dst_stride; + } + vst1_u8((uint8_t*)tmp, mask8); + alpha_mask &= tmp[0]; + alpha_mask &= tmp[1]; + return (alpha_mask != 0xffffffffu); +} + +static void DispatchAlphaToGreen_NEON(const uint8_t* alpha, int alpha_stride, + int width, int height, + uint32_t* dst, int dst_stride) { + int i, j; + uint8x8x4_t greens; // leave A/R/B channels zero'd. + greens.val[0] = vdup_n_u8(0); + greens.val[2] = vdup_n_u8(0); + greens.val[3] = vdup_n_u8(0); + for (j = 0; j < height; ++j) { + for (i = 0; i + 8 <= width; i += 8) { + greens.val[1] = vld1_u8(alpha + i); + vst4_u8((uint8_t*)(dst + i), greens); + } + for (; i < width; ++i) dst[i] = alpha[i] << 8; + alpha += alpha_stride; + dst += dst_stride; + } +} + +static int ExtractAlpha_NEON(const uint8_t* argb, int argb_stride, + int width, int height, + uint8_t* alpha, int alpha_stride) { + uint32_t alpha_mask = 0xffffffffu; + uint8x8_t mask8 = vdup_n_u8(0xff); + uint32_t tmp[2]; + int i, j; + for (j = 0; j < height; ++j) { + // We don't know if alpha is first or last in dst[] (depending on rgbA/Argb + // mode). So we must be sure dst[4*i + 8 - 1] is writable for the store. + // Hence the test with 'width - 1' instead of just 'width'. + for (i = 0; i + 8 <= width - 1; i += 8) { + const uint8x8x4_t rgbX = vld4_u8((const uint8_t*)(argb + 4 * i)); + const uint8x8_t alphas = rgbX.val[0]; + vst1_u8((uint8_t*)(alpha + i), alphas); + mask8 = vand_u8(mask8, alphas); + } + for (; i < width; ++i) { + alpha[i] = argb[4 * i]; + alpha_mask &= alpha[i]; + } + argb += argb_stride; + alpha += alpha_stride; + } + vst1_u8((uint8_t*)tmp, mask8); + alpha_mask &= tmp[0]; + alpha_mask &= tmp[1]; + return (alpha_mask == 0xffffffffu); +} + +static void ExtractGreen_NEON(const uint32_t* argb, + uint8_t* alpha, int size) { + int i; + for (i = 0; i + 16 <= size; i += 16) { + const uint8x16x4_t rgbX = vld4q_u8((const uint8_t*)(argb + i)); + const uint8x16_t greens = rgbX.val[1]; + vst1q_u8(alpha + i, greens); + } + for (; i < size; ++i) alpha[i] = (argb[i] >> 8) & 0xff; +} + +//------------------------------------------------------------------------------ + +extern void WebPInitAlphaProcessingNEON(void); + +WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingNEON(void) { + WebPApplyAlphaMultiply = ApplyAlphaMultiply_NEON; + WebPDispatchAlpha = DispatchAlpha_NEON; + WebPDispatchAlphaToGreen = DispatchAlphaToGreen_NEON; + WebPExtractAlpha = ExtractAlpha_NEON; + WebPExtractGreen = ExtractGreen_NEON; +} + +#else // !WEBP_USE_NEON + +WEBP_DSP_INIT_STUB(WebPInitAlphaProcessingNEON) + +#endif // WEBP_USE_NEON diff --git a/thirdparty/libwebp/dsp/alpha_processing_sse2.c b/thirdparty/libwebp/dsp/alpha_processing_sse2.c index 5acb481dcd..83dc559fac 100644 --- a/thirdparty/libwebp/dsp/alpha_processing_sse2.c +++ b/thirdparty/libwebp/dsp/alpha_processing_sse2.c @@ -150,46 +150,46 @@ static int ExtractAlpha(const uint8_t* argb, int argb_stride, #define PREMULTIPLY(x, m) (((x) * (m)) >> 23) // We can't use a 'const int' for the SHUFFLE value, because it has to be an -// immediate in the _mm_shufflexx_epi16() instruction. We really a macro here. -#define APPLY_ALPHA(RGBX, SHUFFLE, MASK, MULT) do { \ - const __m128i argb0 = _mm_loadl_epi64((__m128i*)&(RGBX)); \ - const __m128i argb1 = _mm_unpacklo_epi8(argb0, zero); \ - const __m128i alpha0 = _mm_and_si128(argb1, MASK); \ - const __m128i alpha1 = _mm_shufflelo_epi16(alpha0, SHUFFLE); \ - const __m128i alpha2 = _mm_shufflehi_epi16(alpha1, SHUFFLE); \ - /* alpha2 = [0 a0 a0 a0][0 a1 a1 a1] */ \ - const __m128i scale0 = _mm_mullo_epi16(alpha2, MULT); \ - const __m128i scale1 = _mm_mulhi_epu16(alpha2, MULT); \ - const __m128i argb2 = _mm_mulhi_epu16(argb1, scale0); \ - const __m128i argb3 = _mm_mullo_epi16(argb1, scale1); \ - const __m128i argb4 = _mm_adds_epu16(argb2, argb3); \ - const __m128i argb5 = _mm_srli_epi16(argb4, 7); \ - const __m128i argb6 = _mm_or_si128(argb5, alpha0); \ - const __m128i argb7 = _mm_packus_epi16(argb6, zero); \ - _mm_storel_epi64((__m128i*)&(RGBX), argb7); \ +// immediate in the _mm_shufflexx_epi16() instruction. We really need a macro. +// We use: v / 255 = (v * 0x8081) >> 23, where v = alpha * {r,g,b} is a 16bit +// value. +#define APPLY_ALPHA(RGBX, SHUFFLE) do { \ + const __m128i argb0 = _mm_loadu_si128((const __m128i*)&(RGBX)); \ + const __m128i argb1_lo = _mm_unpacklo_epi8(argb0, zero); \ + const __m128i argb1_hi = _mm_unpackhi_epi8(argb0, zero); \ + const __m128i alpha0_lo = _mm_or_si128(argb1_lo, kMask); \ + const __m128i alpha0_hi = _mm_or_si128(argb1_hi, kMask); \ + const __m128i alpha1_lo = _mm_shufflelo_epi16(alpha0_lo, SHUFFLE); \ + const __m128i alpha1_hi = _mm_shufflelo_epi16(alpha0_hi, SHUFFLE); \ + const __m128i alpha2_lo = _mm_shufflehi_epi16(alpha1_lo, SHUFFLE); \ + const __m128i alpha2_hi = _mm_shufflehi_epi16(alpha1_hi, SHUFFLE); \ + /* alpha2 = [ff a0 a0 a0][ff a1 a1 a1] */ \ + const __m128i A0_lo = _mm_mullo_epi16(alpha2_lo, argb1_lo); \ + const __m128i A0_hi = _mm_mullo_epi16(alpha2_hi, argb1_hi); \ + const __m128i A1_lo = _mm_mulhi_epu16(A0_lo, kMult); \ + const __m128i A1_hi = _mm_mulhi_epu16(A0_hi, kMult); \ + const __m128i A2_lo = _mm_srli_epi16(A1_lo, 7); \ + const __m128i A2_hi = _mm_srli_epi16(A1_hi, 7); \ + const __m128i A3 = _mm_packus_epi16(A2_lo, A2_hi); \ + _mm_storeu_si128((__m128i*)&(RGBX), A3); \ } while (0) -static void ApplyAlphaMultiply(uint8_t* rgba, int alpha_first, - int w, int h, int stride) { +static void ApplyAlphaMultiply_SSE2(uint8_t* rgba, int alpha_first, + int w, int h, int stride) { const __m128i zero = _mm_setzero_si128(); - const int kSpan = 2; - const int w2 = w & ~(kSpan - 1); + const __m128i kMult = _mm_set1_epi16(0x8081u); + const __m128i kMask = _mm_set_epi16(0, 0xff, 0xff, 0, 0, 0xff, 0xff, 0); + const int kSpan = 4; while (h-- > 0) { uint32_t* const rgbx = (uint32_t*)rgba; int i; if (!alpha_first) { - const __m128i kMask = _mm_set_epi16(0xff, 0, 0, 0, 0xff, 0, 0, 0); - const __m128i kMult = - _mm_set_epi16(0, 0x8081, 0x8081, 0x8081, 0, 0x8081, 0x8081, 0x8081); - for (i = 0; i < w2; i += kSpan) { - APPLY_ALPHA(rgbx[i], _MM_SHUFFLE(0, 3, 3, 3), kMask, kMult); + for (i = 0; i + kSpan <= w; i += kSpan) { + APPLY_ALPHA(rgbx[i], _MM_SHUFFLE(2, 3, 3, 3)); } } else { - const __m128i kMask = _mm_set_epi16(0, 0, 0, 0xff, 0, 0, 0, 0xff); - const __m128i kMult = - _mm_set_epi16(0x8081, 0x8081, 0x8081, 0, 0x8081, 0x8081, 0x8081, 0); - for (i = 0; i < w2; i += kSpan) { - APPLY_ALPHA(rgbx[i], _MM_SHUFFLE(0, 0, 0, 3), kMask, kMult); + for (i = 0; i + kSpan <= w; i += kSpan) { + APPLY_ALPHA(rgbx[i], _MM_SHUFFLE(0, 0, 0, 1)); } } // Finish with left-overs. @@ -213,64 +213,51 @@ static void ApplyAlphaMultiply(uint8_t* rgba, int alpha_first, // ----------------------------------------------------------------------------- // Apply alpha value to rows -// We use: kINV255 = (1 << 24) / 255 = 0x010101 -// So: a * kINV255 = (a << 16) | [(a << 8) | a] -// -> _mm_mulhi_epu16() takes care of the (a<<16) part, -// and _mm_mullo_epu16(a * 0x0101,...) takes care of the "(a << 8) | a" one. - -static void MultARGBRow(uint32_t* const ptr, int width, int inverse) { +static void MultARGBRow_SSE2(uint32_t* const ptr, int width, int inverse) { int x = 0; if (!inverse) { const int kSpan = 2; const __m128i zero = _mm_setzero_si128(); - const __m128i kRound = - _mm_set_epi16(0, 1 << 7, 1 << 7, 1 << 7, 0, 1 << 7, 1 << 7, 1 << 7); - const __m128i kMult = - _mm_set_epi16(0, 0x0101, 0x0101, 0x0101, 0, 0x0101, 0x0101, 0x0101); - const __m128i kOne64 = _mm_set_epi16(1u << 8, 0, 0, 0, 1u << 8, 0, 0, 0); - const int w2 = width & ~(kSpan - 1); - for (x = 0; x < w2; x += kSpan) { - const __m128i argb0 = _mm_loadl_epi64((__m128i*)&ptr[x]); - const __m128i argb1 = _mm_unpacklo_epi8(argb0, zero); - const __m128i tmp0 = _mm_shufflelo_epi16(argb1, _MM_SHUFFLE(3, 3, 3, 3)); - const __m128i tmp1 = _mm_shufflehi_epi16(tmp0, _MM_SHUFFLE(3, 3, 3, 3)); - const __m128i tmp2 = _mm_srli_epi64(tmp1, 16); - const __m128i scale0 = _mm_mullo_epi16(tmp1, kMult); - const __m128i scale1 = _mm_or_si128(tmp2, kOne64); - const __m128i argb2 = _mm_mulhi_epu16(argb1, scale0); - const __m128i argb3 = _mm_mullo_epi16(argb1, scale1); - const __m128i argb4 = _mm_adds_epu16(argb2, argb3); - const __m128i argb5 = _mm_adds_epu16(argb4, kRound); - const __m128i argb6 = _mm_srli_epi16(argb5, 8); - const __m128i argb7 = _mm_packus_epi16(argb6, zero); - _mm_storel_epi64((__m128i*)&ptr[x], argb7); + const __m128i k128 = _mm_set1_epi16(128); + const __m128i kMult = _mm_set1_epi16(0x0101); + const __m128i kMask = _mm_set_epi16(0, 0xff, 0, 0, 0, 0xff, 0, 0); + for (x = 0; x + kSpan <= width; x += kSpan) { + // To compute 'result = (int)(a * x / 255. + .5)', we use: + // tmp = a * v + 128, result = (tmp * 0x0101u) >> 16 + const __m128i A0 = _mm_loadl_epi64((const __m128i*)&ptr[x]); + const __m128i A1 = _mm_unpacklo_epi8(A0, zero); + const __m128i A2 = _mm_or_si128(A1, kMask); + const __m128i A3 = _mm_shufflelo_epi16(A2, _MM_SHUFFLE(2, 3, 3, 3)); + const __m128i A4 = _mm_shufflehi_epi16(A3, _MM_SHUFFLE(2, 3, 3, 3)); + // here, A4 = [ff a0 a0 a0][ff a1 a1 a1] + const __m128i A5 = _mm_mullo_epi16(A4, A1); + const __m128i A6 = _mm_add_epi16(A5, k128); + const __m128i A7 = _mm_mulhi_epu16(A6, kMult); + const __m128i A10 = _mm_packus_epi16(A7, zero); + _mm_storel_epi64((__m128i*)&ptr[x], A10); } } width -= x; if (width > 0) WebPMultARGBRowC(ptr + x, width, inverse); } -static void MultRow(uint8_t* const ptr, const uint8_t* const alpha, - int width, int inverse) { +static void MultRow_SSE2(uint8_t* const ptr, const uint8_t* const alpha, + int width, int inverse) { int x = 0; if (!inverse) { - const int kSpan = 8; const __m128i zero = _mm_setzero_si128(); - const __m128i kRound = _mm_set1_epi16(1 << 7); - const int w2 = width & ~(kSpan - 1); - for (x = 0; x < w2; x += kSpan) { + const __m128i k128 = _mm_set1_epi16(128); + const __m128i kMult = _mm_set1_epi16(0x0101); + for (x = 0; x + 8 <= width; x += 8) { const __m128i v0 = _mm_loadl_epi64((__m128i*)&ptr[x]); + const __m128i a0 = _mm_loadl_epi64((const __m128i*)&alpha[x]); const __m128i v1 = _mm_unpacklo_epi8(v0, zero); - const __m128i alpha0 = _mm_loadl_epi64((const __m128i*)&alpha[x]); - const __m128i alpha1 = _mm_unpacklo_epi8(alpha0, zero); - const __m128i alpha2 = _mm_unpacklo_epi8(alpha0, alpha0); - const __m128i v2 = _mm_mulhi_epu16(v1, alpha2); - const __m128i v3 = _mm_mullo_epi16(v1, alpha1); - const __m128i v4 = _mm_adds_epu16(v2, v3); - const __m128i v5 = _mm_adds_epu16(v4, kRound); - const __m128i v6 = _mm_srli_epi16(v5, 8); - const __m128i v7 = _mm_packus_epi16(v6, zero); - _mm_storel_epi64((__m128i*)&ptr[x], v7); + const __m128i a1 = _mm_unpacklo_epi8(a0, zero); + const __m128i v2 = _mm_mullo_epi16(v1, a1); + const __m128i v3 = _mm_add_epi16(v2, k128); + const __m128i v4 = _mm_mulhi_epu16(v3, kMult); + const __m128i v5 = _mm_packus_epi16(v4, zero); + _mm_storel_epi64((__m128i*)&ptr[x], v5); } } width -= x; @@ -283,9 +270,9 @@ static void MultRow(uint8_t* const ptr, const uint8_t* const alpha, extern void WebPInitAlphaProcessingSSE2(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE2(void) { - WebPMultARGBRow = MultARGBRow; - WebPMultRow = MultRow; - WebPApplyAlphaMultiply = ApplyAlphaMultiply; + WebPMultARGBRow = MultARGBRow_SSE2; + WebPMultRow = MultRow_SSE2; + WebPApplyAlphaMultiply = ApplyAlphaMultiply_SSE2; WebPDispatchAlpha = DispatchAlpha; WebPDispatchAlphaToGreen = DispatchAlphaToGreen; WebPExtractAlpha = ExtractAlpha; diff --git a/thirdparty/libwebp/dsp/common_sse2.h b/thirdparty/libwebp/dsp/common_sse2.h index 7cea13fb3c..995d7cf4ea 100644 --- a/thirdparty/libwebp/dsp/common_sse2.h +++ b/thirdparty/libwebp/dsp/common_sse2.h @@ -100,6 +100,91 @@ static WEBP_INLINE void VP8Transpose_2_4x4_16b( // a03 a13 a23 a33 b03 b13 b23 b33 } +//------------------------------------------------------------------------------ +// Channel mixing. + +// Function used several times in VP8PlanarTo24b. +// It samples the in buffer as follows: one every two unsigned char is stored +// at the beginning of the buffer, while the other half is stored at the end. +#define VP8PlanarTo24bHelper(IN, OUT) \ + do { \ + const __m128i v_mask = _mm_set1_epi16(0x00ff); \ + /* Take one every two upper 8b values.*/ \ + (OUT##0) = _mm_packus_epi16(_mm_and_si128((IN##0), v_mask), \ + _mm_and_si128((IN##1), v_mask)); \ + (OUT##1) = _mm_packus_epi16(_mm_and_si128((IN##2), v_mask), \ + _mm_and_si128((IN##3), v_mask)); \ + (OUT##2) = _mm_packus_epi16(_mm_and_si128((IN##4), v_mask), \ + _mm_and_si128((IN##5), v_mask)); \ + /* Take one every two lower 8b values.*/ \ + (OUT##3) = _mm_packus_epi16(_mm_srli_epi16((IN##0), 8), \ + _mm_srli_epi16((IN##1), 8)); \ + (OUT##4) = _mm_packus_epi16(_mm_srli_epi16((IN##2), 8), \ + _mm_srli_epi16((IN##3), 8)); \ + (OUT##5) = _mm_packus_epi16(_mm_srli_epi16((IN##4), 8), \ + _mm_srli_epi16((IN##5), 8)); \ + } while (0) + +// Pack the planar buffers +// rrrr... rrrr... gggg... gggg... bbbb... bbbb.... +// triplet by triplet in the output buffer rgb as rgbrgbrgbrgb ... +static WEBP_INLINE void VP8PlanarTo24b(__m128i* const in0, __m128i* const in1, + __m128i* const in2, __m128i* const in3, + __m128i* const in4, __m128i* const in5) { + // The input is 6 registers of sixteen 8b but for the sake of explanation, + // let's take 6 registers of four 8b values. + // To pack, we will keep taking one every two 8b integer and move it + // around as follows: + // Input: + // r0r1r2r3 | r4r5r6r7 | g0g1g2g3 | g4g5g6g7 | b0b1b2b3 | b4b5b6b7 + // Split the 6 registers in two sets of 3 registers: the first set as the even + // 8b bytes, the second the odd ones: + // r0r2r4r6 | g0g2g4g6 | b0b2b4b6 | r1r3r5r7 | g1g3g5g7 | b1b3b5b7 + // Repeat the same permutations twice more: + // r0r4g0g4 | b0b4r1r5 | g1g5b1b5 | r2r6g2g6 | b2b6r3r7 | g3g7b3b7 + // r0g0b0r1 | g1b1r2g2 | b2r3g3b3 | r4g4b4r5 | g5b5r6g6 | b6r7g7b7 + __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + VP8PlanarTo24bHelper(*in, tmp); + VP8PlanarTo24bHelper(tmp, *in); + VP8PlanarTo24bHelper(*in, tmp); + // We need to do it two more times than the example as we have sixteen bytes. + { + __m128i out0, out1, out2, out3, out4, out5; + VP8PlanarTo24bHelper(tmp, out); + VP8PlanarTo24bHelper(out, *in); + } +} + +#undef VP8PlanarTo24bHelper + +// Convert four packed four-channel buffers like argbargbargbargb... into the +// split channels aaaaa ... rrrr ... gggg .... bbbbb ...... +static WEBP_INLINE void VP8L32bToPlanar(__m128i* const in0, + __m128i* const in1, + __m128i* const in2, + __m128i* const in3) { + // Column-wise transpose. + const __m128i A0 = _mm_unpacklo_epi8(*in0, *in1); + const __m128i A1 = _mm_unpackhi_epi8(*in0, *in1); + const __m128i A2 = _mm_unpacklo_epi8(*in2, *in3); + const __m128i A3 = _mm_unpackhi_epi8(*in2, *in3); + const __m128i B0 = _mm_unpacklo_epi8(A0, A1); + const __m128i B1 = _mm_unpackhi_epi8(A0, A1); + const __m128i B2 = _mm_unpacklo_epi8(A2, A3); + const __m128i B3 = _mm_unpackhi_epi8(A2, A3); + // C0 = g7 g6 ... g1 g0 | b7 b6 ... b1 b0 + // C1 = a7 a6 ... a1 a0 | r7 r6 ... r1 r0 + const __m128i C0 = _mm_unpacklo_epi8(B0, B1); + const __m128i C1 = _mm_unpackhi_epi8(B0, B1); + const __m128i C2 = _mm_unpacklo_epi8(B2, B3); + const __m128i C3 = _mm_unpackhi_epi8(B2, B3); + // Gather the channels. + *in0 = _mm_unpackhi_epi64(C1, C3); + *in1 = _mm_unpacklo_epi64(C1, C3); + *in2 = _mm_unpackhi_epi64(C0, C2); + *in3 = _mm_unpacklo_epi64(C0, C2); +} + #endif // WEBP_USE_SSE2 #ifdef __cplusplus diff --git a/thirdparty/libwebp/dsp/cost.c b/thirdparty/libwebp/dsp/cost.c index fe72d26e79..58ddea7248 100644 --- a/thirdparty/libwebp/dsp/cost.c +++ b/thirdparty/libwebp/dsp/cost.c @@ -10,7 +10,7 @@ // Author: Skal (pascal.massimino@gmail.com) #include "./dsp.h" -#include "../enc/cost.h" +#include "../enc/cost_enc.h" //------------------------------------------------------------------------------ // Boolean-cost cost table diff --git a/thirdparty/libwebp/dsp/cost_mips32.c b/thirdparty/libwebp/dsp/cost_mips32.c index d1e240e191..3102da877a 100644 --- a/thirdparty/libwebp/dsp/cost_mips32.c +++ b/thirdparty/libwebp/dsp/cost_mips32.c @@ -13,7 +13,7 @@ #if defined(WEBP_USE_MIPS32) -#include "../enc/cost.h" +#include "../enc/cost_enc.h" static int GetResidualCost(int ctx0, const VP8Residual* const res) { int temp0, temp1; diff --git a/thirdparty/libwebp/dsp/cost_mips_dsp_r2.c b/thirdparty/libwebp/dsp/cost_mips_dsp_r2.c index ce64067756..6ec8aeb610 100644 --- a/thirdparty/libwebp/dsp/cost_mips_dsp_r2.c +++ b/thirdparty/libwebp/dsp/cost_mips_dsp_r2.c @@ -13,7 +13,7 @@ #if defined(WEBP_USE_MIPS_DSP_R2) -#include "../enc/cost.h" +#include "../enc/cost_enc.h" static int GetResidualCost(int ctx0, const VP8Residual* const res) { int temp0, temp1; diff --git a/thirdparty/libwebp/dsp/cost_sse2.c b/thirdparty/libwebp/dsp/cost_sse2.c index 0cb1c1fa04..421d51fdd5 100644 --- a/thirdparty/libwebp/dsp/cost_sse2.c +++ b/thirdparty/libwebp/dsp/cost_sse2.c @@ -16,8 +16,8 @@ #if defined(WEBP_USE_SSE2) #include <emmintrin.h> -#include "../enc/cost.h" -#include "../enc/vp8enci.h" +#include "../enc/cost_enc.h" +#include "../enc/vp8i_enc.h" #include "../utils/utils.h" //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/dsp/cpu.c b/thirdparty/libwebp/dsp/cpu.c index cbb08db90a..b5583b6e9b 100644 --- a/thirdparty/libwebp/dsp/cpu.c +++ b/thirdparty/libwebp/dsp/cpu.c @@ -95,26 +95,62 @@ static WEBP_INLINE uint64_t xgetbv(void) { #endif #if defined(__i386__) || defined(__x86_64__) || defined(WEBP_MSC_SSE2) + +// helper function for run-time detection of slow SSSE3 platforms +static int CheckSlowModel(int info) { + // Table listing display models with longer latencies for the bsr instruction + // (ie 2 cycles vs 10/16 cycles) and some SSSE3 instructions like pshufb. + // Refer to Intel 64 and IA-32 Architectures Optimization Reference Manual. + static const uint8_t kSlowModels[] = { + 0x37, 0x4a, 0x4d, // Silvermont Microarchitecture + 0x1c, 0x26, 0x27 // Atom Microarchitecture + }; + const uint32_t model = ((info & 0xf0000) >> 12) | ((info >> 4) & 0xf); + const uint32_t family = (info >> 8) & 0xf; + if (family == 0x06) { + size_t i; + for (i = 0; i < sizeof(kSlowModels) / sizeof(kSlowModels[0]); ++i) { + if (model == kSlowModels[i]) return 1; + } + } + return 0; +} + static int x86CPUInfo(CPUFeature feature) { int max_cpuid_value; int cpu_info[4]; + int is_intel = 0; // get the highest feature value cpuid supports GetCPUInfo(cpu_info, 0); max_cpuid_value = cpu_info[0]; if (max_cpuid_value < 1) { return 0; + } else { + const int VENDOR_ID_INTEL_EBX = 0x756e6547; // uneG + const int VENDOR_ID_INTEL_EDX = 0x49656e69; // Ieni + const int VENDOR_ID_INTEL_ECX = 0x6c65746e; // letn + is_intel = (cpu_info[1] == VENDOR_ID_INTEL_EBX && + cpu_info[2] == VENDOR_ID_INTEL_ECX && + cpu_info[3] == VENDOR_ID_INTEL_EDX); // genuine Intel? } GetCPUInfo(cpu_info, 1); if (feature == kSSE2) { - return 0 != (cpu_info[3] & 0x04000000); + return !!(cpu_info[3] & (1 << 26)); } if (feature == kSSE3) { - return 0 != (cpu_info[2] & 0x00000001); + return !!(cpu_info[2] & (1 << 0)); + } + if (feature == kSlowSSSE3) { + if (is_intel && (cpu_info[2] & (1 << 0))) { // SSSE3? + return CheckSlowModel(cpu_info[0]); + } + return 0; } + if (feature == kSSE4_1) { - return 0 != (cpu_info[2] & 0x00080000); + return !!(cpu_info[2] & (1 << 19)); } if (feature == kAVX) { // bits 27 (OSXSAVE) & 28 (256-bit AVX) @@ -126,7 +162,7 @@ static int x86CPUInfo(CPUFeature feature) { if (feature == kAVX2) { if (x86CPUInfo(kAVX) && max_cpuid_value >= 7) { GetCPUInfo(cpu_info, 7); - return ((cpu_info[1] & 0x00000020) == 0x00000020); + return !!(cpu_info[1] & (1 << 5)); } } return 0; @@ -184,4 +220,3 @@ VP8CPUInfo VP8GetCPUInfo = mipsCPUInfo; #else VP8CPUInfo VP8GetCPUInfo = NULL; #endif - diff --git a/thirdparty/libwebp/dsp/dec.c b/thirdparty/libwebp/dsp/dec.c index 49bd16d976..007e985d8b 100644 --- a/thirdparty/libwebp/dsp/dec.c +++ b/thirdparty/libwebp/dsp/dec.c @@ -12,7 +12,7 @@ // Author: Skal (pascal.massimino@gmail.com) #include "./dsp.h" -#include "../dec/vp8i.h" +#include "../dec/vp8i_dec.h" #include "../utils/utils.h" //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/dsp/dec_clip_tables.c b/thirdparty/libwebp/dsp/dec_clip_tables.c index 3b6dde86ba..74ba34c0bb 100644 --- a/thirdparty/libwebp/dsp/dec_clip_tables.c +++ b/thirdparty/libwebp/dsp/dec_clip_tables.c @@ -63,7 +63,7 @@ static const uint8_t abs0[255 + 255 + 1] = { 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -static const int8_t sclip1[1020 + 1020 + 1] = { +static const uint8_t sclip1[1020 + 1020 + 1] = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, @@ -236,7 +236,7 @@ static const int8_t sclip1[1020 + 1020 + 1] = { 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f }; -static const int8_t sclip2[112 + 112 + 1] = { +static const uint8_t sclip2[112 + 112 + 1] = { 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, @@ -339,8 +339,8 @@ static volatile int tables_ok = 0; #endif -const int8_t* const VP8ksclip1 = &sclip1[1020]; -const int8_t* const VP8ksclip2 = &sclip2[112]; +const int8_t* const VP8ksclip1 = (const int8_t*)&sclip1[1020]; +const int8_t* const VP8ksclip2 = (const int8_t*)&sclip2[112]; const uint8_t* const VP8kclip1 = &clip1[255]; const uint8_t* const VP8kabs0 = &abs0[255]; diff --git a/thirdparty/libwebp/dsp/dec_msa.c b/thirdparty/libwebp/dsp/dec_msa.c index f76055cab0..8d9c98c3cf 100644 --- a/thirdparty/libwebp/dsp/dec_msa.c +++ b/thirdparty/libwebp/dsp/dec_msa.c @@ -154,6 +154,820 @@ static void TransformAC3(const int16_t* in, uint8_t* dst) { } //------------------------------------------------------------------------------ +// Edge filtering functions + +#define FLIP_SIGN2(in0, in1, out0, out1) { \ + out0 = (v16i8)__msa_xori_b(in0, 0x80); \ + out1 = (v16i8)__msa_xori_b(in1, 0x80); \ +} + +#define FLIP_SIGN4(in0, in1, in2, in3, out0, out1, out2, out3) { \ + FLIP_SIGN2(in0, in1, out0, out1); \ + FLIP_SIGN2(in2, in3, out2, out3); \ +} + +#define FILT_VAL(q0_m, p0_m, mask, filt) do { \ + v16i8 q0_sub_p0; \ + q0_sub_p0 = __msa_subs_s_b(q0_m, p0_m); \ + filt = __msa_adds_s_b(filt, q0_sub_p0); \ + filt = __msa_adds_s_b(filt, q0_sub_p0); \ + filt = __msa_adds_s_b(filt, q0_sub_p0); \ + filt = filt & mask; \ +} while (0) + +#define FILT2(q_m, p_m, q, p) do { \ + u_r = SRAI_H(temp1, 7); \ + u_r = __msa_sat_s_h(u_r, 7); \ + u_l = SRAI_H(temp3, 7); \ + u_l = __msa_sat_s_h(u_l, 7); \ + u = __msa_pckev_b((v16i8)u_l, (v16i8)u_r); \ + q_m = __msa_subs_s_b(q_m, u); \ + p_m = __msa_adds_s_b(p_m, u); \ + q = __msa_xori_b((v16u8)q_m, 0x80); \ + p = __msa_xori_b((v16u8)p_m, 0x80); \ +} while (0) + +#define LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev) do { \ + v16i8 p1_m, p0_m, q0_m, q1_m; \ + v16i8 filt, t1, t2; \ + const v16i8 cnst4b = __msa_ldi_b(4); \ + const v16i8 cnst3b = __msa_ldi_b(3); \ + \ + FLIP_SIGN4(p1, p0, q0, q1, p1_m, p0_m, q0_m, q1_m); \ + filt = __msa_subs_s_b(p1_m, q1_m); \ + filt = filt & hev; \ + FILT_VAL(q0_m, p0_m, mask, filt); \ + t1 = __msa_adds_s_b(filt, cnst4b); \ + t1 = SRAI_B(t1, 3); \ + t2 = __msa_adds_s_b(filt, cnst3b); \ + t2 = SRAI_B(t2, 3); \ + q0_m = __msa_subs_s_b(q0_m, t1); \ + q0 = __msa_xori_b((v16u8)q0_m, 0x80); \ + p0_m = __msa_adds_s_b(p0_m, t2); \ + p0 = __msa_xori_b((v16u8)p0_m, 0x80); \ + filt = __msa_srari_b(t1, 1); \ + hev = __msa_xori_b(hev, 0xff); \ + filt = filt & hev; \ + q1_m = __msa_subs_s_b(q1_m, filt); \ + q1 = __msa_xori_b((v16u8)q1_m, 0x80); \ + p1_m = __msa_adds_s_b(p1_m, filt); \ + p1 = __msa_xori_b((v16u8)p1_m, 0x80); \ +} while (0) + +#define LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev) do { \ + v16i8 p2_m, p1_m, p0_m, q2_m, q1_m, q0_m; \ + v16i8 u, filt, t1, t2, filt_sign; \ + v8i16 filt_r, filt_l, u_r, u_l; \ + v8i16 temp0, temp1, temp2, temp3; \ + const v16i8 cnst4b = __msa_ldi_b(4); \ + const v16i8 cnst3b = __msa_ldi_b(3); \ + const v8i16 cnst9h = __msa_ldi_h(9); \ + \ + FLIP_SIGN4(p1, p0, q0, q1, p1_m, p0_m, q0_m, q1_m); \ + filt = __msa_subs_s_b(p1_m, q1_m); \ + FILT_VAL(q0_m, p0_m, mask, filt); \ + FLIP_SIGN2(p2, q2, p2_m, q2_m); \ + t2 = filt & hev; \ + /* filt_val &= ~hev */ \ + hev = __msa_xori_b(hev, 0xff); \ + filt = filt & hev; \ + t1 = __msa_adds_s_b(t2, cnst4b); \ + t1 = SRAI_B(t1, 3); \ + t2 = __msa_adds_s_b(t2, cnst3b); \ + t2 = SRAI_B(t2, 3); \ + q0_m = __msa_subs_s_b(q0_m, t1); \ + p0_m = __msa_adds_s_b(p0_m, t2); \ + filt_sign = __msa_clti_s_b(filt, 0); \ + ILVRL_B2_SH(filt_sign, filt, filt_r, filt_l); \ + /* update q2/p2 */ \ + temp0 = filt_r * cnst9h; \ + temp1 = ADDVI_H(temp0, 63); \ + temp2 = filt_l * cnst9h; \ + temp3 = ADDVI_H(temp2, 63); \ + FILT2(q2_m, p2_m, q2, p2); \ + /* update q1/p1 */ \ + temp1 = temp1 + temp0; \ + temp3 = temp3 + temp2; \ + FILT2(q1_m, p1_m, q1, p1); \ + /* update q0/p0 */ \ + temp1 = temp1 + temp0; \ + temp3 = temp3 + temp2; \ + FILT2(q0_m, p0_m, q0, p0); \ +} while (0) + +#define LPF_MASK_HEV(p3_in, p2_in, p1_in, p0_in, \ + q0_in, q1_in, q2_in, q3_in, \ + limit_in, b_limit_in, thresh_in, \ + hev_out, mask_out) do { \ + v16u8 p3_asub_p2_m, p2_asub_p1_m, p1_asub_p0_m, q1_asub_q0_m; \ + v16u8 p1_asub_q1_m, p0_asub_q0_m, q3_asub_q2_m, q2_asub_q1_m; \ + v16u8 flat_out; \ + \ + /* absolute subtraction of pixel values */ \ + p3_asub_p2_m = __msa_asub_u_b(p3_in, p2_in); \ + p2_asub_p1_m = __msa_asub_u_b(p2_in, p1_in); \ + p1_asub_p0_m = __msa_asub_u_b(p1_in, p0_in); \ + q1_asub_q0_m = __msa_asub_u_b(q1_in, q0_in); \ + q2_asub_q1_m = __msa_asub_u_b(q2_in, q1_in); \ + q3_asub_q2_m = __msa_asub_u_b(q3_in, q2_in); \ + p0_asub_q0_m = __msa_asub_u_b(p0_in, q0_in); \ + p1_asub_q1_m = __msa_asub_u_b(p1_in, q1_in); \ + /* calculation of hev */ \ + flat_out = __msa_max_u_b(p1_asub_p0_m, q1_asub_q0_m); \ + hev_out = (thresh_in < flat_out); \ + /* calculation of mask */ \ + p0_asub_q0_m = __msa_adds_u_b(p0_asub_q0_m, p0_asub_q0_m); \ + p1_asub_q1_m = SRAI_B(p1_asub_q1_m, 1); \ + p0_asub_q0_m = __msa_adds_u_b(p0_asub_q0_m, p1_asub_q1_m); \ + mask_out = (b_limit_in < p0_asub_q0_m); \ + mask_out = __msa_max_u_b(flat_out, mask_out); \ + p3_asub_p2_m = __msa_max_u_b(p3_asub_p2_m, p2_asub_p1_m); \ + mask_out = __msa_max_u_b(p3_asub_p2_m, mask_out); \ + q2_asub_q1_m = __msa_max_u_b(q2_asub_q1_m, q3_asub_q2_m); \ + mask_out = __msa_max_u_b(q2_asub_q1_m, mask_out); \ + mask_out = (limit_in < mask_out); \ + mask_out = __msa_xori_b(mask_out, 0xff); \ +} while (0) + +#define ST6x1_UB(in0, in0_idx, in1, in1_idx, pdst, stride) do { \ + const uint16_t tmp0_h = __msa_copy_s_h((v8i16)in1, in1_idx); \ + const uint32_t tmp0_w = __msa_copy_s_w((v4i32)in0, in0_idx); \ + SW(tmp0_w, pdst); \ + SH(tmp0_h, pdst + stride); \ +} while (0) + +#define ST6x4_UB(in0, start_in0_idx, in1, start_in1_idx, pdst, stride) do { \ + uint8_t* ptmp1 = (uint8_t*)pdst; \ + ST6x1_UB(in0, start_in0_idx, in1, start_in1_idx, ptmp1, 4); \ + ptmp1 += stride; \ + ST6x1_UB(in0, start_in0_idx + 1, in1, start_in1_idx + 1, ptmp1, 4); \ + ptmp1 += stride; \ + ST6x1_UB(in0, start_in0_idx + 2, in1, start_in1_idx + 2, ptmp1, 4); \ + ptmp1 += stride; \ + ST6x1_UB(in0, start_in0_idx + 3, in1, start_in1_idx + 3, ptmp1, 4); \ +} while (0) + +#define LPF_SIMPLE_FILT(p1_in, p0_in, q0_in, q1_in, mask) do { \ + v16i8 p1_m, p0_m, q0_m, q1_m, filt, filt1, filt2; \ + const v16i8 cnst4b = __msa_ldi_b(4); \ + const v16i8 cnst3b = __msa_ldi_b(3); \ + \ + FLIP_SIGN4(p1_in, p0_in, q0_in, q1_in, p1_m, p0_m, q0_m, q1_m); \ + filt = __msa_subs_s_b(p1_m, q1_m); \ + FILT_VAL(q0_m, p0_m, mask, filt); \ + filt1 = __msa_adds_s_b(filt, cnst4b); \ + filt1 = SRAI_B(filt1, 3); \ + filt2 = __msa_adds_s_b(filt, cnst3b); \ + filt2 = SRAI_B(filt2, 3); \ + q0_m = __msa_subs_s_b(q0_m, filt1); \ + p0_m = __msa_adds_s_b(p0_m, filt2); \ + q0_in = __msa_xori_b((v16u8)q0_m, 0x80); \ + p0_in = __msa_xori_b((v16u8)p0_m, 0x80); \ +} while (0) + +#define LPF_SIMPLE_MASK(p1, p0, q0, q1, b_limit, mask) do { \ + v16u8 p1_a_sub_q1, p0_a_sub_q0; \ + \ + p0_a_sub_q0 = __msa_asub_u_b(p0, q0); \ + p1_a_sub_q1 = __msa_asub_u_b(p1, q1); \ + p1_a_sub_q1 = (v16u8)__msa_srli_b((v16i8)p1_a_sub_q1, 1); \ + p0_a_sub_q0 = __msa_adds_u_b(p0_a_sub_q0, p0_a_sub_q0); \ + mask = __msa_adds_u_b(p0_a_sub_q0, p1_a_sub_q1); \ + mask = (mask <= b_limit); \ +} while (0) + +static void VFilter16(uint8_t* src, int stride, + int b_limit_in, int limit_in, int thresh_in) { + uint8_t* ptemp = src - 4 * stride; + v16u8 p3, p2, p1, p0, q3, q2, q1, q0; + v16u8 mask, hev; + const v16u8 thresh = (v16u8)__msa_fill_b(thresh_in); + const v16u8 limit = (v16u8)__msa_fill_b(limit_in); + const v16u8 b_limit = (v16u8)__msa_fill_b(b_limit_in); + + LD_UB8(ptemp, stride, p3, p2, p1, p0, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, + hev, mask); + LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev); + ptemp = src - 3 * stride; + ST_UB4(p2, p1, p0, q0, ptemp, stride); + ptemp += (4 * stride); + ST_UB2(q1, q2, ptemp, stride); +} + +static void HFilter16(uint8_t* src, int stride, + int b_limit_in, int limit_in, int thresh_in) { + uint8_t* ptmp = src - 4; + v16u8 p3, p2, p1, p0, q3, q2, q1, q0; + v16u8 mask, hev; + v16u8 row0, row1, row2, row3, row4, row5, row6, row7, row8; + v16u8 row9, row10, row11, row12, row13, row14, row15; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + const v16u8 b_limit = (v16u8)__msa_fill_b(b_limit_in); + const v16u8 limit = (v16u8)__msa_fill_b(limit_in); + const v16u8 thresh = (v16u8)__msa_fill_b(thresh_in); + + LD_UB8(ptmp, stride, row0, row1, row2, row3, row4, row5, row6, row7); + ptmp += (8 * stride); + LD_UB8(ptmp, stride, row8, row9, row10, row11, row12, row13, row14, row15); + TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, + row8, row9, row10, row11, row12, row13, row14, row15, + p3, p2, p1, p0, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, + hev, mask); + LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev); + ILVR_B2_SH(p1, p2, q0, p0, tmp0, tmp1); + ILVRL_H2_SH(tmp1, tmp0, tmp3, tmp4); + ILVL_B2_SH(p1, p2, q0, p0, tmp0, tmp1); + ILVRL_H2_SH(tmp1, tmp0, tmp6, tmp7); + ILVRL_B2_SH(q2, q1, tmp2, tmp5); + ptmp = src - 3; + ST6x1_UB(tmp3, 0, tmp2, 0, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp3, 1, tmp2, 1, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp3, 2, tmp2, 2, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp3, 3, tmp2, 3, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp4, 0, tmp2, 4, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp4, 1, tmp2, 5, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp4, 2, tmp2, 6, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp4, 3, tmp2, 7, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp6, 0, tmp5, 0, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp6, 1, tmp5, 1, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp6, 2, tmp5, 2, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp6, 3, tmp5, 3, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp7, 0, tmp5, 4, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp7, 1, tmp5, 5, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp7, 2, tmp5, 6, ptmp, 4); + ptmp += stride; + ST6x1_UB(tmp7, 3, tmp5, 7, ptmp, 4); +} + +// on three inner edges +static void VFilterHorEdge16i(uint8_t* src, int stride, + int b_limit, int limit, int thresh) { + v16u8 mask, hev; + v16u8 p3, p2, p1, p0, q3, q2, q1, q0; + const v16u8 thresh0 = (v16u8)__msa_fill_b(thresh); + const v16u8 b_limit0 = (v16u8)__msa_fill_b(b_limit); + const v16u8 limit0 = (v16u8)__msa_fill_b(limit); + + LD_UB8((src - 4 * stride), stride, p3, p2, p1, p0, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit0, b_limit0, thresh0, + hev, mask); + LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev); + ST_UB4(p1, p0, q0, q1, (src - 2 * stride), stride); +} + +static void VFilter16i(uint8_t* src_y, int stride, + int b_limit, int limit, int thresh) { + VFilterHorEdge16i(src_y + 4 * stride, stride, b_limit, limit, thresh); + VFilterHorEdge16i(src_y + 8 * stride, stride, b_limit, limit, thresh); + VFilterHorEdge16i(src_y + 12 * stride, stride, b_limit, limit, thresh); +} + +static void HFilterVertEdge16i(uint8_t* src, int stride, + int b_limit, int limit, int thresh) { + v16u8 mask, hev; + v16u8 p3, p2, p1, p0, q3, q2, q1, q0; + v16u8 row0, row1, row2, row3, row4, row5, row6, row7; + v16u8 row8, row9, row10, row11, row12, row13, row14, row15; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + const v16u8 thresh0 = (v16u8)__msa_fill_b(thresh); + const v16u8 b_limit0 = (v16u8)__msa_fill_b(b_limit); + const v16u8 limit0 = (v16u8)__msa_fill_b(limit); + + LD_UB8(src - 4, stride, row0, row1, row2, row3, row4, row5, row6, row7); + LD_UB8(src - 4 + (8 * stride), stride, + row8, row9, row10, row11, row12, row13, row14, row15); + TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, + row8, row9, row10, row11, row12, row13, row14, row15, + p3, p2, p1, p0, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit0, b_limit0, thresh0, + hev, mask); + LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev); + ILVR_B2_SH(p0, p1, q1, q0, tmp0, tmp1); + ILVRL_H2_SH(tmp1, tmp0, tmp2, tmp3); + ILVL_B2_SH(p0, p1, q1, q0, tmp0, tmp1); + ILVRL_H2_SH(tmp1, tmp0, tmp4, tmp5); + src -= 2; + ST4x8_UB(tmp2, tmp3, src, stride); + src += (8 * stride); + ST4x8_UB(tmp4, tmp5, src, stride); +} + +static void HFilter16i(uint8_t* src_y, int stride, + int b_limit, int limit, int thresh) { + HFilterVertEdge16i(src_y + 4, stride, b_limit, limit, thresh); + HFilterVertEdge16i(src_y + 8, stride, b_limit, limit, thresh); + HFilterVertEdge16i(src_y + 12, stride, b_limit, limit, thresh); +} + +// 8-pixels wide variants, for chroma filtering +static void VFilter8(uint8_t* src_u, uint8_t* src_v, int stride, + int b_limit_in, int limit_in, int thresh_in) { + uint8_t* ptmp_src_u = src_u - 4 * stride; + uint8_t* ptmp_src_v = src_v - 4 * stride; + uint64_t p2_d, p1_d, p0_d, q0_d, q1_d, q2_d; + v16u8 p3, p2, p1, p0, q3, q2, q1, q0, mask, hev; + v16u8 p3_u, p2_u, p1_u, p0_u, q3_u, q2_u, q1_u, q0_u; + v16u8 p3_v, p2_v, p1_v, p0_v, q3_v, q2_v, q1_v, q0_v; + const v16u8 b_limit = (v16u8)__msa_fill_b(b_limit_in); + const v16u8 limit = (v16u8)__msa_fill_b(limit_in); + const v16u8 thresh = (v16u8)__msa_fill_b(thresh_in); + + LD_UB8(ptmp_src_u, stride, p3_u, p2_u, p1_u, p0_u, q0_u, q1_u, q2_u, q3_u); + LD_UB8(ptmp_src_v, stride, p3_v, p2_v, p1_v, p0_v, q0_v, q1_v, q2_v, q3_v); + ILVR_D4_UB(p3_v, p3_u, p2_v, p2_u, p1_v, p1_u, p0_v, p0_u, p3, p2, p1, p0); + ILVR_D4_UB(q0_v, q0_u, q1_v, q1_u, q2_v, q2_u, q3_v, q3_u, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, + hev, mask); + LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev); + p2_d = __msa_copy_s_d((v2i64)p2, 0); + p1_d = __msa_copy_s_d((v2i64)p1, 0); + p0_d = __msa_copy_s_d((v2i64)p0, 0); + q0_d = __msa_copy_s_d((v2i64)q0, 0); + q1_d = __msa_copy_s_d((v2i64)q1, 0); + q2_d = __msa_copy_s_d((v2i64)q2, 0); + ptmp_src_u += stride; + SD4(p2_d, p1_d, p0_d, q0_d, ptmp_src_u, stride); + ptmp_src_u += (4 * stride); + SD(q1_d, ptmp_src_u); + ptmp_src_u += stride; + SD(q2_d, ptmp_src_u); + p2_d = __msa_copy_s_d((v2i64)p2, 1); + p1_d = __msa_copy_s_d((v2i64)p1, 1); + p0_d = __msa_copy_s_d((v2i64)p0, 1); + q0_d = __msa_copy_s_d((v2i64)q0, 1); + q1_d = __msa_copy_s_d((v2i64)q1, 1); + q2_d = __msa_copy_s_d((v2i64)q2, 1); + ptmp_src_v += stride; + SD4(p2_d, p1_d, p0_d, q0_d, ptmp_src_v, stride); + ptmp_src_v += (4 * stride); + SD(q1_d, ptmp_src_v); + ptmp_src_v += stride; + SD(q2_d, ptmp_src_v); +} + +static void HFilter8(uint8_t* src_u, uint8_t* src_v, int stride, + int b_limit_in, int limit_in, int thresh_in) { + uint8_t* ptmp_src_u = src_u - 4; + uint8_t* ptmp_src_v = src_v - 4; + v16u8 p3, p2, p1, p0, q3, q2, q1, q0, mask, hev; + v16u8 row0, row1, row2, row3, row4, row5, row6, row7, row8; + v16u8 row9, row10, row11, row12, row13, row14, row15; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + const v16u8 b_limit = (v16u8)__msa_fill_b(b_limit_in); + const v16u8 limit = (v16u8)__msa_fill_b(limit_in); + const v16u8 thresh = (v16u8)__msa_fill_b(thresh_in); + + LD_UB8(ptmp_src_u, stride, row0, row1, row2, row3, row4, row5, row6, row7); + LD_UB8(ptmp_src_v, stride, + row8, row9, row10, row11, row12, row13, row14, row15); + TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, + row8, row9, row10, row11, row12, row13, row14, row15, + p3, p2, p1, p0, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, + hev, mask); + LPF_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev); + ILVR_B2_SH(p1, p2, q0, p0, tmp0, tmp1); + ILVRL_H2_SH(tmp1, tmp0, tmp3, tmp4); + ILVL_B2_SH(p1, p2, q0, p0, tmp0, tmp1); + ILVRL_H2_SH(tmp1, tmp0, tmp6, tmp7); + ILVRL_B2_SH(q2, q1, tmp2, tmp5); + ptmp_src_u += 1; + ST6x4_UB(tmp3, 0, tmp2, 0, ptmp_src_u, stride); + ptmp_src_u += 4 * stride; + ST6x4_UB(tmp4, 0, tmp2, 4, ptmp_src_u, stride); + ptmp_src_v += 1; + ST6x4_UB(tmp6, 0, tmp5, 0, ptmp_src_v, stride); + ptmp_src_v += 4 * stride; + ST6x4_UB(tmp7, 0, tmp5, 4, ptmp_src_v, stride); +} + +static void VFilter8i(uint8_t* src_u, uint8_t* src_v, int stride, + int b_limit_in, int limit_in, int thresh_in) { + uint64_t p1_d, p0_d, q0_d, q1_d; + v16u8 p3, p2, p1, p0, q3, q2, q1, q0, mask, hev; + v16u8 p3_u, p2_u, p1_u, p0_u, q3_u, q2_u, q1_u, q0_u; + v16u8 p3_v, p2_v, p1_v, p0_v, q3_v, q2_v, q1_v, q0_v; + const v16u8 thresh = (v16u8)__msa_fill_b(thresh_in); + const v16u8 limit = (v16u8)__msa_fill_b(limit_in); + const v16u8 b_limit = (v16u8)__msa_fill_b(b_limit_in); + + LD_UB8(src_u, stride, p3_u, p2_u, p1_u, p0_u, q0_u, q1_u, q2_u, q3_u); + src_u += (5 * stride); + LD_UB8(src_v, stride, p3_v, p2_v, p1_v, p0_v, q0_v, q1_v, q2_v, q3_v); + src_v += (5 * stride); + ILVR_D4_UB(p3_v, p3_u, p2_v, p2_u, p1_v, p1_u, p0_v, p0_u, p3, p2, p1, p0); + ILVR_D4_UB(q0_v, q0_u, q1_v, q1_u, q2_v, q2_u, q3_v, q3_u, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, + hev, mask); + LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev); + p1_d = __msa_copy_s_d((v2i64)p1, 0); + p0_d = __msa_copy_s_d((v2i64)p0, 0); + q0_d = __msa_copy_s_d((v2i64)q0, 0); + q1_d = __msa_copy_s_d((v2i64)q1, 0); + SD4(q1_d, q0_d, p0_d, p1_d, src_u, -stride); + p1_d = __msa_copy_s_d((v2i64)p1, 1); + p0_d = __msa_copy_s_d((v2i64)p0, 1); + q0_d = __msa_copy_s_d((v2i64)q0, 1); + q1_d = __msa_copy_s_d((v2i64)q1, 1); + SD4(q1_d, q0_d, p0_d, p1_d, src_v, -stride); +} + +static void HFilter8i(uint8_t* src_u, uint8_t* src_v, int stride, + int b_limit_in, int limit_in, int thresh_in) { + v16u8 p3, p2, p1, p0, q3, q2, q1, q0, mask, hev; + v16u8 row0, row1, row2, row3, row4, row5, row6, row7, row8; + v16u8 row9, row10, row11, row12, row13, row14, row15; + v4i32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + const v16u8 thresh = (v16u8)__msa_fill_b(thresh_in); + const v16u8 limit = (v16u8)__msa_fill_b(limit_in); + const v16u8 b_limit = (v16u8)__msa_fill_b(b_limit_in); + + LD_UB8(src_u, stride, row0, row1, row2, row3, row4, row5, row6, row7); + LD_UB8(src_v, stride, + row8, row9, row10, row11, row12, row13, row14, row15); + TRANSPOSE16x8_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, + row8, row9, row10, row11, row12, row13, row14, row15, + p3, p2, p1, p0, q0, q1, q2, q3); + LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, + hev, mask); + LPF_FILTER4_4W(p1, p0, q0, q1, mask, hev); + ILVR_B2_SW(p0, p1, q1, q0, tmp0, tmp1); + ILVRL_H2_SW(tmp1, tmp0, tmp2, tmp3); + ILVL_B2_SW(p0, p1, q1, q0, tmp0, tmp1); + ILVRL_H2_SW(tmp1, tmp0, tmp4, tmp5); + src_u += 2; + ST4x4_UB(tmp2, tmp2, 0, 1, 2, 3, src_u, stride); + src_u += 4 * stride; + ST4x4_UB(tmp3, tmp3, 0, 1, 2, 3, src_u, stride); + src_v += 2; + ST4x4_UB(tmp4, tmp4, 0, 1, 2, 3, src_v, stride); + src_v += 4 * stride; + ST4x4_UB(tmp5, tmp5, 0, 1, 2, 3, src_v, stride); +} + +static void SimpleVFilter16(uint8_t* src, int stride, int b_limit_in) { + v16u8 p1, p0, q1, q0, mask; + const v16u8 b_limit = (v16u8)__msa_fill_b(b_limit_in); + + LD_UB4(src - 2 * stride, stride, p1, p0, q0, q1); + LPF_SIMPLE_MASK(p1, p0, q0, q1, b_limit, mask); + LPF_SIMPLE_FILT(p1, p0, q0, q1, mask); + ST_UB2(p0, q0, src - stride, stride); +} + +static void SimpleHFilter16(uint8_t* src, int stride, int b_limit_in) { + v16u8 p1, p0, q1, q0, mask, row0, row1, row2, row3, row4, row5, row6, row7; + v16u8 row8, row9, row10, row11, row12, row13, row14, row15; + v8i16 tmp0, tmp1; + const v16u8 b_limit = (v16u8)__msa_fill_b(b_limit_in); + uint8_t* ptemp_src = src - 2; + + LD_UB8(ptemp_src, stride, row0, row1, row2, row3, row4, row5, row6, row7); + LD_UB8(ptemp_src + 8 * stride, stride, + row8, row9, row10, row11, row12, row13, row14, row15); + TRANSPOSE16x4_UB_UB(row0, row1, row2, row3, row4, row5, row6, row7, + row8, row9, row10, row11, row12, row13, row14, row15, + p1, p0, q0, q1); + LPF_SIMPLE_MASK(p1, p0, q0, q1, b_limit, mask); + LPF_SIMPLE_FILT(p1, p0, q0, q1, mask); + ILVRL_B2_SH(q0, p0, tmp1, tmp0); + ptemp_src += 1; + ST2x4_UB(tmp1, 0, ptemp_src, stride); + ptemp_src += 4 * stride; + ST2x4_UB(tmp1, 4, ptemp_src, stride); + ptemp_src += 4 * stride; + ST2x4_UB(tmp0, 0, ptemp_src, stride); + ptemp_src += 4 * stride; + ST2x4_UB(tmp0, 4, ptemp_src, stride); + ptemp_src += 4 * stride; +} + +static void SimpleVFilter16i(uint8_t* src_y, int stride, int b_limit_in) { + SimpleVFilter16(src_y + 4 * stride, stride, b_limit_in); + SimpleVFilter16(src_y + 8 * stride, stride, b_limit_in); + SimpleVFilter16(src_y + 12 * stride, stride, b_limit_in); +} + +static void SimpleHFilter16i(uint8_t* src_y, int stride, int b_limit_in) { + SimpleHFilter16(src_y + 4, stride, b_limit_in); + SimpleHFilter16(src_y + 8, stride, b_limit_in); + SimpleHFilter16(src_y + 12, stride, b_limit_in); +} + +//------------------------------------------------------------------------------ +// Intra predictions +//------------------------------------------------------------------------------ + +// 4x4 + +static void DC4(uint8_t* dst) { // DC + uint32_t dc = 4; + int i; + for (i = 0; i < 4; ++i) dc += dst[i - BPS] + dst[-1 + i * BPS]; + dc >>= 3; + dc = dc | (dc << 8) | (dc << 16) | (dc << 24); + SW4(dc, dc, dc, dc, dst, BPS); +} + +static void TM4(uint8_t* dst) { + const uint8_t* const ptemp = dst - BPS - 1; + v8i16 T, d, r0, r1, r2, r3; + const v16i8 zero = { 0 }; + const v8i16 TL = (v8i16)__msa_fill_h(ptemp[0 * BPS]); + const v8i16 L0 = (v8i16)__msa_fill_h(ptemp[1 * BPS]); + const v8i16 L1 = (v8i16)__msa_fill_h(ptemp[2 * BPS]); + const v8i16 L2 = (v8i16)__msa_fill_h(ptemp[3 * BPS]); + const v8i16 L3 = (v8i16)__msa_fill_h(ptemp[4 * BPS]); + const v16u8 T1 = LD_UB(ptemp + 1); + + T = (v8i16)__msa_ilvr_b(zero, (v16i8)T1); + d = T - TL; + ADD4(d, L0, d, L1, d, L2, d, L3, r0, r1, r2, r3); + CLIP_SH4_0_255(r0, r1, r2, r3); + PCKEV_ST4x4_UB(r0, r1, r2, r3, dst, BPS); +} + +static void VE4(uint8_t* dst) { // vertical + const uint8_t* const ptop = dst - BPS - 1; + const uint32_t val0 = LW(ptop + 0); + const uint32_t val1 = LW(ptop + 4); + uint32_t out; + v16u8 A, B, C, AC, B2, R; + + INSERT_W2_UB(val0, val1, A); + B = SLDI_UB(A, A, 1); + C = SLDI_UB(A, A, 2); + AC = __msa_ave_u_b(A, C); + B2 = __msa_ave_u_b(B, B); + R = __msa_aver_u_b(AC, B2); + out = __msa_copy_s_w((v4i32)R, 0); + SW4(out, out, out, out, dst, BPS); +} + +static void RD4(uint8_t* dst) { // Down-right + const uint8_t* const ptop = dst - 1 - BPS; + uint32_t val0 = LW(ptop + 0); + uint32_t val1 = LW(ptop + 4); + uint32_t val2, val3; + v16u8 A, B, C, AC, B2, R, A1; + + INSERT_W2_UB(val0, val1, A1); + A = SLDI_UB(A1, A1, 12); + A = (v16u8)__msa_insert_b((v16i8)A, 3, ptop[1 * BPS]); + A = (v16u8)__msa_insert_b((v16i8)A, 2, ptop[2 * BPS]); + A = (v16u8)__msa_insert_b((v16i8)A, 1, ptop[3 * BPS]); + A = (v16u8)__msa_insert_b((v16i8)A, 0, ptop[4 * BPS]); + B = SLDI_UB(A, A, 1); + C = SLDI_UB(A, A, 2); + AC = __msa_ave_u_b(A, C); + B2 = __msa_ave_u_b(B, B); + R = __msa_aver_u_b(AC, B2); + val3 = __msa_copy_s_w((v4i32)R, 0); + R = SLDI_UB(R, R, 1); + val2 = __msa_copy_s_w((v4i32)R, 0); + R = SLDI_UB(R, R, 1); + val1 = __msa_copy_s_w((v4i32)R, 0); + R = SLDI_UB(R, R, 1); + val0 = __msa_copy_s_w((v4i32)R, 0); + SW4(val0, val1, val2, val3, dst, BPS); +} + +static void LD4(uint8_t* dst) { // Down-Left + const uint8_t* const ptop = dst - BPS; + uint32_t val0 = LW(ptop + 0); + uint32_t val1 = LW(ptop + 4); + uint32_t val2, val3; + v16u8 A, B, C, AC, B2, R; + + INSERT_W2_UB(val0, val1, A); + B = SLDI_UB(A, A, 1); + C = SLDI_UB(A, A, 2); + C = (v16u8)__msa_insert_b((v16i8)C, 6, ptop[7]); + AC = __msa_ave_u_b(A, C); + B2 = __msa_ave_u_b(B, B); + R = __msa_aver_u_b(AC, B2); + val0 = __msa_copy_s_w((v4i32)R, 0); + R = SLDI_UB(R, R, 1); + val1 = __msa_copy_s_w((v4i32)R, 0); + R = SLDI_UB(R, R, 1); + val2 = __msa_copy_s_w((v4i32)R, 0); + R = SLDI_UB(R, R, 1); + val3 = __msa_copy_s_w((v4i32)R, 0); + SW4(val0, val1, val2, val3, dst, BPS); +} + +// 16x16 + +static void DC16(uint8_t* dst) { // DC + uint32_t dc = 16; + int i; + const v16u8 rtop = LD_UB(dst - BPS); + const v8u16 dctop = __msa_hadd_u_h(rtop, rtop); + v16u8 out; + + for (i = 0; i < 16; ++i) { + dc += dst[-1 + i * BPS]; + } + dc += HADD_UH_U32(dctop); + out = (v16u8)__msa_fill_b(dc >> 5); + ST_UB8(out, out, out, out, out, out, out, out, dst, BPS); + ST_UB8(out, out, out, out, out, out, out, out, dst + 8 * BPS, BPS); +} + +static void TM16(uint8_t* dst) { + int j; + v8i16 d1, d2; + const v16i8 zero = { 0 }; + const v8i16 TL = (v8i16)__msa_fill_h(dst[-1 - BPS]); + const v16i8 T = LD_SB(dst - BPS); + + ILVRL_B2_SH(zero, T, d1, d2); + SUB2(d1, TL, d2, TL, d1, d2); + for (j = 0; j < 16; j += 4) { + v16i8 t0, t1, t2, t3; + v8i16 r0, r1, r2, r3, r4, r5, r6, r7; + const v8i16 L0 = (v8i16)__msa_fill_h(dst[-1 + 0 * BPS]); + const v8i16 L1 = (v8i16)__msa_fill_h(dst[-1 + 1 * BPS]); + const v8i16 L2 = (v8i16)__msa_fill_h(dst[-1 + 2 * BPS]); + const v8i16 L3 = (v8i16)__msa_fill_h(dst[-1 + 3 * BPS]); + ADD4(d1, L0, d1, L1, d1, L2, d1, L3, r0, r1, r2, r3); + ADD4(d2, L0, d2, L1, d2, L2, d2, L3, r4, r5, r6, r7); + CLIP_SH4_0_255(r0, r1, r2, r3); + CLIP_SH4_0_255(r4, r5, r6, r7); + PCKEV_B4_SB(r4, r0, r5, r1, r6, r2, r7, r3, t0, t1, t2, t3); + ST_SB4(t0, t1, t2, t3, dst, BPS); + dst += 4 * BPS; + } +} + +static void VE16(uint8_t* dst) { // vertical + const v16u8 rtop = LD_UB(dst - BPS); + ST_UB8(rtop, rtop, rtop, rtop, rtop, rtop, rtop, rtop, dst, BPS); + ST_UB8(rtop, rtop, rtop, rtop, rtop, rtop, rtop, rtop, dst + 8 * BPS, BPS); +} + +static void HE16(uint8_t* dst) { // horizontal + int j; + for (j = 16; j > 0; j -= 4) { + const v16u8 L0 = (v16u8)__msa_fill_b(dst[-1 + 0 * BPS]); + const v16u8 L1 = (v16u8)__msa_fill_b(dst[-1 + 1 * BPS]); + const v16u8 L2 = (v16u8)__msa_fill_b(dst[-1 + 2 * BPS]); + const v16u8 L3 = (v16u8)__msa_fill_b(dst[-1 + 3 * BPS]); + ST_UB4(L0, L1, L2, L3, dst, BPS); + dst += 4 * BPS; + } +} + +static void DC16NoTop(uint8_t* dst) { // DC with top samples not available + int j; + uint32_t dc = 8; + v16u8 out; + + for (j = 0; j < 16; ++j) { + dc += dst[-1 + j * BPS]; + } + out = (v16u8)__msa_fill_b(dc >> 4); + ST_UB8(out, out, out, out, out, out, out, out, dst, BPS); + ST_UB8(out, out, out, out, out, out, out, out, dst + 8 * BPS, BPS); +} + +static void DC16NoLeft(uint8_t* dst) { // DC with left samples not available + uint32_t dc = 8; + const v16u8 rtop = LD_UB(dst - BPS); + const v8u16 dctop = __msa_hadd_u_h(rtop, rtop); + v16u8 out; + + dc += HADD_UH_U32(dctop); + out = (v16u8)__msa_fill_b(dc >> 4); + ST_UB8(out, out, out, out, out, out, out, out, dst, BPS); + ST_UB8(out, out, out, out, out, out, out, out, dst + 8 * BPS, BPS); +} + +static void DC16NoTopLeft(uint8_t* dst) { // DC with nothing + const v16u8 out = (v16u8)__msa_fill_b(0x80); + ST_UB8(out, out, out, out, out, out, out, out, dst, BPS); + ST_UB8(out, out, out, out, out, out, out, out, dst + 8 * BPS, BPS); +} + +// Chroma + +#define STORE8x8(out, dst) do { \ + SD4(out, out, out, out, dst + 0 * BPS, BPS); \ + SD4(out, out, out, out, dst + 4 * BPS, BPS); \ +} while (0) + +static void DC8uv(uint8_t* dst) { // DC + uint32_t dc = 8; + int i; + uint64_t out; + const v16u8 rtop = LD_UB(dst - BPS); + const v8u16 temp0 = __msa_hadd_u_h(rtop, rtop); + const v4u32 temp1 = __msa_hadd_u_w(temp0, temp0); + const v2u64 temp2 = __msa_hadd_u_d(temp1, temp1); + v16u8 dctemp; + + for (i = 0; i < 8; ++i) { + dc += dst[-1 + i * BPS]; + } + dc += __msa_copy_s_w((v4i32)temp2, 0); + dctemp = (v16u8)__msa_fill_b(dc >> 4); + out = __msa_copy_s_d((v2i64)dctemp, 0); + STORE8x8(out, dst); +} + +static void TM8uv(uint8_t* dst) { + int j; + const v16i8 T1 = LD_SB(dst - BPS); + const v16i8 zero = { 0 }; + const v8i16 T = (v8i16)__msa_ilvr_b(zero, T1); + const v8i16 TL = (v8i16)__msa_fill_h(dst[-1 - BPS]); + const v8i16 d = T - TL; + + for (j = 0; j < 8; j += 4) { + v16i8 t0, t1; + v8i16 r0 = (v8i16)__msa_fill_h(dst[-1 + 0 * BPS]); + v8i16 r1 = (v8i16)__msa_fill_h(dst[-1 + 1 * BPS]); + v8i16 r2 = (v8i16)__msa_fill_h(dst[-1 + 2 * BPS]); + v8i16 r3 = (v8i16)__msa_fill_h(dst[-1 + 3 * BPS]); + ADD4(d, r0, d, r1, d, r2, d, r3, r0, r1, r2, r3); + CLIP_SH4_0_255(r0, r1, r2, r3); + PCKEV_B2_SB(r1, r0, r3, r2, t0, t1); + ST4x4_UB(t0, t1, 0, 2, 0, 2, dst, BPS); + ST4x4_UB(t0, t1, 1, 3, 1, 3, dst + 4, BPS); + dst += 4 * BPS; + } +} + +static void VE8uv(uint8_t* dst) { // vertical + const v16u8 rtop = LD_UB(dst - BPS); + const uint64_t out = __msa_copy_s_d((v2i64)rtop, 0); + STORE8x8(out, dst); +} + +static void HE8uv(uint8_t* dst) { // horizontal + int j; + for (j = 0; j < 8; j += 4) { + const v16u8 L0 = (v16u8)__msa_fill_b(dst[-1 + 0 * BPS]); + const v16u8 L1 = (v16u8)__msa_fill_b(dst[-1 + 1 * BPS]); + const v16u8 L2 = (v16u8)__msa_fill_b(dst[-1 + 2 * BPS]); + const v16u8 L3 = (v16u8)__msa_fill_b(dst[-1 + 3 * BPS]); + const uint64_t out0 = __msa_copy_s_d((v2i64)L0, 0); + const uint64_t out1 = __msa_copy_s_d((v2i64)L1, 0); + const uint64_t out2 = __msa_copy_s_d((v2i64)L2, 0); + const uint64_t out3 = __msa_copy_s_d((v2i64)L3, 0); + SD4(out0, out1, out2, out3, dst, BPS); + dst += 4 * BPS; + } +} + +static void DC8uvNoLeft(uint8_t* dst) { // DC with no left samples + const uint32_t dc = 4; + const v16u8 rtop = LD_UB(dst - BPS); + const v8u16 temp0 = __msa_hadd_u_h(rtop, rtop); + const v4u32 temp1 = __msa_hadd_u_w(temp0, temp0); + const v2u64 temp2 = __msa_hadd_u_d(temp1, temp1); + const uint32_t sum_m = __msa_copy_s_w((v4i32)temp2, 0); + const v16u8 dcval = (v16u8)__msa_fill_b((dc + sum_m) >> 3); + const uint64_t out = __msa_copy_s_d((v2i64)dcval, 0); + STORE8x8(out, dst); +} + +static void DC8uvNoTop(uint8_t* dst) { // DC with no top samples + uint32_t dc = 4; + int i; + uint64_t out; + v16u8 dctemp; + + for (i = 0; i < 8; ++i) { + dc += dst[-1 + i * BPS]; + } + dctemp = (v16u8)__msa_fill_b(dc >> 3); + out = __msa_copy_s_d((v2i64)dctemp, 0); + STORE8x8(out, dst); +} + +static void DC8uvNoTopLeft(uint8_t* dst) { // DC with nothing + const uint64_t out = 0x8080808080808080ULL; + STORE8x8(out, dst); +} + +//------------------------------------------------------------------------------ // Entry point extern void VP8DspInitMSA(void); @@ -163,6 +977,39 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitMSA(void) { VP8Transform = TransformTwo; VP8TransformDC = TransformDC; VP8TransformAC3 = TransformAC3; + + VP8VFilter16 = VFilter16; + VP8HFilter16 = HFilter16; + VP8VFilter16i = VFilter16i; + VP8HFilter16i = HFilter16i; + VP8VFilter8 = VFilter8; + VP8HFilter8 = HFilter8; + VP8VFilter8i = VFilter8i; + VP8HFilter8i = HFilter8i; + VP8SimpleVFilter16 = SimpleVFilter16; + VP8SimpleHFilter16 = SimpleHFilter16; + VP8SimpleVFilter16i = SimpleVFilter16i; + VP8SimpleHFilter16i = SimpleHFilter16i; + + VP8PredLuma4[0] = DC4; + VP8PredLuma4[1] = TM4; + VP8PredLuma4[2] = VE4; + VP8PredLuma4[4] = RD4; + VP8PredLuma4[6] = LD4; + VP8PredLuma16[0] = DC16; + VP8PredLuma16[1] = TM16; + VP8PredLuma16[2] = VE16; + VP8PredLuma16[3] = HE16; + VP8PredLuma16[4] = DC16NoTop; + VP8PredLuma16[5] = DC16NoLeft; + VP8PredLuma16[6] = DC16NoTopLeft; + VP8PredChroma8[0] = DC8uv; + VP8PredChroma8[1] = TM8uv; + VP8PredChroma8[2] = VE8uv; + VP8PredChroma8[3] = HE8uv; + VP8PredChroma8[4] = DC8uvNoTop; + VP8PredChroma8[5] = DC8uvNoLeft; + VP8PredChroma8[6] = DC8uvNoTopLeft; } #else // !WEBP_USE_MSA diff --git a/thirdparty/libwebp/dsp/dec_neon.c b/thirdparty/libwebp/dsp/dec_neon.c index a63f43fe17..34796cf4a2 100644 --- a/thirdparty/libwebp/dsp/dec_neon.c +++ b/thirdparty/libwebp/dsp/dec_neon.c @@ -17,7 +17,7 @@ #if defined(WEBP_USE_NEON) #include "./neon.h" -#include "../dec/vp8i.h" +#include "../dec/vp8i_dec.h" //------------------------------------------------------------------------------ // NxM Loading functions @@ -666,9 +666,8 @@ static uint8x16_t NeedsHev(const uint8x16_t p1, const uint8x16_t p0, const uint8x16_t hev_thresh_v = vdupq_n_u8((uint8_t)hev_thresh); const uint8x16_t a_p1_p0 = vabdq_u8(p1, p0); // abs(p1 - p0) const uint8x16_t a_q1_q0 = vabdq_u8(q1, q0); // abs(q1 - q0) - const uint8x16_t mask1 = vcgtq_u8(a_p1_p0, hev_thresh_v); - const uint8x16_t mask2 = vcgtq_u8(a_q1_q0, hev_thresh_v); - const uint8x16_t mask = vorrq_u8(mask1, mask2); + const uint8x16_t a_max = vmaxq_u8(a_p1_p0, a_q1_q0); + const uint8x16_t mask = vcgtq_u8(a_max, hev_thresh_v); return mask; } @@ -756,24 +755,25 @@ static void ApplyFilter6( const int8x16_t delta, uint8x16_t* const op2, uint8x16_t* const op1, uint8x16_t* const op0, uint8x16_t* const oq0, uint8x16_t* const oq1, uint8x16_t* const oq2) { - const int16x8_t kCst63 = vdupq_n_s16(63); - const int8x8_t kCst27 = vdup_n_s8(27); - const int8x8_t kCst18 = vdup_n_s8(18); - const int8x8_t kCst9 = vdup_n_s8(9); + // We have to compute: X = (9*a+63) >> 7, Y = (18*a+63)>>7, Z = (27*a+63) >> 7 + // Turns out, there's a common sub-expression S=9 * a - 1 that can be used + // with the special vqrshrn_n_s16 rounding-shift-and-narrow instruction: + // X = (S + 64) >> 7, Y = (S + 32) >> 6, Z = (18 * a + S + 64) >> 7 const int8x8_t delta_lo = vget_low_s8(delta); const int8x8_t delta_hi = vget_high_s8(delta); - const int16x8_t s1_lo = vmlal_s8(kCst63, kCst27, delta_lo); // 63 + 27 * a - const int16x8_t s1_hi = vmlal_s8(kCst63, kCst27, delta_hi); // 63 + 27 * a - const int16x8_t s2_lo = vmlal_s8(kCst63, kCst18, delta_lo); // 63 + 18 * a - const int16x8_t s2_hi = vmlal_s8(kCst63, kCst18, delta_hi); // 63 + 18 * a - const int16x8_t s3_lo = vmlal_s8(kCst63, kCst9, delta_lo); // 63 + 9 * a - const int16x8_t s3_hi = vmlal_s8(kCst63, kCst9, delta_hi); // 63 + 9 * a - const int8x8_t a1_lo = vqshrn_n_s16(s1_lo, 7); - const int8x8_t a1_hi = vqshrn_n_s16(s1_hi, 7); - const int8x8_t a2_lo = vqshrn_n_s16(s2_lo, 7); - const int8x8_t a2_hi = vqshrn_n_s16(s2_hi, 7); - const int8x8_t a3_lo = vqshrn_n_s16(s3_lo, 7); - const int8x8_t a3_hi = vqshrn_n_s16(s3_hi, 7); + const int8x8_t kCst9 = vdup_n_s8(9); + const int16x8_t kCstm1 = vdupq_n_s16(-1); + const int8x8_t kCst18 = vdup_n_s8(18); + const int16x8_t S_lo = vmlal_s8(kCstm1, kCst9, delta_lo); // S = 9 * a - 1 + const int16x8_t S_hi = vmlal_s8(kCstm1, kCst9, delta_hi); + const int16x8_t Z_lo = vmlal_s8(S_lo, kCst18, delta_lo); // S + 18 * a + const int16x8_t Z_hi = vmlal_s8(S_hi, kCst18, delta_hi); + const int8x8_t a3_lo = vqrshrn_n_s16(S_lo, 7); // (9 * a + 63) >> 7 + const int8x8_t a3_hi = vqrshrn_n_s16(S_hi, 7); + const int8x8_t a2_lo = vqrshrn_n_s16(S_lo, 6); // (9 * a + 31) >> 6 + const int8x8_t a2_hi = vqrshrn_n_s16(S_hi, 6); + const int8x8_t a1_lo = vqrshrn_n_s16(Z_lo, 7); // (27 * a + 63) >> 7 + const int8x8_t a1_hi = vqrshrn_n_s16(Z_hi, 7); const int8x16_t a1 = vcombine_s8(a1_lo, a1_hi); const int8x16_t a2 = vcombine_s8(a2_lo, a2_hi); const int8x16_t a3 = vcombine_s8(a3_lo, a3_hi); diff --git a/thirdparty/libwebp/dsp/dec_sse2.c b/thirdparty/libwebp/dsp/dec_sse2.c index f0a8ddcaf3..411fb02768 100644 --- a/thirdparty/libwebp/dsp/dec_sse2.c +++ b/thirdparty/libwebp/dsp/dec_sse2.c @@ -22,7 +22,7 @@ #include <emmintrin.h> #include "./common_sse2.h" -#include "../dec/vp8i.h" +#include "../dec/vp8i_dec.h" #include "../utils/utils.h" //------------------------------------------------------------------------------ @@ -140,7 +140,7 @@ static void Transform(const int16_t* in, uint8_t* dst, int do_two) { // Transpose the two 4x4. VP8Transpose_2_4x4_16b(&shifted0, &shifted1, &shifted2, &shifted3, &T0, &T1, - &T2, &T3); + &T2, &T3); } // Add inverse transform to 'dst' and store. diff --git a/thirdparty/libwebp/dsp/dec_sse41.c b/thirdparty/libwebp/dsp/dec_sse41.c index 8d6aed13e6..4e81ec4d80 100644 --- a/thirdparty/libwebp/dsp/dec_sse41.c +++ b/thirdparty/libwebp/dsp/dec_sse41.c @@ -16,7 +16,7 @@ #if defined(WEBP_USE_SSE41) #include <smmintrin.h> -#include "../dec/vp8i.h" +#include "../dec/vp8i_dec.h" #include "../utils/utils.h" static void HE16(uint8_t* dst) { // horizontal diff --git a/thirdparty/libwebp/dsp/dsp.h b/thirdparty/libwebp/dsp/dsp.h index 1faac27b2b..813fed4a35 100644 --- a/thirdparty/libwebp/dsp/dsp.h +++ b/thirdparty/libwebp/dsp/dsp.h @@ -111,8 +111,7 @@ extern "C" { #define WEBP_UBSAN_IGNORE_UNDEF #define WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW -#if !defined(WEBP_FORCE_ALIGNED) && defined(__clang__) && \ - defined(__has_attribute) +#if defined(__clang__) && defined(__has_attribute) #if __has_attribute(no_sanitize) // This macro prevents the undefined behavior sanitizer from reporting // failures. This is only meant to silence unaligned loads on platforms that @@ -133,6 +132,7 @@ extern "C" { typedef enum { kSSE2, kSSE3, + kSlowSSSE3, // special feature for slow SSSE3 architectures kSSE4_1, kAVX, kAVX2, @@ -185,6 +185,11 @@ typedef int (*VP8WMetric)(const uint8_t* pix, const uint8_t* ref, // 4 by 4 symmetric matrix. extern VP8WMetric VP8TDisto4x4, VP8TDisto16x16; +// Compute the average (DC) of four 4x4 blocks. +// Each sub-4x4 block #i sum is stored in dc[i]. +typedef void (*VP8MeanMetric)(const uint8_t* ref, uint32_t dc[4]); +extern VP8MeanMetric VP8Mean16x4; + typedef void (*VP8BlockCopy)(const uint8_t* src, uint8_t* dst); extern VP8BlockCopy VP8Copy4x4; extern VP8BlockCopy VP8Copy16x8; @@ -246,30 +251,37 @@ extern VP8GetResidualCostFunc VP8GetResidualCost; void VP8EncDspCostInit(void); //------------------------------------------------------------------------------ -// SSIM utils +// SSIM / PSNR utils // struct for accumulating statistical moments typedef struct { - double w; // sum(w_i) : sum of weights - double xm, ym; // sum(w_i * x_i), sum(w_i * y_i) - double xxm, xym, yym; // sum(w_i * x_i * x_i), etc. + uint32_t w; // sum(w_i) : sum of weights + uint32_t xm, ym; // sum(w_i * x_i), sum(w_i * y_i) + uint32_t xxm, xym, yym; // sum(w_i * x_i * x_i), etc. } VP8DistoStats; +// Compute the final SSIM value +// The non-clipped version assumes stats->w = (2 * VP8_SSIM_KERNEL + 1)^2. +double VP8SSIMFromStats(const VP8DistoStats* const stats); +double VP8SSIMFromStatsClipped(const VP8DistoStats* const stats); + #define VP8_SSIM_KERNEL 3 // total size of the kernel: 2 * VP8_SSIM_KERNEL + 1 -typedef void (*VP8SSIMAccumulateClippedFunc)(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int xo, int yo, // center position - int W, int H, // plane dimension - VP8DistoStats* const stats); +typedef double (*VP8SSIMGetClippedFunc)(const uint8_t* src1, int stride1, + const uint8_t* src2, int stride2, + int xo, int yo, // center position + int W, int H); // plane dimension // This version is called with the guarantee that you can load 8 bytes and // 8 rows at offset src1 and src2 -typedef void (*VP8SSIMAccumulateFunc)(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - VP8DistoStats* const stats); +typedef double (*VP8SSIMGetFunc)(const uint8_t* src1, int stride1, + const uint8_t* src2, int stride2); + +extern VP8SSIMGetFunc VP8SSIMGet; // unclipped / unchecked +extern VP8SSIMGetClippedFunc VP8SSIMGetClipped; // with clipping -extern VP8SSIMAccumulateFunc VP8SSIMAccumulate; // unclipped / unchecked -extern VP8SSIMAccumulateClippedFunc VP8SSIMAccumulateClipped; // with clipping +typedef uint32_t (*VP8AccumulateSSEFunc)(const uint8_t* src1, + const uint8_t* src2, int len); +extern VP8AccumulateSSEFunc VP8AccumulateSSE; // must be called before using any of the above directly void VP8SSIMDspInit(void); @@ -416,6 +428,15 @@ extern void WebPConvertARGBToUV_C(const uint32_t* argb, uint8_t* u, uint8_t* v, extern void WebPConvertRGBA32ToUV_C(const uint16_t* rgb, uint8_t* u, uint8_t* v, int width); +// utilities for accurate RGB->YUV conversion +extern uint64_t (*WebPSharpYUVUpdateY)(const uint16_t* src, const uint16_t* ref, + uint16_t* dst, int len); +extern void (*WebPSharpYUVUpdateRGB)(const int16_t* src, const int16_t* ref, + int16_t* dst, int len); +extern void (*WebPSharpYUVFilterRow)(const int16_t* A, const int16_t* B, + int len, + const uint16_t* best_y, uint16_t* out); + // Must be called before using the above. void WebPInitConvertARGBToYUV(void); @@ -488,6 +509,10 @@ extern int (*WebPExtractAlpha)(const uint8_t* argb, int argb_stride, int width, int height, uint8_t* alpha, int alpha_stride); +// Extract the green values from 32b values in argb[] and pack them into alpha[] +// (this is the opposite of WebPDispatchAlphaToGreen). +extern void (*WebPExtractGreen)(const uint32_t* argb, uint8_t* alpha, int size); + // Pre-Multiply operation transforms x into x * A / 255 (where x=Y,R,G or B). // Un-Multiply operation transforms x into x * 255 / A. diff --git a/thirdparty/libwebp/dsp/enc.c b/thirdparty/libwebp/dsp/enc.c index db0e9e70ae..f31bc6de18 100644 --- a/thirdparty/libwebp/dsp/enc.c +++ b/thirdparty/libwebp/dsp/enc.c @@ -15,7 +15,7 @@ #include <stdlib.h> // for abs() #include "./dsp.h" -#include "../enc/vp8enci.h" +#include "../enc/vp8i_enc.h" static WEBP_INLINE uint8_t clip_8b(int v) { return (!(v & ~0xff)) ? v : (v < 0) ? 0 : 255; @@ -551,6 +551,20 @@ static int SSE4x4(const uint8_t* a, const uint8_t* b) { return GetSSE(a, b, 4, 4); } +static void Mean16x4(const uint8_t* ref, uint32_t dc[4]) { + int k, x, y; + for (k = 0; k < 4; ++k) { + uint32_t avg = 0; + for (y = 0; y < 4; ++y) { + for (x = 0; x < 4; ++x) { + avg += ref[x + y * BPS]; + } + } + dc[k] = avg; + ref += 4; // go to next 4x4 block. + } +} + //------------------------------------------------------------------------------ // Texture distortion // @@ -656,32 +670,6 @@ static int Quantize2Blocks(int16_t in[32], int16_t out[32], return nz; } -static int QuantizeBlockWHT(int16_t in[16], int16_t out[16], - const VP8Matrix* const mtx) { - int n, last = -1; - for (n = 0; n < 16; ++n) { - const int j = kZigzag[n]; - const int sign = (in[j] < 0); - const uint32_t coeff = sign ? -in[j] : in[j]; - assert(mtx->sharpen_[j] == 0); - if (coeff > mtx->zthresh_[j]) { - const uint32_t Q = mtx->q_[j]; - const uint32_t iQ = mtx->iq_[j]; - const uint32_t B = mtx->bias_[j]; - int level = QUANTDIV(coeff, iQ, B); - if (level > MAX_LEVEL) level = MAX_LEVEL; - if (sign) level = -level; - in[j] = level * (int)Q; - out[n] = level; - if (level) last = n; - } else { - out[n] = 0; - in[j] = 0; - } - } - return (last >= 0); -} - //------------------------------------------------------------------------------ // Block copy @@ -703,11 +691,51 @@ static void Copy16x8(const uint8_t* src, uint8_t* dst) { } //------------------------------------------------------------------------------ +// SSIM / PSNR -static void SSIMAccumulateClipped(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int xo, int yo, int W, int H, - VP8DistoStats* const stats) { +// hat-shaped filter. Sum of coefficients is equal to 16. +static const uint32_t kWeight[2 * VP8_SSIM_KERNEL + 1] = { + 1, 2, 3, 4, 3, 2, 1 +}; +static const uint32_t kWeightSum = 16 * 16; // sum{kWeight}^2 + +static WEBP_INLINE double SSIMCalculation( + const VP8DistoStats* const stats, uint32_t N /*num samples*/) { + const uint32_t w2 = N * N; + const uint32_t C1 = 20 * w2; + const uint32_t C2 = 60 * w2; + const uint32_t C3 = 8 * 8 * w2; // 'dark' limit ~= 6 + const uint64_t xmxm = (uint64_t)stats->xm * stats->xm; + const uint64_t ymym = (uint64_t)stats->ym * stats->ym; + if (xmxm + ymym >= C3) { + const int64_t xmym = (int64_t)stats->xm * stats->ym; + const int64_t sxy = (int64_t)stats->xym * N - xmym; // can be negative + const uint64_t sxx = (uint64_t)stats->xxm * N - xmxm; + const uint64_t syy = (uint64_t)stats->yym * N - ymym; + // we descale by 8 to prevent overflow during the fnum/fden multiply. + const uint64_t num_S = (2 * (uint64_t)(sxy < 0 ? 0 : sxy) + C2) >> 8; + const uint64_t den_S = (sxx + syy + C2) >> 8; + const uint64_t fnum = (2 * xmym + C1) * num_S; + const uint64_t fden = (xmxm + ymym + C1) * den_S; + const double r = (double)fnum / fden; + assert(r >= 0. && r <= 1.0); + return r; + } + return 1.; // area is too dark to contribute meaningfully +} + +double VP8SSIMFromStats(const VP8DistoStats* const stats) { + return SSIMCalculation(stats, kWeightSum); +} + +double VP8SSIMFromStatsClipped(const VP8DistoStats* const stats) { + return SSIMCalculation(stats, stats->w); +} + +static double SSIMGetClipped_C(const uint8_t* src1, int stride1, + const uint8_t* src2, int stride2, + int xo, int yo, int W, int H) { + VP8DistoStats stats = { 0, 0, 0, 0, 0, 0 }; const int ymin = (yo - VP8_SSIM_KERNEL < 0) ? 0 : yo - VP8_SSIM_KERNEL; const int ymax = (yo + VP8_SSIM_KERNEL > H - 1) ? H - 1 : yo + VP8_SSIM_KERNEL; @@ -719,38 +747,61 @@ static void SSIMAccumulateClipped(const uint8_t* src1, int stride1, src2 += ymin * stride2; for (y = ymin; y <= ymax; ++y, src1 += stride1, src2 += stride2) { for (x = xmin; x <= xmax; ++x) { - const int s1 = src1[x]; - const int s2 = src2[x]; - stats->w += 1; - stats->xm += s1; - stats->ym += s2; - stats->xxm += s1 * s1; - stats->xym += s1 * s2; - stats->yym += s2 * s2; + const uint32_t w = kWeight[VP8_SSIM_KERNEL + x - xo] + * kWeight[VP8_SSIM_KERNEL + y - yo]; + const uint32_t s1 = src1[x]; + const uint32_t s2 = src2[x]; + stats.w += w; + stats.xm += w * s1; + stats.ym += w * s2; + stats.xxm += w * s1 * s1; + stats.xym += w * s1 * s2; + stats.yym += w * s2 * s2; } } + return VP8SSIMFromStatsClipped(&stats); } -static void SSIMAccumulate(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - VP8DistoStats* const stats) { +static double SSIMGet_C(const uint8_t* src1, int stride1, + const uint8_t* src2, int stride2) { + VP8DistoStats stats = { 0, 0, 0, 0, 0, 0 }; int x, y; for (y = 0; y <= 2 * VP8_SSIM_KERNEL; ++y, src1 += stride1, src2 += stride2) { for (x = 0; x <= 2 * VP8_SSIM_KERNEL; ++x) { - const int s1 = src1[x]; - const int s2 = src2[x]; - stats->w += 1; - stats->xm += s1; - stats->ym += s2; - stats->xxm += s1 * s1; - stats->xym += s1 * s2; - stats->yym += s2 * s2; + const uint32_t w = kWeight[x] * kWeight[y]; + const uint32_t s1 = src1[x]; + const uint32_t s2 = src2[x]; + stats.xm += w * s1; + stats.ym += w * s2; + stats.xxm += w * s1 * s1; + stats.xym += w * s1 * s2; + stats.yym += w * s2 * s2; } } + return VP8SSIMFromStats(&stats); +} + +//------------------------------------------------------------------------------ + +static uint32_t AccumulateSSE(const uint8_t* src1, + const uint8_t* src2, int len) { + int i; + uint32_t sse2 = 0; + assert(len <= 65535); // to ensure that accumulation fits within uint32_t + for (i = 0; i < len; ++i) { + const int32_t diff = src1[i] - src2[i]; + sse2 += diff * diff; + } + return sse2; } -VP8SSIMAccumulateFunc VP8SSIMAccumulate; -VP8SSIMAccumulateClippedFunc VP8SSIMAccumulateClipped; +//------------------------------------------------------------------------------ + +VP8SSIMGetFunc VP8SSIMGet; +VP8SSIMGetClippedFunc VP8SSIMGetClipped; +VP8AccumulateSSEFunc VP8AccumulateSSE; + +extern void VP8SSIMDspInitSSE2(void); static volatile VP8CPUInfo ssim_last_cpuinfo_used = (VP8CPUInfo)&ssim_last_cpuinfo_used; @@ -758,8 +809,17 @@ static volatile VP8CPUInfo ssim_last_cpuinfo_used = WEBP_TSAN_IGNORE_FUNCTION void VP8SSIMDspInit(void) { if (ssim_last_cpuinfo_used == VP8GetCPUInfo) return; - VP8SSIMAccumulate = SSIMAccumulate; - VP8SSIMAccumulateClipped = SSIMAccumulateClipped; + VP8SSIMGetClipped = SSIMGetClipped_C; + VP8SSIMGet = SSIMGet_C; + + VP8AccumulateSSE = AccumulateSSE; + if (VP8GetCPUInfo != NULL) { +#if defined(WEBP_USE_SSE2) + if (VP8GetCPUInfo(kSSE2)) { + VP8SSIMDspInitSSE2(); + } +#endif + } ssim_last_cpuinfo_used = VP8GetCPUInfo; } @@ -783,6 +843,7 @@ VP8Metric VP8SSE16x8; VP8Metric VP8SSE4x4; VP8WMetric VP8TDisto4x4; VP8WMetric VP8TDisto16x16; +VP8MeanMetric VP8Mean16x4; VP8QuantizeBlock VP8EncQuantizeBlock; VP8Quantize2Blocks VP8EncQuantize2Blocks; VP8QuantizeBlockWHT VP8EncQuantizeBlockWHT; @@ -795,6 +856,7 @@ extern void VP8EncDspInitAVX2(void); extern void VP8EncDspInitNEON(void); extern void VP8EncDspInitMIPS32(void); extern void VP8EncDspInitMIPSdspR2(void); +extern void VP8EncDspInitMSA(void); static volatile VP8CPUInfo enc_last_cpuinfo_used = (VP8CPUInfo)&enc_last_cpuinfo_used; @@ -820,9 +882,10 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInit(void) { VP8SSE4x4 = SSE4x4; VP8TDisto4x4 = Disto4x4; VP8TDisto16x16 = Disto16x16; + VP8Mean16x4 = Mean16x4; VP8EncQuantizeBlock = QuantizeBlock; VP8EncQuantize2Blocks = Quantize2Blocks; - VP8EncQuantizeBlockWHT = QuantizeBlockWHT; + VP8EncQuantizeBlockWHT = QuantizeBlock; VP8Copy4x4 = Copy4x4; VP8Copy16x8 = Copy16x8; @@ -858,6 +921,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInit(void) { VP8EncDspInitMIPSdspR2(); } #endif +#if defined(WEBP_USE_MSA) + if (VP8GetCPUInfo(kMSA)) { + VP8EncDspInitMSA(); + } +#endif } enc_last_cpuinfo_used = VP8GetCPUInfo; } diff --git a/thirdparty/libwebp/dsp/enc_mips32.c b/thirdparty/libwebp/dsp/enc_mips32.c index fd10143de9..752b14daf6 100644 --- a/thirdparty/libwebp/dsp/enc_mips32.c +++ b/thirdparty/libwebp/dsp/enc_mips32.c @@ -18,8 +18,8 @@ #if defined(WEBP_USE_MIPS32) #include "./mips_macro.h" -#include "../enc/vp8enci.h" -#include "../enc/cost.h" +#include "../enc/vp8i_enc.h" +#include "../enc/cost_enc.h" static const int kC1 = 20091 + (1 << 16); static const int kC2 = 35468; diff --git a/thirdparty/libwebp/dsp/enc_mips_dsp_r2.c b/thirdparty/libwebp/dsp/enc_mips_dsp_r2.c index 7ab96f6800..6c8c1c6acd 100644 --- a/thirdparty/libwebp/dsp/enc_mips_dsp_r2.c +++ b/thirdparty/libwebp/dsp/enc_mips_dsp_r2.c @@ -17,8 +17,8 @@ #if defined(WEBP_USE_MIPS_DSP_R2) #include "./mips_macro.h" -#include "../enc/cost.h" -#include "../enc/vp8enci.h" +#include "../enc/cost_enc.h" +#include "../enc/vp8i_enc.h" static const int kC1 = 20091 + (1 << 16); static const int kC2 = 35468; diff --git a/thirdparty/libwebp/dsp/enc_msa.c b/thirdparty/libwebp/dsp/enc_msa.c new file mode 100644 index 0000000000..909b46d5d9 --- /dev/null +++ b/thirdparty/libwebp/dsp/enc_msa.c @@ -0,0 +1,892 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// MSA version of encoder dsp functions. +// +// Author: Prashant Patil (prashant.patil@imgtec.com) + +#include "./dsp.h" + +#if defined(WEBP_USE_MSA) + +#include <stdlib.h> +#include "./msa_macro.h" +#include "../enc/vp8i_enc.h" + +//------------------------------------------------------------------------------ +// Transforms + +#define IDCT_1D_W(in0, in1, in2, in3, out0, out1, out2, out3) do { \ + v4i32 a1_m, b1_m, c1_m, d1_m; \ + const v4i32 cospi8sqrt2minus1 = __msa_fill_w(20091); \ + const v4i32 sinpi8sqrt2 = __msa_fill_w(35468); \ + v4i32 c_tmp1_m = in1 * sinpi8sqrt2; \ + v4i32 c_tmp2_m = in3 * cospi8sqrt2minus1; \ + v4i32 d_tmp1_m = in1 * cospi8sqrt2minus1; \ + v4i32 d_tmp2_m = in3 * sinpi8sqrt2; \ + \ + ADDSUB2(in0, in2, a1_m, b1_m); \ + SRAI_W2_SW(c_tmp1_m, c_tmp2_m, 16); \ + c_tmp2_m = c_tmp2_m + in3; \ + c1_m = c_tmp1_m - c_tmp2_m; \ + SRAI_W2_SW(d_tmp1_m, d_tmp2_m, 16); \ + d_tmp1_m = d_tmp1_m + in1; \ + d1_m = d_tmp1_m + d_tmp2_m; \ + BUTTERFLY_4(a1_m, b1_m, c1_m, d1_m, out0, out1, out2, out3); \ +} while (0) + +static WEBP_INLINE void ITransformOne(const uint8_t* ref, const int16_t* in, + uint8_t* dst) { + v8i16 input0, input1; + v4i32 in0, in1, in2, in3, hz0, hz1, hz2, hz3, vt0, vt1, vt2, vt3; + v4i32 res0, res1, res2, res3; + v16i8 dest0, dest1, dest2, dest3; + const v16i8 zero = { 0 }; + + LD_SH2(in, 8, input0, input1); + UNPCK_SH_SW(input0, in0, in1); + UNPCK_SH_SW(input1, in2, in3); + IDCT_1D_W(in0, in1, in2, in3, hz0, hz1, hz2, hz3); + TRANSPOSE4x4_SW_SW(hz0, hz1, hz2, hz3, hz0, hz1, hz2, hz3); + IDCT_1D_W(hz0, hz1, hz2, hz3, vt0, vt1, vt2, vt3); + SRARI_W4_SW(vt0, vt1, vt2, vt3, 3); + TRANSPOSE4x4_SW_SW(vt0, vt1, vt2, vt3, vt0, vt1, vt2, vt3); + LD_SB4(ref, BPS, dest0, dest1, dest2, dest3); + ILVR_B4_SW(zero, dest0, zero, dest1, zero, dest2, zero, dest3, + res0, res1, res2, res3); + ILVR_H4_SW(zero, res0, zero, res1, zero, res2, zero, res3, + res0, res1, res2, res3); + ADD4(res0, vt0, res1, vt1, res2, vt2, res3, vt3, res0, res1, res2, res3); + CLIP_SW4_0_255(res0, res1, res2, res3); + PCKEV_B2_SW(res0, res1, res2, res3, vt0, vt1); + res0 = (v4i32)__msa_pckev_b((v16i8)vt0, (v16i8)vt1); + ST4x4_UB(res0, res0, 3, 2, 1, 0, dst, BPS); +} + +static void ITransform(const uint8_t* ref, const int16_t* in, uint8_t* dst, + int do_two) { + ITransformOne(ref, in, dst); + if (do_two) { + ITransformOne(ref + 4, in + 16, dst + 4); + } +} + +static void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) { + uint64_t out0, out1, out2, out3; + uint32_t in0, in1, in2, in3; + v4i32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + v8i16 t0, t1, t2, t3; + v16u8 srcl0, srcl1, src0, src1; + const v8i16 mask0 = { 0, 4, 8, 12, 1, 5, 9, 13 }; + const v8i16 mask1 = { 3, 7, 11, 15, 2, 6, 10, 14 }; + const v8i16 mask2 = { 4, 0, 5, 1, 6, 2, 7, 3 }; + const v8i16 mask3 = { 0, 4, 1, 5, 2, 6, 3, 7 }; + const v8i16 cnst0 = { 2217, -5352, 2217, -5352, 2217, -5352, 2217, -5352 }; + const v8i16 cnst1 = { 5352, 2217, 5352, 2217, 5352, 2217, 5352, 2217 }; + + LW4(src, BPS, in0, in1, in2, in3); + INSERT_W4_UB(in0, in1, in2, in3, src0); + LW4(ref, BPS, in0, in1, in2, in3); + INSERT_W4_UB(in0, in1, in2, in3, src1); + ILVRL_B2_UB(src0, src1, srcl0, srcl1); + HSUB_UB2_SH(srcl0, srcl1, t0, t1); + VSHF_H2_SH(t0, t1, t0, t1, mask0, mask1, t2, t3); + ADDSUB2(t2, t3, t0, t1); + t0 = SRLI_H(t0, 3); + VSHF_H2_SH(t0, t0, t1, t1, mask2, mask3, t3, t2); + tmp0 = __msa_hadd_s_w(t3, t3); + tmp2 = __msa_hsub_s_w(t3, t3); + FILL_W2_SW(1812, 937, tmp1, tmp3); + DPADD_SH2_SW(t2, t2, cnst0, cnst1, tmp3, tmp1); + SRAI_W2_SW(tmp1, tmp3, 9); + PCKEV_H2_SH(tmp1, tmp0, tmp3, tmp2, t0, t1); + VSHF_H2_SH(t0, t1, t0, t1, mask0, mask1, t2, t3); + ADDSUB2(t2, t3, t0, t1); + VSHF_H2_SH(t0, t0, t1, t1, mask2, mask3, t3, t2); + tmp0 = __msa_hadd_s_w(t3, t3); + tmp2 = __msa_hsub_s_w(t3, t3); + ADDVI_W2_SW(tmp0, 7, tmp2, 7, tmp0, tmp2); + SRAI_W2_SW(tmp0, tmp2, 4); + FILL_W2_SW(12000, 51000, tmp1, tmp3); + DPADD_SH2_SW(t2, t2, cnst0, cnst1, tmp3, tmp1); + SRAI_W2_SW(tmp1, tmp3, 16); + UNPCK_R_SH_SW(t1, tmp4); + tmp5 = __msa_ceqi_w(tmp4, 0); + tmp4 = (v4i32)__msa_nor_v((v16u8)tmp5, (v16u8)tmp5); + tmp5 = __msa_fill_w(1); + tmp5 = (v4i32)__msa_and_v((v16u8)tmp5, (v16u8)tmp4); + tmp1 += tmp5; + PCKEV_H2_SH(tmp1, tmp0, tmp3, tmp2, t0, t1); + out0 = __msa_copy_s_d((v2i64)t0, 0); + out1 = __msa_copy_s_d((v2i64)t0, 1); + out2 = __msa_copy_s_d((v2i64)t1, 0); + out3 = __msa_copy_s_d((v2i64)t1, 1); + SD4(out0, out1, out2, out3, out, 8); +} + +static void FTransformWHT(const int16_t* in, int16_t* out) { + v8i16 in0 = { 0 }; + v8i16 in1 = { 0 }; + v8i16 tmp0, tmp1, tmp2, tmp3; + v8i16 out0, out1; + const v8i16 mask0 = { 0, 1, 2, 3, 8, 9, 10, 11 }; + const v8i16 mask1 = { 4, 5, 6, 7, 12, 13, 14, 15 }; + const v8i16 mask2 = { 0, 4, 8, 12, 1, 5, 9, 13 }; + const v8i16 mask3 = { 3, 7, 11, 15, 2, 6, 10, 14 }; + + in0 = __msa_insert_h(in0, 0, in[ 0]); + in0 = __msa_insert_h(in0, 1, in[ 64]); + in0 = __msa_insert_h(in0, 2, in[128]); + in0 = __msa_insert_h(in0, 3, in[192]); + in0 = __msa_insert_h(in0, 4, in[ 16]); + in0 = __msa_insert_h(in0, 5, in[ 80]); + in0 = __msa_insert_h(in0, 6, in[144]); + in0 = __msa_insert_h(in0, 7, in[208]); + in1 = __msa_insert_h(in1, 0, in[ 48]); + in1 = __msa_insert_h(in1, 1, in[112]); + in1 = __msa_insert_h(in1, 2, in[176]); + in1 = __msa_insert_h(in1, 3, in[240]); + in1 = __msa_insert_h(in1, 4, in[ 32]); + in1 = __msa_insert_h(in1, 5, in[ 96]); + in1 = __msa_insert_h(in1, 6, in[160]); + in1 = __msa_insert_h(in1, 7, in[224]); + ADDSUB2(in0, in1, tmp0, tmp1); + VSHF_H2_SH(tmp0, tmp1, tmp0, tmp1, mask0, mask1, tmp2, tmp3); + ADDSUB2(tmp2, tmp3, tmp0, tmp1); + VSHF_H2_SH(tmp0, tmp1, tmp0, tmp1, mask2, mask3, in0, in1); + ADDSUB2(in0, in1, tmp0, tmp1); + VSHF_H2_SH(tmp0, tmp1, tmp0, tmp1, mask0, mask1, tmp2, tmp3); + ADDSUB2(tmp2, tmp3, out0, out1); + SRAI_H2_SH(out0, out1, 1); + ST_SH2(out0, out1, out, 8); +} + +static int TTransform(const uint8_t* in, const uint16_t* w) { + int sum; + uint32_t in0_m, in1_m, in2_m, in3_m; + v16i8 src0; + v8i16 in0, in1, tmp0, tmp1, tmp2, tmp3; + v4i32 dst0, dst1; + const v16i8 zero = { 0 }; + const v8i16 mask0 = { 0, 1, 2, 3, 8, 9, 10, 11 }; + const v8i16 mask1 = { 4, 5, 6, 7, 12, 13, 14, 15 }; + const v8i16 mask2 = { 0, 4, 8, 12, 1, 5, 9, 13 }; + const v8i16 mask3 = { 3, 7, 11, 15, 2, 6, 10, 14 }; + + LW4(in, BPS, in0_m, in1_m, in2_m, in3_m); + INSERT_W4_SB(in0_m, in1_m, in2_m, in3_m, src0); + ILVRL_B2_SH(zero, src0, tmp0, tmp1); + VSHF_H2_SH(tmp0, tmp1, tmp0, tmp1, mask2, mask3, in0, in1); + ADDSUB2(in0, in1, tmp0, tmp1); + VSHF_H2_SH(tmp0, tmp1, tmp0, tmp1, mask0, mask1, tmp2, tmp3); + ADDSUB2(tmp2, tmp3, tmp0, tmp1); + VSHF_H2_SH(tmp0, tmp1, tmp0, tmp1, mask2, mask3, in0, in1); + ADDSUB2(in0, in1, tmp0, tmp1); + VSHF_H2_SH(tmp0, tmp1, tmp0, tmp1, mask0, mask1, tmp2, tmp3); + ADDSUB2(tmp2, tmp3, tmp0, tmp1); + tmp0 = __msa_add_a_h(tmp0, (v8i16)zero); + tmp1 = __msa_add_a_h(tmp1, (v8i16)zero); + LD_SH2(w, 8, tmp2, tmp3); + DOTP_SH2_SW(tmp0, tmp1, tmp2, tmp3, dst0, dst1); + dst0 = dst0 + dst1; + sum = HADD_SW_S32(dst0); + return sum; +} + +static int Disto4x4(const uint8_t* const a, const uint8_t* const b, + const uint16_t* const w) { + const int sum1 = TTransform(a, w); + const int sum2 = TTransform(b, w); + return abs(sum2 - sum1) >> 5; +} + +static int Disto16x16(const uint8_t* const a, const uint8_t* const b, + const uint16_t* const w) { + int D = 0; + int x, y; + for (y = 0; y < 16 * BPS; y += 4 * BPS) { + for (x = 0; x < 16; x += 4) { + D += Disto4x4(a + x + y, b + x + y, w); + } + } + return D; +} + +//------------------------------------------------------------------------------ +// Histogram + +static void CollectHistogram(const uint8_t* ref, const uint8_t* pred, + int start_block, int end_block, + VP8Histogram* const histo) { + int j; + int distribution[MAX_COEFF_THRESH + 1] = { 0 }; + for (j = start_block; j < end_block; ++j) { + int16_t out[16]; + VP8FTransform(ref + VP8DspScan[j], pred + VP8DspScan[j], out); + { + int k; + v8i16 coeff0, coeff1; + const v8i16 zero = { 0 }; + const v8i16 max_coeff_thr = __msa_ldi_h(MAX_COEFF_THRESH); + LD_SH2(&out[0], 8, coeff0, coeff1); + coeff0 = __msa_add_a_h(coeff0, zero); + coeff1 = __msa_add_a_h(coeff1, zero); + SRAI_H2_SH(coeff0, coeff1, 3); + coeff0 = __msa_min_s_h(coeff0, max_coeff_thr); + coeff1 = __msa_min_s_h(coeff1, max_coeff_thr); + ST_SH2(coeff0, coeff1, &out[0], 8); + for (k = 0; k < 16; ++k) { + ++distribution[out[k]]; + } + } + } + VP8SetHistogramData(distribution, histo); +} + +//------------------------------------------------------------------------------ +// Intra predictions + +// luma 4x4 prediction + +#define DST(x, y) dst[(x) + (y) * BPS] +#define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2) +#define AVG2(a, b) (((a) + (b) + 1) >> 1) + +static WEBP_INLINE void VE4(uint8_t* dst, const uint8_t* top) { // vertical + const uint64_t val_m = LD(top - 1); + const v16u8 A = (v16u8)__msa_insert_d((v2i64)A, 0, val_m); + const v16u8 B = SLDI_UB(A, A, 1); + const v16u8 C = SLDI_UB(A, A, 2); + const v16u8 AC = __msa_ave_u_b(A, C); + const v16u8 B2 = __msa_ave_u_b(B, B); + const v16u8 R = __msa_aver_u_b(AC, B2); + const uint32_t out = __msa_copy_s_w((v4i32)R, 0); + SW4(out, out, out, out, dst, BPS); +} + +static WEBP_INLINE void HE4(uint8_t* dst, const uint8_t* top) { // horizontal + const int X = top[-1]; + const int I = top[-2]; + const int J = top[-3]; + const int K = top[-4]; + const int L = top[-5]; + WebPUint32ToMem(dst + 0 * BPS, 0x01010101U * AVG3(X, I, J)); + WebPUint32ToMem(dst + 1 * BPS, 0x01010101U * AVG3(I, J, K)); + WebPUint32ToMem(dst + 2 * BPS, 0x01010101U * AVG3(J, K, L)); + WebPUint32ToMem(dst + 3 * BPS, 0x01010101U * AVG3(K, L, L)); +} + +static WEBP_INLINE void DC4(uint8_t* dst, const uint8_t* top) { + uint32_t dc = 4; + int i; + for (i = 0; i < 4; ++i) dc += top[i] + top[-5 + i]; + dc >>= 3; + dc = dc | (dc << 8) | (dc << 16) | (dc << 24); + SW4(dc, dc, dc, dc, dst, BPS); +} + +static WEBP_INLINE void RD4(uint8_t* dst, const uint8_t* top) { + const uint64_t val_m = LD(top - 5); + const v16u8 A1 = (v16u8)__msa_insert_d((v2i64)A1, 0, val_m); + const v16u8 A = (v16u8)__msa_insert_b((v16i8)A1, 8, top[3]); + const v16u8 B = SLDI_UB(A, A, 1); + const v16u8 C = SLDI_UB(A, A, 2); + const v16u8 AC = __msa_ave_u_b(A, C); + const v16u8 B2 = __msa_ave_u_b(B, B); + const v16u8 R0 = __msa_aver_u_b(AC, B2); + const v16u8 R1 = SLDI_UB(R0, R0, 1); + const v16u8 R2 = SLDI_UB(R1, R1, 1); + const v16u8 R3 = SLDI_UB(R2, R2, 1); + const uint32_t val0 = __msa_copy_s_w((v4i32)R0, 0); + const uint32_t val1 = __msa_copy_s_w((v4i32)R1, 0); + const uint32_t val2 = __msa_copy_s_w((v4i32)R2, 0); + const uint32_t val3 = __msa_copy_s_w((v4i32)R3, 0); + SW4(val3, val2, val1, val0, dst, BPS); +} + +static WEBP_INLINE void LD4(uint8_t* dst, const uint8_t* top) { + const uint64_t val_m = LD(top); + const v16u8 A = (v16u8)__msa_insert_d((v2i64)A, 0, val_m); + const v16u8 B = SLDI_UB(A, A, 1); + const v16u8 C1 = SLDI_UB(A, A, 2); + const v16u8 C = (v16u8)__msa_insert_b((v16i8)C1, 6, top[7]); + const v16u8 AC = __msa_ave_u_b(A, C); + const v16u8 B2 = __msa_ave_u_b(B, B); + const v16u8 R0 = __msa_aver_u_b(AC, B2); + const v16u8 R1 = SLDI_UB(R0, R0, 1); + const v16u8 R2 = SLDI_UB(R1, R1, 1); + const v16u8 R3 = SLDI_UB(R2, R2, 1); + const uint32_t val0 = __msa_copy_s_w((v4i32)R0, 0); + const uint32_t val1 = __msa_copy_s_w((v4i32)R1, 0); + const uint32_t val2 = __msa_copy_s_w((v4i32)R2, 0); + const uint32_t val3 = __msa_copy_s_w((v4i32)R3, 0); + SW4(val0, val1, val2, val3, dst, BPS); +} + +static WEBP_INLINE void VR4(uint8_t* dst, const uint8_t* top) { + const int X = top[-1]; + const int I = top[-2]; + const int J = top[-3]; + const int K = top[-4]; + const int A = top[0]; + const int B = top[1]; + const int C = top[2]; + const int D = top[3]; + DST(0, 0) = DST(1, 2) = AVG2(X, A); + DST(1, 0) = DST(2, 2) = AVG2(A, B); + DST(2, 0) = DST(3, 2) = AVG2(B, C); + DST(3, 0) = AVG2(C, D); + DST(0, 3) = AVG3(K, J, I); + DST(0, 2) = AVG3(J, I, X); + DST(0, 1) = DST(1, 3) = AVG3(I, X, A); + DST(1, 1) = DST(2, 3) = AVG3(X, A, B); + DST(2, 1) = DST(3, 3) = AVG3(A, B, C); + DST(3, 1) = AVG3(B, C, D); +} + +static WEBP_INLINE void VL4(uint8_t* dst, const uint8_t* top) { + const int A = top[0]; + const int B = top[1]; + const int C = top[2]; + const int D = top[3]; + const int E = top[4]; + const int F = top[5]; + const int G = top[6]; + const int H = top[7]; + DST(0, 0) = AVG2(A, B); + DST(1, 0) = DST(0, 2) = AVG2(B, C); + DST(2, 0) = DST(1, 2) = AVG2(C, D); + DST(3, 0) = DST(2, 2) = AVG2(D, E); + DST(0, 1) = AVG3(A, B, C); + DST(1, 1) = DST(0, 3) = AVG3(B, C, D); + DST(2, 1) = DST(1, 3) = AVG3(C, D, E); + DST(3, 1) = DST(2, 3) = AVG3(D, E, F); + DST(3, 2) = AVG3(E, F, G); + DST(3, 3) = AVG3(F, G, H); +} + +static WEBP_INLINE void HU4(uint8_t* dst, const uint8_t* top) { + const int I = top[-2]; + const int J = top[-3]; + const int K = top[-4]; + const int L = top[-5]; + DST(0, 0) = AVG2(I, J); + DST(2, 0) = DST(0, 1) = AVG2(J, K); + DST(2, 1) = DST(0, 2) = AVG2(K, L); + DST(1, 0) = AVG3(I, J, K); + DST(3, 0) = DST(1, 1) = AVG3(J, K, L); + DST(3, 1) = DST(1, 2) = AVG3(K, L, L); + DST(3, 2) = DST(2, 2) = + DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L; +} + +static WEBP_INLINE void HD4(uint8_t* dst, const uint8_t* top) { + const int X = top[-1]; + const int I = top[-2]; + const int J = top[-3]; + const int K = top[-4]; + const int L = top[-5]; + const int A = top[0]; + const int B = top[1]; + const int C = top[2]; + DST(0, 0) = DST(2, 1) = AVG2(I, X); + DST(0, 1) = DST(2, 2) = AVG2(J, I); + DST(0, 2) = DST(2, 3) = AVG2(K, J); + DST(0, 3) = AVG2(L, K); + DST(3, 0) = AVG3(A, B, C); + DST(2, 0) = AVG3(X, A, B); + DST(1, 0) = DST(3, 1) = AVG3(I, X, A); + DST(1, 1) = DST(3, 2) = AVG3(J, I, X); + DST(1, 2) = DST(3, 3) = AVG3(K, J, I); + DST(1, 3) = AVG3(L, K, J); +} + +static WEBP_INLINE void TM4(uint8_t* dst, const uint8_t* top) { + const v16i8 zero = { 0 }; + const v8i16 TL = (v8i16)__msa_fill_h(top[-1]); + const v8i16 L0 = (v8i16)__msa_fill_h(top[-2]); + const v8i16 L1 = (v8i16)__msa_fill_h(top[-3]); + const v8i16 L2 = (v8i16)__msa_fill_h(top[-4]); + const v8i16 L3 = (v8i16)__msa_fill_h(top[-5]); + const v16u8 T1 = LD_UB(top); + const v8i16 T = (v8i16)__msa_ilvr_b(zero, (v16i8)T1); + const v8i16 d = T - TL; + v8i16 r0, r1, r2, r3; + ADD4(d, L0, d, L1, d, L2, d, L3, r0, r1, r2, r3); + CLIP_SH4_0_255(r0, r1, r2, r3); + PCKEV_ST4x4_UB(r0, r1, r2, r3, dst, BPS); +} + +#undef DST +#undef AVG3 +#undef AVG2 + +static void Intra4Preds(uint8_t* dst, const uint8_t* top) { + DC4(I4DC4 + dst, top); + TM4(I4TM4 + dst, top); + VE4(I4VE4 + dst, top); + HE4(I4HE4 + dst, top); + RD4(I4RD4 + dst, top); + VR4(I4VR4 + dst, top); + LD4(I4LD4 + dst, top); + VL4(I4VL4 + dst, top); + HD4(I4HD4 + dst, top); + HU4(I4HU4 + dst, top); +} + +// luma 16x16 prediction + +#define STORE16x16(out, dst) do { \ + ST_UB8(out, out, out, out, out, out, out, out, dst + 0 * BPS, BPS); \ + ST_UB8(out, out, out, out, out, out, out, out, dst + 8 * BPS, BPS); \ +} while (0) + +static WEBP_INLINE void VerticalPred16x16(uint8_t* dst, const uint8_t* top) { + if (top != NULL) { + const v16u8 out = LD_UB(top); + STORE16x16(out, dst); + } else { + const v16u8 out = (v16u8)__msa_fill_b(0x7f); + STORE16x16(out, dst); + } +} + +static WEBP_INLINE void HorizontalPred16x16(uint8_t* dst, + const uint8_t* left) { + if (left != NULL) { + int j; + for (j = 0; j < 16; j += 4) { + const v16u8 L0 = (v16u8)__msa_fill_b(left[0]); + const v16u8 L1 = (v16u8)__msa_fill_b(left[1]); + const v16u8 L2 = (v16u8)__msa_fill_b(left[2]); + const v16u8 L3 = (v16u8)__msa_fill_b(left[3]); + ST_UB4(L0, L1, L2, L3, dst, BPS); + dst += 4 * BPS; + left += 4; + } + } else { + const v16u8 out = (v16u8)__msa_fill_b(0x81); + STORE16x16(out, dst); + } +} + +static WEBP_INLINE void TrueMotion16x16(uint8_t* dst, const uint8_t* left, + const uint8_t* top) { + if (left != NULL) { + if (top != NULL) { + int j; + v8i16 d1, d2; + const v16i8 zero = { 0 }; + const v8i16 TL = (v8i16)__msa_fill_h(left[-1]); + const v16u8 T = LD_UB(top); + ILVRL_B2_SH(zero, T, d1, d2); + SUB2(d1, TL, d2, TL, d1, d2); + for (j = 0; j < 16; j += 4) { + v16i8 t0, t1, t2, t3; + v8i16 r0, r1, r2, r3, r4, r5, r6, r7; + const v8i16 L0 = (v8i16)__msa_fill_h(left[j + 0]); + const v8i16 L1 = (v8i16)__msa_fill_h(left[j + 1]); + const v8i16 L2 = (v8i16)__msa_fill_h(left[j + 2]); + const v8i16 L3 = (v8i16)__msa_fill_h(left[j + 3]); + ADD4(d1, L0, d1, L1, d1, L2, d1, L3, r0, r1, r2, r3); + ADD4(d2, L0, d2, L1, d2, L2, d2, L3, r4, r5, r6, r7); + CLIP_SH4_0_255(r0, r1, r2, r3); + CLIP_SH4_0_255(r4, r5, r6, r7); + PCKEV_B4_SB(r4, r0, r5, r1, r6, r2, r7, r3, t0, t1, t2, t3); + ST_SB4(t0, t1, t2, t3, dst, BPS); + dst += 4 * BPS; + } + } else { + HorizontalPred16x16(dst, left); + } + } else { + if (top != NULL) { + VerticalPred16x16(dst, top); + } else { + const v16u8 out = (v16u8)__msa_fill_b(0x81); + STORE16x16(out, dst); + } + } +} + +static WEBP_INLINE void DCMode16x16(uint8_t* dst, const uint8_t* left, + const uint8_t* top) { + int DC; + v16u8 out; + if (top != NULL && left != NULL) { + const v16u8 rtop = LD_UB(top); + const v8u16 dctop = __msa_hadd_u_h(rtop, rtop); + const v16u8 rleft = LD_UB(left); + const v8u16 dcleft = __msa_hadd_u_h(rleft, rleft); + const v8u16 dctemp = dctop + dcleft; + DC = HADD_UH_U32(dctemp); + DC = (DC + 16) >> 5; + } else if (left != NULL) { // left but no top + const v16u8 rleft = LD_UB(left); + const v8u16 dcleft = __msa_hadd_u_h(rleft, rleft); + DC = HADD_UH_U32(dcleft); + DC = (DC + DC + 16) >> 5; + } else if (top != NULL) { // top but no left + const v16u8 rtop = LD_UB(top); + const v8u16 dctop = __msa_hadd_u_h(rtop, rtop); + DC = HADD_UH_U32(dctop); + DC = (DC + DC + 16) >> 5; + } else { // no top, no left, nothing. + DC = 0x80; + } + out = (v16u8)__msa_fill_b(DC); + STORE16x16(out, dst); +} + +static void Intra16Preds(uint8_t* dst, + const uint8_t* left, const uint8_t* top) { + DCMode16x16(I16DC16 + dst, left, top); + VerticalPred16x16(I16VE16 + dst, top); + HorizontalPred16x16(I16HE16 + dst, left); + TrueMotion16x16(I16TM16 + dst, left, top); +} + +// Chroma 8x8 prediction + +#define CALC_DC8(in, out) do { \ + const v8u16 temp0 = __msa_hadd_u_h(in, in); \ + const v4u32 temp1 = __msa_hadd_u_w(temp0, temp0); \ + const v2i64 temp2 = (v2i64)__msa_hadd_u_d(temp1, temp1); \ + const v2i64 temp3 = __msa_splati_d(temp2, 1); \ + const v2i64 temp4 = temp3 + temp2; \ + const v16i8 temp5 = (v16i8)__msa_srari_d(temp4, 4); \ + const v2i64 temp6 = (v2i64)__msa_splati_b(temp5, 0); \ + out = __msa_copy_s_d(temp6, 0); \ +} while (0) + +#define STORE8x8(out, dst) do { \ + SD4(out, out, out, out, dst + 0 * BPS, BPS); \ + SD4(out, out, out, out, dst + 4 * BPS, BPS); \ +} while (0) + +static WEBP_INLINE void VerticalPred8x8(uint8_t* dst, const uint8_t* top) { + if (top != NULL) { + const uint64_t out = LD(top); + STORE8x8(out, dst); + } else { + const uint64_t out = 0x7f7f7f7f7f7f7f7fULL; + STORE8x8(out, dst); + } +} + +static WEBP_INLINE void HorizontalPred8x8(uint8_t* dst, const uint8_t* left) { + if (left != NULL) { + int j; + for (j = 0; j < 8; j += 4) { + const v16u8 L0 = (v16u8)__msa_fill_b(left[0]); + const v16u8 L1 = (v16u8)__msa_fill_b(left[1]); + const v16u8 L2 = (v16u8)__msa_fill_b(left[2]); + const v16u8 L3 = (v16u8)__msa_fill_b(left[3]); + const uint64_t out0 = __msa_copy_s_d((v2i64)L0, 0); + const uint64_t out1 = __msa_copy_s_d((v2i64)L1, 0); + const uint64_t out2 = __msa_copy_s_d((v2i64)L2, 0); + const uint64_t out3 = __msa_copy_s_d((v2i64)L3, 0); + SD4(out0, out1, out2, out3, dst, BPS); + dst += 4 * BPS; + left += 4; + } + } else { + const uint64_t out = 0x8181818181818181ULL; + STORE8x8(out, dst); + } +} + +static WEBP_INLINE void TrueMotion8x8(uint8_t* dst, const uint8_t* left, + const uint8_t* top) { + if (left != NULL) { + if (top != NULL) { + int j; + const v8i16 TL = (v8i16)__msa_fill_h(left[-1]); + const v16u8 T1 = LD_UB(top); + const v16i8 zero = { 0 }; + const v8i16 T = (v8i16)__msa_ilvr_b(zero, (v16i8)T1); + const v8i16 d = T - TL; + for (j = 0; j < 8; j += 4) { + uint64_t out0, out1, out2, out3; + v16i8 t0, t1; + v8i16 r0 = (v8i16)__msa_fill_h(left[j + 0]); + v8i16 r1 = (v8i16)__msa_fill_h(left[j + 1]); + v8i16 r2 = (v8i16)__msa_fill_h(left[j + 2]); + v8i16 r3 = (v8i16)__msa_fill_h(left[j + 3]); + ADD4(d, r0, d, r1, d, r2, d, r3, r0, r1, r2, r3); + CLIP_SH4_0_255(r0, r1, r2, r3); + PCKEV_B2_SB(r1, r0, r3, r2, t0, t1); + out0 = __msa_copy_s_d((v2i64)t0, 0); + out1 = __msa_copy_s_d((v2i64)t0, 1); + out2 = __msa_copy_s_d((v2i64)t1, 0); + out3 = __msa_copy_s_d((v2i64)t1, 1); + SD4(out0, out1, out2, out3, dst, BPS); + dst += 4 * BPS; + } + } else { + HorizontalPred8x8(dst, left); + } + } else { + if (top != NULL) { + VerticalPred8x8(dst, top); + } else { + const uint64_t out = 0x8181818181818181ULL; + STORE8x8(out, dst); + } + } +} + +static WEBP_INLINE void DCMode8x8(uint8_t* dst, const uint8_t* left, + const uint8_t* top) { + uint64_t out; + v16u8 src; + if (top != NULL && left != NULL) { + const uint64_t left_m = LD(left); + const uint64_t top_m = LD(top); + INSERT_D2_UB(left_m, top_m, src); + CALC_DC8(src, out); + } else if (left != NULL) { // left but no top + const uint64_t left_m = LD(left); + INSERT_D2_UB(left_m, left_m, src); + CALC_DC8(src, out); + } else if (top != NULL) { // top but no left + const uint64_t top_m = LD(top); + INSERT_D2_UB(top_m, top_m, src); + CALC_DC8(src, out); + } else { // no top, no left, nothing. + src = (v16u8)__msa_fill_b(0x80); + out = __msa_copy_s_d((v2i64)src, 0); + } + STORE8x8(out, dst); +} + +static void IntraChromaPreds(uint8_t* dst, const uint8_t* left, + const uint8_t* top) { + // U block + DCMode8x8(C8DC8 + dst, left, top); + VerticalPred8x8(C8VE8 + dst, top); + HorizontalPred8x8(C8HE8 + dst, left); + TrueMotion8x8(C8TM8 + dst, left, top); + // V block + dst += 8; + if (top != NULL) top += 8; + if (left != NULL) left += 16; + DCMode8x8(C8DC8 + dst, left, top); + VerticalPred8x8(C8VE8 + dst, top); + HorizontalPred8x8(C8HE8 + dst, left); + TrueMotion8x8(C8TM8 + dst, left, top); +} + +//------------------------------------------------------------------------------ +// Metric + +#define PACK_DOTP_UB4_SW(in0, in1, in2, in3, out0, out1, out2, out3) do { \ + v16u8 tmp0, tmp1; \ + v8i16 tmp2, tmp3; \ + ILVRL_B2_UB(in0, in1, tmp0, tmp1); \ + HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ + DOTP_SH2_SW(tmp2, tmp3, tmp2, tmp3, out0, out1); \ + ILVRL_B2_UB(in2, in3, tmp0, tmp1); \ + HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ + DOTP_SH2_SW(tmp2, tmp3, tmp2, tmp3, out2, out3); \ +} while (0) + +#define PACK_DPADD_UB4_SW(in0, in1, in2, in3, out0, out1, out2, out3) do { \ + v16u8 tmp0, tmp1; \ + v8i16 tmp2, tmp3; \ + ILVRL_B2_UB(in0, in1, tmp0, tmp1); \ + HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ + DPADD_SH2_SW(tmp2, tmp3, tmp2, tmp3, out0, out1); \ + ILVRL_B2_UB(in2, in3, tmp0, tmp1); \ + HSUB_UB2_SH(tmp0, tmp1, tmp2, tmp3); \ + DPADD_SH2_SW(tmp2, tmp3, tmp2, tmp3, out2, out3); \ +} while (0) + +static int SSE16x16(const uint8_t* a, const uint8_t* b) { + uint32_t sum; + v16u8 src0, src1, src2, src3, src4, src5, src6, src7; + v16u8 ref0, ref1, ref2, ref3, ref4, ref5, ref6, ref7; + v4i32 out0, out1, out2, out3; + + LD_UB8(a, BPS, src0, src1, src2, src3, src4, src5, src6, src7); + LD_UB8(b, BPS, ref0, ref1, ref2, ref3, ref4, ref5, ref6, ref7); + PACK_DOTP_UB4_SW(src0, ref0, src1, ref1, out0, out1, out2, out3); + PACK_DPADD_UB4_SW(src2, ref2, src3, ref3, out0, out1, out2, out3); + PACK_DPADD_UB4_SW(src4, ref4, src5, ref5, out0, out1, out2, out3); + PACK_DPADD_UB4_SW(src6, ref6, src7, ref7, out0, out1, out2, out3); + a += 8 * BPS; + b += 8 * BPS; + LD_UB8(a, BPS, src0, src1, src2, src3, src4, src5, src6, src7); + LD_UB8(b, BPS, ref0, ref1, ref2, ref3, ref4, ref5, ref6, ref7); + PACK_DPADD_UB4_SW(src0, ref0, src1, ref1, out0, out1, out2, out3); + PACK_DPADD_UB4_SW(src2, ref2, src3, ref3, out0, out1, out2, out3); + PACK_DPADD_UB4_SW(src4, ref4, src5, ref5, out0, out1, out2, out3); + PACK_DPADD_UB4_SW(src6, ref6, src7, ref7, out0, out1, out2, out3); + out0 += out1; + out2 += out3; + out0 += out2; + sum = HADD_SW_S32(out0); + return sum; +} + +static int SSE16x8(const uint8_t* a, const uint8_t* b) { + uint32_t sum; + v16u8 src0, src1, src2, src3, src4, src5, src6, src7; + v16u8 ref0, ref1, ref2, ref3, ref4, ref5, ref6, ref7; + v4i32 out0, out1, out2, out3; + + LD_UB8(a, BPS, src0, src1, src2, src3, src4, src5, src6, src7); + LD_UB8(b, BPS, ref0, ref1, ref2, ref3, ref4, ref5, ref6, ref7); + PACK_DOTP_UB4_SW(src0, ref0, src1, ref1, out0, out1, out2, out3); + PACK_DPADD_UB4_SW(src2, ref2, src3, ref3, out0, out1, out2, out3); + PACK_DPADD_UB4_SW(src4, ref4, src5, ref5, out0, out1, out2, out3); + PACK_DPADD_UB4_SW(src6, ref6, src7, ref7, out0, out1, out2, out3); + out0 += out1; + out2 += out3; + out0 += out2; + sum = HADD_SW_S32(out0); + return sum; +} + +static int SSE8x8(const uint8_t* a, const uint8_t* b) { + uint32_t sum; + v16u8 src0, src1, src2, src3, src4, src5, src6, src7; + v16u8 ref0, ref1, ref2, ref3, ref4, ref5, ref6, ref7; + v16u8 t0, t1, t2, t3; + v4i32 out0, out1, out2, out3; + + LD_UB8(a, BPS, src0, src1, src2, src3, src4, src5, src6, src7); + LD_UB8(b, BPS, ref0, ref1, ref2, ref3, ref4, ref5, ref6, ref7); + ILVR_B4_UB(src0, src1, src2, src3, ref0, ref1, ref2, ref3, t0, t1, t2, t3); + PACK_DOTP_UB4_SW(t0, t2, t1, t3, out0, out1, out2, out3); + ILVR_B4_UB(src4, src5, src6, src7, ref4, ref5, ref6, ref7, t0, t1, t2, t3); + PACK_DPADD_UB4_SW(t0, t2, t1, t3, out0, out1, out2, out3); + out0 += out1; + out2 += out3; + out0 += out2; + sum = HADD_SW_S32(out0); + return sum; +} + +static int SSE4x4(const uint8_t* a, const uint8_t* b) { + uint32_t sum = 0; + uint32_t src0, src1, src2, src3, ref0, ref1, ref2, ref3; + v16u8 src, ref, tmp0, tmp1; + v8i16 diff0, diff1; + v4i32 out0, out1; + + LW4(a, BPS, src0, src1, src2, src3); + LW4(b, BPS, ref0, ref1, ref2, ref3); + INSERT_W4_UB(src0, src1, src2, src3, src); + INSERT_W4_UB(ref0, ref1, ref2, ref3, ref); + ILVRL_B2_UB(src, ref, tmp0, tmp1); + HSUB_UB2_SH(tmp0, tmp1, diff0, diff1); + DOTP_SH2_SW(diff0, diff1, diff0, diff1, out0, out1); + out0 += out1; + sum = HADD_SW_S32(out0); + return sum; +} + +//------------------------------------------------------------------------------ +// Quantization + +static int QuantizeBlock(int16_t in[16], int16_t out[16], + const VP8Matrix* const mtx) { + int sum; + v8i16 in0, in1, sh0, sh1, out0, out1; + v8i16 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, sign0, sign1; + v4i32 s0, s1, s2, s3, b0, b1, b2, b3, t0, t1, t2, t3; + const v8i16 zero = { 0 }; + const v8i16 zigzag0 = { 0, 1, 4, 8, 5, 2, 3, 6 }; + const v8i16 zigzag1 = { 9, 12, 13, 10, 7, 11, 14, 15 }; + const v8i16 maxlevel = __msa_fill_h(MAX_LEVEL); + + LD_SH2(&in[0], 8, in0, in1); + LD_SH2(&mtx->sharpen_[0], 8, sh0, sh1); + tmp4 = __msa_add_a_h(in0, zero); + tmp5 = __msa_add_a_h(in1, zero); + ILVRL_H2_SH(sh0, tmp4, tmp0, tmp1); + ILVRL_H2_SH(sh1, tmp5, tmp2, tmp3); + HADD_SH4_SW(tmp0, tmp1, tmp2, tmp3, s0, s1, s2, s3); + sign0 = (in0 < zero); + sign1 = (in1 < zero); // sign + LD_SH2(&mtx->iq_[0], 8, tmp0, tmp1); // iq + ILVRL_H2_SW(zero, tmp0, t0, t1); + ILVRL_H2_SW(zero, tmp1, t2, t3); + LD_SW4(&mtx->bias_[0], 4, b0, b1, b2, b3); // bias + MUL4(t0, s0, t1, s1, t2, s2, t3, s3, t0, t1, t2, t3); + ADD4(b0, t0, b1, t1, b2, t2, b3, t3, b0, b1, b2, b3); + SRAI_W4_SW(b0, b1, b2, b3, 17); + PCKEV_H2_SH(b1, b0, b3, b2, tmp2, tmp3); + tmp0 = (tmp2 > maxlevel); + tmp1 = (tmp3 > maxlevel); + tmp2 = (v8i16)__msa_bmnz_v((v16u8)tmp2, (v16u8)maxlevel, (v16u8)tmp0); + tmp3 = (v8i16)__msa_bmnz_v((v16u8)tmp3, (v16u8)maxlevel, (v16u8)tmp1); + SUB2(0, tmp2, 0, tmp3, tmp0, tmp1); + tmp2 = (v8i16)__msa_bmnz_v((v16u8)tmp2, (v16u8)tmp0, (v16u8)sign0); + tmp3 = (v8i16)__msa_bmnz_v((v16u8)tmp3, (v16u8)tmp1, (v16u8)sign1); + LD_SW4(&mtx->zthresh_[0], 4, t0, t1, t2, t3); // zthresh + t0 = (s0 > t0); + t1 = (s1 > t1); + t2 = (s2 > t2); + t3 = (s3 > t3); + PCKEV_H2_SH(t1, t0, t3, t2, tmp0, tmp1); + tmp4 = (v8i16)__msa_bmnz_v((v16u8)zero, (v16u8)tmp2, (v16u8)tmp0); + tmp5 = (v8i16)__msa_bmnz_v((v16u8)zero, (v16u8)tmp3, (v16u8)tmp1); + LD_SH2(&mtx->q_[0], 8, tmp0, tmp1); + MUL2(tmp4, tmp0, tmp5, tmp1, in0, in1); + VSHF_H2_SH(tmp4, tmp5, tmp4, tmp5, zigzag0, zigzag1, out0, out1); + ST_SH2(in0, in1, &in[0], 8); + ST_SH2(out0, out1, &out[0], 8); + out0 = __msa_add_a_h(out0, out1); + sum = HADD_SH_S32(out0); + return (sum > 0); +} + +static int Quantize2Blocks(int16_t in[32], int16_t out[32], + const VP8Matrix* const mtx) { + int nz; + nz = VP8EncQuantizeBlock(in + 0 * 16, out + 0 * 16, mtx) << 0; + nz |= VP8EncQuantizeBlock(in + 1 * 16, out + 1 * 16, mtx) << 1; + return nz; +} + +//------------------------------------------------------------------------------ +// Entry point + +extern void VP8EncDspInitMSA(void); + +WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMSA(void) { + VP8ITransform = ITransform; + VP8FTransform = FTransform; + VP8FTransformWHT = FTransformWHT; + + VP8TDisto4x4 = Disto4x4; + VP8TDisto16x16 = Disto16x16; + VP8CollectHistogram = CollectHistogram; + + VP8EncPredLuma4 = Intra4Preds; + VP8EncPredLuma16 = Intra16Preds; + VP8EncPredChroma8 = IntraChromaPreds; + + VP8SSE16x16 = SSE16x16; + VP8SSE16x8 = SSE16x8; + VP8SSE8x8 = SSE8x8; + VP8SSE4x4 = SSE4x4; + + VP8EncQuantizeBlock = QuantizeBlock; + VP8EncQuantize2Blocks = Quantize2Blocks; + VP8EncQuantizeBlockWHT = QuantizeBlock; +} + +#else // !WEBP_USE_MSA + +WEBP_DSP_INIT_STUB(VP8EncDspInitMSA) + +#endif // WEBP_USE_MSA diff --git a/thirdparty/libwebp/dsp/enc_neon.c b/thirdparty/libwebp/dsp/enc_neon.c index 46f6bf9a33..6a078d632d 100644 --- a/thirdparty/libwebp/dsp/enc_neon.c +++ b/thirdparty/libwebp/dsp/enc_neon.c @@ -18,7 +18,7 @@ #include <assert.h> #include "./neon.h" -#include "../enc/vp8enci.h" +#include "../enc/vp8i_enc.h" //------------------------------------------------------------------------------ // Transforms (Paragraph 14.4) @@ -746,9 +746,14 @@ static WEBP_INLINE void AccumulateSSE16(const uint8_t* const a, const uint8x16_t a0 = vld1q_u8(a); const uint8x16_t b0 = vld1q_u8(b); const uint8x16_t abs_diff = vabdq_u8(a0, b0); - uint16x8_t prod = vmull_u8(vget_low_u8(abs_diff), vget_low_u8(abs_diff)); - prod = vmlal_u8(prod, vget_high_u8(abs_diff), vget_high_u8(abs_diff)); - *sum = vpadalq_u16(*sum, prod); // pair-wise add and accumulate + const uint16x8_t prod1 = vmull_u8(vget_low_u8(abs_diff), + vget_low_u8(abs_diff)); + const uint16x8_t prod2 = vmull_u8(vget_high_u8(abs_diff), + vget_high_u8(abs_diff)); + /* pair-wise adds and widen */ + const uint32x4_t sum1 = vpaddlq_u16(prod1); + const uint32x4_t sum2 = vpaddlq_u16(prod2); + *sum = vaddq_u32(*sum, vaddq_u32(sum1, sum2)); } // Horizontal sum of all four uint32_t values in 'sum'. @@ -758,7 +763,7 @@ static int SumToInt(uint32x4_t sum) { return (int)sum3; } -static int SSE16x16(const uint8_t* a, const uint8_t* b) { +static int SSE16x16_NEON(const uint8_t* a, const uint8_t* b) { uint32x4_t sum = vdupq_n_u32(0); int y; for (y = 0; y < 16; ++y) { @@ -767,7 +772,7 @@ static int SSE16x16(const uint8_t* a, const uint8_t* b) { return SumToInt(sum); } -static int SSE16x8(const uint8_t* a, const uint8_t* b) { +static int SSE16x8_NEON(const uint8_t* a, const uint8_t* b) { uint32x4_t sum = vdupq_n_u32(0); int y; for (y = 0; y < 8; ++y) { @@ -776,7 +781,7 @@ static int SSE16x8(const uint8_t* a, const uint8_t* b) { return SumToInt(sum); } -static int SSE8x8(const uint8_t* a, const uint8_t* b) { +static int SSE8x8_NEON(const uint8_t* a, const uint8_t* b) { uint32x4_t sum = vdupq_n_u32(0); int y; for (y = 0; y < 8; ++y) { @@ -789,13 +794,18 @@ static int SSE8x8(const uint8_t* a, const uint8_t* b) { return SumToInt(sum); } -static int SSE4x4(const uint8_t* a, const uint8_t* b) { +static int SSE4x4_NEON(const uint8_t* a, const uint8_t* b) { const uint8x16_t a0 = Load4x4(a); const uint8x16_t b0 = Load4x4(b); const uint8x16_t abs_diff = vabdq_u8(a0, b0); - uint16x8_t prod = vmull_u8(vget_low_u8(abs_diff), vget_low_u8(abs_diff)); - prod = vmlal_u8(prod, vget_high_u8(abs_diff), vget_high_u8(abs_diff)); - return SumToInt(vpaddlq_u16(prod)); + const uint16x8_t prod1 = vmull_u8(vget_low_u8(abs_diff), + vget_low_u8(abs_diff)); + const uint16x8_t prod2 = vmull_u8(vget_high_u8(abs_diff), + vget_high_u8(abs_diff)); + /* pair-wise adds and widen */ + const uint32x4_t sum1 = vpaddlq_u16(prod1); + const uint32x4_t sum2 = vpaddlq_u16(prod2); + return SumToInt(vaddq_u32(sum1, sum2)); } //------------------------------------------------------------------------------ @@ -903,10 +913,12 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitNEON(void) { VP8TDisto4x4 = Disto4x4; VP8TDisto16x16 = Disto16x16; VP8CollectHistogram = CollectHistogram; - VP8SSE16x16 = SSE16x16; - VP8SSE16x8 = SSE16x8; - VP8SSE8x8 = SSE8x8; - VP8SSE4x4 = SSE4x4; + + VP8SSE16x16 = SSE16x16_NEON; + VP8SSE16x8 = SSE16x8_NEON; + VP8SSE8x8 = SSE8x8_NEON; + VP8SSE4x4 = SSE4x4_NEON; + #if !defined(WORK_AROUND_GCC) VP8EncQuantizeBlock = QuantizeBlock; VP8EncQuantize2Blocks = Quantize2Blocks; diff --git a/thirdparty/libwebp/dsp/enc_sse2.c b/thirdparty/libwebp/dsp/enc_sse2.c index 4a2e3ce14f..2026a74c91 100644 --- a/thirdparty/libwebp/dsp/enc_sse2.c +++ b/thirdparty/libwebp/dsp/enc_sse2.c @@ -14,12 +14,13 @@ #include "./dsp.h" #if defined(WEBP_USE_SSE2) +#include <assert.h> #include <stdlib.h> // for abs() #include <emmintrin.h> #include "./common_sse2.h" -#include "../enc/cost.h" -#include "../enc/vp8enci.h" +#include "../enc/cost_enc.h" +#include "../enc/vp8i_enc.h" //------------------------------------------------------------------------------ // Transforms (Paragraph 14.4) @@ -139,7 +140,7 @@ static void ITransform(const uint8_t* ref, const int16_t* in, uint8_t* dst, // Transpose the two 4x4. VP8Transpose_2_4x4_16b(&shifted0, &shifted1, &shifted2, &shifted3, &T0, &T1, - &T2, &T3); + &T2, &T3); } // Add inverse transform to 'ref' and store. @@ -250,25 +251,11 @@ static void FTransformPass2(const __m128i* const v01, const __m128i* const v32, const __m128i k51000 = _mm_set1_epi32(51000); // Same operations are done on the (0,3) and (1,2) pairs. - // a0 = v0 + v3 - // a1 = v1 + v2 // a3 = v0 - v3 // a2 = v1 - v2 - const __m128i a01 = _mm_add_epi16(*v01, *v32); const __m128i a32 = _mm_sub_epi16(*v01, *v32); - const __m128i a11 = _mm_unpackhi_epi64(a01, a01); const __m128i a22 = _mm_unpackhi_epi64(a32, a32); - const __m128i a01_plus_7 = _mm_add_epi16(a01, seven); - // d0 = (a0 + a1 + 7) >> 4; - // d2 = (a0 - a1 + 7) >> 4; - const __m128i c0 = _mm_add_epi16(a01_plus_7, a11); - const __m128i c2 = _mm_sub_epi16(a01_plus_7, a11); - const __m128i d0 = _mm_srai_epi16(c0, 4); - const __m128i d2 = _mm_srai_epi16(c2, 4); - - // f1 = ((b3 * 5352 + b2 * 2217 + 12000) >> 16) - // f3 = ((b3 * 2217 - b2 * 5352 + 51000) >> 16) const __m128i b23 = _mm_unpacklo_epi16(a22, a32); const __m128i c1 = _mm_madd_epi16(b23, k5352_2217); const __m128i c3 = _mm_madd_epi16(b23, k2217_5352); @@ -276,14 +263,28 @@ static void FTransformPass2(const __m128i* const v01, const __m128i* const v32, const __m128i d3 = _mm_add_epi32(c3, k51000); const __m128i e1 = _mm_srai_epi32(d1, 16); const __m128i e3 = _mm_srai_epi32(d3, 16); + // f1 = ((b3 * 5352 + b2 * 2217 + 12000) >> 16) + // f3 = ((b3 * 2217 - b2 * 5352 + 51000) >> 16) const __m128i f1 = _mm_packs_epi32(e1, e1); const __m128i f3 = _mm_packs_epi32(e3, e3); - // f1 = f1 + (a3 != 0); + // g1 = f1 + (a3 != 0); // The compare will return (0xffff, 0) for (==0, !=0). To turn that into the // desired (0, 1), we add one earlier through k12000_plus_one. - // -> f1 = f1 + 1 - (a3 == 0) + // -> g1 = f1 + 1 - (a3 == 0) const __m128i g1 = _mm_add_epi16(f1, _mm_cmpeq_epi16(a32, zero)); + // a0 = v0 + v3 + // a1 = v1 + v2 + const __m128i a01 = _mm_add_epi16(*v01, *v32); + const __m128i a01_plus_7 = _mm_add_epi16(a01, seven); + const __m128i a11 = _mm_unpackhi_epi64(a01, a01); + const __m128i c0 = _mm_add_epi16(a01_plus_7, a11); + const __m128i c2 = _mm_sub_epi16(a01_plus_7, a11); + // d0 = (a0 + a1 + 7) >> 4; + // d2 = (a0 - a1 + 7) >> 4; + const __m128i d0 = _mm_srai_epi16(c0, 4); + const __m128i d2 = _mm_srai_epi16(c2, 4); + const __m128i d0_g1 = _mm_unpacklo_epi64(d0, g1); const __m128i d2_f3 = _mm_unpacklo_epi64(d2, f3); _mm_storeu_si128((__m128i*)&out[0], d0_g1); @@ -1046,6 +1047,37 @@ static int SSE4x4(const uint8_t* a, const uint8_t* b) { } //------------------------------------------------------------------------------ + +static void Mean16x4(const uint8_t* ref, uint32_t dc[4]) { + const __m128i mask = _mm_set1_epi16(0x00ff); + const __m128i a0 = _mm_loadu_si128((const __m128i*)&ref[BPS * 0]); + const __m128i a1 = _mm_loadu_si128((const __m128i*)&ref[BPS * 1]); + const __m128i a2 = _mm_loadu_si128((const __m128i*)&ref[BPS * 2]); + const __m128i a3 = _mm_loadu_si128((const __m128i*)&ref[BPS * 3]); + const __m128i b0 = _mm_srli_epi16(a0, 8); // hi byte + const __m128i b1 = _mm_srli_epi16(a1, 8); + const __m128i b2 = _mm_srli_epi16(a2, 8); + const __m128i b3 = _mm_srli_epi16(a3, 8); + const __m128i c0 = _mm_and_si128(a0, mask); // lo byte + const __m128i c1 = _mm_and_si128(a1, mask); + const __m128i c2 = _mm_and_si128(a2, mask); + const __m128i c3 = _mm_and_si128(a3, mask); + const __m128i d0 = _mm_add_epi32(b0, c0); + const __m128i d1 = _mm_add_epi32(b1, c1); + const __m128i d2 = _mm_add_epi32(b2, c2); + const __m128i d3 = _mm_add_epi32(b3, c3); + const __m128i e0 = _mm_add_epi32(d0, d1); + const __m128i e1 = _mm_add_epi32(d2, d3); + const __m128i f0 = _mm_add_epi32(e0, e1); + uint16_t tmp[8]; + _mm_storeu_si128((__m128i*)tmp, f0); + dc[0] = tmp[0] + tmp[1]; + dc[1] = tmp[2] + tmp[3]; + dc[2] = tmp[4] + tmp[5]; + dc[3] = tmp[6] + tmp[7]; +} + +//------------------------------------------------------------------------------ // Texture distortion // // We try to match the spectral content (weighted) between source and @@ -1331,10 +1363,122 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitSSE2(void) { VP8SSE4x4 = SSE4x4; VP8TDisto4x4 = Disto4x4; VP8TDisto16x16 = Disto16x16; + VP8Mean16x4 = Mean16x4; +} + +//------------------------------------------------------------------------------ +// SSIM / PSNR entry point (TODO(skal): move to its own file later) + +static uint32_t AccumulateSSE_SSE2(const uint8_t* src1, + const uint8_t* src2, int len) { + int i = 0; + uint32_t sse2 = 0; + if (len >= 16) { + const int limit = len - 32; + int32_t tmp[4]; + __m128i sum1; + __m128i sum = _mm_setzero_si128(); + __m128i a0 = _mm_loadu_si128((const __m128i*)&src1[i]); + __m128i b0 = _mm_loadu_si128((const __m128i*)&src2[i]); + i += 16; + while (i <= limit) { + const __m128i a1 = _mm_loadu_si128((const __m128i*)&src1[i]); + const __m128i b1 = _mm_loadu_si128((const __m128i*)&src2[i]); + __m128i sum2; + i += 16; + SubtractAndAccumulate(a0, b0, &sum1); + sum = _mm_add_epi32(sum, sum1); + a0 = _mm_loadu_si128((const __m128i*)&src1[i]); + b0 = _mm_loadu_si128((const __m128i*)&src2[i]); + i += 16; + SubtractAndAccumulate(a1, b1, &sum2); + sum = _mm_add_epi32(sum, sum2); + } + SubtractAndAccumulate(a0, b0, &sum1); + sum = _mm_add_epi32(sum, sum1); + _mm_storeu_si128((__m128i*)tmp, sum); + sse2 += (tmp[3] + tmp[2] + tmp[1] + tmp[0]); + } + + for (; i < len; ++i) { + const int32_t diff = src1[i] - src2[i]; + sse2 += diff * diff; + } + return sse2; +} + +static uint32_t HorizontalAdd16b(const __m128i* const m) { + uint16_t tmp[8]; + const __m128i a = _mm_srli_si128(*m, 8); + const __m128i b = _mm_add_epi16(*m, a); + _mm_storeu_si128((__m128i*)tmp, b); + return (uint32_t)tmp[3] + tmp[2] + tmp[1] + tmp[0]; +} + +static uint32_t HorizontalAdd32b(const __m128i* const m) { + const __m128i a = _mm_srli_si128(*m, 8); + const __m128i b = _mm_add_epi32(*m, a); + const __m128i c = _mm_add_epi32(b, _mm_srli_si128(b, 4)); + return (uint32_t)_mm_cvtsi128_si32(c); +} + +static const uint16_t kWeight[] = { 1, 2, 3, 4, 3, 2, 1, 0 }; + +#define ACCUMULATE_ROW(WEIGHT) do { \ + /* compute row weight (Wx * Wy) */ \ + const __m128i Wy = _mm_set1_epi16((WEIGHT)); \ + const __m128i W = _mm_mullo_epi16(Wx, Wy); \ + /* process 8 bytes at a time (7 bytes, actually) */ \ + const __m128i a0 = _mm_loadl_epi64((const __m128i*)src1); \ + const __m128i b0 = _mm_loadl_epi64((const __m128i*)src2); \ + /* convert to 16b and multiply by weight */ \ + const __m128i a1 = _mm_unpacklo_epi8(a0, zero); \ + const __m128i b1 = _mm_unpacklo_epi8(b0, zero); \ + const __m128i wa1 = _mm_mullo_epi16(a1, W); \ + const __m128i wb1 = _mm_mullo_epi16(b1, W); \ + /* accumulate */ \ + xm = _mm_add_epi16(xm, wa1); \ + ym = _mm_add_epi16(ym, wb1); \ + xxm = _mm_add_epi32(xxm, _mm_madd_epi16(a1, wa1)); \ + xym = _mm_add_epi32(xym, _mm_madd_epi16(a1, wb1)); \ + yym = _mm_add_epi32(yym, _mm_madd_epi16(b1, wb1)); \ + src1 += stride1; \ + src2 += stride2; \ +} while (0) + +static double SSIMGet_SSE2(const uint8_t* src1, int stride1, + const uint8_t* src2, int stride2) { + VP8DistoStats stats; + const __m128i zero = _mm_setzero_si128(); + __m128i xm = zero, ym = zero; // 16b accums + __m128i xxm = zero, yym = zero, xym = zero; // 32b accum + const __m128i Wx = _mm_loadu_si128((const __m128i*)kWeight); + assert(2 * VP8_SSIM_KERNEL + 1 == 7); + ACCUMULATE_ROW(1); + ACCUMULATE_ROW(2); + ACCUMULATE_ROW(3); + ACCUMULATE_ROW(4); + ACCUMULATE_ROW(3); + ACCUMULATE_ROW(2); + ACCUMULATE_ROW(1); + stats.xm = HorizontalAdd16b(&xm); + stats.ym = HorizontalAdd16b(&ym); + stats.xxm = HorizontalAdd32b(&xxm); + stats.xym = HorizontalAdd32b(&xym); + stats.yym = HorizontalAdd32b(&yym); + return VP8SSIMFromStats(&stats); +} + +extern void VP8SSIMDspInitSSE2(void); + +WEBP_TSAN_IGNORE_FUNCTION void VP8SSIMDspInitSSE2(void) { + VP8AccumulateSSE = AccumulateSSE_SSE2; + VP8SSIMGet = SSIMGet_SSE2; } #else // !WEBP_USE_SSE2 WEBP_DSP_INIT_STUB(VP8EncDspInitSSE2) +WEBP_DSP_INIT_STUB(VP8SSIMDspInitSSE2) #endif // WEBP_USE_SSE2 diff --git a/thirdparty/libwebp/dsp/enc_sse41.c b/thirdparty/libwebp/dsp/enc_sse41.c index a1783901a6..e32086d9fd 100644 --- a/thirdparty/libwebp/dsp/enc_sse41.c +++ b/thirdparty/libwebp/dsp/enc_sse41.c @@ -18,7 +18,7 @@ #include <stdlib.h> // for abs() #include "./common_sse2.h" -#include "../enc/vp8enci.h" +#include "../enc/vp8i_enc.h" //------------------------------------------------------------------------------ // Compute susceptibility based on DCT-coeff histograms. diff --git a/thirdparty/libwebp/dsp/filters.c b/thirdparty/libwebp/dsp/filters.c index 9f04faf0cb..65f34aad1f 100644 --- a/thirdparty/libwebp/dsp/filters.c +++ b/thirdparty/libwebp/dsp/filters.c @@ -227,6 +227,8 @@ WebPFilterFunc WebPFilters[WEBP_FILTER_LAST]; WebPUnfilterFunc WebPUnfilters[WEBP_FILTER_LAST]; extern void VP8FiltersInitMIPSdspR2(void); +extern void VP8FiltersInitMSA(void); +extern void VP8FiltersInitNEON(void); extern void VP8FiltersInitSSE2(void); static volatile VP8CPUInfo filters_last_cpuinfo_used = @@ -251,11 +253,21 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInit(void) { VP8FiltersInitSSE2(); } #endif +#if defined(WEBP_USE_NEON) + if (VP8GetCPUInfo(kNEON)) { + VP8FiltersInitNEON(); + } +#endif #if defined(WEBP_USE_MIPS_DSP_R2) if (VP8GetCPUInfo(kMIPSdspR2)) { VP8FiltersInitMIPSdspR2(); } #endif +#if defined(WEBP_USE_MSA) + if (VP8GetCPUInfo(kMSA)) { + VP8FiltersInitMSA(); + } +#endif } filters_last_cpuinfo_used = VP8GetCPUInfo; } diff --git a/thirdparty/libwebp/dsp/filters_msa.c b/thirdparty/libwebp/dsp/filters_msa.c new file mode 100644 index 0000000000..4b8922d0bc --- /dev/null +++ b/thirdparty/libwebp/dsp/filters_msa.c @@ -0,0 +1,202 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// MSA variant of alpha filters +// +// Author: Prashant Patil (prashant.patil@imgtec.com) + +#include "./dsp.h" + +#if defined(WEBP_USE_MSA) + +#include "./msa_macro.h" + +#include <assert.h> + +static WEBP_INLINE void PredictLineInverse0(const uint8_t* src, + const uint8_t* pred, + uint8_t* dst, int length) { + v16u8 src0, pred0, dst0; + assert(length >= 0); + while (length >= 32) { + v16u8 src1, pred1, dst1; + LD_UB2(src, 16, src0, src1); + LD_UB2(pred, 16, pred0, pred1); + SUB2(src0, pred0, src1, pred1, dst0, dst1); + ST_UB2(dst0, dst1, dst, 16); + src += 32; + pred += 32; + dst += 32; + length -= 32; + } + if (length > 0) { + int i; + if (length >= 16) { + src0 = LD_UB(src); + pred0 = LD_UB(pred); + dst0 = src0 - pred0; + ST_UB(dst0, dst); + src += 16; + pred += 16; + dst += 16; + length -= 16; + } + for (i = 0; i < length; i++) { + dst[i] = src[i] - pred[i]; + } + } +} + +//------------------------------------------------------------------------------ +// Helpful macro. + +#define SANITY_CHECK(in, out) \ + assert(in != NULL); \ + assert(out != NULL); \ + assert(width > 0); \ + assert(height > 0); \ + assert(stride >= width); + +//------------------------------------------------------------------------------ +// Horrizontal filter + +static void HorizontalFilter(const uint8_t* data, int width, int height, + int stride, uint8_t* filtered_data) { + const uint8_t* preds = data; + const uint8_t* in = data; + uint8_t* out = filtered_data; + int row = 1; + SANITY_CHECK(in, out); + + // Leftmost pixel is the same as input for topmost scanline. + out[0] = in[0]; + PredictLineInverse0(in + 1, preds, out + 1, width - 1); + preds += stride; + in += stride; + out += stride; + // Filter line-by-line. + while (row < height) { + // Leftmost pixel is predicted from above. + PredictLineInverse0(in, preds - stride, out, 1); + PredictLineInverse0(in + 1, preds, out + 1, width - 1); + ++row; + preds += stride; + in += stride; + out += stride; + } +} + +//------------------------------------------------------------------------------ +// Gradient filter + +static WEBP_INLINE void PredictLineGradient(const uint8_t* pinput, + const uint8_t* ppred, + uint8_t* poutput, int stride, + int size) { + int w; + const v16i8 zero = { 0 }; + while (size >= 16) { + v16u8 pred0, dst0; + v8i16 a0, a1, b0, b1, c0, c1; + const v16u8 tmp0 = LD_UB(ppred - 1); + const v16u8 tmp1 = LD_UB(ppred - stride); + const v16u8 tmp2 = LD_UB(ppred - stride - 1); + const v16u8 src0 = LD_UB(pinput); + ILVRL_B2_SH(zero, tmp0, a0, a1); + ILVRL_B2_SH(zero, tmp1, b0, b1); + ILVRL_B2_SH(zero, tmp2, c0, c1); + ADD2(a0, b0, a1, b1, a0, a1); + SUB2(a0, c0, a1, c1, a0, a1); + CLIP_SH2_0_255(a0, a1); + pred0 = (v16u8)__msa_pckev_b((v16i8)a1, (v16i8)a0); + dst0 = src0 - pred0; + ST_UB(dst0, poutput); + ppred += 16; + pinput += 16; + poutput += 16; + size -= 16; + } + for (w = 0; w < size; ++w) { + const int pred = ppred[w - 1] + ppred[w - stride] - ppred[w - stride - 1]; + poutput[w] = pinput[w] - (pred < 0 ? 0 : pred > 255 ? 255 : pred); + } +} + + +static void GradientFilter(const uint8_t* data, int width, int height, + int stride, uint8_t* filtered_data) { + const uint8_t* in = data; + const uint8_t* preds = data; + uint8_t* out = filtered_data; + int row = 1; + SANITY_CHECK(in, out); + + // left prediction for top scan-line + out[0] = in[0]; + PredictLineInverse0(in + 1, preds, out + 1, width - 1); + preds += stride; + in += stride; + out += stride; + // Filter line-by-line. + while (row < height) { + out[0] = in[0] - preds[- stride]; + PredictLineGradient(preds + 1, in + 1, out + 1, stride, width - 1); + ++row; + preds += stride; + in += stride; + out += stride; + } +} + +//------------------------------------------------------------------------------ +// Vertical filter + +static void VerticalFilter(const uint8_t* data, int width, int height, + int stride, uint8_t* filtered_data) { + const uint8_t* in = data; + const uint8_t* preds = data; + uint8_t* out = filtered_data; + int row = 1; + SANITY_CHECK(in, out); + + // Very first top-left pixel is copied. + out[0] = in[0]; + // Rest of top scan-line is left-predicted. + PredictLineInverse0(in + 1, preds, out + 1, width - 1); + in += stride; + out += stride; + + // Filter line-by-line. + while (row < height) { + PredictLineInverse0(in, preds, out, width); + ++row; + preds += stride; + in += stride; + out += stride; + } +} + +#undef SANITY_CHECK + +//------------------------------------------------------------------------------ +// Entry point + +extern void VP8FiltersInitMSA(void); + +WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitMSA(void) { + WebPFilters[WEBP_FILTER_HORIZONTAL] = HorizontalFilter; + WebPFilters[WEBP_FILTER_VERTICAL] = VerticalFilter; + WebPFilters[WEBP_FILTER_GRADIENT] = GradientFilter; +} + +#else // !WEBP_USE_MSA + +WEBP_DSP_INIT_STUB(VP8FiltersInitMSA) + +#endif // WEBP_USE_MSA diff --git a/thirdparty/libwebp/dsp/filters_neon.c b/thirdparty/libwebp/dsp/filters_neon.c new file mode 100644 index 0000000000..4d6e50cc76 --- /dev/null +++ b/thirdparty/libwebp/dsp/filters_neon.c @@ -0,0 +1,327 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// NEON variant of alpha filters +// +// Author: Skal (pascal.massimino@gmail.com) + +#include "./dsp.h" + +#if defined(WEBP_USE_NEON) + +#include <assert.h> +#include "./neon.h" + +//------------------------------------------------------------------------------ +// Helpful macros. + +# define SANITY_CHECK(in, out) \ + assert(in != NULL); \ + assert(out != NULL); \ + assert(width > 0); \ + assert(height > 0); \ + assert(stride >= width); \ + assert(row >= 0 && num_rows > 0 && row + num_rows <= height); \ + (void)height; // Silence unused warning. + +// load eight u8 and widen to s16 +#define U8_TO_S16(A) vreinterpretq_s16_u16(vmovl_u8(A)) +#define LOAD_U8_TO_S16(A) U8_TO_S16(vld1_u8(A)) + +// shift left or right by N byte, inserting zeros +#define SHIFT_RIGHT_N_Q(A, N) vextq_u8((A), zero, (N)) +#define SHIFT_LEFT_N_Q(A, N) vextq_u8(zero, (A), (16 - (N)) % 16) + +// rotate left by N bytes +#define ROTATE_LEFT_N(A, N) vext_u8((A), (A), (N)) +// rotate right by N bytes +#define ROTATE_RIGHT_N(A, N) vext_u8((A), (A), (8 - (N)) % 8) + +static void PredictLine_NEON(const uint8_t* src, const uint8_t* pred, + uint8_t* dst, int length) { + int i; + assert(length >= 0); + for (i = 0; i + 16 <= length; i += 16) { + const uint8x16_t A = vld1q_u8(&src[i]); + const uint8x16_t B = vld1q_u8(&pred[i]); + const uint8x16_t C = vsubq_u8(A, B); + vst1q_u8(&dst[i], C); + } + for (; i < length; ++i) dst[i] = src[i] - pred[i]; +} + +// Special case for left-based prediction (when preds==dst-1 or preds==src-1). +static void PredictLineLeft_NEON(const uint8_t* src, uint8_t* dst, int length) { + PredictLine_NEON(src, src - 1, dst, length); +} + +//------------------------------------------------------------------------------ +// Horizontal filter. + +static WEBP_INLINE void DoHorizontalFilter_NEON(const uint8_t* in, + int width, int height, + int stride, + int row, int num_rows, + uint8_t* out) { + const size_t start_offset = row * stride; + const int last_row = row + num_rows; + SANITY_CHECK(in, out); + in += start_offset; + out += start_offset; + + if (row == 0) { + // Leftmost pixel is the same as input for topmost scanline. + out[0] = in[0]; + PredictLineLeft_NEON(in + 1, out + 1, width - 1); + row = 1; + in += stride; + out += stride; + } + + // Filter line-by-line. + while (row < last_row) { + // Leftmost pixel is predicted from above. + out[0] = in[0] - in[-stride]; + PredictLineLeft_NEON(in + 1, out + 1, width - 1); + ++row; + in += stride; + out += stride; + } +} + +static void HorizontalFilter_NEON(const uint8_t* data, int width, int height, + int stride, uint8_t* filtered_data) { + DoHorizontalFilter_NEON(data, width, height, stride, 0, height, + filtered_data); +} + +//------------------------------------------------------------------------------ +// Vertical filter. + +static WEBP_INLINE void DoVerticalFilter_NEON(const uint8_t* in, + int width, int height, int stride, + int row, int num_rows, + uint8_t* out) { + const size_t start_offset = row * stride; + const int last_row = row + num_rows; + SANITY_CHECK(in, out); + in += start_offset; + out += start_offset; + + if (row == 0) { + // Very first top-left pixel is copied. + out[0] = in[0]; + // Rest of top scan-line is left-predicted. + PredictLineLeft_NEON(in + 1, out + 1, width - 1); + row = 1; + in += stride; + out += stride; + } + + // Filter line-by-line. + while (row < last_row) { + PredictLine_NEON(in, in - stride, out, width); + ++row; + in += stride; + out += stride; + } +} + +static void VerticalFilter_NEON(const uint8_t* data, int width, int height, + int stride, uint8_t* filtered_data) { + DoVerticalFilter_NEON(data, width, height, stride, 0, height, + filtered_data); +} + +//------------------------------------------------------------------------------ +// Gradient filter. + +static WEBP_INLINE int GradientPredictor_C(uint8_t a, uint8_t b, uint8_t c) { + const int g = a + b - c; + return ((g & ~0xff) == 0) ? g : (g < 0) ? 0 : 255; // clip to 8bit +} + +static void GradientPredictDirect_NEON(const uint8_t* const row, + const uint8_t* const top, + uint8_t* const out, int length) { + int i; + for (i = 0; i + 8 <= length; i += 8) { + const uint8x8_t A = vld1_u8(&row[i - 1]); + const uint8x8_t B = vld1_u8(&top[i + 0]); + const int16x8_t C = vreinterpretq_s16_u16(vaddl_u8(A, B)); + const int16x8_t D = LOAD_U8_TO_S16(&top[i - 1]); + const uint8x8_t E = vqmovun_s16(vsubq_s16(C, D)); + const uint8x8_t F = vld1_u8(&row[i + 0]); + vst1_u8(&out[i], vsub_u8(F, E)); + } + for (; i < length; ++i) { + out[i] = row[i] - GradientPredictor_C(row[i - 1], top[i], top[i - 1]); + } +} + +static WEBP_INLINE void DoGradientFilter_NEON(const uint8_t* in, + int width, int height, + int stride, + int row, int num_rows, + uint8_t* out) { + const size_t start_offset = row * stride; + const int last_row = row + num_rows; + SANITY_CHECK(in, out); + in += start_offset; + out += start_offset; + + // left prediction for top scan-line + if (row == 0) { + out[0] = in[0]; + PredictLineLeft_NEON(in + 1, out + 1, width - 1); + row = 1; + in += stride; + out += stride; + } + + // Filter line-by-line. + while (row < last_row) { + out[0] = in[0] - in[-stride]; + GradientPredictDirect_NEON(in + 1, in + 1 - stride, out + 1, width - 1); + ++row; + in += stride; + out += stride; + } +} + +static void GradientFilter_NEON(const uint8_t* data, int width, int height, + int stride, uint8_t* filtered_data) { + DoGradientFilter_NEON(data, width, height, stride, 0, height, + filtered_data); +} + +#undef SANITY_CHECK + +//------------------------------------------------------------------------------ +// Inverse transforms + +static void HorizontalUnfilter_NEON(const uint8_t* prev, const uint8_t* in, + uint8_t* out, int width) { + int i; + const uint8x16_t zero = vdupq_n_u8(0); + uint8x16_t last; + out[0] = in[0] + (prev == NULL ? 0 : prev[0]); + if (width <= 1) return; + last = vsetq_lane_u8(out[0], zero, 0); + for (i = 1; i + 16 <= width; i += 16) { + const uint8x16_t A0 = vld1q_u8(&in[i]); + const uint8x16_t A1 = vaddq_u8(A0, last); + const uint8x16_t A2 = SHIFT_LEFT_N_Q(A1, 1); + const uint8x16_t A3 = vaddq_u8(A1, A2); + const uint8x16_t A4 = SHIFT_LEFT_N_Q(A3, 2); + const uint8x16_t A5 = vaddq_u8(A3, A4); + const uint8x16_t A6 = SHIFT_LEFT_N_Q(A5, 4); + const uint8x16_t A7 = vaddq_u8(A5, A6); + const uint8x16_t A8 = SHIFT_LEFT_N_Q(A7, 8); + const uint8x16_t A9 = vaddq_u8(A7, A8); + vst1q_u8(&out[i], A9); + last = SHIFT_RIGHT_N_Q(A9, 15); + } + for (; i < width; ++i) out[i] = in[i] + out[i - 1]; +} + +static void VerticalUnfilter_NEON(const uint8_t* prev, const uint8_t* in, + uint8_t* out, int width) { + if (prev == NULL) { + HorizontalUnfilter_NEON(NULL, in, out, width); + } else { + int i; + assert(width >= 0); + for (i = 0; i + 16 <= width; i += 16) { + const uint8x16_t A = vld1q_u8(&in[i]); + const uint8x16_t B = vld1q_u8(&prev[i]); + const uint8x16_t C = vaddq_u8(A, B); + vst1q_u8(&out[i], C); + } + for (; i < width; ++i) out[i] = in[i] + prev[i]; + } +} + +// GradientUnfilter_NEON is correct but slower than the C-version, +// at least on ARM64. For armv7, it's a wash. +// So best is to disable it for now, but keep the idea around... +// #define USE_GRADIENT_UNFILTER + +#if defined(USE_GRADIENT_UNFILTER) +#define GRAD_PROCESS_LANE(L) do { \ + const uint8x8_t tmp1 = ROTATE_RIGHT_N(pred, 1); /* rotate predictor in */ \ + const int16x8_t tmp2 = vaddq_s16(BC, U8_TO_S16(tmp1)); \ + const uint8x8_t delta = vqmovun_s16(tmp2); \ + pred = vadd_u8(D, delta); \ + out = vext_u8(out, ROTATE_LEFT_N(pred, (L)), 1); \ +} while (0) + +static void GradientPredictInverse_NEON(const uint8_t* const in, + const uint8_t* const top, + uint8_t* const row, int length) { + if (length > 0) { + int i; + uint8x8_t pred = vdup_n_u8(row[-1]); // left sample + uint8x8_t out = vdup_n_u8(0); + for (i = 0; i + 8 <= length; i += 8) { + const int16x8_t B = LOAD_U8_TO_S16(&top[i + 0]); + const int16x8_t C = LOAD_U8_TO_S16(&top[i - 1]); + const int16x8_t BC = vsubq_s16(B, C); // unclipped gradient basis B - C + const uint8x8_t D = vld1_u8(&in[i]); // base input + GRAD_PROCESS_LANE(0); + GRAD_PROCESS_LANE(1); + GRAD_PROCESS_LANE(2); + GRAD_PROCESS_LANE(3); + GRAD_PROCESS_LANE(4); + GRAD_PROCESS_LANE(5); + GRAD_PROCESS_LANE(6); + GRAD_PROCESS_LANE(7); + vst1_u8(&row[i], out); + } + for (; i < length; ++i) { + row[i] = in[i] + GradientPredictor_C(row[i - 1], top[i], top[i - 1]); + } + } +} +#undef GRAD_PROCESS_LANE + +static void GradientUnfilter_NEON(const uint8_t* prev, const uint8_t* in, + uint8_t* out, int width) { + if (prev == NULL) { + HorizontalUnfilter_NEON(NULL, in, out, width); + } else { + out[0] = in[0] + prev[0]; // predict from above + GradientPredictInverse_NEON(in + 1, prev + 1, out + 1, width - 1); + } +} + +#endif // USE_GRADIENT_UNFILTER + +//------------------------------------------------------------------------------ +// Entry point + +extern void VP8FiltersInitNEON(void); + +WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitNEON(void) { + WebPUnfilters[WEBP_FILTER_HORIZONTAL] = HorizontalUnfilter_NEON; + WebPUnfilters[WEBP_FILTER_VERTICAL] = VerticalUnfilter_NEON; +#if defined(USE_GRADIENT_UNFILTER) + WebPUnfilters[WEBP_FILTER_GRADIENT] = GradientUnfilter_NEON; +#endif + + WebPFilters[WEBP_FILTER_HORIZONTAL] = HorizontalFilter_NEON; + WebPFilters[WEBP_FILTER_VERTICAL] = VerticalFilter_NEON; + WebPFilters[WEBP_FILTER_GRADIENT] = GradientFilter_NEON; +} + +#else // !WEBP_USE_NEON + +WEBP_DSP_INIT_STUB(VP8FiltersInitNEON) + +#endif // WEBP_USE_NEON diff --git a/thirdparty/libwebp/dsp/lossless.c b/thirdparty/libwebp/dsp/lossless.c index af913efccb..20d18f6ecd 100644 --- a/thirdparty/libwebp/dsp/lossless.c +++ b/thirdparty/libwebp/dsp/lossless.c @@ -17,20 +17,16 @@ #include <math.h> #include <stdlib.h> -#include "../dec/vp8li.h" -#include "../utils/endian_inl.h" +#include "../dec/vp8li_dec.h" +#include "../utils/endian_inl_utils.h" #include "./lossless.h" +#include "./lossless_common.h" #define MAX_DIFF_COST (1e30f) //------------------------------------------------------------------------------ // Image transforms. -// In-place sum of each component with mod 256. -static WEBP_INLINE void AddPixelsEq(uint32_t* a, uint32_t b) { - *a = VP8LAddPixels(*a, b); -} - static WEBP_INLINE uint32_t Average2(uint32_t a0, uint32_t a1) { return (((a0 ^ a1) & 0xfefefefeu) >> 1) + (a0 & a1); } @@ -171,21 +167,41 @@ static uint32_t Predictor13(uint32_t left, const uint32_t* const top) { return pred; } +GENERATE_PREDICTOR_ADD(Predictor0, PredictorAdd0) +static void PredictorAdd1(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + uint32_t left = out[-1]; + for (i = 0; i < num_pixels; ++i) { + out[i] = left = VP8LAddPixels(in[i], left); + } + (void)upper; +} +GENERATE_PREDICTOR_ADD(Predictor2, PredictorAdd2) +GENERATE_PREDICTOR_ADD(Predictor3, PredictorAdd3) +GENERATE_PREDICTOR_ADD(Predictor4, PredictorAdd4) +GENERATE_PREDICTOR_ADD(Predictor5, PredictorAdd5) +GENERATE_PREDICTOR_ADD(Predictor6, PredictorAdd6) +GENERATE_PREDICTOR_ADD(Predictor7, PredictorAdd7) +GENERATE_PREDICTOR_ADD(Predictor8, PredictorAdd8) +GENERATE_PREDICTOR_ADD(Predictor9, PredictorAdd9) +GENERATE_PREDICTOR_ADD(Predictor10, PredictorAdd10) +GENERATE_PREDICTOR_ADD(Predictor11, PredictorAdd11) +GENERATE_PREDICTOR_ADD(Predictor12, PredictorAdd12) +GENERATE_PREDICTOR_ADD(Predictor13, PredictorAdd13) + //------------------------------------------------------------------------------ // Inverse prediction. static void PredictorInverseTransform(const VP8LTransform* const transform, - int y_start, int y_end, uint32_t* data) { + int y_start, int y_end, + const uint32_t* in, uint32_t* out) { const int width = transform->xsize_; if (y_start == 0) { // First Row follows the L (mode=1) mode. - int x; - const uint32_t pred0 = Predictor0(data[-1], NULL); - AddPixelsEq(data, pred0); - for (x = 1; x < width; ++x) { - const uint32_t pred1 = Predictor1(data[x - 1], NULL); - AddPixelsEq(data + x, pred1); - } - data += width; + PredictorAdd0(in, NULL, 1, out); + PredictorAdd1(in + 1, NULL, width - 1, out + 1); + in += width; + out += width; ++y_start; } @@ -193,36 +209,26 @@ static void PredictorInverseTransform(const VP8LTransform* const transform, int y = y_start; const int tile_width = 1 << transform->bits_; const int mask = tile_width - 1; - const int safe_width = width & ~mask; const int tiles_per_row = VP8LSubSampleSize(width, transform->bits_); const uint32_t* pred_mode_base = transform->data_ + (y >> transform->bits_) * tiles_per_row; while (y < y_end) { - const uint32_t pred2 = Predictor2(data[-1], data - width); const uint32_t* pred_mode_src = pred_mode_base; - VP8LPredictorFunc pred_func; int x = 1; - int t = 1; // First pixel follows the T (mode=2) mode. - AddPixelsEq(data, pred2); + PredictorAdd2(in, out - width, 1, out); // .. the rest: - while (x < safe_width) { - pred_func = VP8LPredictors[((*pred_mode_src++) >> 8) & 0xf]; - for (; t < tile_width; ++t, ++x) { - const uint32_t pred = pred_func(data[x - 1], data + x - width); - AddPixelsEq(data + x, pred); - } - t = 0; - } - if (x < width) { - pred_func = VP8LPredictors[((*pred_mode_src++) >> 8) & 0xf]; - for (; x < width; ++x) { - const uint32_t pred = pred_func(data[x - 1], data + x - width); - AddPixelsEq(data + x, pred); - } + while (x < width) { + const VP8LPredictorAddSubFunc pred_func = + VP8LPredictorsAdd[((*pred_mode_src++) >> 8) & 0xf]; + int x_end = (x & ~mask) + tile_width; + if (x_end > width) x_end = width; + pred_func(in + x, out + x - width, x_end - x, out + x); + x = x_end; } - data += width; + in += width; + out += width; ++y; if ((y & mask) == 0) { // Use the same mask, since tiles are squares. pred_mode_base += tiles_per_row; @@ -233,21 +239,22 @@ static void PredictorInverseTransform(const VP8LTransform* const transform, // Add green to blue and red channels (i.e. perform the inverse transform of // 'subtract green'). -void VP8LAddGreenToBlueAndRed_C(uint32_t* data, int num_pixels) { +void VP8LAddGreenToBlueAndRed_C(const uint32_t* src, int num_pixels, + uint32_t* dst) { int i; for (i = 0; i < num_pixels; ++i) { - const uint32_t argb = data[i]; + const uint32_t argb = src[i]; const uint32_t green = ((argb >> 8) & 0xff); uint32_t red_blue = (argb & 0x00ff00ffu); red_blue += (green << 16) | green; red_blue &= 0x00ff00ffu; - data[i] = (argb & 0xff00ff00u) | red_blue; + dst[i] = (argb & 0xff00ff00u) | red_blue; } } -static WEBP_INLINE uint32_t ColorTransformDelta(int8_t color_pred, - int8_t color) { - return (uint32_t)((int)(color_pred) * color) >> 5; +static WEBP_INLINE int ColorTransformDelta(int8_t color_pred, + int8_t color) { + return ((int)color_pred * color) >> 5; } static WEBP_INLINE void ColorCodeToMultipliers(uint32_t color_code, @@ -257,27 +264,29 @@ static WEBP_INLINE void ColorCodeToMultipliers(uint32_t color_code, m->red_to_blue_ = (color_code >> 16) & 0xff; } -void VP8LTransformColorInverse_C(const VP8LMultipliers* const m, uint32_t* data, - int num_pixels) { +void VP8LTransformColorInverse_C(const VP8LMultipliers* const m, + const uint32_t* src, int num_pixels, + uint32_t* dst) { int i; for (i = 0; i < num_pixels; ++i) { - const uint32_t argb = data[i]; + const uint32_t argb = src[i]; const uint32_t green = argb >> 8; const uint32_t red = argb >> 16; - uint32_t new_red = red; - uint32_t new_blue = argb; + int new_red = red; + int new_blue = argb; new_red += ColorTransformDelta(m->green_to_red_, green); new_red &= 0xff; new_blue += ColorTransformDelta(m->green_to_blue_, green); new_blue += ColorTransformDelta(m->red_to_blue_, new_red); new_blue &= 0xff; - data[i] = (argb & 0xff00ff00u) | (new_red << 16) | (new_blue); + dst[i] = (argb & 0xff00ff00u) | (new_red << 16) | (new_blue); } } // Color space inverse transform. static void ColorSpaceInverseTransform(const VP8LTransform* const transform, - int y_start, int y_end, uint32_t* data) { + int y_start, int y_end, + const uint32_t* src, uint32_t* dst) { const int width = transform->xsize_; const int tile_width = 1 << transform->bits_; const int mask = tile_width - 1; @@ -291,17 +300,19 @@ static void ColorSpaceInverseTransform(const VP8LTransform* const transform, while (y < y_end) { const uint32_t* pred = pred_row; VP8LMultipliers m = { 0, 0, 0 }; - const uint32_t* const data_safe_end = data + safe_width; - const uint32_t* const data_end = data + width; - while (data < data_safe_end) { + const uint32_t* const src_safe_end = src + safe_width; + const uint32_t* const src_end = src + width; + while (src < src_safe_end) { ColorCodeToMultipliers(*pred++, &m); - VP8LTransformColorInverse(&m, data, tile_width); - data += tile_width; + VP8LTransformColorInverse(&m, src, tile_width, dst); + src += tile_width; + dst += tile_width; } - if (data < data_end) { // Left-overs using C-version. + if (src < src_end) { // Left-overs using C-version. ColorCodeToMultipliers(*pred++, &m); - VP8LTransformColorInverse(&m, data, remaining_width); - data += remaining_width; + VP8LTransformColorInverse(&m, src, remaining_width, dst); + src += remaining_width; + dst += remaining_width; } ++y; if ((y & mask) == 0) pred_row += tiles_per_row; @@ -366,10 +377,10 @@ void VP8LInverseTransform(const VP8LTransform* const transform, assert(row_end <= transform->ysize_); switch (transform->type_) { case SUBTRACT_GREEN: - VP8LAddGreenToBlueAndRed(out, (row_end - row_start) * width); + VP8LAddGreenToBlueAndRed(in, (row_end - row_start) * width, out); break; case PREDICTOR_TRANSFORM: - PredictorInverseTransform(transform, row_start, row_end, out); + PredictorInverseTransform(transform, row_start, row_end, in, out); if (row_end != transform->ysize_) { // The last predicted row in this iteration will be the top-pred row // for the first row in next iteration. @@ -378,7 +389,7 @@ void VP8LInverseTransform(const VP8LTransform* const transform, } break; case CROSS_COLOR_TRANSFORM: - ColorSpaceInverseTransform(transform, row_start, row_end, out); + ColorSpaceInverseTransform(transform, row_start, row_end, in, out); break; case COLOR_INDEXING_TRANSFORM: if (in == out && transform->bits_ > 0) { @@ -555,10 +566,15 @@ void VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels, //------------------------------------------------------------------------------ -VP8LProcessBlueAndRedFunc VP8LAddGreenToBlueAndRed; +VP8LProcessDecBlueAndRedFunc VP8LAddGreenToBlueAndRed; +VP8LPredictorAddSubFunc VP8LPredictorsAdd[16]; VP8LPredictorFunc VP8LPredictors[16]; -VP8LTransformColorFunc VP8LTransformColorInverse; +// exposed plain-C implementations +VP8LPredictorAddSubFunc VP8LPredictorsAdd_C[16]; +VP8LPredictorFunc VP8LPredictors_C[16]; + +VP8LTransformColorInverseFunc VP8LTransformColorInverse; VP8LConvertFunc VP8LConvertBGRAToRGB; VP8LConvertFunc VP8LConvertBGRAToRGBA; @@ -572,29 +588,37 @@ VP8LMapAlphaFunc VP8LMapColor8b; extern void VP8LDspInitSSE2(void); extern void VP8LDspInitNEON(void); extern void VP8LDspInitMIPSdspR2(void); +extern void VP8LDspInitMSA(void); static volatile VP8CPUInfo lossless_last_cpuinfo_used = (VP8CPUInfo)&lossless_last_cpuinfo_used; +#define COPY_PREDICTOR_ARRAY(IN, OUT) do { \ + (OUT)[0] = IN##0; \ + (OUT)[1] = IN##1; \ + (OUT)[2] = IN##2; \ + (OUT)[3] = IN##3; \ + (OUT)[4] = IN##4; \ + (OUT)[5] = IN##5; \ + (OUT)[6] = IN##6; \ + (OUT)[7] = IN##7; \ + (OUT)[8] = IN##8; \ + (OUT)[9] = IN##9; \ + (OUT)[10] = IN##10; \ + (OUT)[11] = IN##11; \ + (OUT)[12] = IN##12; \ + (OUT)[13] = IN##13; \ + (OUT)[14] = IN##0; /* <- padding security sentinels*/ \ + (OUT)[15] = IN##0; \ +} while (0); + WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInit(void) { if (lossless_last_cpuinfo_used == VP8GetCPUInfo) return; - VP8LPredictors[0] = Predictor0; - VP8LPredictors[1] = Predictor1; - VP8LPredictors[2] = Predictor2; - VP8LPredictors[3] = Predictor3; - VP8LPredictors[4] = Predictor4; - VP8LPredictors[5] = Predictor5; - VP8LPredictors[6] = Predictor6; - VP8LPredictors[7] = Predictor7; - VP8LPredictors[8] = Predictor8; - VP8LPredictors[9] = Predictor9; - VP8LPredictors[10] = Predictor10; - VP8LPredictors[11] = Predictor11; - VP8LPredictors[12] = Predictor12; - VP8LPredictors[13] = Predictor13; - VP8LPredictors[14] = Predictor0; // <- padding security sentinels - VP8LPredictors[15] = Predictor0; + COPY_PREDICTOR_ARRAY(Predictor, VP8LPredictors) + COPY_PREDICTOR_ARRAY(Predictor, VP8LPredictors_C) + COPY_PREDICTOR_ARRAY(PredictorAdd, VP8LPredictorsAdd) + COPY_PREDICTOR_ARRAY(PredictorAdd, VP8LPredictorsAdd_C) VP8LAddGreenToBlueAndRed = VP8LAddGreenToBlueAndRed_C; @@ -626,8 +650,14 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInit(void) { VP8LDspInitMIPSdspR2(); } #endif +#if defined(WEBP_USE_MSA) + if (VP8GetCPUInfo(kMSA)) { + VP8LDspInitMSA(); + } +#endif } lossless_last_cpuinfo_used = VP8GetCPUInfo; } +#undef COPY_PREDICTOR_ARRAY //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/dsp/lossless.h b/thirdparty/libwebp/dsp/lossless.h index 9f0d7a25b7..352a54e509 100644 --- a/thirdparty/libwebp/dsp/lossless.h +++ b/thirdparty/libwebp/dsp/lossless.h @@ -18,7 +18,7 @@ #include "../webp/types.h" #include "../webp/decode.h" -#include "../enc/histogram.h" +#include "../enc/histogram_enc.h" #include "../utils/utils.h" #ifdef __cplusplus @@ -26,7 +26,7 @@ extern "C" { #endif #ifdef WEBP_EXPERIMENTAL_FEATURES -#include "../enc/delta_palettization.h" +#include "../enc/delta_palettization_enc.h" #endif // WEBP_EXPERIMENTAL_FEATURES //------------------------------------------------------------------------------ @@ -34,9 +34,17 @@ extern "C" { typedef uint32_t (*VP8LPredictorFunc)(uint32_t left, const uint32_t* const top); extern VP8LPredictorFunc VP8LPredictors[16]; - -typedef void (*VP8LProcessBlueAndRedFunc)(uint32_t* argb_data, int num_pixels); -extern VP8LProcessBlueAndRedFunc VP8LAddGreenToBlueAndRed; +extern VP8LPredictorFunc VP8LPredictors_C[16]; +// These Add/Sub function expects upper[-1] and out[-1] to be readable. +typedef void (*VP8LPredictorAddSubFunc)(const uint32_t* in, + const uint32_t* upper, int num_pixels, + uint32_t* out); +extern VP8LPredictorAddSubFunc VP8LPredictorsAdd[16]; +extern VP8LPredictorAddSubFunc VP8LPredictorsAdd_C[16]; + +typedef void (*VP8LProcessDecBlueAndRedFunc)(const uint32_t* src, + int num_pixels, uint32_t* dst); +extern VP8LProcessDecBlueAndRedFunc VP8LAddGreenToBlueAndRed; typedef struct { // Note: the members are uint8_t, so that any negative values are @@ -45,9 +53,10 @@ typedef struct { uint8_t green_to_blue_; uint8_t red_to_blue_; } VP8LMultipliers; -typedef void (*VP8LTransformColorFunc)(const VP8LMultipliers* const m, - uint32_t* argb_data, int num_pixels); -extern VP8LTransformColorFunc VP8LTransformColorInverse; +typedef void (*VP8LTransformColorInverseFunc)(const VP8LMultipliers* const m, + const uint32_t* src, + int num_pixels, uint32_t* dst); +extern VP8LTransformColorInverseFunc VP8LTransformColorInverse; struct VP8LTransform; // Defined in dec/vp8li.h. @@ -72,23 +81,6 @@ extern VP8LConvertFunc VP8LConvertBGRAToBGR; void VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels, WEBP_CSP_MODE out_colorspace, uint8_t* const rgba); -// color mapping related functions. -static WEBP_INLINE uint32_t VP8GetARGBIndex(uint32_t idx) { - return (idx >> 8) & 0xff; -} - -static WEBP_INLINE uint8_t VP8GetAlphaIndex(uint8_t idx) { - return idx; -} - -static WEBP_INLINE uint32_t VP8GetARGBValue(uint32_t val) { - return val; -} - -static WEBP_INLINE uint8_t VP8GetAlphaValue(uint32_t val) { - return (val >> 8) & 0xff; -} - typedef void (*VP8LMapARGBFunc)(const uint32_t* src, const uint32_t* const color_map, uint32_t* dst, int y_start, @@ -110,7 +102,8 @@ void VP8LColorIndexInverseTransformAlpha( // Expose some C-only fallback functions void VP8LTransformColorInverse_C(const VP8LMultipliers* const m, - uint32_t* data, int num_pixels); + const uint32_t* src, int num_pixels, + uint32_t* dst); void VP8LConvertBGRAToRGB_C(const uint32_t* src, int num_pixels, uint8_t* dst); void VP8LConvertBGRAToRGBA_C(const uint32_t* src, int num_pixels, uint8_t* dst); @@ -119,7 +112,8 @@ void VP8LConvertBGRAToRGBA4444_C(const uint32_t* src, void VP8LConvertBGRAToRGB565_C(const uint32_t* src, int num_pixels, uint8_t* dst); void VP8LConvertBGRAToBGR_C(const uint32_t* src, int num_pixels, uint8_t* dst); -void VP8LAddGreenToBlueAndRed_C(uint32_t* data, int num_pixels); +void VP8LAddGreenToBlueAndRed_C(const uint32_t* src, int num_pixels, + uint32_t* dst); // Must be called before calling any of the above methods. void VP8LDspInit(void); @@ -127,7 +121,10 @@ void VP8LDspInit(void); //------------------------------------------------------------------------------ // Encoding -extern VP8LProcessBlueAndRedFunc VP8LSubtractGreenFromBlueAndRed; +typedef void (*VP8LProcessEncBlueAndRedFunc)(uint32_t* dst, int num_pixels); +extern VP8LProcessEncBlueAndRedFunc VP8LSubtractGreenFromBlueAndRed; +typedef void (*VP8LTransformColorFunc)(const VP8LMultipliers* const m, + uint32_t* const dst, int num_pixels); extern VP8LTransformColorFunc VP8LTransformColor; typedef void (*VP8LCollectColorBlueTransformsFunc)( const uint32_t* argb, int stride, @@ -153,62 +150,8 @@ void VP8LCollectColorBlueTransforms_C(const uint32_t* argb, int stride, int green_to_blue, int red_to_blue, int histo[]); -//------------------------------------------------------------------------------ -// Image transforms. - -void VP8LResidualImage(int width, int height, int bits, int low_effort, - uint32_t* const argb, uint32_t* const argb_scratch, - uint32_t* const image, int near_lossless, int exact, - int used_subtract_green); - -void VP8LColorSpaceTransform(int width, int height, int bits, int quality, - uint32_t* const argb, uint32_t* image); - -//------------------------------------------------------------------------------ -// Misc methods. - -// Computes sampled size of 'size' when sampling using 'sampling bits'. -static WEBP_INLINE uint32_t VP8LSubSampleSize(uint32_t size, - uint32_t sampling_bits) { - return (size + (1 << sampling_bits) - 1) >> sampling_bits; -} - -// Converts near lossless quality into max number of bits shaved off. -static WEBP_INLINE int VP8LNearLosslessBits(int near_lossless_quality) { - // 100 -> 0 - // 80..99 -> 1 - // 60..79 -> 2 - // 40..59 -> 3 - // 20..39 -> 4 - // 0..19 -> 5 - return 5 - near_lossless_quality / 20; -} - -// ----------------------------------------------------------------------------- -// Faster logarithm for integers. Small values use a look-up table. - -// The threshold till approximate version of log_2 can be used. -// Practically, we can get rid of the call to log() as the two values match to -// very high degree (the ratio of these two is 0.99999x). -// Keeping a high threshold for now. -#define APPROX_LOG_WITH_CORRECTION_MAX 65536 -#define APPROX_LOG_MAX 4096 -#define LOG_2_RECIPROCAL 1.44269504088896338700465094007086 -#define LOG_LOOKUP_IDX_MAX 256 -extern const float kLog2Table[LOG_LOOKUP_IDX_MAX]; -extern const float kSLog2Table[LOG_LOOKUP_IDX_MAX]; -typedef float (*VP8LFastLog2SlowFunc)(uint32_t v); - -extern VP8LFastLog2SlowFunc VP8LFastLog2Slow; -extern VP8LFastLog2SlowFunc VP8LFastSLog2Slow; - -static WEBP_INLINE float VP8LFastLog2(uint32_t v) { - return (v < LOG_LOOKUP_IDX_MAX) ? kLog2Table[v] : VP8LFastLog2Slow(v); -} -// Fast calculation of v * log2(v) for integer input. -static WEBP_INLINE float VP8LFastSLog2(uint32_t v) { - return (v < LOG_LOOKUP_IDX_MAX) ? kSLog2Table[v] : VP8LFastSLog2Slow(v); -} +extern VP8LPredictorAddSubFunc VP8LPredictorsSub[16]; +extern VP8LPredictorAddSubFunc VP8LPredictorsSub_C[16]; // ----------------------------------------------------------------------------- // Huffman-cost related functions. @@ -228,11 +171,6 @@ typedef struct { // small struct to hold counters int streaks[2][2]; // [zero/non-zero][streak<3 / streak>=3] } VP8LStreaks; -typedef VP8LStreaks (*VP8LCostCombinedCountFunc)(const uint32_t* X, - const uint32_t* Y, int length); - -extern VP8LCostCombinedCountFunc VP8LHuffmanCostCombinedCount; - typedef struct { // small struct to hold bit entropy results double entropy; // entropy uint32_t sum; // sum of the population @@ -246,26 +184,20 @@ void VP8LBitEntropyInit(VP8LBitEntropy* const entropy); // Get the combined symbol bit entropy and Huffman cost stats for the // distributions 'X' and 'Y'. Those results can then be refined according to // codec specific heuristics. -void VP8LGetCombinedEntropyUnrefined(const uint32_t* const X, - const uint32_t* const Y, int length, - VP8LBitEntropy* const bit_entropy, - VP8LStreaks* const stats); +typedef void (*VP8LGetCombinedEntropyUnrefinedFunc)( + const uint32_t X[], const uint32_t Y[], int length, + VP8LBitEntropy* const bit_entropy, VP8LStreaks* const stats); +extern VP8LGetCombinedEntropyUnrefinedFunc VP8LGetCombinedEntropyUnrefined; + // Get the entropy for the distribution 'X'. -void VP8LGetEntropyUnrefined(const uint32_t* const X, int length, - VP8LBitEntropy* const bit_entropy, - VP8LStreaks* const stats); +typedef void (*VP8LGetEntropyUnrefinedFunc)(const uint32_t X[], int length, + VP8LBitEntropy* const bit_entropy, + VP8LStreaks* const stats); +extern VP8LGetEntropyUnrefinedFunc VP8LGetEntropyUnrefined; void VP8LBitsEntropyUnrefined(const uint32_t* const array, int n, VP8LBitEntropy* const entropy); -typedef void (*GetEntropyUnrefinedHelperFunc)(uint32_t val, int i, - uint32_t* const val_prev, - int* const i_prev, - VP8LBitEntropy* const bit_entropy, - VP8LStreaks* const stats); -// Internal function used by VP8LGet*EntropyUnrefined. -extern GetEntropyUnrefinedHelperFunc VP8LGetEntropyUnrefinedHelper; - typedef void (*VP8LHistogramAddFunc)(const VP8LHistogram* const a, const VP8LHistogram* const b, VP8LHistogram* const out); @@ -279,86 +211,11 @@ typedef int (*VP8LVectorMismatchFunc)(const uint32_t* const array1, // Returns the first index where array1 and array2 are different. extern VP8LVectorMismatchFunc VP8LVectorMismatch; -static WEBP_INLINE int VP8LBitsLog2Ceiling(uint32_t n) { - const int log_floor = BitsLog2Floor(n); - if (n == (n & ~(n - 1))) // zero or a power of two. - return log_floor; - else - return log_floor + 1; -} - -// Splitting of distance and length codes into prefixes and -// extra bits. The prefixes are encoded with an entropy code -// while the extra bits are stored just as normal bits. -static WEBP_INLINE void VP8LPrefixEncodeBitsNoLUT(int distance, int* const code, - int* const extra_bits) { - const int highest_bit = BitsLog2Floor(--distance); - const int second_highest_bit = (distance >> (highest_bit - 1)) & 1; - *extra_bits = highest_bit - 1; - *code = 2 * highest_bit + second_highest_bit; -} - -static WEBP_INLINE void VP8LPrefixEncodeNoLUT(int distance, int* const code, - int* const extra_bits, - int* const extra_bits_value) { - const int highest_bit = BitsLog2Floor(--distance); - const int second_highest_bit = (distance >> (highest_bit - 1)) & 1; - *extra_bits = highest_bit - 1; - *extra_bits_value = distance & ((1 << *extra_bits) - 1); - *code = 2 * highest_bit + second_highest_bit; -} - -#define PREFIX_LOOKUP_IDX_MAX 512 -typedef struct { - int8_t code_; - int8_t extra_bits_; -} VP8LPrefixCode; - -// These tables are derived using VP8LPrefixEncodeNoLUT. -extern const VP8LPrefixCode kPrefixEncodeCode[PREFIX_LOOKUP_IDX_MAX]; -extern const uint8_t kPrefixEncodeExtraBitsValue[PREFIX_LOOKUP_IDX_MAX]; -static WEBP_INLINE void VP8LPrefixEncodeBits(int distance, int* const code, - int* const extra_bits) { - if (distance < PREFIX_LOOKUP_IDX_MAX) { - const VP8LPrefixCode prefix_code = kPrefixEncodeCode[distance]; - *code = prefix_code.code_; - *extra_bits = prefix_code.extra_bits_; - } else { - VP8LPrefixEncodeBitsNoLUT(distance, code, extra_bits); - } -} - -static WEBP_INLINE void VP8LPrefixEncode(int distance, int* const code, - int* const extra_bits, - int* const extra_bits_value) { - if (distance < PREFIX_LOOKUP_IDX_MAX) { - const VP8LPrefixCode prefix_code = kPrefixEncodeCode[distance]; - *code = prefix_code.code_; - *extra_bits = prefix_code.extra_bits_; - *extra_bits_value = kPrefixEncodeExtraBitsValue[distance]; - } else { - VP8LPrefixEncodeNoLUT(distance, code, extra_bits, extra_bits_value); - } -} - -// Sum of each component, mod 256. -static WEBP_INLINE uint32_t VP8LAddPixels(uint32_t a, uint32_t b) { - const uint32_t alpha_and_green = (a & 0xff00ff00u) + (b & 0xff00ff00u); - const uint32_t red_and_blue = (a & 0x00ff00ffu) + (b & 0x00ff00ffu); - return (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu); -} - -// Difference of each component, mod 256. -static WEBP_INLINE uint32_t VP8LSubPixels(uint32_t a, uint32_t b) { - const uint32_t alpha_and_green = - 0x00ff00ffu + (a & 0xff00ff00u) - (b & 0xff00ff00u); - const uint32_t red_and_blue = - 0xff00ff00u + (a & 0x00ff00ffu) - (b & 0x00ff00ffu); - return (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu); -} - -void VP8LBundleColorMap(const uint8_t* const row, int width, - int xbits, uint32_t* const dst); +typedef void (*VP8LBundleColorMapFunc)(const uint8_t* const row, int width, + int xbits, uint32_t* dst); +extern VP8LBundleColorMapFunc VP8LBundleColorMap; +void VP8LBundleColorMap_C(const uint8_t* const row, int width, int xbits, + uint32_t* dst); // Must be called before calling any of the above methods. void VP8LEncDspInit(void); diff --git a/thirdparty/libwebp/dsp/lossless_common.h b/thirdparty/libwebp/dsp/lossless_common.h new file mode 100644 index 0000000000..c40f711208 --- /dev/null +++ b/thirdparty/libwebp/dsp/lossless_common.h @@ -0,0 +1,210 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Image transforms and color space conversion methods for lossless decoder. +// +// Authors: Vikas Arora (vikaas.arora@gmail.com) +// Jyrki Alakuijala (jyrki@google.com) +// Vincent Rabaud (vrabaud@google.com) + +#ifndef WEBP_DSP_LOSSLESS_COMMON_H_ +#define WEBP_DSP_LOSSLESS_COMMON_H_ + +#include "../webp/types.h" + +#include "../utils/utils.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//------------------------------------------------------------------------------ +// Decoding + +// color mapping related functions. +static WEBP_INLINE uint32_t VP8GetARGBIndex(uint32_t idx) { + return (idx >> 8) & 0xff; +} + +static WEBP_INLINE uint8_t VP8GetAlphaIndex(uint8_t idx) { + return idx; +} + +static WEBP_INLINE uint32_t VP8GetARGBValue(uint32_t val) { + return val; +} + +static WEBP_INLINE uint8_t VP8GetAlphaValue(uint32_t val) { + return (val >> 8) & 0xff; +} + +//------------------------------------------------------------------------------ +// Misc methods. + +// Computes sampled size of 'size' when sampling using 'sampling bits'. +static WEBP_INLINE uint32_t VP8LSubSampleSize(uint32_t size, + uint32_t sampling_bits) { + return (size + (1 << sampling_bits) - 1) >> sampling_bits; +} + +// Converts near lossless quality into max number of bits shaved off. +static WEBP_INLINE int VP8LNearLosslessBits(int near_lossless_quality) { + // 100 -> 0 + // 80..99 -> 1 + // 60..79 -> 2 + // 40..59 -> 3 + // 20..39 -> 4 + // 0..19 -> 5 + return 5 - near_lossless_quality / 20; +} + +// ----------------------------------------------------------------------------- +// Faster logarithm for integers. Small values use a look-up table. + +// The threshold till approximate version of log_2 can be used. +// Practically, we can get rid of the call to log() as the two values match to +// very high degree (the ratio of these two is 0.99999x). +// Keeping a high threshold for now. +#define APPROX_LOG_WITH_CORRECTION_MAX 65536 +#define APPROX_LOG_MAX 4096 +#define LOG_2_RECIPROCAL 1.44269504088896338700465094007086 +#define LOG_LOOKUP_IDX_MAX 256 +extern const float kLog2Table[LOG_LOOKUP_IDX_MAX]; +extern const float kSLog2Table[LOG_LOOKUP_IDX_MAX]; +typedef float (*VP8LFastLog2SlowFunc)(uint32_t v); + +extern VP8LFastLog2SlowFunc VP8LFastLog2Slow; +extern VP8LFastLog2SlowFunc VP8LFastSLog2Slow; + +static WEBP_INLINE float VP8LFastLog2(uint32_t v) { + return (v < LOG_LOOKUP_IDX_MAX) ? kLog2Table[v] : VP8LFastLog2Slow(v); +} +// Fast calculation of v * log2(v) for integer input. +static WEBP_INLINE float VP8LFastSLog2(uint32_t v) { + return (v < LOG_LOOKUP_IDX_MAX) ? kSLog2Table[v] : VP8LFastSLog2Slow(v); +} + +// ----------------------------------------------------------------------------- +// PrefixEncode() + +static WEBP_INLINE int VP8LBitsLog2Ceiling(uint32_t n) { + const int log_floor = BitsLog2Floor(n); + if (n == (n & ~(n - 1))) { // zero or a power of two. + return log_floor; + } + return log_floor + 1; +} + +// Splitting of distance and length codes into prefixes and +// extra bits. The prefixes are encoded with an entropy code +// while the extra bits are stored just as normal bits. +static WEBP_INLINE void VP8LPrefixEncodeBitsNoLUT(int distance, int* const code, + int* const extra_bits) { + const int highest_bit = BitsLog2Floor(--distance); + const int second_highest_bit = (distance >> (highest_bit - 1)) & 1; + *extra_bits = highest_bit - 1; + *code = 2 * highest_bit + second_highest_bit; +} + +static WEBP_INLINE void VP8LPrefixEncodeNoLUT(int distance, int* const code, + int* const extra_bits, + int* const extra_bits_value) { + const int highest_bit = BitsLog2Floor(--distance); + const int second_highest_bit = (distance >> (highest_bit - 1)) & 1; + *extra_bits = highest_bit - 1; + *extra_bits_value = distance & ((1 << *extra_bits) - 1); + *code = 2 * highest_bit + second_highest_bit; +} + +#define PREFIX_LOOKUP_IDX_MAX 512 +typedef struct { + int8_t code_; + int8_t extra_bits_; +} VP8LPrefixCode; + +// These tables are derived using VP8LPrefixEncodeNoLUT. +extern const VP8LPrefixCode kPrefixEncodeCode[PREFIX_LOOKUP_IDX_MAX]; +extern const uint8_t kPrefixEncodeExtraBitsValue[PREFIX_LOOKUP_IDX_MAX]; +static WEBP_INLINE void VP8LPrefixEncodeBits(int distance, int* const code, + int* const extra_bits) { + if (distance < PREFIX_LOOKUP_IDX_MAX) { + const VP8LPrefixCode prefix_code = kPrefixEncodeCode[distance]; + *code = prefix_code.code_; + *extra_bits = prefix_code.extra_bits_; + } else { + VP8LPrefixEncodeBitsNoLUT(distance, code, extra_bits); + } +} + +static WEBP_INLINE void VP8LPrefixEncode(int distance, int* const code, + int* const extra_bits, + int* const extra_bits_value) { + if (distance < PREFIX_LOOKUP_IDX_MAX) { + const VP8LPrefixCode prefix_code = kPrefixEncodeCode[distance]; + *code = prefix_code.code_; + *extra_bits = prefix_code.extra_bits_; + *extra_bits_value = kPrefixEncodeExtraBitsValue[distance]; + } else { + VP8LPrefixEncodeNoLUT(distance, code, extra_bits, extra_bits_value); + } +} + +// Sum of each component, mod 256. +static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE +uint32_t VP8LAddPixels(uint32_t a, uint32_t b) { + const uint32_t alpha_and_green = (a & 0xff00ff00u) + (b & 0xff00ff00u); + const uint32_t red_and_blue = (a & 0x00ff00ffu) + (b & 0x00ff00ffu); + return (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu); +} + +// Difference of each component, mod 256. +static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE +uint32_t VP8LSubPixels(uint32_t a, uint32_t b) { + const uint32_t alpha_and_green = + 0x00ff00ffu + (a & 0xff00ff00u) - (b & 0xff00ff00u); + const uint32_t red_and_blue = + 0xff00ff00u + (a & 0x00ff00ffu) - (b & 0x00ff00ffu); + return (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu); +} + +//------------------------------------------------------------------------------ +// Transform-related functions use din both encoding and decoding. + +// Macros used to create a batch predictor that iteratively uses a +// one-pixel predictor. + +// The predictor is added to the output pixel (which +// is therefore considered as a residual) to get the final prediction. +#define GENERATE_PREDICTOR_ADD(PREDICTOR, PREDICTOR_ADD) \ +static void PREDICTOR_ADD(const uint32_t* in, const uint32_t* upper, \ + int num_pixels, uint32_t* out) { \ + int x; \ + for (x = 0; x < num_pixels; ++x) { \ + const uint32_t pred = (PREDICTOR)(out[x - 1], upper + x); \ + out[x] = VP8LAddPixels(in[x], pred); \ + } \ +} + +// It subtracts the prediction from the input pixel and stores the residual +// in the output pixel. +#define GENERATE_PREDICTOR_SUB(PREDICTOR, PREDICTOR_SUB) \ +static void PREDICTOR_SUB(const uint32_t* in, const uint32_t* upper, \ + int num_pixels, uint32_t* out) { \ + int x; \ + for (x = 0; x < num_pixels; ++x) { \ + const uint32_t pred = (PREDICTOR)(in[x - 1], upper + x); \ + out[x] = VP8LSubPixels(in[x], pred); \ + } \ +} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBP_DSP_LOSSLESS_COMMON_H_ diff --git a/thirdparty/libwebp/dsp/lossless_enc.c b/thirdparty/libwebp/dsp/lossless_enc.c index 256f6f5f8b..4e46fbab8b 100644 --- a/thirdparty/libwebp/dsp/lossless_enc.c +++ b/thirdparty/libwebp/dsp/lossless_enc.c @@ -17,16 +17,12 @@ #include <math.h> #include <stdlib.h> -#include "../dec/vp8li.h" -#include "../utils/endian_inl.h" +#include "../dec/vp8li_dec.h" +#include "../utils/endian_inl_utils.h" #include "./lossless.h" +#include "./lossless_common.h" #include "./yuv.h" -#define MAX_DIFF_COST (1e30f) - -static const int kPredLowEffort = 11; -static const uint32_t kMaskAlpha = 0xff000000; - // lookup table for small values of log2(int) const float kLog2Table[LOG_LOOKUP_IDX_MAX] = { 0.0000000000000000f, 0.0000000000000000f, @@ -380,26 +376,9 @@ static float FastLog2Slow(uint32_t v) { } } -// Mostly used to reduce code size + readability -static WEBP_INLINE int GetMin(int a, int b) { return (a > b) ? b : a; } -static WEBP_INLINE int GetMax(int a, int b) { return (a < b) ? b : a; } - //------------------------------------------------------------------------------ // Methods to calculate Entropy (Shannon). -static float PredictionCostSpatial(const int counts[256], int weight_0, - double exp_val) { - const int significant_symbols = 256 >> 4; - const double exp_decay_factor = 0.6; - double bits = weight_0 * counts[0]; - int i; - for (i = 1; i < significant_symbols; ++i) { - bits += exp_val * (counts[i] + counts[256 - i]); - exp_val *= exp_decay_factor; - } - return (float)(-0.1 * bits); -} - // Compute the combined Shanon's entropy for distribution {X} and {X+Y} static float CombinedShannonEntropy(const int X[256], const int Y[256]) { int i; @@ -422,18 +401,6 @@ static float CombinedShannonEntropy(const int X[256], const int Y[256]) { return (float)retval; } -static float PredictionCostSpatialHistogram(const int accumulated[4][256], - const int tile[4][256]) { - int i; - double retval = 0; - for (i = 0; i < 4; ++i) { - const double kExpValue = 0.94; - retval += PredictionCostSpatial(tile[i], 1, kExpValue); - retval += VP8LCombinedShannonEntropy(tile[i], accumulated[i]); - } - return (float)retval; -} - void VP8LBitEntropyInit(VP8LBitEntropy* const entropy) { entropy->entropy = 0.; entropy->sum = 0; @@ -486,9 +453,9 @@ static WEBP_INLINE void GetEntropyUnrefinedHelper( *i_prev = i; } -void VP8LGetEntropyUnrefined(const uint32_t* const X, int length, - VP8LBitEntropy* const bit_entropy, - VP8LStreaks* const stats) { +static void GetEntropyUnrefined(const uint32_t X[], int length, + VP8LBitEntropy* const bit_entropy, + VP8LStreaks* const stats) { int i; int i_prev = 0; uint32_t x_prev = X[0]; @@ -499,18 +466,18 @@ void VP8LGetEntropyUnrefined(const uint32_t* const X, int length, for (i = 1; i < length; ++i) { const uint32_t x = X[i]; if (x != x_prev) { - VP8LGetEntropyUnrefinedHelper(x, i, &x_prev, &i_prev, bit_entropy, stats); + GetEntropyUnrefinedHelper(x, i, &x_prev, &i_prev, bit_entropy, stats); } } - VP8LGetEntropyUnrefinedHelper(0, i, &x_prev, &i_prev, bit_entropy, stats); + GetEntropyUnrefinedHelper(0, i, &x_prev, &i_prev, bit_entropy, stats); bit_entropy->entropy += VP8LFastSLog2(bit_entropy->sum); } -void VP8LGetCombinedEntropyUnrefined(const uint32_t* const X, - const uint32_t* const Y, int length, - VP8LBitEntropy* const bit_entropy, - VP8LStreaks* const stats) { +static void GetCombinedEntropyUnrefined(const uint32_t X[], const uint32_t Y[], + int length, + VP8LBitEntropy* const bit_entropy, + VP8LStreaks* const stats) { int i = 1; int i_prev = 0; uint32_t xy_prev = X[0] + Y[0]; @@ -521,439 +488,29 @@ void VP8LGetCombinedEntropyUnrefined(const uint32_t* const X, for (i = 1; i < length; ++i) { const uint32_t xy = X[i] + Y[i]; if (xy != xy_prev) { - VP8LGetEntropyUnrefinedHelper(xy, i, &xy_prev, &i_prev, bit_entropy, - stats); + GetEntropyUnrefinedHelper(xy, i, &xy_prev, &i_prev, bit_entropy, stats); } } - VP8LGetEntropyUnrefinedHelper(0, i, &xy_prev, &i_prev, bit_entropy, stats); + GetEntropyUnrefinedHelper(0, i, &xy_prev, &i_prev, bit_entropy, stats); bit_entropy->entropy += VP8LFastSLog2(bit_entropy->sum); } -static WEBP_INLINE void UpdateHisto(int histo_argb[4][256], uint32_t argb) { - ++histo_argb[0][argb >> 24]; - ++histo_argb[1][(argb >> 16) & 0xff]; - ++histo_argb[2][(argb >> 8) & 0xff]; - ++histo_argb[3][argb & 0xff]; -} - //------------------------------------------------------------------------------ -static WEBP_INLINE uint32_t Predict(VP8LPredictorFunc pred_func, - int x, int y, - const uint32_t* current_row, - const uint32_t* upper_row) { - if (y == 0) { - return (x == 0) ? ARGB_BLACK : current_row[x - 1]; // Left. - } else if (x == 0) { - return upper_row[x]; // Top. - } else { - return pred_func(current_row[x - 1], upper_row + x); - } -} - -static int MaxDiffBetweenPixels(uint32_t p1, uint32_t p2) { - const int diff_a = abs((int)(p1 >> 24) - (int)(p2 >> 24)); - const int diff_r = abs((int)((p1 >> 16) & 0xff) - (int)((p2 >> 16) & 0xff)); - const int diff_g = abs((int)((p1 >> 8) & 0xff) - (int)((p2 >> 8) & 0xff)); - const int diff_b = abs((int)(p1 & 0xff) - (int)(p2 & 0xff)); - return GetMax(GetMax(diff_a, diff_r), GetMax(diff_g, diff_b)); -} - -static int MaxDiffAroundPixel(uint32_t current, uint32_t up, uint32_t down, - uint32_t left, uint32_t right) { - const int diff_up = MaxDiffBetweenPixels(current, up); - const int diff_down = MaxDiffBetweenPixels(current, down); - const int diff_left = MaxDiffBetweenPixels(current, left); - const int diff_right = MaxDiffBetweenPixels(current, right); - return GetMax(GetMax(diff_up, diff_down), GetMax(diff_left, diff_right)); -} - -static uint32_t AddGreenToBlueAndRed(uint32_t argb) { - const uint32_t green = (argb >> 8) & 0xff; - uint32_t red_blue = argb & 0x00ff00ffu; - red_blue += (green << 16) | green; - red_blue &= 0x00ff00ffu; - return (argb & 0xff00ff00u) | red_blue; -} - -static void MaxDiffsForRow(int width, int stride, const uint32_t* const argb, - uint8_t* const max_diffs, int used_subtract_green) { - uint32_t current, up, down, left, right; - int x; - if (width <= 2) return; - current = argb[0]; - right = argb[1]; - if (used_subtract_green) { - current = AddGreenToBlueAndRed(current); - right = AddGreenToBlueAndRed(right); - } - // max_diffs[0] and max_diffs[width - 1] are never used. - for (x = 1; x < width - 1; ++x) { - up = argb[-stride + x]; - down = argb[stride + x]; - left = current; - current = right; - right = argb[x + 1]; - if (used_subtract_green) { - up = AddGreenToBlueAndRed(up); - down = AddGreenToBlueAndRed(down); - right = AddGreenToBlueAndRed(right); - } - max_diffs[x] = MaxDiffAroundPixel(current, up, down, left, right); - } -} - -// Quantize the difference between the actual component value and its prediction -// to a multiple of quantization, working modulo 256, taking care not to cross -// a boundary (inclusive upper limit). -static uint8_t NearLosslessComponent(uint8_t value, uint8_t predict, - uint8_t boundary, int quantization) { - const int residual = (value - predict) & 0xff; - const int boundary_residual = (boundary - predict) & 0xff; - const int lower = residual & ~(quantization - 1); - const int upper = lower + quantization; - // Resolve ties towards a value closer to the prediction (i.e. towards lower - // if value comes after prediction and towards upper otherwise). - const int bias = ((boundary - value) & 0xff) < boundary_residual; - if (residual - lower < upper - residual + bias) { - // lower is closer to residual than upper. - if (residual > boundary_residual && lower <= boundary_residual) { - // Halve quantization step to avoid crossing boundary. This midpoint is - // on the same side of boundary as residual because midpoint >= residual - // (since lower is closer than upper) and residual is above the boundary. - return lower + (quantization >> 1); - } - return lower; - } else { - // upper is closer to residual than lower. - if (residual <= boundary_residual && upper > boundary_residual) { - // Halve quantization step to avoid crossing boundary. This midpoint is - // on the same side of boundary as residual because midpoint <= residual - // (since upper is closer than lower) and residual is below the boundary. - return lower + (quantization >> 1); - } - return upper & 0xff; - } -} - -// Quantize every component of the difference between the actual pixel value and -// its prediction to a multiple of a quantization (a power of 2, not larger than -// max_quantization which is a power of 2, smaller than max_diff). Take care if -// value and predict have undergone subtract green, which means that red and -// blue are represented as offsets from green. -static uint32_t NearLossless(uint32_t value, uint32_t predict, - int max_quantization, int max_diff, - int used_subtract_green) { - int quantization; - uint8_t new_green = 0; - uint8_t green_diff = 0; - uint8_t a, r, g, b; - if (max_diff <= 2) { - return VP8LSubPixels(value, predict); - } - quantization = max_quantization; - while (quantization >= max_diff) { - quantization >>= 1; - } - if ((value >> 24) == 0 || (value >> 24) == 0xff) { - // Preserve transparency of fully transparent or fully opaque pixels. - a = ((value >> 24) - (predict >> 24)) & 0xff; - } else { - a = NearLosslessComponent(value >> 24, predict >> 24, 0xff, quantization); - } - g = NearLosslessComponent((value >> 8) & 0xff, (predict >> 8) & 0xff, 0xff, - quantization); - if (used_subtract_green) { - // The green offset will be added to red and blue components during decoding - // to obtain the actual red and blue values. - new_green = ((predict >> 8) + g) & 0xff; - // The amount by which green has been adjusted during quantization. It is - // subtracted from red and blue for compensation, to avoid accumulating two - // quantization errors in them. - green_diff = (new_green - (value >> 8)) & 0xff; - } - r = NearLosslessComponent(((value >> 16) - green_diff) & 0xff, - (predict >> 16) & 0xff, 0xff - new_green, - quantization); - b = NearLosslessComponent((value - green_diff) & 0xff, predict & 0xff, - 0xff - new_green, quantization); - return ((uint32_t)a << 24) | ((uint32_t)r << 16) | ((uint32_t)g << 8) | b; -} - -// Returns the difference between the pixel and its prediction. In case of a -// lossy encoding, updates the source image to avoid propagating the deviation -// further to pixels which depend on the current pixel for their predictions. -static WEBP_INLINE uint32_t GetResidual(int width, int height, - uint32_t* const upper_row, - uint32_t* const current_row, - const uint8_t* const max_diffs, - int mode, VP8LPredictorFunc pred_func, - int x, int y, int max_quantization, - int exact, int used_subtract_green) { - const uint32_t predict = Predict(pred_func, x, y, current_row, upper_row); - uint32_t residual; - if (max_quantization == 1 || mode == 0 || y == 0 || y == height - 1 || - x == 0 || x == width - 1) { - residual = VP8LSubPixels(current_row[x], predict); - } else { - residual = NearLossless(current_row[x], predict, max_quantization, - max_diffs[x], used_subtract_green); - // Update the source image. - current_row[x] = VP8LAddPixels(predict, residual); - // x is never 0 here so we do not need to update upper_row like below. - } - if (!exact && (current_row[x] & kMaskAlpha) == 0) { - // If alpha is 0, cleanup RGB. We can choose the RGB values of the residual - // for best compression. The prediction of alpha itself can be non-zero and - // must be kept though. We choose RGB of the residual to be 0. - residual &= kMaskAlpha; - // Update the source image. - current_row[x] = predict & ~kMaskAlpha; - // The prediction for the rightmost pixel in a row uses the leftmost pixel - // in that row as its top-right context pixel. Hence if we change the - // leftmost pixel of current_row, the corresponding change must be applied - // to upper_row as well where top-right context is being read from. - if (x == 0 && y != 0) upper_row[width] = current_row[0]; - } - return residual; -} - -// Returns best predictor and updates the accumulated histogram. -// If max_quantization > 1, assumes that near lossless processing will be -// applied, quantizing residuals to multiples of quantization levels up to -// max_quantization (the actual quantization level depends on smoothness near -// the given pixel). -static int GetBestPredictorForTile(int width, int height, - int tile_x, int tile_y, int bits, - int accumulated[4][256], - uint32_t* const argb_scratch, - const uint32_t* const argb, - int max_quantization, - int exact, int used_subtract_green) { - const int kNumPredModes = 14; - const int start_x = tile_x << bits; - const int start_y = tile_y << bits; - const int tile_size = 1 << bits; - const int max_y = GetMin(tile_size, height - start_y); - const int max_x = GetMin(tile_size, width - start_x); - // Whether there exist columns just outside the tile. - const int have_left = (start_x > 0); - const int have_right = (max_x < width - start_x); - // Position and size of the strip covering the tile and adjacent columns if - // they exist. - const int context_start_x = start_x - have_left; - const int context_width = max_x + have_left + have_right; - // The width of upper_row and current_row is one pixel larger than image width - // to allow the top right pixel to point to the leftmost pixel of the next row - // when at the right edge. - uint32_t* upper_row = argb_scratch; - uint32_t* current_row = upper_row + width + 1; - uint8_t* const max_diffs = (uint8_t*)(current_row + width + 1); - float best_diff = MAX_DIFF_COST; - int best_mode = 0; - int mode; - int histo_stack_1[4][256]; - int histo_stack_2[4][256]; - // Need pointers to be able to swap arrays. - int (*histo_argb)[256] = histo_stack_1; - int (*best_histo)[256] = histo_stack_2; - int i, j; - - for (mode = 0; mode < kNumPredModes; ++mode) { - const VP8LPredictorFunc pred_func = VP8LPredictors[mode]; - float cur_diff; - int relative_y; - memset(histo_argb, 0, sizeof(histo_stack_1)); - if (start_y > 0) { - // Read the row above the tile which will become the first upper_row. - // Include a pixel to the left if it exists; include a pixel to the right - // in all cases (wrapping to the leftmost pixel of the next row if it does - // not exist). - memcpy(current_row + context_start_x, - argb + (start_y - 1) * width + context_start_x, - sizeof(*argb) * (max_x + have_left + 1)); - } - for (relative_y = 0; relative_y < max_y; ++relative_y) { - const int y = start_y + relative_y; - int relative_x; - uint32_t* tmp = upper_row; - upper_row = current_row; - current_row = tmp; - // Read current_row. Include a pixel to the left if it exists; include a - // pixel to the right in all cases except at the bottom right corner of - // the image (wrapping to the leftmost pixel of the next row if it does - // not exist in the current row). - memcpy(current_row + context_start_x, - argb + y * width + context_start_x, - sizeof(*argb) * (max_x + have_left + (y + 1 < height))); - if (max_quantization > 1 && y >= 1 && y + 1 < height) { - MaxDiffsForRow(context_width, width, argb + y * width + context_start_x, - max_diffs + context_start_x, used_subtract_green); - } - - for (relative_x = 0; relative_x < max_x; ++relative_x) { - const int x = start_x + relative_x; - UpdateHisto(histo_argb, - GetResidual(width, height, upper_row, current_row, - max_diffs, mode, pred_func, x, y, - max_quantization, exact, used_subtract_green)); - } - } - cur_diff = PredictionCostSpatialHistogram( - (const int (*)[256])accumulated, (const int (*)[256])histo_argb); - if (cur_diff < best_diff) { - int (*tmp)[256] = histo_argb; - histo_argb = best_histo; - best_histo = tmp; - best_diff = cur_diff; - best_mode = mode; - } - } - - for (i = 0; i < 4; i++) { - for (j = 0; j < 256; j++) { - accumulated[i][j] += best_histo[i][j]; - } - } - - return best_mode; -} - -// Converts pixels of the image to residuals with respect to predictions. -// If max_quantization > 1, applies near lossless processing, quantizing -// residuals to multiples of quantization levels up to max_quantization -// (the actual quantization level depends on smoothness near the given pixel). -static void CopyImageWithPrediction(int width, int height, - int bits, uint32_t* const modes, - uint32_t* const argb_scratch, - uint32_t* const argb, - int low_effort, int max_quantization, - int exact, int used_subtract_green) { - const int tiles_per_row = VP8LSubSampleSize(width, bits); - const int mask = (1 << bits) - 1; - // The width of upper_row and current_row is one pixel larger than image width - // to allow the top right pixel to point to the leftmost pixel of the next row - // when at the right edge. - uint32_t* upper_row = argb_scratch; - uint32_t* current_row = upper_row + width + 1; - uint8_t* current_max_diffs = (uint8_t*)(current_row + width + 1); - uint8_t* lower_max_diffs = current_max_diffs + width; - int y; - int mode = 0; - VP8LPredictorFunc pred_func = NULL; - - for (y = 0; y < height; ++y) { - int x; - uint32_t* const tmp32 = upper_row; - upper_row = current_row; - current_row = tmp32; - memcpy(current_row, argb + y * width, - sizeof(*argb) * (width + (y + 1 < height))); - - if (low_effort) { - for (x = 0; x < width; ++x) { - const uint32_t predict = Predict(VP8LPredictors[kPredLowEffort], x, y, - current_row, upper_row); - argb[y * width + x] = VP8LSubPixels(current_row[x], predict); - } - } else { - if (max_quantization > 1) { - // Compute max_diffs for the lower row now, because that needs the - // contents of argb for the current row, which we will overwrite with - // residuals before proceeding with the next row. - uint8_t* const tmp8 = current_max_diffs; - current_max_diffs = lower_max_diffs; - lower_max_diffs = tmp8; - if (y + 2 < height) { - MaxDiffsForRow(width, width, argb + (y + 1) * width, lower_max_diffs, - used_subtract_green); - } - } - for (x = 0; x < width; ++x) { - if ((x & mask) == 0) { - mode = (modes[(y >> bits) * tiles_per_row + (x >> bits)] >> 8) & 0xff; - pred_func = VP8LPredictors[mode]; - } - argb[y * width + x] = GetResidual( - width, height, upper_row, current_row, current_max_diffs, mode, - pred_func, x, y, max_quantization, exact, used_subtract_green); - } - } - } -} - -// Finds the best predictor for each tile, and converts the image to residuals -// with respect to predictions. If near_lossless_quality < 100, applies -// near lossless processing, shaving off more bits of residuals for lower -// qualities. -void VP8LResidualImage(int width, int height, int bits, int low_effort, - uint32_t* const argb, uint32_t* const argb_scratch, - uint32_t* const image, int near_lossless_quality, - int exact, int used_subtract_green) { - const int tiles_per_row = VP8LSubSampleSize(width, bits); - const int tiles_per_col = VP8LSubSampleSize(height, bits); - int tile_y; - int histo[4][256]; - const int max_quantization = 1 << VP8LNearLosslessBits(near_lossless_quality); - if (low_effort) { - int i; - for (i = 0; i < tiles_per_row * tiles_per_col; ++i) { - image[i] = ARGB_BLACK | (kPredLowEffort << 8); - } - } else { - memset(histo, 0, sizeof(histo)); - for (tile_y = 0; tile_y < tiles_per_col; ++tile_y) { - int tile_x; - for (tile_x = 0; tile_x < tiles_per_row; ++tile_x) { - const int pred = GetBestPredictorForTile(width, height, tile_x, tile_y, - bits, histo, argb_scratch, argb, max_quantization, exact, - used_subtract_green); - image[tile_y * tiles_per_row + tile_x] = ARGB_BLACK | (pred << 8); - } - } - } - - CopyImageWithPrediction(width, height, bits, image, argb_scratch, argb, - low_effort, max_quantization, exact, - used_subtract_green); -} - void VP8LSubtractGreenFromBlueAndRed_C(uint32_t* argb_data, int num_pixels) { int i; for (i = 0; i < num_pixels; ++i) { - const uint32_t argb = argb_data[i]; - const uint32_t green = (argb >> 8) & 0xff; + const int argb = argb_data[i]; + const int green = (argb >> 8) & 0xff; const uint32_t new_r = (((argb >> 16) & 0xff) - green) & 0xff; - const uint32_t new_b = ((argb & 0xff) - green) & 0xff; - argb_data[i] = (argb & 0xff00ff00) | (new_r << 16) | new_b; + const uint32_t new_b = (((argb >> 0) & 0xff) - green) & 0xff; + argb_data[i] = (argb & 0xff00ff00u) | (new_r << 16) | new_b; } } -static WEBP_INLINE void MultipliersClear(VP8LMultipliers* const m) { - m->green_to_red_ = 0; - m->green_to_blue_ = 0; - m->red_to_blue_ = 0; -} - -static WEBP_INLINE uint32_t ColorTransformDelta(int8_t color_pred, - int8_t color) { - return (uint32_t)((int)(color_pred) * color) >> 5; -} - -static WEBP_INLINE void ColorCodeToMultipliers(uint32_t color_code, - VP8LMultipliers* const m) { - m->green_to_red_ = (color_code >> 0) & 0xff; - m->green_to_blue_ = (color_code >> 8) & 0xff; - m->red_to_blue_ = (color_code >> 16) & 0xff; -} - -static WEBP_INLINE uint32_t MultipliersToColorCode( - const VP8LMultipliers* const m) { - return 0xff000000u | - ((uint32_t)(m->red_to_blue_) << 16) | - ((uint32_t)(m->green_to_blue_) << 8) | - m->green_to_red_; +static WEBP_INLINE int ColorTransformDelta(int8_t color_pred, int8_t color) { + return ((int)color_pred * color) >> 5; } void VP8LTransformColor_C(const VP8LMultipliers* const m, uint32_t* data, @@ -963,8 +520,8 @@ void VP8LTransformColor_C(const VP8LMultipliers* const m, uint32_t* data, const uint32_t argb = data[i]; const uint32_t green = argb >> 8; const uint32_t red = argb >> 16; - uint32_t new_red = red; - uint32_t new_blue = argb; + int new_red = red; + int new_blue = argb; new_red -= ColorTransformDelta(m->green_to_red_, green); new_red &= 0xff; new_blue -= ColorTransformDelta(m->green_to_blue_, green); @@ -977,7 +534,7 @@ void VP8LTransformColor_C(const VP8LMultipliers* const m, uint32_t* data, static WEBP_INLINE uint8_t TransformColorRed(uint8_t green_to_red, uint32_t argb) { const uint32_t green = argb >> 8; - uint32_t new_red = argb >> 16; + int new_red = argb >> 16; new_red -= ColorTransformDelta(green_to_red, green); return (new_red & 0xff); } @@ -993,15 +550,6 @@ static WEBP_INLINE uint8_t TransformColorBlue(uint8_t green_to_blue, return (new_blue & 0xff); } -static float PredictionCostCrossColor(const int accumulated[256], - const int counts[256]) { - // Favor low entropy, locally and globally. - // Favor small absolute values for PredictionCostSpatial - static const double kExpValue = 2.4; - return VP8LCombinedShannonEntropy(counts, accumulated) + - PredictionCostSpatial(counts, 3, kExpValue); -} - void VP8LCollectColorRedTransforms_C(const uint32_t* argb, int stride, int tile_width, int tile_height, int green_to_red, int histo[]) { @@ -1014,59 +562,6 @@ void VP8LCollectColorRedTransforms_C(const uint32_t* argb, int stride, } } -static float GetPredictionCostCrossColorRed( - const uint32_t* argb, int stride, int tile_width, int tile_height, - VP8LMultipliers prev_x, VP8LMultipliers prev_y, int green_to_red, - const int accumulated_red_histo[256]) { - int histo[256] = { 0 }; - float cur_diff; - - VP8LCollectColorRedTransforms(argb, stride, tile_width, tile_height, - green_to_red, histo); - - cur_diff = PredictionCostCrossColor(accumulated_red_histo, histo); - if ((uint8_t)green_to_red == prev_x.green_to_red_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if ((uint8_t)green_to_red == prev_y.green_to_red_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if (green_to_red == 0) { - cur_diff -= 3; - } - return cur_diff; -} - -static void GetBestGreenToRed( - const uint32_t* argb, int stride, int tile_width, int tile_height, - VP8LMultipliers prev_x, VP8LMultipliers prev_y, int quality, - const int accumulated_red_histo[256], VP8LMultipliers* const best_tx) { - const int kMaxIters = 4 + ((7 * quality) >> 8); // in range [4..6] - int green_to_red_best = 0; - int iter, offset; - float best_diff = GetPredictionCostCrossColorRed( - argb, stride, tile_width, tile_height, prev_x, prev_y, - green_to_red_best, accumulated_red_histo); - for (iter = 0; iter < kMaxIters; ++iter) { - // ColorTransformDelta is a 3.5 bit fixed point, so 32 is equal to - // one in color computation. Having initial delta here as 1 is sufficient - // to explore the range of (-2, 2). - const int delta = 32 >> iter; - // Try a negative and a positive delta from the best known value. - for (offset = -delta; offset <= delta; offset += 2 * delta) { - const int green_to_red_cur = offset + green_to_red_best; - const float cur_diff = GetPredictionCostCrossColorRed( - argb, stride, tile_width, tile_height, prev_x, prev_y, - green_to_red_cur, accumulated_red_histo); - if (cur_diff < best_diff) { - best_diff = cur_diff; - green_to_red_best = green_to_red_cur; - } - } - } - best_tx->green_to_red_ = green_to_red_best; -} - void VP8LCollectColorBlueTransforms_C(const uint32_t* argb, int stride, int tile_width, int tile_height, int green_to_blue, int red_to_blue, @@ -1080,187 +575,6 @@ void VP8LCollectColorBlueTransforms_C(const uint32_t* argb, int stride, } } -static float GetPredictionCostCrossColorBlue( - const uint32_t* argb, int stride, int tile_width, int tile_height, - VP8LMultipliers prev_x, VP8LMultipliers prev_y, - int green_to_blue, int red_to_blue, const int accumulated_blue_histo[256]) { - int histo[256] = { 0 }; - float cur_diff; - - VP8LCollectColorBlueTransforms(argb, stride, tile_width, tile_height, - green_to_blue, red_to_blue, histo); - - cur_diff = PredictionCostCrossColor(accumulated_blue_histo, histo); - if ((uint8_t)green_to_blue == prev_x.green_to_blue_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if ((uint8_t)green_to_blue == prev_y.green_to_blue_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if ((uint8_t)red_to_blue == prev_x.red_to_blue_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if ((uint8_t)red_to_blue == prev_y.red_to_blue_) { - cur_diff -= 3; // favor keeping the areas locally similar - } - if (green_to_blue == 0) { - cur_diff -= 3; - } - if (red_to_blue == 0) { - cur_diff -= 3; - } - return cur_diff; -} - -#define kGreenRedToBlueNumAxis 8 -#define kGreenRedToBlueMaxIters 7 -static void GetBestGreenRedToBlue( - const uint32_t* argb, int stride, int tile_width, int tile_height, - VP8LMultipliers prev_x, VP8LMultipliers prev_y, int quality, - const int accumulated_blue_histo[256], - VP8LMultipliers* const best_tx) { - const int8_t offset[kGreenRedToBlueNumAxis][2] = - {{0, -1}, {0, 1}, {-1, 0}, {1, 0}, {-1, -1}, {-1, 1}, {1, -1}, {1, 1}}; - const int8_t delta_lut[kGreenRedToBlueMaxIters] = { 16, 16, 8, 4, 2, 2, 2 }; - const int iters = - (quality < 25) ? 1 : (quality > 50) ? kGreenRedToBlueMaxIters : 4; - int green_to_blue_best = 0; - int red_to_blue_best = 0; - int iter; - // Initial value at origin: - float best_diff = GetPredictionCostCrossColorBlue( - argb, stride, tile_width, tile_height, prev_x, prev_y, - green_to_blue_best, red_to_blue_best, accumulated_blue_histo); - for (iter = 0; iter < iters; ++iter) { - const int delta = delta_lut[iter]; - int axis; - for (axis = 0; axis < kGreenRedToBlueNumAxis; ++axis) { - const int green_to_blue_cur = - offset[axis][0] * delta + green_to_blue_best; - const int red_to_blue_cur = offset[axis][1] * delta + red_to_blue_best; - const float cur_diff = GetPredictionCostCrossColorBlue( - argb, stride, tile_width, tile_height, prev_x, prev_y, - green_to_blue_cur, red_to_blue_cur, accumulated_blue_histo); - if (cur_diff < best_diff) { - best_diff = cur_diff; - green_to_blue_best = green_to_blue_cur; - red_to_blue_best = red_to_blue_cur; - } - if (quality < 25 && iter == 4) { - // Only axis aligned diffs for lower quality. - break; // next iter. - } - } - if (delta == 2 && green_to_blue_best == 0 && red_to_blue_best == 0) { - // Further iterations would not help. - break; // out of iter-loop. - } - } - best_tx->green_to_blue_ = green_to_blue_best; - best_tx->red_to_blue_ = red_to_blue_best; -} -#undef kGreenRedToBlueMaxIters -#undef kGreenRedToBlueNumAxis - -static VP8LMultipliers GetBestColorTransformForTile( - int tile_x, int tile_y, int bits, - VP8LMultipliers prev_x, - VP8LMultipliers prev_y, - int quality, int xsize, int ysize, - const int accumulated_red_histo[256], - const int accumulated_blue_histo[256], - const uint32_t* const argb) { - const int max_tile_size = 1 << bits; - const int tile_y_offset = tile_y * max_tile_size; - const int tile_x_offset = tile_x * max_tile_size; - const int all_x_max = GetMin(tile_x_offset + max_tile_size, xsize); - const int all_y_max = GetMin(tile_y_offset + max_tile_size, ysize); - const int tile_width = all_x_max - tile_x_offset; - const int tile_height = all_y_max - tile_y_offset; - const uint32_t* const tile_argb = argb + tile_y_offset * xsize - + tile_x_offset; - VP8LMultipliers best_tx; - MultipliersClear(&best_tx); - - GetBestGreenToRed(tile_argb, xsize, tile_width, tile_height, - prev_x, prev_y, quality, accumulated_red_histo, &best_tx); - GetBestGreenRedToBlue(tile_argb, xsize, tile_width, tile_height, - prev_x, prev_y, quality, accumulated_blue_histo, - &best_tx); - return best_tx; -} - -static void CopyTileWithColorTransform(int xsize, int ysize, - int tile_x, int tile_y, - int max_tile_size, - VP8LMultipliers color_transform, - uint32_t* argb) { - const int xscan = GetMin(max_tile_size, xsize - tile_x); - int yscan = GetMin(max_tile_size, ysize - tile_y); - argb += tile_y * xsize + tile_x; - while (yscan-- > 0) { - VP8LTransformColor(&color_transform, argb, xscan); - argb += xsize; - } -} - -void VP8LColorSpaceTransform(int width, int height, int bits, int quality, - uint32_t* const argb, uint32_t* image) { - const int max_tile_size = 1 << bits; - const int tile_xsize = VP8LSubSampleSize(width, bits); - const int tile_ysize = VP8LSubSampleSize(height, bits); - int accumulated_red_histo[256] = { 0 }; - int accumulated_blue_histo[256] = { 0 }; - int tile_x, tile_y; - VP8LMultipliers prev_x, prev_y; - MultipliersClear(&prev_y); - MultipliersClear(&prev_x); - for (tile_y = 0; tile_y < tile_ysize; ++tile_y) { - for (tile_x = 0; tile_x < tile_xsize; ++tile_x) { - int y; - const int tile_x_offset = tile_x * max_tile_size; - const int tile_y_offset = tile_y * max_tile_size; - const int all_x_max = GetMin(tile_x_offset + max_tile_size, width); - const int all_y_max = GetMin(tile_y_offset + max_tile_size, height); - const int offset = tile_y * tile_xsize + tile_x; - if (tile_y != 0) { - ColorCodeToMultipliers(image[offset - tile_xsize], &prev_y); - } - prev_x = GetBestColorTransformForTile(tile_x, tile_y, bits, - prev_x, prev_y, - quality, width, height, - accumulated_red_histo, - accumulated_blue_histo, - argb); - image[offset] = MultipliersToColorCode(&prev_x); - CopyTileWithColorTransform(width, height, tile_x_offset, tile_y_offset, - max_tile_size, prev_x, argb); - - // Gather accumulated histogram data. - for (y = tile_y_offset; y < all_y_max; ++y) { - int ix = y * width + tile_x_offset; - const int ix_end = ix + all_x_max - tile_x_offset; - for (; ix < ix_end; ++ix) { - const uint32_t pix = argb[ix]; - if (ix >= 2 && - pix == argb[ix - 2] && - pix == argb[ix - 1]) { - continue; // repeated pixels are handled by backward references - } - if (ix >= width + 2 && - argb[ix - 2] == argb[ix - width - 2] && - argb[ix - 1] == argb[ix - width - 1] && - pix == argb[ix - width]) { - continue; // repeated pixels are handled by backward references - } - ++accumulated_red_histo[(pix >> 16) & 0xff]; - ++accumulated_blue_histo[(pix >> 0) & 0xff]; - } - } - } - } -} - //------------------------------------------------------------------------------ static int VectorMismatch(const uint32_t* const array1, @@ -1274,8 +588,8 @@ static int VectorMismatch(const uint32_t* const array1, } // Bundles multiple (1, 2, 4 or 8) pixels into a single pixel. -void VP8LBundleColorMap(const uint8_t* const row, int width, - int xbits, uint32_t* const dst) { +void VP8LBundleColorMap_C(const uint8_t* const row, int width, int xbits, + uint32_t* dst) { int x; if (xbits > 0) { const int bit_depth = 1 << (3 - xbits); @@ -1350,8 +664,172 @@ static void HistogramAdd(const VP8LHistogram* const a, } //------------------------------------------------------------------------------ +// Image transforms. -VP8LProcessBlueAndRedFunc VP8LSubtractGreenFromBlueAndRed; +static WEBP_INLINE uint32_t Average2(uint32_t a0, uint32_t a1) { + return (((a0 ^ a1) & 0xfefefefeu) >> 1) + (a0 & a1); +} + +static WEBP_INLINE uint32_t Average3(uint32_t a0, uint32_t a1, uint32_t a2) { + return Average2(Average2(a0, a2), a1); +} + +static WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1, + uint32_t a2, uint32_t a3) { + return Average2(Average2(a0, a1), Average2(a2, a3)); +} + +static WEBP_INLINE uint32_t Clip255(uint32_t a) { + if (a < 256) { + return a; + } + // return 0, when a is a negative integer. + // return 255, when a is positive. + return ~a >> 24; +} + +static WEBP_INLINE int AddSubtractComponentFull(int a, int b, int c) { + return Clip255(a + b - c); +} + +static WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1, + uint32_t c2) { + const int a = AddSubtractComponentFull(c0 >> 24, c1 >> 24, c2 >> 24); + const int r = AddSubtractComponentFull((c0 >> 16) & 0xff, + (c1 >> 16) & 0xff, + (c2 >> 16) & 0xff); + const int g = AddSubtractComponentFull((c0 >> 8) & 0xff, + (c1 >> 8) & 0xff, + (c2 >> 8) & 0xff); + const int b = AddSubtractComponentFull(c0 & 0xff, c1 & 0xff, c2 & 0xff); + return ((uint32_t)a << 24) | (r << 16) | (g << 8) | b; +} + +static WEBP_INLINE int AddSubtractComponentHalf(int a, int b) { + return Clip255(a + (a - b) / 2); +} + +static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1, + uint32_t c2) { + const uint32_t ave = Average2(c0, c1); + const int a = AddSubtractComponentHalf(ave >> 24, c2 >> 24); + const int r = AddSubtractComponentHalf((ave >> 16) & 0xff, (c2 >> 16) & 0xff); + const int g = AddSubtractComponentHalf((ave >> 8) & 0xff, (c2 >> 8) & 0xff); + const int b = AddSubtractComponentHalf((ave >> 0) & 0xff, (c2 >> 0) & 0xff); + return ((uint32_t)a << 24) | (r << 16) | (g << 8) | b; +} + +// gcc-4.9 on ARM generates incorrect code in Select() when Sub3() is inlined. +#if defined(__arm__) && \ + (LOCAL_GCC_VERSION == 0x409 || LOCAL_GCC_VERSION == 0x408) +# define LOCAL_INLINE __attribute__ ((noinline)) +#else +# define LOCAL_INLINE WEBP_INLINE +#endif + +static LOCAL_INLINE int Sub3(int a, int b, int c) { + const int pb = b - c; + const int pa = a - c; + return abs(pb) - abs(pa); +} + +#undef LOCAL_INLINE + +static WEBP_INLINE uint32_t Select(uint32_t a, uint32_t b, uint32_t c) { + const int pa_minus_pb = + Sub3((a >> 24) , (b >> 24) , (c >> 24) ) + + Sub3((a >> 16) & 0xff, (b >> 16) & 0xff, (c >> 16) & 0xff) + + Sub3((a >> 8) & 0xff, (b >> 8) & 0xff, (c >> 8) & 0xff) + + Sub3((a ) & 0xff, (b ) & 0xff, (c ) & 0xff); + return (pa_minus_pb <= 0) ? a : b; +} + +//------------------------------------------------------------------------------ +// Predictors + +static uint32_t Predictor2(uint32_t left, const uint32_t* const top) { + (void)left; + return top[0]; +} +static uint32_t Predictor3(uint32_t left, const uint32_t* const top) { + (void)left; + return top[1]; +} +static uint32_t Predictor4(uint32_t left, const uint32_t* const top) { + (void)left; + return top[-1]; +} +static uint32_t Predictor5(uint32_t left, const uint32_t* const top) { + const uint32_t pred = Average3(left, top[0], top[1]); + return pred; +} +static uint32_t Predictor6(uint32_t left, const uint32_t* const top) { + const uint32_t pred = Average2(left, top[-1]); + return pred; +} +static uint32_t Predictor7(uint32_t left, const uint32_t* const top) { + const uint32_t pred = Average2(left, top[0]); + return pred; +} +static uint32_t Predictor8(uint32_t left, const uint32_t* const top) { + const uint32_t pred = Average2(top[-1], top[0]); + (void)left; + return pred; +} +static uint32_t Predictor9(uint32_t left, const uint32_t* const top) { + const uint32_t pred = Average2(top[0], top[1]); + (void)left; + return pred; +} +static uint32_t Predictor10(uint32_t left, const uint32_t* const top) { + const uint32_t pred = Average4(left, top[-1], top[0], top[1]); + return pred; +} +static uint32_t Predictor11(uint32_t left, const uint32_t* const top) { + const uint32_t pred = Select(top[0], left, top[-1]); + return pred; +} +static uint32_t Predictor12(uint32_t left, const uint32_t* const top) { + const uint32_t pred = ClampedAddSubtractFull(left, top[0], top[-1]); + return pred; +} +static uint32_t Predictor13(uint32_t left, const uint32_t* const top) { + const uint32_t pred = ClampedAddSubtractHalf(left, top[0], top[-1]); + return pred; +} + +//------------------------------------------------------------------------------ + +static void PredictorSub0_C(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + for (i = 0; i < num_pixels; ++i) out[i] = VP8LSubPixels(in[i], ARGB_BLACK); + (void)upper; +} + +static void PredictorSub1_C(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + for (i = 0; i < num_pixels; ++i) out[i] = VP8LSubPixels(in[i], in[i - 1]); + (void)upper; +} + +GENERATE_PREDICTOR_SUB(Predictor2, PredictorSub2_C) +GENERATE_PREDICTOR_SUB(Predictor3, PredictorSub3_C) +GENERATE_PREDICTOR_SUB(Predictor4, PredictorSub4_C) +GENERATE_PREDICTOR_SUB(Predictor5, PredictorSub5_C) +GENERATE_PREDICTOR_SUB(Predictor6, PredictorSub6_C) +GENERATE_PREDICTOR_SUB(Predictor7, PredictorSub7_C) +GENERATE_PREDICTOR_SUB(Predictor8, PredictorSub8_C) +GENERATE_PREDICTOR_SUB(Predictor9, PredictorSub9_C) +GENERATE_PREDICTOR_SUB(Predictor10, PredictorSub10_C) +GENERATE_PREDICTOR_SUB(Predictor11, PredictorSub11_C) +GENERATE_PREDICTOR_SUB(Predictor12, PredictorSub12_C) +GENERATE_PREDICTOR_SUB(Predictor13, PredictorSub13_C) + +//------------------------------------------------------------------------------ + +VP8LProcessEncBlueAndRedFunc VP8LSubtractGreenFromBlueAndRed; VP8LTransformColorFunc VP8LTransformColor; @@ -1365,17 +843,23 @@ VP8LCostFunc VP8LExtraCost; VP8LCostCombinedFunc VP8LExtraCostCombined; VP8LCombinedShannonEntropyFunc VP8LCombinedShannonEntropy; -GetEntropyUnrefinedHelperFunc VP8LGetEntropyUnrefinedHelper; +VP8LGetEntropyUnrefinedFunc VP8LGetEntropyUnrefined; +VP8LGetCombinedEntropyUnrefinedFunc VP8LGetCombinedEntropyUnrefined; VP8LHistogramAddFunc VP8LHistogramAdd; VP8LVectorMismatchFunc VP8LVectorMismatch; +VP8LBundleColorMapFunc VP8LBundleColorMap; + +VP8LPredictorAddSubFunc VP8LPredictorsSub[16]; +VP8LPredictorAddSubFunc VP8LPredictorsSub_C[16]; extern void VP8LEncDspInitSSE2(void); extern void VP8LEncDspInitSSE41(void); extern void VP8LEncDspInitNEON(void); extern void VP8LEncDspInitMIPS32(void); extern void VP8LEncDspInitMIPSdspR2(void); +extern void VP8LEncDspInitMSA(void); static volatile VP8CPUInfo lossless_enc_last_cpuinfo_used = (VP8CPUInfo)&lossless_enc_last_cpuinfo_used; @@ -1399,11 +883,47 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInit(void) { VP8LExtraCostCombined = ExtraCostCombined; VP8LCombinedShannonEntropy = CombinedShannonEntropy; - VP8LGetEntropyUnrefinedHelper = GetEntropyUnrefinedHelper; + VP8LGetEntropyUnrefined = GetEntropyUnrefined; + VP8LGetCombinedEntropyUnrefined = GetCombinedEntropyUnrefined; VP8LHistogramAdd = HistogramAdd; VP8LVectorMismatch = VectorMismatch; + VP8LBundleColorMap = VP8LBundleColorMap_C; + + VP8LPredictorsSub[0] = PredictorSub0_C; + VP8LPredictorsSub[1] = PredictorSub1_C; + VP8LPredictorsSub[2] = PredictorSub2_C; + VP8LPredictorsSub[3] = PredictorSub3_C; + VP8LPredictorsSub[4] = PredictorSub4_C; + VP8LPredictorsSub[5] = PredictorSub5_C; + VP8LPredictorsSub[6] = PredictorSub6_C; + VP8LPredictorsSub[7] = PredictorSub7_C; + VP8LPredictorsSub[8] = PredictorSub8_C; + VP8LPredictorsSub[9] = PredictorSub9_C; + VP8LPredictorsSub[10] = PredictorSub10_C; + VP8LPredictorsSub[11] = PredictorSub11_C; + VP8LPredictorsSub[12] = PredictorSub12_C; + VP8LPredictorsSub[13] = PredictorSub13_C; + VP8LPredictorsSub[14] = PredictorSub0_C; // <- padding security sentinels + VP8LPredictorsSub[15] = PredictorSub0_C; + + VP8LPredictorsSub_C[0] = PredictorSub0_C; + VP8LPredictorsSub_C[1] = PredictorSub1_C; + VP8LPredictorsSub_C[2] = PredictorSub2_C; + VP8LPredictorsSub_C[3] = PredictorSub3_C; + VP8LPredictorsSub_C[4] = PredictorSub4_C; + VP8LPredictorsSub_C[5] = PredictorSub5_C; + VP8LPredictorsSub_C[6] = PredictorSub6_C; + VP8LPredictorsSub_C[7] = PredictorSub7_C; + VP8LPredictorsSub_C[8] = PredictorSub8_C; + VP8LPredictorsSub_C[9] = PredictorSub9_C; + VP8LPredictorsSub_C[10] = PredictorSub10_C; + VP8LPredictorsSub_C[11] = PredictorSub11_C; + VP8LPredictorsSub_C[12] = PredictorSub12_C; + VP8LPredictorsSub_C[13] = PredictorSub13_C; + VP8LPredictorsSub_C[14] = PredictorSub0_C; // <- padding security sentinels + VP8LPredictorsSub_C[15] = PredictorSub0_C; // If defined, use CPUInfo() to overwrite some pointers with faster versions. if (VP8GetCPUInfo != NULL) { @@ -1432,6 +952,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInit(void) { VP8LEncDspInitMIPSdspR2(); } #endif +#if defined(WEBP_USE_MSA) + if (VP8GetCPUInfo(kMSA)) { + VP8LEncDspInitMSA(); + } +#endif } lossless_enc_last_cpuinfo_used = VP8GetCPUInfo; } diff --git a/thirdparty/libwebp/dsp/lossless_enc_mips32.c b/thirdparty/libwebp/dsp/lossless_enc_mips32.c index 49c666d4fd..4186b9f50d 100644 --- a/thirdparty/libwebp/dsp/lossless_enc_mips32.c +++ b/thirdparty/libwebp/dsp/lossless_enc_mips32.c @@ -14,6 +14,7 @@ #include "./dsp.h" #include "./lossless.h" +#include "./lossless_common.h" #if defined(WEBP_USE_MIPS32) @@ -240,6 +241,49 @@ static WEBP_INLINE void GetEntropyUnrefinedHelper( *i_prev = i; } +static void GetEntropyUnrefined(const uint32_t X[], int length, + VP8LBitEntropy* const bit_entropy, + VP8LStreaks* const stats) { + int i; + int i_prev = 0; + uint32_t x_prev = X[0]; + + memset(stats, 0, sizeof(*stats)); + VP8LBitEntropyInit(bit_entropy); + + for (i = 1; i < length; ++i) { + const uint32_t x = X[i]; + if (x != x_prev) { + GetEntropyUnrefinedHelper(x, i, &x_prev, &i_prev, bit_entropy, stats); + } + } + GetEntropyUnrefinedHelper(0, i, &x_prev, &i_prev, bit_entropy, stats); + + bit_entropy->entropy += VP8LFastSLog2(bit_entropy->sum); +} + +static void GetCombinedEntropyUnrefined(const uint32_t X[], const uint32_t Y[], + int length, + VP8LBitEntropy* const bit_entropy, + VP8LStreaks* const stats) { + int i = 1; + int i_prev = 0; + uint32_t xy_prev = X[0] + Y[0]; + + memset(stats, 0, sizeof(*stats)); + VP8LBitEntropyInit(bit_entropy); + + for (i = 1; i < length; ++i) { + const uint32_t xy = X[i] + Y[i]; + if (xy != xy_prev) { + GetEntropyUnrefinedHelper(xy, i, &xy_prev, &i_prev, bit_entropy, stats); + } + } + GetEntropyUnrefinedHelper(0, i, &xy_prev, &i_prev, bit_entropy, stats); + + bit_entropy->entropy += VP8LFastSLog2(bit_entropy->sum); +} + #define ASM_START \ __asm__ volatile( \ ".set push \n\t" \ @@ -375,7 +419,8 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitMIPS32(void) { VP8LFastLog2Slow = FastLog2Slow; VP8LExtraCost = ExtraCost; VP8LExtraCostCombined = ExtraCostCombined; - VP8LGetEntropyUnrefinedHelper = GetEntropyUnrefinedHelper; + VP8LGetEntropyUnrefined = GetEntropyUnrefined; + VP8LGetCombinedEntropyUnrefined = GetCombinedEntropyUnrefined; VP8LHistogramAdd = HistogramAdd; } diff --git a/thirdparty/libwebp/dsp/lossless_enc_msa.c b/thirdparty/libwebp/dsp/lossless_enc_msa.c new file mode 100644 index 0000000000..2f69ba3bca --- /dev/null +++ b/thirdparty/libwebp/dsp/lossless_enc_msa.c @@ -0,0 +1,147 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// MSA variant of Image transform methods for lossless encoder. +// +// Authors: Prashant Patil (Prashant.Patil@imgtec.com) + +#include "./dsp.h" + +#if defined(WEBP_USE_MSA) + +#include "./lossless.h" +#include "./msa_macro.h" + +#define TRANSFORM_COLOR_8(src0, src1, dst0, dst1, c0, c1, mask0, mask1) do { \ + v8i16 g0, g1, t0, t1, t2, t3; \ + v4i32 t4, t5; \ + VSHF_B2_SH(src0, src0, src1, src1, mask0, mask0, g0, g1); \ + DOTP_SB2_SH(g0, g1, c0, c0, t0, t1); \ + SRAI_H2_SH(t0, t1, 5); \ + t0 = __msa_subv_h((v8i16)src0, t0); \ + t1 = __msa_subv_h((v8i16)src1, t1); \ + t4 = __msa_srli_w((v4i32)src0, 16); \ + t5 = __msa_srli_w((v4i32)src1, 16); \ + DOTP_SB2_SH(t4, t5, c1, c1, t2, t3); \ + SRAI_H2_SH(t2, t3, 5); \ + SUB2(t0, t2, t1, t3, t0, t1); \ + VSHF_B2_UB(src0, t0, src1, t1, mask1, mask1, dst0, dst1); \ +} while (0) + +#define TRANSFORM_COLOR_4(src, dst, c0, c1, mask0, mask1) do { \ + const v16i8 g0 = VSHF_SB(src, src, mask0); \ + v8i16 t0 = __msa_dotp_s_h(c0, g0); \ + v8i16 t1; \ + v4i32 t2; \ + t0 = SRAI_H(t0, 5); \ + t0 = __msa_subv_h((v8i16)src, t0); \ + t2 = __msa_srli_w((v4i32)src, 16); \ + t1 = __msa_dotp_s_h(c1, (v16i8)t2); \ + t1 = SRAI_H(t1, 5); \ + t0 = t0 - t1; \ + dst = VSHF_UB(src, t0, mask1); \ +} while (0) + +static void TransformColor(const VP8LMultipliers* const m, uint32_t* data, + int num_pixels) { + v16u8 src0, dst0; + const v16i8 g2br = (v16i8)__msa_fill_w(m->green_to_blue_ | + (m->green_to_red_ << 16)); + const v16i8 r2b = (v16i8)__msa_fill_w(m->red_to_blue_); + const v16u8 mask0 = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, + 13, 255, 13, 255 }; + const v16u8 mask1 = { 16, 1, 18, 3, 20, 5, 22, 7, 24, 9, 26, 11, + 28, 13, 30, 15 }; + + while (num_pixels >= 8) { + v16u8 src1, dst1; + LD_UB2(data, 4, src0, src1); + TRANSFORM_COLOR_8(src0, src1, dst0, dst1, g2br, r2b, mask0, mask1); + ST_UB2(dst0, dst1, data, 4); + data += 8; + num_pixels -= 8; + } + if (num_pixels > 0) { + if (num_pixels >= 4) { + src0 = LD_UB(data); + TRANSFORM_COLOR_4(src0, dst0, g2br, r2b, mask0, mask1); + ST_UB(dst0, data); + data += 4; + num_pixels -= 4; + } + if (num_pixels > 0) { + src0 = LD_UB(data); + TRANSFORM_COLOR_4(src0, dst0, g2br, r2b, mask0, mask1); + if (num_pixels == 3) { + const uint64_t pix_d = __msa_copy_s_d((v2i64)dst0, 0); + const uint32_t pix_w = __msa_copy_s_w((v4i32)dst0, 2); + SD(pix_d, data + 0); + SW(pix_w, data + 2); + } else if (num_pixels == 2) { + const uint64_t pix_d = __msa_copy_s_d((v2i64)dst0, 0); + SD(pix_d, data); + } else { + const uint32_t pix_w = __msa_copy_s_w((v4i32)dst0, 0); + SW(pix_w, data); + } + } + } +} + +static void SubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixels) { + int i; + uint8_t* ptemp_data = (uint8_t*)argb_data; + v16u8 src0, dst0, tmp0; + const v16u8 mask = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, + 13, 255, 13, 255 }; + + while (num_pixels >= 8) { + v16u8 src1, dst1, tmp1; + LD_UB2(ptemp_data, 16, src0, src1); + VSHF_B2_UB(src0, src1, src1, src0, mask, mask, tmp0, tmp1); + SUB2(src0, tmp0, src1, tmp1, dst0, dst1); + ST_UB2(dst0, dst1, ptemp_data, 16); + ptemp_data += 8 * 4; + num_pixels -= 8; + } + if (num_pixels > 0) { + if (num_pixels >= 4) { + src0 = LD_UB(ptemp_data); + tmp0 = VSHF_UB(src0, src0, mask); + dst0 = src0 - tmp0; + ST_UB(dst0, ptemp_data); + ptemp_data += 4 * 4; + num_pixels -= 4; + } + for (i = 0; i < num_pixels; i++) { + const uint8_t b = ptemp_data[0]; + const uint8_t g = ptemp_data[1]; + const uint8_t r = ptemp_data[2]; + ptemp_data[0] = (b - g) & 0xff; + ptemp_data[2] = (r - g) & 0xff; + ptemp_data += 4; + } + } +} + +//------------------------------------------------------------------------------ +// Entry point + +extern void VP8LEncDspInitMSA(void); + +WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitMSA(void) { + VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed; + VP8LTransformColor = TransformColor; +} + +#else // !WEBP_USE_MSA + +WEBP_DSP_INIT_STUB(VP8LEncDspInitMSA) + +#endif // WEBP_USE_MSA diff --git a/thirdparty/libwebp/dsp/lossless_enc_sse2.c b/thirdparty/libwebp/dsp/lossless_enc_sse2.c index 7c894e7ca4..8ad85d94d7 100644 --- a/thirdparty/libwebp/dsp/lossless_enc_sse2.c +++ b/thirdparty/libwebp/dsp/lossless_enc_sse2.c @@ -17,6 +17,8 @@ #include <assert.h> #include <emmintrin.h> #include "./lossless.h" +#include "./common_sse2.h" +#include "./lossless_common.h" // For sign-extended multiplying constants, pre-shifted by 5: #define CST_5b(X) (((int16_t)((uint16_t)X << 8)) >> 5) @@ -35,7 +37,9 @@ static void SubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixels) { _mm_storeu_si128((__m128i*)&argb_data[i], out); } // fallthrough and finish off with plain-C - VP8LSubtractGreenFromBlueAndRed_C(argb_data + i, num_pixels - i); + if (i != num_pixels) { + VP8LSubtractGreenFromBlueAndRed_C(argb_data + i, num_pixels - i); + } } //------------------------------------------------------------------------------ @@ -69,7 +73,9 @@ static void TransformColor(const VP8LMultipliers* const m, _mm_storeu_si128((__m128i*)&argb_data[i], out); } // fallthrough and finish off with plain-C - VP8LTransformColor_C(m, argb_data + i, num_pixels - i); + if (i != num_pixels) { + VP8LTransformColor_C(m, argb_data + i, num_pixels - i); + } } //------------------------------------------------------------------------------ @@ -364,8 +370,9 @@ static int VectorMismatch(const uint32_t* const array1, if (length >= 8 && _mm_movemask_epi8(_mm_cmpeq_epi32( _mm_loadu_si128((const __m128i*)&array1[4]), - _mm_loadu_si128((const __m128i*)&array2[4]))) == 0xffff) + _mm_loadu_si128((const __m128i*)&array2[4]))) == 0xffff) { match_len = 8; + } } } @@ -375,6 +382,295 @@ static int VectorMismatch(const uint32_t* const array1, return match_len; } +// Bundles multiple (1, 2, 4 or 8) pixels into a single pixel. +static void BundleColorMap_SSE2(const uint8_t* const row, int width, int xbits, + uint32_t* dst) { + int x; + assert(xbits >= 0); + assert(xbits <= 3); + switch (xbits) { + case 0: { + const __m128i ff = _mm_set1_epi16(0xff00); + const __m128i zero = _mm_setzero_si128(); + // Store 0xff000000 | (row[x] << 8). + for (x = 0; x + 16 <= width; x += 16, dst += 16) { + const __m128i in = _mm_loadu_si128((const __m128i*)&row[x]); + const __m128i in_lo = _mm_unpacklo_epi8(zero, in); + const __m128i dst0 = _mm_unpacklo_epi16(in_lo, ff); + const __m128i dst1 = _mm_unpackhi_epi16(in_lo, ff); + const __m128i in_hi = _mm_unpackhi_epi8(zero, in); + const __m128i dst2 = _mm_unpacklo_epi16(in_hi, ff); + const __m128i dst3 = _mm_unpackhi_epi16(in_hi, ff); + _mm_storeu_si128((__m128i*)&dst[0], dst0); + _mm_storeu_si128((__m128i*)&dst[4], dst1); + _mm_storeu_si128((__m128i*)&dst[8], dst2); + _mm_storeu_si128((__m128i*)&dst[12], dst3); + } + break; + } + case 1: { + const __m128i ff = _mm_set1_epi16(0xff00); + const __m128i mul = _mm_set1_epi16(0x110); + for (x = 0; x + 16 <= width; x += 16, dst += 8) { + // 0a0b | (where a/b are 4 bits). + const __m128i in = _mm_loadu_si128((const __m128i*)&row[x]); + const __m128i tmp = _mm_mullo_epi16(in, mul); // aba0 + const __m128i pack = _mm_and_si128(tmp, ff); // ab00 + const __m128i dst0 = _mm_unpacklo_epi16(pack, ff); + const __m128i dst1 = _mm_unpackhi_epi16(pack, ff); + _mm_storeu_si128((__m128i*)&dst[0], dst0); + _mm_storeu_si128((__m128i*)&dst[4], dst1); + } + break; + } + case 2: { + const __m128i mask_or = _mm_set1_epi32(0xff000000); + const __m128i mul_cst = _mm_set1_epi16(0x0104); + const __m128i mask_mul = _mm_set1_epi16(0x0f00); + for (x = 0; x + 16 <= width; x += 16, dst += 4) { + // 000a000b000c000d | (where a/b/c/d are 2 bits). + const __m128i in = _mm_loadu_si128((const __m128i*)&row[x]); + const __m128i mul = _mm_mullo_epi16(in, mul_cst); // 00ab00b000cd00d0 + const __m128i tmp = _mm_and_si128(mul, mask_mul); // 00ab000000cd0000 + const __m128i shift = _mm_srli_epi32(tmp, 12); // 00000000ab000000 + const __m128i pack = _mm_or_si128(shift, tmp); // 00000000abcd0000 + // Convert to 0xff00**00. + const __m128i res = _mm_or_si128(pack, mask_or); + _mm_storeu_si128((__m128i*)dst, res); + } + break; + } + default: { + assert(xbits == 3); + for (x = 0; x + 16 <= width; x += 16, dst += 2) { + // 0000000a00000000b... | (where a/b are 1 bit). + const __m128i in = _mm_loadu_si128((const __m128i*)&row[x]); + const __m128i shift = _mm_slli_epi64(in, 7); + const uint32_t move = _mm_movemask_epi8(shift); + dst[0] = 0xff000000 | ((move & 0xff) << 8); + dst[1] = 0xff000000 | (move & 0xff00); + } + break; + } + } + if (x != width) { + VP8LBundleColorMap_C(row + x, width - x, xbits, dst); + } +} + +//------------------------------------------------------------------------------ +// Batch version of Predictor Transform subtraction + +static WEBP_INLINE void Average2_m128i(const __m128i* const a0, + const __m128i* const a1, + __m128i* const avg) { + // (a + b) >> 1 = ((a + b + 1) >> 1) - ((a ^ b) & 1) + const __m128i ones = _mm_set1_epi8(1); + const __m128i avg1 = _mm_avg_epu8(*a0, *a1); + const __m128i one = _mm_and_si128(_mm_xor_si128(*a0, *a1), ones); + *avg = _mm_sub_epi8(avg1, one); +} + +// Predictor0: ARGB_BLACK. +static void PredictorSub0_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + const __m128i black = _mm_set1_epi32(ARGB_BLACK); + for (i = 0; i + 4 <= num_pixels; i += 4) { + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); + const __m128i res = _mm_sub_epi8(src, black); + _mm_storeu_si128((__m128i*)&out[i], res); + } + if (i != num_pixels) { + VP8LPredictorsSub_C[0](in + i, upper + i, num_pixels - i, out + i); + } +} + +#define GENERATE_PREDICTOR_1(X, IN) \ +static void PredictorSub##X##_SSE2(const uint32_t* in, const uint32_t* upper, \ + int num_pixels, uint32_t* out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ + const __m128i pred = _mm_loadu_si128((const __m128i*)&(IN)); \ + const __m128i res = _mm_sub_epi8(src, pred); \ + _mm_storeu_si128((__m128i*)&out[i], res); \ + } \ + if (i != num_pixels) { \ + VP8LPredictorsSub_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ + } \ +} + +GENERATE_PREDICTOR_1(1, in[i - 1]) // Predictor1: L +GENERATE_PREDICTOR_1(2, upper[i]) // Predictor2: T +GENERATE_PREDICTOR_1(3, upper[i + 1]) // Predictor3: TR +GENERATE_PREDICTOR_1(4, upper[i - 1]) // Predictor4: TL +#undef GENERATE_PREDICTOR_1 + +// Predictor5: avg2(avg2(L, TR), T) +static void PredictorSub5_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + for (i = 0; i + 4 <= num_pixels; i += 4) { + const __m128i L = _mm_loadu_si128((const __m128i*)&in[i - 1]); + const __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]); + const __m128i TR = _mm_loadu_si128((const __m128i*)&upper[i + 1]); + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); + __m128i avg, pred, res; + Average2_m128i(&L, &TR, &avg); + Average2_m128i(&avg, &T, &pred); + res = _mm_sub_epi8(src, pred); + _mm_storeu_si128((__m128i*)&out[i], res); + } + if (i != num_pixels) { + VP8LPredictorsSub_C[5](in + i, upper + i, num_pixels - i, out + i); + } +} + +#define GENERATE_PREDICTOR_2(X, A, B) \ +static void PredictorSub##X##_SSE2(const uint32_t* in, const uint32_t* upper, \ + int num_pixels, uint32_t* out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const __m128i tA = _mm_loadu_si128((const __m128i*)&(A)); \ + const __m128i tB = _mm_loadu_si128((const __m128i*)&(B)); \ + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ + __m128i pred, res; \ + Average2_m128i(&tA, &tB, &pred); \ + res = _mm_sub_epi8(src, pred); \ + _mm_storeu_si128((__m128i*)&out[i], res); \ + } \ + if (i != num_pixels) { \ + VP8LPredictorsSub_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ + } \ +} + +GENERATE_PREDICTOR_2(6, in[i - 1], upper[i - 1]) // Predictor6: avg(L, TL) +GENERATE_PREDICTOR_2(7, in[i - 1], upper[i]) // Predictor7: avg(L, T) +GENERATE_PREDICTOR_2(8, upper[i - 1], upper[i]) // Predictor8: avg(TL, T) +GENERATE_PREDICTOR_2(9, upper[i], upper[i + 1]) // Predictor9: average(T, TR) +#undef GENERATE_PREDICTOR_2 + +// Predictor10: avg(avg(L,TL), avg(T, TR)). +static void PredictorSub10_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + for (i = 0; i + 4 <= num_pixels; i += 4) { + const __m128i L = _mm_loadu_si128((const __m128i*)&in[i - 1]); + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); + const __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]); + const __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]); + const __m128i TR = _mm_loadu_si128((const __m128i*)&upper[i + 1]); + __m128i avgTTR, avgLTL, avg, res; + Average2_m128i(&T, &TR, &avgTTR); + Average2_m128i(&L, &TL, &avgLTL); + Average2_m128i(&avgTTR, &avgLTL, &avg); + res = _mm_sub_epi8(src, avg); + _mm_storeu_si128((__m128i*)&out[i], res); + } + if (i != num_pixels) { + VP8LPredictorsSub_C[10](in + i, upper + i, num_pixels - i, out + i); + } +} + +// Predictor11: select. +static void GetSumAbsDiff32(const __m128i* const A, const __m128i* const B, + __m128i* const out) { + // We can unpack with any value on the upper 32 bits, provided it's the same + // on both operands (to that their sum of abs diff is zero). Here we use *A. + const __m128i A_lo = _mm_unpacklo_epi32(*A, *A); + const __m128i B_lo = _mm_unpacklo_epi32(*B, *A); + const __m128i A_hi = _mm_unpackhi_epi32(*A, *A); + const __m128i B_hi = _mm_unpackhi_epi32(*B, *A); + const __m128i s_lo = _mm_sad_epu8(A_lo, B_lo); + const __m128i s_hi = _mm_sad_epu8(A_hi, B_hi); + *out = _mm_packs_epi32(s_lo, s_hi); +} + +static void PredictorSub11_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + for (i = 0; i + 4 <= num_pixels; i += 4) { + const __m128i L = _mm_loadu_si128((const __m128i*)&in[i - 1]); + const __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]); + const __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]); + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); + __m128i pa, pb; + GetSumAbsDiff32(&T, &TL, &pa); // pa = sum |T-TL| + GetSumAbsDiff32(&L, &TL, &pb); // pb = sum |L-TL| + { + const __m128i mask = _mm_cmpgt_epi32(pb, pa); + const __m128i A = _mm_and_si128(mask, L); + const __m128i B = _mm_andnot_si128(mask, T); + const __m128i pred = _mm_or_si128(A, B); // pred = (L > T)? L : T + const __m128i res = _mm_sub_epi8(src, pred); + _mm_storeu_si128((__m128i*)&out[i], res); + } + } + if (i != num_pixels) { + VP8LPredictorsSub_C[11](in + i, upper + i, num_pixels - i, out + i); + } +} + +// Predictor12: ClampedSubSubtractFull. +static void PredictorSub12_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + const __m128i zero = _mm_setzero_si128(); + for (i = 0; i + 4 <= num_pixels; i += 4) { + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); + const __m128i L = _mm_loadu_si128((const __m128i*)&in[i - 1]); + const __m128i L_lo = _mm_unpacklo_epi8(L, zero); + const __m128i L_hi = _mm_unpackhi_epi8(L, zero); + const __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]); + const __m128i T_lo = _mm_unpacklo_epi8(T, zero); + const __m128i T_hi = _mm_unpackhi_epi8(T, zero); + const __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]); + const __m128i TL_lo = _mm_unpacklo_epi8(TL, zero); + const __m128i TL_hi = _mm_unpackhi_epi8(TL, zero); + const __m128i diff_lo = _mm_sub_epi16(T_lo, TL_lo); + const __m128i diff_hi = _mm_sub_epi16(T_hi, TL_hi); + const __m128i pred_lo = _mm_add_epi16(L_lo, diff_lo); + const __m128i pred_hi = _mm_add_epi16(L_hi, diff_hi); + const __m128i pred = _mm_packus_epi16(pred_lo, pred_hi); + const __m128i res = _mm_sub_epi8(src, pred); + _mm_storeu_si128((__m128i*)&out[i], res); + } + if (i != num_pixels) { + VP8LPredictorsSub_C[12](in + i, upper + i, num_pixels - i, out + i); + } +} + +// Predictors13: ClampedAddSubtractHalf +static void PredictorSub13_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + const __m128i zero = _mm_setzero_si128(); + for (i = 0; i + 2 <= num_pixels; i += 2) { + // we can only process two pixels at a time + const __m128i L = _mm_loadl_epi64((const __m128i*)&in[i - 1]); + const __m128i src = _mm_loadl_epi64((const __m128i*)&in[i]); + const __m128i T = _mm_loadl_epi64((const __m128i*)&upper[i]); + const __m128i TL = _mm_loadl_epi64((const __m128i*)&upper[i - 1]); + const __m128i L_lo = _mm_unpacklo_epi8(L, zero); + const __m128i T_lo = _mm_unpacklo_epi8(T, zero); + const __m128i TL_lo = _mm_unpacklo_epi8(TL, zero); + const __m128i sum = _mm_add_epi16(T_lo, L_lo); + const __m128i avg = _mm_srli_epi16(sum, 1); + const __m128i A1 = _mm_sub_epi16(avg, TL_lo); + const __m128i bit_fix = _mm_cmpgt_epi16(TL_lo, avg); + const __m128i A2 = _mm_sub_epi16(A1, bit_fix); + const __m128i A3 = _mm_srai_epi16(A2, 1); + const __m128i A4 = _mm_add_epi16(avg, A3); + const __m128i pred = _mm_packus_epi16(A4, A4); + const __m128i res = _mm_sub_epi8(src, pred); + _mm_storel_epi64((__m128i*)&out[i], res); + } + if (i != num_pixels) { + VP8LPredictorsSub_C[13](in + i, upper + i, num_pixels - i, out + i); + } +} + //------------------------------------------------------------------------------ // Entry point @@ -388,6 +684,24 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitSSE2(void) { VP8LHistogramAdd = HistogramAdd; VP8LCombinedShannonEntropy = CombinedShannonEntropy; VP8LVectorMismatch = VectorMismatch; + VP8LBundleColorMap = BundleColorMap_SSE2; + + VP8LPredictorsSub[0] = PredictorSub0_SSE2; + VP8LPredictorsSub[1] = PredictorSub1_SSE2; + VP8LPredictorsSub[2] = PredictorSub2_SSE2; + VP8LPredictorsSub[3] = PredictorSub3_SSE2; + VP8LPredictorsSub[4] = PredictorSub4_SSE2; + VP8LPredictorsSub[5] = PredictorSub5_SSE2; + VP8LPredictorsSub[6] = PredictorSub6_SSE2; + VP8LPredictorsSub[7] = PredictorSub7_SSE2; + VP8LPredictorsSub[8] = PredictorSub8_SSE2; + VP8LPredictorsSub[9] = PredictorSub9_SSE2; + VP8LPredictorsSub[10] = PredictorSub10_SSE2; + VP8LPredictorsSub[11] = PredictorSub11_SSE2; + VP8LPredictorsSub[12] = PredictorSub12_SSE2; + VP8LPredictorsSub[13] = PredictorSub13_SSE2; + VP8LPredictorsSub[14] = PredictorSub0_SSE2; // <- padding security sentinels + VP8LPredictorsSub[15] = PredictorSub0_SSE2; } #else // !WEBP_USE_SSE2 diff --git a/thirdparty/libwebp/dsp/lossless_enc_sse41.c b/thirdparty/libwebp/dsp/lossless_enc_sse41.c index 3e493198db..821057ccd4 100644 --- a/thirdparty/libwebp/dsp/lossless_enc_sse41.c +++ b/thirdparty/libwebp/dsp/lossless_enc_sse41.c @@ -32,7 +32,9 @@ static void SubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixels) { _mm_storeu_si128((__m128i*)&argb_data[i], out); } // fallthrough and finish off with plain-C - VP8LSubtractGreenFromBlueAndRed_C(argb_data + i, num_pixels - i); + if (i != num_pixels) { + VP8LSubtractGreenFromBlueAndRed_C(argb_data + i, num_pixels - i); + } } //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/dsp/lossless_mips_dsp_r2.c b/thirdparty/libwebp/dsp/lossless_mips_dsp_r2.c index 90aed7f151..2984ce8df7 100644 --- a/thirdparty/libwebp/dsp/lossless_mips_dsp_r2.c +++ b/thirdparty/libwebp/dsp/lossless_mips_dsp_r2.c @@ -17,6 +17,7 @@ #if defined(WEBP_USE_MIPS_DSP_R2) #include "./lossless.h" +#include "./lossless_common.h" #define MAP_COLOR_FUNCS(FUNC_NAME, TYPE, GET_INDEX, GET_VALUE) \ static void FUNC_NAME(const TYPE* src, \ @@ -227,25 +228,27 @@ static uint32_t Predictor13(uint32_t left, const uint32_t* const top) { // Add green to blue and red channels (i.e. perform the inverse transform of // 'subtract green'). -static void AddGreenToBlueAndRed(uint32_t* data, int num_pixels) { +static void AddGreenToBlueAndRed(const uint32_t* src, int num_pixels, + uint32_t* dst) { uint32_t temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7; - uint32_t* const p_loop1_end = data + (num_pixels & ~3); - uint32_t* const p_loop2_end = data + num_pixels; + const uint32_t* const p_loop1_end = src + (num_pixels & ~3); + const uint32_t* const p_loop2_end = src + num_pixels; __asm__ volatile ( ".set push \n\t" ".set noreorder \n\t" - "beq %[data], %[p_loop1_end], 3f \n\t" + "beq %[src], %[p_loop1_end], 3f \n\t" " nop \n\t" "0: \n\t" - "lw %[temp0], 0(%[data]) \n\t" - "lw %[temp1], 4(%[data]) \n\t" - "lw %[temp2], 8(%[data]) \n\t" - "lw %[temp3], 12(%[data]) \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "lw %[temp1], 4(%[src]) \n\t" + "lw %[temp2], 8(%[src]) \n\t" + "lw %[temp3], 12(%[src]) \n\t" "ext %[temp4], %[temp0], 8, 8 \n\t" "ext %[temp5], %[temp1], 8, 8 \n\t" "ext %[temp6], %[temp2], 8, 8 \n\t" "ext %[temp7], %[temp3], 8, 8 \n\t" - "addiu %[data], %[data], 16 \n\t" + "addiu %[src], %[src], 16 \n\t" + "addiu %[dst], %[dst], 16 \n\t" "replv.ph %[temp4], %[temp4] \n\t" "replv.ph %[temp5], %[temp5] \n\t" "replv.ph %[temp6], %[temp6] \n\t" @@ -254,44 +257,47 @@ static void AddGreenToBlueAndRed(uint32_t* data, int num_pixels) { "addu.qb %[temp1], %[temp1], %[temp5] \n\t" "addu.qb %[temp2], %[temp2], %[temp6] \n\t" "addu.qb %[temp3], %[temp3], %[temp7] \n\t" - "sw %[temp0], -16(%[data]) \n\t" - "sw %[temp1], -12(%[data]) \n\t" - "sw %[temp2], -8(%[data]) \n\t" - "bne %[data], %[p_loop1_end], 0b \n\t" - " sw %[temp3], -4(%[data]) \n\t" + "sw %[temp0], -16(%[dst]) \n\t" + "sw %[temp1], -12(%[dst]) \n\t" + "sw %[temp2], -8(%[dst]) \n\t" + "bne %[src], %[p_loop1_end], 0b \n\t" + " sw %[temp3], -4(%[dst]) \n\t" "3: \n\t" - "beq %[data], %[p_loop2_end], 2f \n\t" + "beq %[src], %[p_loop2_end], 2f \n\t" " nop \n\t" "1: \n\t" - "lw %[temp0], 0(%[data]) \n\t" - "addiu %[data], %[data], 4 \n\t" + "lw %[temp0], 0(%[src]) \n\t" + "addiu %[src], %[src], 4 \n\t" + "addiu %[dst], %[dst], 4 \n\t" "ext %[temp4], %[temp0], 8, 8 \n\t" "replv.ph %[temp4], %[temp4] \n\t" "addu.qb %[temp0], %[temp0], %[temp4] \n\t" - "bne %[data], %[p_loop2_end], 1b \n\t" - " sw %[temp0], -4(%[data]) \n\t" + "bne %[src], %[p_loop2_end], 1b \n\t" + " sw %[temp0], -4(%[dst]) \n\t" "2: \n\t" ".set pop \n\t" - : [data]"+&r"(data), [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), - [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), - [temp5]"=&r"(temp5), [temp6]"=&r"(temp6), [temp7]"=&r"(temp7) + : [dst]"+&r"(dst), [src]"+&r"(src), [temp0]"=&r"(temp0), + [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), + [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [temp6]"=&r"(temp6), + [temp7]"=&r"(temp7) : [p_loop1_end]"r"(p_loop1_end), [p_loop2_end]"r"(p_loop2_end) : "memory" ); } static void TransformColorInverse(const VP8LMultipliers* const m, - uint32_t* data, int num_pixels) { + const uint32_t* src, int num_pixels, + uint32_t* dst) { int temp0, temp1, temp2, temp3, temp4, temp5; uint32_t argb, argb1, new_red; const uint32_t G_to_R = m->green_to_red_; const uint32_t G_to_B = m->green_to_blue_; const uint32_t R_to_B = m->red_to_blue_; - uint32_t* const p_loop_end = data + (num_pixels & ~1); + const uint32_t* const p_loop_end = src + (num_pixels & ~1); __asm__ volatile ( ".set push \n\t" ".set noreorder \n\t" - "beq %[data], %[p_loop_end], 1f \n\t" + "beq %[src], %[p_loop_end], 1f \n\t" " nop \n\t" "replv.ph %[temp0], %[G_to_R] \n\t" "replv.ph %[temp1], %[G_to_B] \n\t" @@ -303,9 +309,12 @@ static void TransformColorInverse(const VP8LMultipliers* const m, "shra.ph %[temp1], %[temp1], 8 \n\t" "shra.ph %[temp2], %[temp2], 8 \n\t" "0: \n\t" - "lw %[argb], 0(%[data]) \n\t" - "lw %[argb1], 4(%[data]) \n\t" - "addiu %[data], %[data], 8 \n\t" + "lw %[argb], 0(%[src]) \n\t" + "lw %[argb1], 4(%[src]) \n\t" + "sw %[argb], 0(%[dst]) \n\t" + "sw %[argb1], 4(%[dst]) \n\t" + "addiu %[src], %[src], 8 \n\t" + "addiu %[dst], %[dst], 8 \n\t" "precrq.qb.ph %[temp3], %[argb], %[argb1] \n\t" "preceu.ph.qbra %[temp3], %[temp3] \n\t" "shll.ph %[temp3], %[temp3], 8 \n\t" @@ -322,29 +331,29 @@ static void TransformColorInverse(const VP8LMultipliers* const m, "shll.ph %[temp4], %[temp5], 8 \n\t" "shra.ph %[temp4], %[temp4], 8 \n\t" "mul.ph %[temp4], %[temp4], %[temp2] \n\t" - "sb %[temp5], -2(%[data]) \n\t" + "sb %[temp5], -2(%[dst]) \n\t" "sra %[temp5], %[temp5], 16 \n\t" "shra.ph %[temp4], %[temp4], 5 \n\t" "addu.ph %[argb1], %[argb1], %[temp4] \n\t" "preceu.ph.qbra %[temp3], %[argb1] \n\t" - "sb %[temp5], -6(%[data]) \n\t" - "sb %[temp3], -4(%[data]) \n\t" + "sb %[temp5], -6(%[dst]) \n\t" + "sb %[temp3], -4(%[dst]) \n\t" "sra %[temp3], %[temp3], 16 \n\t" - "bne %[data], %[p_loop_end], 0b \n\t" - " sb %[temp3], -8(%[data]) \n\t" + "bne %[src], %[p_loop_end], 0b \n\t" + " sb %[temp3], -8(%[dst]) \n\t" "1: \n\t" ".set pop \n\t" : [temp0]"=&r"(temp0), [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3), [temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [new_red]"=&r"(new_red), [argb]"=&r"(argb), - [argb1]"=&r"(argb1), [data]"+&r"(data) + [argb1]"=&r"(argb1), [dst]"+&r"(dst), [src]"+&r"(src) : [G_to_R]"r"(G_to_R), [R_to_B]"r"(R_to_B), [G_to_B]"r"(G_to_B), [p_loop_end]"r"(p_loop_end) : "memory", "hi", "lo" ); // Fall-back to C-version for left-overs. - if (num_pixels & 1) VP8LTransformColorInverse_C(m, data, 1); + if (num_pixels & 1) VP8LTransformColorInverse_C(m, src, 1, dst); } static void ConvertBGRAToRGB(const uint32_t* src, diff --git a/thirdparty/libwebp/dsp/lossless_msa.c b/thirdparty/libwebp/dsp/lossless_msa.c new file mode 100644 index 0000000000..f6dd5649ac --- /dev/null +++ b/thirdparty/libwebp/dsp/lossless_msa.c @@ -0,0 +1,355 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// MSA variant of methods for lossless decoder +// +// Author: Prashant Patil (prashant.patil@imgtec.com) + +#include "./dsp.h" + +#if defined(WEBP_USE_MSA) + +#include "./lossless.h" +#include "./msa_macro.h" + +//------------------------------------------------------------------------------ +// Colorspace conversion functions + +#define CONVERT16_BGRA_XXX(psrc, pdst, m0, m1, m2) do { \ + v16u8 src0, src1, src2, src3, dst0, dst1, dst2; \ + LD_UB4(psrc, 16, src0, src1, src2, src3); \ + VSHF_B2_UB(src0, src1, src1, src2, m0, m1, dst0, dst1); \ + dst2 = VSHF_UB(src2, src3, m2); \ + ST_UB2(dst0, dst1, pdst, 16); \ + ST_UB(dst2, pdst + 32); \ +} while (0) + +#define CONVERT12_BGRA_XXX(psrc, pdst, m0, m1, m2) do { \ + uint32_t pix_w; \ + v16u8 src0, src1, src2, dst0, dst1, dst2; \ + LD_UB3(psrc, 16, src0, src1, src2); \ + VSHF_B2_UB(src0, src1, src1, src2, m0, m1, dst0, dst1); \ + dst2 = VSHF_UB(src2, src2, m2); \ + ST_UB2(dst0, dst1, pdst, 16); \ + pix_w = __msa_copy_s_w((v4i32)dst2, 0); \ + SW(pix_w, pdst + 32); \ +} while (0) + +#define CONVERT8_BGRA_XXX(psrc, pdst, m0, m1) do { \ + uint64_t pix_d; \ + v16u8 src0, src1, src2, dst0, dst1; \ + LD_UB2(psrc, 16, src0, src1); \ + VSHF_B2_UB(src0, src1, src1, src2, m0, m1, dst0, dst1); \ + ST_UB(dst0, pdst); \ + pix_d = __msa_copy_s_d((v2i64)dst1, 0); \ + SD(pix_d, pdst + 16); \ +} while (0) + +#define CONVERT4_BGRA_XXX(psrc, pdst, m) do { \ + const v16u8 src0 = LD_UB(psrc); \ + const v16u8 dst0 = VSHF_UB(src0, src0, m); \ + uint64_t pix_d = __msa_copy_s_d((v2i64)dst0, 0); \ + uint32_t pix_w = __msa_copy_s_w((v4i32)dst0, 2); \ + SD(pix_d, pdst + 0); \ + SW(pix_w, pdst + 8); \ +} while (0) + +#define CONVERT1_BGRA_BGR(psrc, pdst) do { \ + const int32_t b = (psrc)[0]; \ + const int32_t g = (psrc)[1]; \ + const int32_t r = (psrc)[2]; \ + (pdst)[0] = b; \ + (pdst)[1] = g; \ + (pdst)[2] = r; \ +} while (0) + +#define CONVERT1_BGRA_RGB(psrc, pdst) do { \ + const int32_t b = (psrc)[0]; \ + const int32_t g = (psrc)[1]; \ + const int32_t r = (psrc)[2]; \ + (pdst)[0] = r; \ + (pdst)[1] = g; \ + (pdst)[2] = b; \ +} while (0) + +#define TRANSFORM_COLOR_INVERSE_8(src0, src1, dst0, dst1, \ + c0, c1, mask0, mask1) do { \ + v8i16 g0, g1, t0, t1, t2, t3; \ + v4i32 t4, t5; \ + VSHF_B2_SH(src0, src0, src1, src1, mask0, mask0, g0, g1); \ + DOTP_SB2_SH(g0, g1, c0, c0, t0, t1); \ + SRAI_H2_SH(t0, t1, 5); \ + t0 = __msa_addv_h(t0, (v8i16)src0); \ + t1 = __msa_addv_h(t1, (v8i16)src1); \ + t4 = __msa_srli_w((v4i32)t0, 16); \ + t5 = __msa_srli_w((v4i32)t1, 16); \ + DOTP_SB2_SH(t4, t5, c1, c1, t2, t3); \ + SRAI_H2_SH(t2, t3, 5); \ + ADD2(t0, t2, t1, t3, t0, t1); \ + VSHF_B2_UB(src0, t0, src1, t1, mask1, mask1, dst0, dst1); \ +} while (0) + +#define TRANSFORM_COLOR_INVERSE_4(src, dst, c0, c1, mask0, mask1) do { \ + const v16i8 g0 = VSHF_SB(src, src, mask0); \ + v8i16 t0 = __msa_dotp_s_h(c0, g0); \ + v8i16 t1; \ + v4i32 t2; \ + t0 = SRAI_H(t0, 5); \ + t0 = __msa_addv_h(t0, (v8i16)src); \ + t2 = __msa_srli_w((v4i32)t0, 16); \ + t1 = __msa_dotp_s_h(c1, (v16i8)t2); \ + t1 = SRAI_H(t1, 5); \ + t0 = t0 + t1; \ + dst = VSHF_UB(src, t0, mask1); \ +} while (0) + +static void ConvertBGRAToRGBA(const uint32_t* src, + int num_pixels, uint8_t* dst) { + int i; + const uint8_t* ptemp_src = (const uint8_t*)src; + uint8_t* ptemp_dst = (uint8_t*)dst; + v16u8 src0, dst0; + const v16u8 mask = { 2, 1, 0, 3, 6, 5, 4, 7, 10, 9, 8, 11, 14, 13, 12, 15 }; + + while (num_pixels >= 8) { + v16u8 src1, dst1; + LD_UB2(ptemp_src, 16, src0, src1); + VSHF_B2_UB(src0, src0, src1, src1, mask, mask, dst0, dst1); + ST_UB2(dst0, dst1, ptemp_dst, 16); + ptemp_src += 32; + ptemp_dst += 32; + num_pixels -= 8; + } + if (num_pixels > 0) { + if (num_pixels >= 4) { + src0 = LD_UB(ptemp_src); + dst0 = VSHF_UB(src0, src0, mask); + ST_UB(dst0, ptemp_dst); + ptemp_src += 16; + ptemp_dst += 16; + num_pixels -= 4; + } + for (i = 0; i < num_pixels; i++) { + const uint8_t b = ptemp_src[2]; + const uint8_t g = ptemp_src[1]; + const uint8_t r = ptemp_src[0]; + const uint8_t a = ptemp_src[3]; + ptemp_dst[0] = b; + ptemp_dst[1] = g; + ptemp_dst[2] = r; + ptemp_dst[3] = a; + ptemp_src += 4; + ptemp_dst += 4; + } + } +} + +static void ConvertBGRAToBGR(const uint32_t* src, + int num_pixels, uint8_t* dst) { + const uint8_t* ptemp_src = (const uint8_t*)src; + uint8_t* ptemp_dst = (uint8_t*)dst; + const v16u8 mask0 = { 0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 14, + 16, 17, 18, 20 }; + const v16u8 mask1 = { 5, 6, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, + 21, 22, 24, 25 }; + const v16u8 mask2 = { 10, 12, 13, 14, 16, 17, 18, 20, 21, 22, 24, 25, + 26, 28, 29, 30 }; + + while (num_pixels >= 16) { + CONVERT16_BGRA_XXX(ptemp_src, ptemp_dst, mask0, mask1, mask2); + ptemp_src += 64; + ptemp_dst += 48; + num_pixels -= 16; + } + if (num_pixels > 0) { + if (num_pixels >= 12) { + CONVERT12_BGRA_XXX(ptemp_src, ptemp_dst, mask0, mask1, mask2); + ptemp_src += 48; + ptemp_dst += 36; + num_pixels -= 12; + } else if (num_pixels >= 8) { + CONVERT8_BGRA_XXX(ptemp_src, ptemp_dst, mask0, mask1); + ptemp_src += 32; + ptemp_dst += 24; + num_pixels -= 8; + } else if (num_pixels >= 4) { + CONVERT4_BGRA_XXX(ptemp_src, ptemp_dst, mask0); + ptemp_src += 16; + ptemp_dst += 12; + num_pixels -= 4; + } + if (num_pixels == 3) { + CONVERT1_BGRA_BGR(ptemp_src + 0, ptemp_dst + 0); + CONVERT1_BGRA_BGR(ptemp_src + 4, ptemp_dst + 3); + CONVERT1_BGRA_BGR(ptemp_src + 8, ptemp_dst + 6); + } else if (num_pixels == 2) { + CONVERT1_BGRA_BGR(ptemp_src + 0, ptemp_dst + 0); + CONVERT1_BGRA_BGR(ptemp_src + 4, ptemp_dst + 3); + } else if (num_pixels == 1) { + CONVERT1_BGRA_BGR(ptemp_src, ptemp_dst); + } + } +} + +static void ConvertBGRAToRGB(const uint32_t* src, + int num_pixels, uint8_t* dst) { + const uint8_t* ptemp_src = (const uint8_t*)src; + uint8_t* ptemp_dst = (uint8_t*)dst; + const v16u8 mask0 = { 2, 1, 0, 6, 5, 4, 10, 9, 8, 14, 13, 12, + 18, 17, 16, 22 }; + const v16u8 mask1 = { 5, 4, 10, 9, 8, 14, 13, 12, 18, 17, 16, 22, + 21, 20, 26, 25 }; + const v16u8 mask2 = { 8, 14, 13, 12, 18, 17, 16, 22, 21, 20, 26, 25, + 24, 30, 29, 28 }; + + while (num_pixels >= 16) { + CONVERT16_BGRA_XXX(ptemp_src, ptemp_dst, mask0, mask1, mask2); + ptemp_src += 64; + ptemp_dst += 48; + num_pixels -= 16; + } + if (num_pixels) { + if (num_pixels >= 12) { + CONVERT12_BGRA_XXX(ptemp_src, ptemp_dst, mask0, mask1, mask2); + ptemp_src += 48; + ptemp_dst += 36; + num_pixels -= 12; + } else if (num_pixels >= 8) { + CONVERT8_BGRA_XXX(ptemp_src, ptemp_dst, mask0, mask1); + ptemp_src += 32; + ptemp_dst += 24; + num_pixels -= 8; + } else if (num_pixels >= 4) { + CONVERT4_BGRA_XXX(ptemp_src, ptemp_dst, mask0); + ptemp_src += 16; + ptemp_dst += 12; + num_pixels -= 4; + } + if (num_pixels == 3) { + CONVERT1_BGRA_RGB(ptemp_src + 0, ptemp_dst + 0); + CONVERT1_BGRA_RGB(ptemp_src + 4, ptemp_dst + 3); + CONVERT1_BGRA_RGB(ptemp_src + 8, ptemp_dst + 6); + } else if (num_pixels == 2) { + CONVERT1_BGRA_RGB(ptemp_src + 0, ptemp_dst + 0); + CONVERT1_BGRA_RGB(ptemp_src + 4, ptemp_dst + 3); + } else if (num_pixels == 1) { + CONVERT1_BGRA_RGB(ptemp_src, ptemp_dst); + } + } +} + +static void AddGreenToBlueAndRed(const uint32_t* const src, int num_pixels, + uint32_t* dst) { + int i; + const uint8_t* in = (const uint8_t*)src; + uint8_t* out = (uint8_t*)dst; + v16u8 src0, dst0, tmp0; + const v16u8 mask = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, + 13, 255, 13, 255 }; + + while (num_pixels >= 8) { + v16u8 src1, dst1, tmp1; + LD_UB2(in, 16, src0, src1); + VSHF_B2_UB(src0, src1, src1, src0, mask, mask, tmp0, tmp1); + ADD2(src0, tmp0, src1, tmp1, dst0, dst1); + ST_UB2(dst0, dst1, out, 16); + in += 32; + out += 32; + num_pixels -= 8; + } + if (num_pixels > 0) { + if (num_pixels >= 4) { + src0 = LD_UB(in); + tmp0 = VSHF_UB(src0, src0, mask); + dst0 = src0 + tmp0; + ST_UB(dst0, out); + in += 16; + out += 16; + num_pixels -= 4; + } + for (i = 0; i < num_pixels; i++) { + const uint8_t b = in[0]; + const uint8_t g = in[1]; + const uint8_t r = in[2]; + out[0] = (b + g) & 0xff; + out[1] = g; + out[2] = (r + g) & 0xff; + out[4] = in[4]; + out += 4; + } + } +} + +static void TransformColorInverse(const VP8LMultipliers* const m, + const uint32_t* src, int num_pixels, + uint32_t* dst) { + v16u8 src0, dst0; + const v16i8 g2br = (v16i8)__msa_fill_w(m->green_to_blue_ | + (m->green_to_red_ << 16)); + const v16i8 r2b = (v16i8)__msa_fill_w(m->red_to_blue_); + const v16u8 mask0 = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255, + 13, 255, 13, 255 }; + const v16u8 mask1 = { 16, 1, 18, 3, 20, 5, 22, 7, 24, 9, 26, 11, + 28, 13, 30, 15 }; + + while (num_pixels >= 8) { + v16u8 src1, dst1; + LD_UB2(src, 4, src0, src1); + TRANSFORM_COLOR_INVERSE_8(src0, src1, dst0, dst1, g2br, r2b, mask0, mask1); + ST_UB2(dst0, dst1, dst, 4); + src += 8; + dst += 8; + num_pixels -= 8; + } + if (num_pixels > 0) { + if (num_pixels >= 4) { + src0 = LD_UB(src); + TRANSFORM_COLOR_INVERSE_4(src0, dst0, g2br, r2b, mask0, mask1); + ST_UB(dst0, dst); + src += 4; + dst += 4; + num_pixels -= 4; + } + if (num_pixels > 0) { + src0 = LD_UB(src); + TRANSFORM_COLOR_INVERSE_4(src0, dst0, g2br, r2b, mask0, mask1); + if (num_pixels == 3) { + const uint64_t pix_d = __msa_copy_s_d((v2i64)dst0, 0); + const uint32_t pix_w = __msa_copy_s_w((v4i32)dst0, 2); + SD(pix_d, dst + 0); + SW(pix_w, dst + 2); + } else if (num_pixels == 2) { + const uint64_t pix_d = __msa_copy_s_d((v2i64)dst0, 0); + SD(pix_d, dst); + } else { + const uint32_t pix_w = __msa_copy_s_w((v4i32)dst0, 0); + SW(pix_w, dst); + } + } + } +} + +//------------------------------------------------------------------------------ +// Entry point + +extern void VP8LDspInitMSA(void); + +WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMSA(void) { + VP8LConvertBGRAToRGBA = ConvertBGRAToRGBA; + VP8LConvertBGRAToBGR = ConvertBGRAToBGR; + VP8LConvertBGRAToRGB = ConvertBGRAToRGB; + VP8LAddGreenToBlueAndRed = AddGreenToBlueAndRed; + VP8LTransformColorInverse = TransformColorInverse; +} + +#else // !WEBP_USE_MSA + +WEBP_DSP_INIT_STUB(VP8LDspInitMSA) + +#endif // WEBP_USE_MSA diff --git a/thirdparty/libwebp/dsp/lossless_neon.c b/thirdparty/libwebp/dsp/lossless_neon.c index 6faccb8f97..1145d5fad0 100644 --- a/thirdparty/libwebp/dsp/lossless_neon.c +++ b/thirdparty/libwebp/dsp/lossless_neon.c @@ -139,6 +139,357 @@ static void ConvertBGRAToRGB(const uint32_t* src, #endif // !WORK_AROUND_GCC + +//------------------------------------------------------------------------------ +// Predictor Transform + +#define LOAD_U32_AS_U8(IN) vreinterpret_u8_u32(vdup_n_u32((IN))) +#define LOAD_U32P_AS_U8(IN) vreinterpret_u8_u32(vld1_u32((IN))) +#define LOADQ_U32_AS_U8(IN) vreinterpretq_u8_u32(vdupq_n_u32((IN))) +#define LOADQ_U32P_AS_U8(IN) vreinterpretq_u8_u32(vld1q_u32((IN))) +#define GET_U8_AS_U32(IN) vget_lane_u32(vreinterpret_u32_u8((IN)), 0); +#define GETQ_U8_AS_U32(IN) vgetq_lane_u32(vreinterpretq_u32_u8((IN)), 0); +#define STOREQ_U8_AS_U32P(OUT, IN) vst1q_u32((OUT), vreinterpretq_u32_u8((IN))); +#define ROTATE32_LEFT(L) vextq_u8((L), (L), 12) // D|C|B|A -> C|B|A|D + +static WEBP_INLINE uint8x8_t Average2_u8_NEON(uint32_t a0, uint32_t a1) { + const uint8x8_t A0 = LOAD_U32_AS_U8(a0); + const uint8x8_t A1 = LOAD_U32_AS_U8(a1); + return vhadd_u8(A0, A1); +} + +static WEBP_INLINE uint32_t ClampedAddSubtractHalf_NEON(uint32_t c0, + uint32_t c1, + uint32_t c2) { + const uint8x8_t avg = Average2_u8_NEON(c0, c1); + // Remove one to c2 when bigger than avg. + const uint8x8_t C2 = LOAD_U32_AS_U8(c2); + const uint8x8_t cmp = vcgt_u8(C2, avg); + const uint8x8_t C2_1 = vadd_u8(C2, cmp); + // Compute half of the difference between avg and c2. + const int8x8_t diff_avg = vreinterpret_s8_u8(vhsub_u8(avg, C2_1)); + // Compute the sum with avg and saturate. + const int16x8_t avg_16 = vreinterpretq_s16_u16(vmovl_u8(avg)); + const uint8x8_t res = vqmovun_s16(vaddw_s8(avg_16, diff_avg)); + const uint32_t output = GET_U8_AS_U32(res); + return output; +} + +static WEBP_INLINE uint32_t Average2_NEON(uint32_t a0, uint32_t a1) { + const uint8x8_t avg_u8x8 = Average2_u8_NEON(a0, a1); + const uint32_t avg = GET_U8_AS_U32(avg_u8x8); + return avg; +} + +static WEBP_INLINE uint32_t Average3_NEON(uint32_t a0, uint32_t a1, + uint32_t a2) { + const uint8x8_t avg0 = Average2_u8_NEON(a0, a2); + const uint8x8_t A1 = LOAD_U32_AS_U8(a1); + const uint32_t avg = GET_U8_AS_U32(vhadd_u8(avg0, A1)); + return avg; +} + +static uint32_t Predictor5_NEON(uint32_t left, const uint32_t* const top) { + return Average3_NEON(left, top[0], top[1]); +} +static uint32_t Predictor6_NEON(uint32_t left, const uint32_t* const top) { + return Average2_NEON(left, top[-1]); +} +static uint32_t Predictor7_NEON(uint32_t left, const uint32_t* const top) { + return Average2_NEON(left, top[0]); +} +static uint32_t Predictor13_NEON(uint32_t left, const uint32_t* const top) { + return ClampedAddSubtractHalf_NEON(left, top[0], top[-1]); +} + +// Batch versions of those functions. + +// Predictor0: ARGB_BLACK. +static void PredictorAdd0_NEON(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + const uint8x16_t black = vreinterpretq_u8_u32(vdupq_n_u32(ARGB_BLACK)); + for (i = 0; i + 4 <= num_pixels; i += 4) { + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); + const uint8x16_t res = vaddq_u8(src, black); + STOREQ_U8_AS_U32P(&out[i], res); + } + VP8LPredictorsAdd_C[0](in + i, upper + i, num_pixels - i, out + i); +} + +// Predictor1: left. +static void PredictorAdd1_NEON(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + const uint8x16_t zero = LOADQ_U32_AS_U8(0); + for (i = 0; i + 4 <= num_pixels; i += 4) { + // a | b | c | d + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); + // 0 | a | b | c + const uint8x16_t shift0 = vextq_u8(zero, src, 12); + // a | a + b | b + c | c + d + const uint8x16_t sum0 = vaddq_u8(src, shift0); + // 0 | 0 | a | a + b + const uint8x16_t shift1 = vextq_u8(zero, sum0, 8); + // a | a + b | a + b + c | a + b + c + d + const uint8x16_t sum1 = vaddq_u8(sum0, shift1); + const uint8x16_t prev = LOADQ_U32_AS_U8(out[i - 1]); + const uint8x16_t res = vaddq_u8(sum1, prev); + STOREQ_U8_AS_U32P(&out[i], res); + } + VP8LPredictorsAdd_C[1](in + i, upper + i, num_pixels - i, out + i); +} + +// Macro that adds 32-bit integers from IN using mod 256 arithmetic +// per 8 bit channel. +#define GENERATE_PREDICTOR_1(X, IN) \ +static void PredictorAdd##X##_NEON(const uint32_t* in, \ + const uint32_t* upper, int num_pixels, \ + uint32_t* out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); \ + const uint8x16_t other = LOADQ_U32P_AS_U8(&(IN)); \ + const uint8x16_t res = vaddq_u8(src, other); \ + STOREQ_U8_AS_U32P(&out[i], res); \ + } \ + VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ +} +// Predictor2: Top. +GENERATE_PREDICTOR_1(2, upper[i]) +// Predictor3: Top-right. +GENERATE_PREDICTOR_1(3, upper[i + 1]) +// Predictor4: Top-left. +GENERATE_PREDICTOR_1(4, upper[i - 1]) +#undef GENERATE_PREDICTOR_1 + +// Predictor5: average(average(left, TR), T) +#define DO_PRED5(LANE) do { \ + const uint8x16_t avgLTR = vhaddq_u8(L, TR); \ + const uint8x16_t avg = vhaddq_u8(avgLTR, T); \ + const uint8x16_t res = vaddq_u8(avg, src); \ + vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ + L = ROTATE32_LEFT(res); \ +} while (0) + +static void PredictorAdd5_NEON(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + uint8x16_t L = LOADQ_U32_AS_U8(out[-1]); + for (i = 0; i + 4 <= num_pixels; i += 4) { + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); + const uint8x16_t T = LOADQ_U32P_AS_U8(&upper[i + 0]); + const uint8x16_t TR = LOADQ_U32P_AS_U8(&upper[i + 1]); + DO_PRED5(0); + DO_PRED5(1); + DO_PRED5(2); + DO_PRED5(3); + } + VP8LPredictorsAdd_C[5](in + i, upper + i, num_pixels - i, out + i); +} +#undef DO_PRED5 + +#define DO_PRED67(LANE) do { \ + const uint8x16_t avg = vhaddq_u8(L, top); \ + const uint8x16_t res = vaddq_u8(avg, src); \ + vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ + L = ROTATE32_LEFT(res); \ +} while (0) + +// Predictor6: average(left, TL) +static void PredictorAdd6_NEON(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + uint8x16_t L = LOADQ_U32_AS_U8(out[-1]); + for (i = 0; i + 4 <= num_pixels; i += 4) { + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); + const uint8x16_t top = LOADQ_U32P_AS_U8(&upper[i - 1]); + DO_PRED67(0); + DO_PRED67(1); + DO_PRED67(2); + DO_PRED67(3); + } + VP8LPredictorsAdd_C[6](in + i, upper + i, num_pixels - i, out + i); +} + +// Predictor7: average(left, T) +static void PredictorAdd7_NEON(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + uint8x16_t L = LOADQ_U32_AS_U8(out[-1]); + for (i = 0; i + 4 <= num_pixels; i += 4) { + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); + const uint8x16_t top = LOADQ_U32P_AS_U8(&upper[i]); + DO_PRED67(0); + DO_PRED67(1); + DO_PRED67(2); + DO_PRED67(3); + } + VP8LPredictorsAdd_C[7](in + i, upper + i, num_pixels - i, out + i); +} +#undef DO_PRED67 + +#define GENERATE_PREDICTOR_2(X, IN) \ +static void PredictorAdd##X##_NEON(const uint32_t* in, \ + const uint32_t* upper, int num_pixels, \ + uint32_t* out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); \ + const uint8x16_t Tother = LOADQ_U32P_AS_U8(&(IN)); \ + const uint8x16_t T = LOADQ_U32P_AS_U8(&upper[i]); \ + const uint8x16_t avg = vhaddq_u8(T, Tother); \ + const uint8x16_t res = vaddq_u8(avg, src); \ + STOREQ_U8_AS_U32P(&out[i], res); \ + } \ + VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ +} +// Predictor8: average TL T. +GENERATE_PREDICTOR_2(8, upper[i - 1]) +// Predictor9: average T TR. +GENERATE_PREDICTOR_2(9, upper[i + 1]) +#undef GENERATE_PREDICTOR_2 + +// Predictor10: average of (average of (L,TL), average of (T, TR)). +#define DO_PRED10(LANE) do { \ + const uint8x16_t avgLTL = vhaddq_u8(L, TL); \ + const uint8x16_t avg = vhaddq_u8(avgTTR, avgLTL); \ + const uint8x16_t res = vaddq_u8(avg, src); \ + vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ + L = ROTATE32_LEFT(res); \ +} while (0) + +static void PredictorAdd10_NEON(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + uint8x16_t L = LOADQ_U32_AS_U8(out[-1]); + for (i = 0; i + 4 <= num_pixels; i += 4) { + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); + const uint8x16_t TL = LOADQ_U32P_AS_U8(&upper[i - 1]); + const uint8x16_t T = LOADQ_U32P_AS_U8(&upper[i]); + const uint8x16_t TR = LOADQ_U32P_AS_U8(&upper[i + 1]); + const uint8x16_t avgTTR = vhaddq_u8(T, TR); + DO_PRED10(0); + DO_PRED10(1); + DO_PRED10(2); + DO_PRED10(3); + } + VP8LPredictorsAdd_C[10](in + i, upper + i, num_pixels - i, out + i); +} +#undef DO_PRED10 + +// Predictor11: select. +#define DO_PRED11(LANE) do { \ + const uint8x16_t sumLin = vaddq_u8(L, src); /* in + L */ \ + const uint8x16_t pLTL = vabdq_u8(L, TL); /* |L - TL| */ \ + const uint16x8_t sum_LTL = vpaddlq_u8(pLTL); \ + const uint32x4_t pa = vpaddlq_u16(sum_LTL); \ + const uint32x4_t mask = vcleq_u32(pa, pb); \ + const uint8x16_t res = vbslq_u8(vreinterpretq_u8_u32(mask), sumTin, sumLin); \ + vst1q_lane_u32(&out[i + (LANE)], vreinterpretq_u32_u8(res), (LANE)); \ + L = ROTATE32_LEFT(res); \ +} while (0) + +static void PredictorAdd11_NEON(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + uint8x16_t L = LOADQ_U32_AS_U8(out[-1]); + for (i = 0; i + 4 <= num_pixels; i += 4) { + const uint8x16_t T = LOADQ_U32P_AS_U8(&upper[i]); + const uint8x16_t TL = LOADQ_U32P_AS_U8(&upper[i - 1]); + const uint8x16_t pTTL = vabdq_u8(T, TL); // |T - TL| + const uint16x8_t sum_TTL = vpaddlq_u8(pTTL); + const uint32x4_t pb = vpaddlq_u16(sum_TTL); + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); + const uint8x16_t sumTin = vaddq_u8(T, src); // in + T + DO_PRED11(0); + DO_PRED11(1); + DO_PRED11(2); + DO_PRED11(3); + } + VP8LPredictorsAdd_C[11](in + i, upper + i, num_pixels - i, out + i); +} +#undef DO_PRED11 + +// Predictor12: ClampedAddSubtractFull. +#define DO_PRED12(DIFF, LANE) do { \ + const uint8x8_t pred = \ + vqmovun_s16(vaddq_s16(vreinterpretq_s16_u16(L), (DIFF))); \ + const uint8x8_t res = \ + vadd_u8(pred, (LANE <= 1) ? vget_low_u8(src) : vget_high_u8(src)); \ + const uint16x8_t res16 = vmovl_u8(res); \ + vst1_lane_u32(&out[i + (LANE)], vreinterpret_u32_u8(res), (LANE) & 1); \ + /* rotate in the left predictor for next iteration */ \ + L = vextq_u16(res16, res16, 4); \ +} while (0) + +static void PredictorAdd12_NEON(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + uint16x8_t L = vmovl_u8(LOAD_U32_AS_U8(out[-1])); + for (i = 0; i + 4 <= num_pixels; i += 4) { + // load four pixels of source + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); + // precompute the difference T - TL once for all, stored as s16 + const uint8x16_t TL = LOADQ_U32P_AS_U8(&upper[i - 1]); + const uint8x16_t T = LOADQ_U32P_AS_U8(&upper[i]); + const int16x8_t diff_lo = + vreinterpretq_s16_u16(vsubl_u8(vget_low_u8(T), vget_low_u8(TL))); + const int16x8_t diff_hi = + vreinterpretq_s16_u16(vsubl_u8(vget_high_u8(T), vget_high_u8(TL))); + // loop over the four reconstructed pixels + DO_PRED12(diff_lo, 0); + DO_PRED12(diff_lo, 1); + DO_PRED12(diff_hi, 2); + DO_PRED12(diff_hi, 3); + } + VP8LPredictorsAdd_C[12](in + i, upper + i, num_pixels - i, out + i); +} +#undef DO_PRED12 + +// Predictor13: ClampedAddSubtractHalf +#define DO_PRED13(LANE, LOW_OR_HI) do { \ + const uint8x16_t avg = vhaddq_u8(L, T); \ + const uint8x16_t cmp = vcgtq_u8(TL, avg); \ + const uint8x16_t TL_1 = vaddq_u8(TL, cmp); \ + /* Compute half of the difference between avg and TL'. */ \ + const int8x8_t diff_avg = \ + vreinterpret_s8_u8(LOW_OR_HI(vhsubq_u8(avg, TL_1))); \ + /* Compute the sum with avg and saturate. */ \ + const int16x8_t avg_16 = vreinterpretq_s16_u16(vmovl_u8(LOW_OR_HI(avg))); \ + const uint8x8_t delta = vqmovun_s16(vaddw_s8(avg_16, diff_avg)); \ + const uint8x8_t res = vadd_u8(LOW_OR_HI(src), delta); \ + const uint8x16_t res2 = vcombine_u8(res, res); \ + vst1_lane_u32(&out[i + (LANE)], vreinterpret_u32_u8(res), (LANE) & 1); \ + L = ROTATE32_LEFT(res2); \ +} while (0) + +static void PredictorAdd13_NEON(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + uint8x16_t L = LOADQ_U32_AS_U8(out[-1]); + for (i = 0; i + 4 <= num_pixels; i += 4) { + const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); + const uint8x16_t T = LOADQ_U32P_AS_U8(&upper[i]); + const uint8x16_t TL = LOADQ_U32P_AS_U8(&upper[i - 1]); + DO_PRED13(0, vget_low_u8); + DO_PRED13(1, vget_low_u8); + DO_PRED13(2, vget_high_u8); + DO_PRED13(3, vget_high_u8); + } + VP8LPredictorsAdd_C[13](in + i, upper + i, num_pixels - i, out + i); +} +#undef DO_PRED13 + +#undef LOAD_U32_AS_U8 +#undef LOAD_U32P_AS_U8 +#undef LOADQ_U32_AS_U8 +#undef LOADQ_U32P_AS_U8 +#undef GET_U8_AS_U32 +#undef GETQ_U8_AS_U32 +#undef STOREQ_U8_AS_U32P +#undef ROTATE32_LEFT + //------------------------------------------------------------------------------ // Subtract-Green Transform @@ -171,28 +522,30 @@ static WEBP_INLINE uint8x16_t DoGreenShuffle(const uint8x16_t argb, } #endif // USE_VTBLQ -static void AddGreenToBlueAndRed(uint32_t* argb_data, int num_pixels) { - const uint32_t* const end = argb_data + (num_pixels & ~3); +static void AddGreenToBlueAndRed(const uint32_t* src, int num_pixels, + uint32_t* dst) { + const uint32_t* const end = src + (num_pixels & ~3); #ifdef USE_VTBLQ const uint8x16_t shuffle = vld1q_u8(kGreenShuffle); #else const uint8x8_t shuffle = vld1_u8(kGreenShuffle); #endif - for (; argb_data < end; argb_data += 4) { - const uint8x16_t argb = vld1q_u8((uint8_t*)argb_data); + for (; src < end; src += 4, dst += 4) { + const uint8x16_t argb = vld1q_u8((const uint8_t*)src); const uint8x16_t greens = DoGreenShuffle(argb, shuffle); - vst1q_u8((uint8_t*)argb_data, vaddq_u8(argb, greens)); + vst1q_u8((uint8_t*)dst, vaddq_u8(argb, greens)); } // fallthrough and finish off with plain-C - VP8LAddGreenToBlueAndRed_C(argb_data, num_pixels & 3); + VP8LAddGreenToBlueAndRed_C(src, num_pixels & 3, dst); } //------------------------------------------------------------------------------ // Color Transform static void TransformColorInverse(const VP8LMultipliers* const m, - uint32_t* argb_data, int num_pixels) { - // sign-extended multiplying constants, pre-shifted by 6. + const uint32_t* const src, int num_pixels, + uint32_t* dst) { +// sign-extended multiplying constants, pre-shifted by 6. #define CST(X) (((int16_t)(m->X << 8)) >> 6) const int16_t rb[8] = { CST(green_to_blue_), CST(green_to_red_), @@ -219,7 +572,7 @@ static void TransformColorInverse(const VP8LMultipliers* const m, const uint32x4_t mask_ag = vdupq_n_u32(0xff00ff00u); int i; for (i = 0; i + 4 <= num_pixels; i += 4) { - const uint8x16_t in = vld1q_u8((uint8_t*)(argb_data + i)); + const uint8x16_t in = vld1q_u8((const uint8_t*)(src + i)); const uint32x4_t a0g0 = vandq_u32(vreinterpretq_u32_u8(in), mask_ag); // 0 g 0 g const uint8x16_t greens = DoGreenShuffle(in, shuffle); @@ -240,10 +593,10 @@ static void TransformColorInverse(const VP8LMultipliers* const m, // 0 r' 0 b'' const uint16x8_t G = vshrq_n_u16(vreinterpretq_u16_s8(F), 8); const uint32x4_t out = vorrq_u32(vreinterpretq_u32_u16(G), a0g0); - vst1q_u32(argb_data + i, out); + vst1q_u32(dst + i, out); } // Fall-back to C-version for left-overs. - VP8LTransformColorInverse_C(m, argb_data + i, num_pixels - i); + VP8LTransformColorInverse_C(m, src + i, num_pixels - i, dst + i); } #undef USE_VTBLQ @@ -254,6 +607,26 @@ static void TransformColorInverse(const VP8LMultipliers* const m, extern void VP8LDspInitNEON(void); WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitNEON(void) { + VP8LPredictors[5] = Predictor5_NEON; + VP8LPredictors[6] = Predictor6_NEON; + VP8LPredictors[7] = Predictor7_NEON; + VP8LPredictors[13] = Predictor13_NEON; + + VP8LPredictorsAdd[0] = PredictorAdd0_NEON; + VP8LPredictorsAdd[1] = PredictorAdd1_NEON; + VP8LPredictorsAdd[2] = PredictorAdd2_NEON; + VP8LPredictorsAdd[3] = PredictorAdd3_NEON; + VP8LPredictorsAdd[4] = PredictorAdd4_NEON; + VP8LPredictorsAdd[5] = PredictorAdd5_NEON; + VP8LPredictorsAdd[6] = PredictorAdd6_NEON; + VP8LPredictorsAdd[7] = PredictorAdd7_NEON; + VP8LPredictorsAdd[8] = PredictorAdd8_NEON; + VP8LPredictorsAdd[9] = PredictorAdd9_NEON; + VP8LPredictorsAdd[10] = PredictorAdd10_NEON; + VP8LPredictorsAdd[11] = PredictorAdd11_NEON; + VP8LPredictorsAdd[12] = PredictorAdd12_NEON; + VP8LPredictorsAdd[13] = PredictorAdd13_NEON; + VP8LConvertBGRAToRGBA = ConvertBGRAToRGBA; VP8LConvertBGRAToBGR = ConvertBGRAToBGR; VP8LConvertBGRAToRGB = ConvertBGRAToRGB; diff --git a/thirdparty/libwebp/dsp/lossless_sse2.c b/thirdparty/libwebp/dsp/lossless_sse2.c index 2d016c2911..15aae93869 100644 --- a/thirdparty/libwebp/dsp/lossless_sse2.c +++ b/thirdparty/libwebp/dsp/lossless_sse2.c @@ -14,9 +14,12 @@ #include "./dsp.h" #if defined(WEBP_USE_SSE2) + +#include "./common_sse2.h" +#include "./lossless.h" +#include "./lossless_common.h" #include <assert.h> #include <emmintrin.h> -#include "./lossless.h" //------------------------------------------------------------------------------ // Predictor Transform @@ -75,25 +78,44 @@ static WEBP_INLINE uint32_t Select(uint32_t a, uint32_t b, uint32_t c) { return (pa_minus_pb <= 0) ? a : b; } -static WEBP_INLINE __m128i Average2_128i(uint32_t a0, uint32_t a1) { +static WEBP_INLINE void Average2_m128i(const __m128i* const a0, + const __m128i* const a1, + __m128i* const avg) { + // (a + b) >> 1 = ((a + b + 1) >> 1) - ((a ^ b) & 1) + const __m128i ones = _mm_set1_epi8(1); + const __m128i avg1 = _mm_avg_epu8(*a0, *a1); + const __m128i one = _mm_and_si128(_mm_xor_si128(*a0, *a1), ones); + *avg = _mm_sub_epi8(avg1, one); +} + +static WEBP_INLINE void Average2_uint32(const uint32_t a0, const uint32_t a1, + __m128i* const avg) { + // (a + b) >> 1 = ((a + b + 1) >> 1) - ((a ^ b) & 1) + const __m128i ones = _mm_set1_epi8(1); + const __m128i A0 = _mm_cvtsi32_si128(a0); + const __m128i A1 = _mm_cvtsi32_si128(a1); + const __m128i avg1 = _mm_avg_epu8(A0, A1); + const __m128i one = _mm_and_si128(_mm_xor_si128(A0, A1), ones); + *avg = _mm_sub_epi8(avg1, one); +} + +static WEBP_INLINE __m128i Average2_uint32_16(uint32_t a0, uint32_t a1) { const __m128i zero = _mm_setzero_si128(); const __m128i A0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a0), zero); const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a1), zero); const __m128i sum = _mm_add_epi16(A1, A0); - const __m128i avg = _mm_srli_epi16(sum, 1); - return avg; + return _mm_srli_epi16(sum, 1); } static WEBP_INLINE uint32_t Average2(uint32_t a0, uint32_t a1) { - const __m128i avg = Average2_128i(a0, a1); - const __m128i A2 = _mm_packus_epi16(avg, avg); - const uint32_t output = _mm_cvtsi128_si32(A2); - return output; + __m128i output; + Average2_uint32(a0, a1, &output); + return _mm_cvtsi128_si32(output); } static WEBP_INLINE uint32_t Average3(uint32_t a0, uint32_t a1, uint32_t a2) { const __m128i zero = _mm_setzero_si128(); - const __m128i avg1 = Average2_128i(a0, a2); + const __m128i avg1 = Average2_uint32_16(a0, a2); const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a1), zero); const __m128i sum = _mm_add_epi16(avg1, A1); const __m128i avg2 = _mm_srli_epi16(sum, 1); @@ -104,8 +126,8 @@ static WEBP_INLINE uint32_t Average3(uint32_t a0, uint32_t a1, uint32_t a2) { static WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { - const __m128i avg1 = Average2_128i(a0, a1); - const __m128i avg2 = Average2_128i(a2, a3); + const __m128i avg1 = Average2_uint32_16(a0, a1); + const __m128i avg2 = Average2_uint32_16(a2, a3); const __m128i sum = _mm_add_epi16(avg2, avg1); const __m128i avg3 = _mm_srli_epi16(sum, 1); const __m128i A0 = _mm_packus_epi16(avg3, avg3); @@ -113,68 +135,289 @@ static WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1, return output; } -static uint32_t Predictor5(uint32_t left, const uint32_t* const top) { +static uint32_t Predictor5_SSE2(uint32_t left, const uint32_t* const top) { const uint32_t pred = Average3(left, top[0], top[1]); return pred; } -static uint32_t Predictor6(uint32_t left, const uint32_t* const top) { +static uint32_t Predictor6_SSE2(uint32_t left, const uint32_t* const top) { const uint32_t pred = Average2(left, top[-1]); return pred; } -static uint32_t Predictor7(uint32_t left, const uint32_t* const top) { +static uint32_t Predictor7_SSE2(uint32_t left, const uint32_t* const top) { const uint32_t pred = Average2(left, top[0]); return pred; } -static uint32_t Predictor8(uint32_t left, const uint32_t* const top) { +static uint32_t Predictor8_SSE2(uint32_t left, const uint32_t* const top) { const uint32_t pred = Average2(top[-1], top[0]); (void)left; return pred; } -static uint32_t Predictor9(uint32_t left, const uint32_t* const top) { +static uint32_t Predictor9_SSE2(uint32_t left, const uint32_t* const top) { const uint32_t pred = Average2(top[0], top[1]); (void)left; return pred; } -static uint32_t Predictor10(uint32_t left, const uint32_t* const top) { +static uint32_t Predictor10_SSE2(uint32_t left, const uint32_t* const top) { const uint32_t pred = Average4(left, top[-1], top[0], top[1]); return pred; } -static uint32_t Predictor11(uint32_t left, const uint32_t* const top) { +static uint32_t Predictor11_SSE2(uint32_t left, const uint32_t* const top) { const uint32_t pred = Select(top[0], left, top[-1]); return pred; } -static uint32_t Predictor12(uint32_t left, const uint32_t* const top) { +static uint32_t Predictor12_SSE2(uint32_t left, const uint32_t* const top) { const uint32_t pred = ClampedAddSubtractFull(left, top[0], top[-1]); return pred; } -static uint32_t Predictor13(uint32_t left, const uint32_t* const top) { +static uint32_t Predictor13_SSE2(uint32_t left, const uint32_t* const top) { const uint32_t pred = ClampedAddSubtractHalf(left, top[0], top[-1]); return pred; } +// Batch versions of those functions. + +// Predictor0: ARGB_BLACK. +static void PredictorAdd0_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + const __m128i black = _mm_set1_epi32(ARGB_BLACK); + for (i = 0; i + 4 <= num_pixels; i += 4) { + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); + const __m128i res = _mm_add_epi8(src, black); + _mm_storeu_si128((__m128i*)&out[i], res); + } + if (i != num_pixels) { + VP8LPredictorsAdd_C[0](in + i, upper + i, num_pixels - i, out + i); + } +} + +// Predictor1: left. +static void PredictorAdd1_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + __m128i prev = _mm_set1_epi32(out[-1]); + for (i = 0; i + 4 <= num_pixels; i += 4) { + // a | b | c | d + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); + // 0 | a | b | c + const __m128i shift0 = _mm_slli_si128(src, 4); + // a | a + b | b + c | c + d + const __m128i sum0 = _mm_add_epi8(src, shift0); + // 0 | 0 | a | a + b + const __m128i shift1 = _mm_slli_si128(sum0, 8); + // a | a + b | a + b + c | a + b + c + d + const __m128i sum1 = _mm_add_epi8(sum0, shift1); + const __m128i res = _mm_add_epi8(sum1, prev); + _mm_storeu_si128((__m128i*)&out[i], res); + // replicate prev output on the four lanes + prev = _mm_shuffle_epi32(res, (3 << 0) | (3 << 2) | (3 << 4) | (3 << 6)); + } + if (i != num_pixels) { + VP8LPredictorsAdd_C[1](in + i, upper + i, num_pixels - i, out + i); + } +} + +// Macro that adds 32-bit integers from IN using mod 256 arithmetic +// per 8 bit channel. +#define GENERATE_PREDICTOR_1(X, IN) \ +static void PredictorAdd##X##_SSE2(const uint32_t* in, const uint32_t* upper, \ + int num_pixels, uint32_t* out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ + const __m128i other = _mm_loadu_si128((const __m128i*)&(IN)); \ + const __m128i res = _mm_add_epi8(src, other); \ + _mm_storeu_si128((__m128i*)&out[i], res); \ + } \ + if (i != num_pixels) { \ + VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ + } \ +} + +// Predictor2: Top. +GENERATE_PREDICTOR_1(2, upper[i]) +// Predictor3: Top-right. +GENERATE_PREDICTOR_1(3, upper[i + 1]) +// Predictor4: Top-left. +GENERATE_PREDICTOR_1(4, upper[i - 1]) +#undef GENERATE_PREDICTOR_1 + +// Due to averages with integers, values cannot be accumulated in parallel for +// predictors 5 to 7. +GENERATE_PREDICTOR_ADD(Predictor5_SSE2, PredictorAdd5_SSE2) +GENERATE_PREDICTOR_ADD(Predictor6_SSE2, PredictorAdd6_SSE2) +GENERATE_PREDICTOR_ADD(Predictor7_SSE2, PredictorAdd7_SSE2) + +#define GENERATE_PREDICTOR_2(X, IN) \ +static void PredictorAdd##X##_SSE2(const uint32_t* in, const uint32_t* upper, \ + int num_pixels, uint32_t* out) { \ + int i; \ + for (i = 0; i + 4 <= num_pixels; i += 4) { \ + const __m128i Tother = _mm_loadu_si128((const __m128i*)&(IN)); \ + const __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]); \ + const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); \ + __m128i avg, res; \ + Average2_m128i(&T, &Tother, &avg); \ + res = _mm_add_epi8(avg, src); \ + _mm_storeu_si128((__m128i*)&out[i], res); \ + } \ + if (i != num_pixels) { \ + VP8LPredictorsAdd_C[(X)](in + i, upper + i, num_pixels - i, out + i); \ + } \ +} +// Predictor8: average TL T. +GENERATE_PREDICTOR_2(8, upper[i - 1]) +// Predictor9: average T TR. +GENERATE_PREDICTOR_2(9, upper[i + 1]) +#undef GENERATE_PREDICTOR_2 + +// Predictor10: average of (average of (L,TL), average of (T, TR)). +static void PredictorAdd10_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i, j; + __m128i L = _mm_cvtsi32_si128(out[-1]); + for (i = 0; i + 4 <= num_pixels; i += 4) { + __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); + __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]); + const __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]); + const __m128i TR = _mm_loadu_si128((const __m128i*)&upper[i + 1]); + __m128i avgTTR; + Average2_m128i(&T, &TR, &avgTTR); + for (j = 0; j < 4; ++j) { + __m128i avgLTL, avg; + Average2_m128i(&L, &TL, &avgLTL); + Average2_m128i(&avgTTR, &avgLTL, &avg); + L = _mm_add_epi8(avg, src); + out[i + j] = _mm_cvtsi128_si32(L); + // Rotate the pre-computed values for the next iteration. + avgTTR = _mm_srli_si128(avgTTR, 4); + TL = _mm_srli_si128(TL, 4); + src = _mm_srli_si128(src, 4); + } + } + if (i != num_pixels) { + VP8LPredictorsAdd_C[10](in + i, upper + i, num_pixels - i, out + i); + } +} + +// Predictor11: select. +static void GetSumAbsDiff32(const __m128i* const A, const __m128i* const B, + __m128i* const out) { + // We can unpack with any value on the upper 32 bits, provided it's the same + // on both operands (to that their sum of abs diff is zero). Here we use *A. + const __m128i A_lo = _mm_unpacklo_epi32(*A, *A); + const __m128i B_lo = _mm_unpacklo_epi32(*B, *A); + const __m128i A_hi = _mm_unpackhi_epi32(*A, *A); + const __m128i B_hi = _mm_unpackhi_epi32(*B, *A); + const __m128i s_lo = _mm_sad_epu8(A_lo, B_lo); + const __m128i s_hi = _mm_sad_epu8(A_hi, B_hi); + *out = _mm_packs_epi32(s_lo, s_hi); +} + +static void PredictorAdd11_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i, j; + __m128i L = _mm_cvtsi32_si128(out[-1]); + for (i = 0; i + 4 <= num_pixels; i += 4) { + __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]); + __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]); + __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); + __m128i pa; + GetSumAbsDiff32(&T, &TL, &pa); // pa = sum |T-TL| + for (j = 0; j < 4; ++j) { + const __m128i L_lo = _mm_unpacklo_epi32(L, L); + const __m128i TL_lo = _mm_unpacklo_epi32(TL, L); + const __m128i pb = _mm_sad_epu8(L_lo, TL_lo); // pb = sum |L-TL| + const __m128i mask = _mm_cmpgt_epi32(pb, pa); + const __m128i A = _mm_and_si128(mask, L); + const __m128i B = _mm_andnot_si128(mask, T); + const __m128i pred = _mm_or_si128(A, B); // pred = (L > T)? L : T + L = _mm_add_epi8(src, pred); + out[i + j] = _mm_cvtsi128_si32(L); + // Shift the pre-computed value for the next iteration. + T = _mm_srli_si128(T, 4); + TL = _mm_srli_si128(TL, 4); + src = _mm_srli_si128(src, 4); + pa = _mm_srli_si128(pa, 4); + } + } + if (i != num_pixels) { + VP8LPredictorsAdd_C[11](in + i, upper + i, num_pixels - i, out + i); + } +} + +// Predictor12: ClampedAddSubtractFull. +#define DO_PRED12(DIFF, LANE, OUT) \ +do { \ + const __m128i all = _mm_add_epi16(L, (DIFF)); \ + const __m128i alls = _mm_packus_epi16(all, all); \ + const __m128i res = _mm_add_epi8(src, alls); \ + out[i + (OUT)] = _mm_cvtsi128_si32(res); \ + L = _mm_unpacklo_epi8(res, zero); \ + /* Shift the pre-computed value for the next iteration.*/ \ + if (LANE == 0) (DIFF) = _mm_srli_si128((DIFF), 8); \ + src = _mm_srli_si128(src, 4); \ +} while (0) + +static void PredictorAdd12_SSE2(const uint32_t* in, const uint32_t* upper, + int num_pixels, uint32_t* out) { + int i; + const __m128i zero = _mm_setzero_si128(); + const __m128i L8 = _mm_cvtsi32_si128(out[-1]); + __m128i L = _mm_unpacklo_epi8(L8, zero); + for (i = 0; i + 4 <= num_pixels; i += 4) { + // Load 4 pixels at a time. + __m128i src = _mm_loadu_si128((const __m128i*)&in[i]); + const __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]); + const __m128i T_lo = _mm_unpacklo_epi8(T, zero); + const __m128i T_hi = _mm_unpackhi_epi8(T, zero); + const __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]); + const __m128i TL_lo = _mm_unpacklo_epi8(TL, zero); + const __m128i TL_hi = _mm_unpackhi_epi8(TL, zero); + __m128i diff_lo = _mm_sub_epi16(T_lo, TL_lo); + __m128i diff_hi = _mm_sub_epi16(T_hi, TL_hi); + DO_PRED12(diff_lo, 0, 0); + DO_PRED12(diff_lo, 1, 1); + DO_PRED12(diff_hi, 0, 2); + DO_PRED12(diff_hi, 1, 3); + } + if (i != num_pixels) { + VP8LPredictorsAdd_C[12](in + i, upper + i, num_pixels - i, out + i); + } +} +#undef DO_PRED12 + +// Due to averages with integers, values cannot be accumulated in parallel for +// predictors 13. +GENERATE_PREDICTOR_ADD(Predictor13_SSE2, PredictorAdd13_SSE2) + //------------------------------------------------------------------------------ // Subtract-Green Transform -static void AddGreenToBlueAndRed(uint32_t* argb_data, int num_pixels) { +static void AddGreenToBlueAndRed(const uint32_t* const src, int num_pixels, + uint32_t* dst) { int i; for (i = 0; i + 4 <= num_pixels; i += 4) { - const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]); // argb + const __m128i in = _mm_loadu_si128((const __m128i*)&src[i]); // argb const __m128i A = _mm_srli_epi16(in, 8); // 0 a 0 g const __m128i B = _mm_shufflelo_epi16(A, _MM_SHUFFLE(2, 2, 0, 0)); const __m128i C = _mm_shufflehi_epi16(B, _MM_SHUFFLE(2, 2, 0, 0)); // 0g0g const __m128i out = _mm_add_epi8(in, C); - _mm_storeu_si128((__m128i*)&argb_data[i], out); + _mm_storeu_si128((__m128i*)&dst[i], out); } // fallthrough and finish off with plain-C - VP8LAddGreenToBlueAndRed_C(argb_data + i, num_pixels - i); + if (i != num_pixels) { + VP8LAddGreenToBlueAndRed_C(src + i, num_pixels - i, dst + i); + } } //------------------------------------------------------------------------------ // Color Transform static void TransformColorInverse(const VP8LMultipliers* const m, - uint32_t* argb_data, int num_pixels) { - // sign-extended multiplying constants, pre-shifted by 5. + const uint32_t* const src, int num_pixels, + uint32_t* dst) { +// sign-extended multiplying constants, pre-shifted by 5. #define CST(X) (((int16_t)(m->X << 8)) >> 5) // sign-extend const __m128i mults_rb = _mm_set_epi16( CST(green_to_red_), CST(green_to_blue_), @@ -188,7 +431,7 @@ static void TransformColorInverse(const VP8LMultipliers* const m, const __m128i mask_ag = _mm_set1_epi32(0xff00ff00); // alpha-green masks int i; for (i = 0; i + 4 <= num_pixels; i += 4) { - const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]); // argb + const __m128i in = _mm_loadu_si128((const __m128i*)&src[i]); // argb const __m128i A = _mm_and_si128(in, mask_ag); // a 0 g 0 const __m128i B = _mm_shufflelo_epi16(A, _MM_SHUFFLE(2, 2, 0, 0)); const __m128i C = _mm_shufflehi_epi16(B, _MM_SHUFFLE(2, 2, 0, 0)); // g0g0 @@ -200,15 +443,53 @@ static void TransformColorInverse(const VP8LMultipliers* const m, const __m128i I = _mm_add_epi8(H, F); // r' x b'' 0 const __m128i J = _mm_srli_epi16(I, 8); // 0 r' 0 b'' const __m128i out = _mm_or_si128(J, A); - _mm_storeu_si128((__m128i*)&argb_data[i], out); + _mm_storeu_si128((__m128i*)&dst[i], out); } // Fall-back to C-version for left-overs. - VP8LTransformColorInverse_C(m, argb_data + i, num_pixels - i); + if (i != num_pixels) { + VP8LTransformColorInverse_C(m, src + i, num_pixels - i, dst + i); + } } //------------------------------------------------------------------------------ // Color-space conversion functions +static void ConvertBGRAToRGB(const uint32_t* src, int num_pixels, + uint8_t* dst) { + const __m128i* in = (const __m128i*)src; + __m128i* out = (__m128i*)dst; + + while (num_pixels >= 32) { + // Load the BGRA buffers. + __m128i in0 = _mm_loadu_si128(in + 0); + __m128i in1 = _mm_loadu_si128(in + 1); + __m128i in2 = _mm_loadu_si128(in + 2); + __m128i in3 = _mm_loadu_si128(in + 3); + __m128i in4 = _mm_loadu_si128(in + 4); + __m128i in5 = _mm_loadu_si128(in + 5); + __m128i in6 = _mm_loadu_si128(in + 6); + __m128i in7 = _mm_loadu_si128(in + 7); + VP8L32bToPlanar(&in0, &in1, &in2, &in3); + VP8L32bToPlanar(&in4, &in5, &in6, &in7); + // At this points, in1/in5 contains red only, in2/in6 green only ... + // Pack the colors in 24b RGB. + VP8PlanarTo24b(&in1, &in5, &in2, &in6, &in3, &in7); + _mm_storeu_si128(out + 0, in1); + _mm_storeu_si128(out + 1, in5); + _mm_storeu_si128(out + 2, in2); + _mm_storeu_si128(out + 3, in6); + _mm_storeu_si128(out + 4, in3); + _mm_storeu_si128(out + 5, in7); + in += 8; + out += 6; + num_pixels -= 32; + } + // left-overs + if (num_pixels > 0) { + VP8LConvertBGRAToRGB_C((const uint32_t*)in, num_pixels, (uint8_t*)out); + } +} + static void ConvertBGRAToRGBA(const uint32_t* src, int num_pixels, uint8_t* dst) { const __m128i* in = (const __m128i*)src; @@ -233,7 +514,9 @@ static void ConvertBGRAToRGBA(const uint32_t* src, num_pixels -= 8; } // left-overs - VP8LConvertBGRAToRGBA_C((const uint32_t*)in, num_pixels, (uint8_t*)out); + if (num_pixels > 0) { + VP8LConvertBGRAToRGBA_C((const uint32_t*)in, num_pixels, (uint8_t*)out); + } } static void ConvertBGRAToRGBA4444(const uint32_t* src, @@ -267,7 +550,9 @@ static void ConvertBGRAToRGBA4444(const uint32_t* src, num_pixels -= 8; } // left-overs - VP8LConvertBGRAToRGBA4444_C((const uint32_t*)in, num_pixels, (uint8_t*)out); + if (num_pixels > 0) { + VP8LConvertBGRAToRGBA4444_C((const uint32_t*)in, num_pixels, (uint8_t*)out); + } } static void ConvertBGRAToRGB565(const uint32_t* src, @@ -306,7 +591,9 @@ static void ConvertBGRAToRGB565(const uint32_t* src, num_pixels -= 8; } // left-overs - VP8LConvertBGRAToRGB565_C((const uint32_t*)in, num_pixels, (uint8_t*)out); + if (num_pixels > 0) { + VP8LConvertBGRAToRGB565_C((const uint32_t*)in, num_pixels, (uint8_t*)out); + } } static void ConvertBGRAToBGR(const uint32_t* src, @@ -337,7 +624,9 @@ static void ConvertBGRAToBGR(const uint32_t* src, num_pixels -= 8; } // left-overs - VP8LConvertBGRAToBGR_C((const uint32_t*)in, num_pixels, dst); + if (num_pixels > 0) { + VP8LConvertBGRAToBGR_C((const uint32_t*)in, num_pixels, dst); + } } //------------------------------------------------------------------------------ @@ -346,19 +635,35 @@ static void ConvertBGRAToBGR(const uint32_t* src, extern void VP8LDspInitSSE2(void); WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitSSE2(void) { - VP8LPredictors[5] = Predictor5; - VP8LPredictors[6] = Predictor6; - VP8LPredictors[7] = Predictor7; - VP8LPredictors[8] = Predictor8; - VP8LPredictors[9] = Predictor9; - VP8LPredictors[10] = Predictor10; - VP8LPredictors[11] = Predictor11; - VP8LPredictors[12] = Predictor12; - VP8LPredictors[13] = Predictor13; + VP8LPredictors[5] = Predictor5_SSE2; + VP8LPredictors[6] = Predictor6_SSE2; + VP8LPredictors[7] = Predictor7_SSE2; + VP8LPredictors[8] = Predictor8_SSE2; + VP8LPredictors[9] = Predictor9_SSE2; + VP8LPredictors[10] = Predictor10_SSE2; + VP8LPredictors[11] = Predictor11_SSE2; + VP8LPredictors[12] = Predictor12_SSE2; + VP8LPredictors[13] = Predictor13_SSE2; + + VP8LPredictorsAdd[0] = PredictorAdd0_SSE2; + VP8LPredictorsAdd[1] = PredictorAdd1_SSE2; + VP8LPredictorsAdd[2] = PredictorAdd2_SSE2; + VP8LPredictorsAdd[3] = PredictorAdd3_SSE2; + VP8LPredictorsAdd[4] = PredictorAdd4_SSE2; + VP8LPredictorsAdd[5] = PredictorAdd5_SSE2; + VP8LPredictorsAdd[6] = PredictorAdd6_SSE2; + VP8LPredictorsAdd[7] = PredictorAdd7_SSE2; + VP8LPredictorsAdd[8] = PredictorAdd8_SSE2; + VP8LPredictorsAdd[9] = PredictorAdd9_SSE2; + VP8LPredictorsAdd[10] = PredictorAdd10_SSE2; + VP8LPredictorsAdd[11] = PredictorAdd11_SSE2; + VP8LPredictorsAdd[12] = PredictorAdd12_SSE2; + VP8LPredictorsAdd[13] = PredictorAdd13_SSE2; VP8LAddGreenToBlueAndRed = AddGreenToBlueAndRed; VP8LTransformColorInverse = TransformColorInverse; + VP8LConvertBGRAToRGB = ConvertBGRAToRGB; VP8LConvertBGRAToRGBA = ConvertBGRAToRGBA; VP8LConvertBGRAToRGBA4444 = ConvertBGRAToRGBA4444; VP8LConvertBGRAToRGB565 = ConvertBGRAToRGB565; diff --git a/thirdparty/libwebp/dsp/msa_macro.h b/thirdparty/libwebp/dsp/msa_macro.h index 5c707f476a..d0e5f45e01 100644 --- a/thirdparty/libwebp/dsp/msa_macro.h +++ b/thirdparty/libwebp/dsp/msa_macro.h @@ -23,12 +23,24 @@ #ifdef CLANG_BUILD #define ADDVI_H(a, b) __msa_addvi_h((v8i16)a, b) + #define ADDVI_W(a, b) __msa_addvi_w((v4i32)a, b) + #define SRAI_B(a, b) __msa_srai_b((v16i8)a, b) #define SRAI_H(a, b) __msa_srai_h((v8i16)a, b) #define SRAI_W(a, b) __msa_srai_w((v4i32)a, b) + #define SRLI_H(a, b) __msa_srli_h((v8i16)a, b) + #define SLLI_B(a, b) __msa_slli_b((v4i32)a, b) + #define ANDI_B(a, b) __msa_andi_b((v16u8)a, b) + #define ORI_B(a, b) __msa_ori_b((v16u8)a, b) #else #define ADDVI_H(a, b) (a + b) + #define ADDVI_W(a, b) (a + b) + #define SRAI_B(a, b) (a >> b) #define SRAI_H(a, b) (a >> b) #define SRAI_W(a, b) (a >> b) + #define SRLI_H(a, b) (a << b) + #define SLLI_B(a, b) (a << b) + #define ANDI_B(a, b) (a & b) + #define ORI_B(a, b) (a | b) #endif #define LD_B(RTYPE, psrc) *((RTYPE*)(psrc)) @@ -116,13 +128,13 @@ #define SH(val, pdst) MSA_STORE(val, pdst, msa_ush) MSA_STORE_FUNC(uint32_t, usw, msa_usw); #define SW(val, pdst) MSA_STORE(val, pdst, msa_usw) - #define SD(val, pdst) { \ + #define SD(val, pdst) do { \ uint8_t* const pdst_sd_m = (uint8_t*)(pdst); \ const uint32_t val0_m = (uint32_t)(val & 0x00000000FFFFFFFF); \ const uint32_t val1_m = (uint32_t)((val >> 32) & 0x00000000FFFFFFFF); \ SW(val0_m, pdst_sd_m); \ SW(val1_m, pdst_sd_m + 4); \ - } + } while (0) #endif // (__mips_isa_rev >= 6) /* Description : Load 4 words with stride @@ -133,34 +145,68 @@ * Load word in 'out2' from (psrc + 2 * stride) * Load word in 'out3' from (psrc + 3 * stride) */ -#define LW4(psrc, stride, out0, out1, out2, out3) { \ - const uint8_t* ptmp = (const uint8_t*)psrc; \ - out0 = LW(ptmp); \ - ptmp += stride; \ - out1 = LW(ptmp); \ - ptmp += stride; \ - out2 = LW(ptmp); \ - ptmp += stride; \ - out3 = LW(ptmp); \ -} +#define LW4(psrc, stride, out0, out1, out2, out3) do { \ + const uint8_t* ptmp = (const uint8_t*)psrc; \ + out0 = LW(ptmp); \ + ptmp += stride; \ + out1 = LW(ptmp); \ + ptmp += stride; \ + out2 = LW(ptmp); \ + ptmp += stride; \ + out3 = LW(ptmp); \ +} while (0) -/* Description : Store 4 words with stride +/* Description : Store words with stride * Arguments : Inputs - in0, in1, in2, in3, pdst, stride * Details : Store word from 'in0' to (pdst) * Store word from 'in1' to (pdst + stride) * Store word from 'in2' to (pdst + 2 * stride) * Store word from 'in3' to (pdst + 3 * stride) */ -#define SW4(in0, in1, in2, in3, pdst, stride) { \ - uint8_t* ptmp = (uint8_t*)pdst; \ - SW(in0, ptmp); \ - ptmp += stride; \ - SW(in1, ptmp); \ - ptmp += stride; \ - SW(in2, ptmp); \ - ptmp += stride; \ - SW(in3, ptmp); \ -} +#define SW4(in0, in1, in2, in3, pdst, stride) do { \ + uint8_t* ptmp = (uint8_t*)pdst; \ + SW(in0, ptmp); \ + ptmp += stride; \ + SW(in1, ptmp); \ + ptmp += stride; \ + SW(in2, ptmp); \ + ptmp += stride; \ + SW(in3, ptmp); \ +} while (0) + +#define SW3(in0, in1, in2, pdst, stride) do { \ + uint8_t* ptmp = (uint8_t*)pdst; \ + SW(in0, ptmp); \ + ptmp += stride; \ + SW(in1, ptmp); \ + ptmp += stride; \ + SW(in2, ptmp); \ +} while (0) + +#define SW2(in0, in1, pdst, stride) do { \ + uint8_t* ptmp = (uint8_t*)pdst; \ + SW(in0, ptmp); \ + ptmp += stride; \ + SW(in1, ptmp); \ +} while (0) + +/* Description : Store 4 double words with stride + * Arguments : Inputs - in0, in1, in2, in3, pdst, stride + * Details : Store double word from 'in0' to (pdst) + * Store double word from 'in1' to (pdst + stride) + * Store double word from 'in2' to (pdst + 2 * stride) + * Store double word from 'in3' to (pdst + 3 * stride) + */ +#define SD4(in0, in1, in2, in3, pdst, stride) do { \ + uint8_t* ptmp = (uint8_t*)pdst; \ + SD(in0, ptmp); \ + ptmp += stride; \ + SD(in1, ptmp); \ + ptmp += stride; \ + SD(in2, ptmp); \ + ptmp += stride; \ + SD(in3, ptmp); \ +} while (0) /* Description : Load vectors with 16 byte elements with stride * Arguments : Inputs - psrc, stride @@ -169,33 +215,169 @@ * Details : Load 16 byte elements in 'out0' from (psrc) * Load 16 byte elements in 'out1' from (psrc + stride) */ -#define LD_B2(RTYPE, psrc, stride, out0, out1) { \ - out0 = LD_B(RTYPE, psrc); \ - out1 = LD_B(RTYPE, psrc + stride); \ -} +#define LD_B2(RTYPE, psrc, stride, out0, out1) do { \ + out0 = LD_B(RTYPE, psrc); \ + out1 = LD_B(RTYPE, psrc + stride); \ +} while (0) #define LD_UB2(...) LD_B2(v16u8, __VA_ARGS__) #define LD_SB2(...) LD_B2(v16i8, __VA_ARGS__) -#define LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3) { \ - LD_B2(RTYPE, psrc, stride, out0, out1); \ - LD_B2(RTYPE, psrc + 2 * stride , stride, out2, out3); \ -} +#define LD_B3(RTYPE, psrc, stride, out0, out1, out2) do { \ + LD_B2(RTYPE, psrc, stride, out0, out1); \ + out2 = LD_B(RTYPE, psrc + 2 * stride); \ +} while (0) +#define LD_UB3(...) LD_B3(v16u8, __VA_ARGS__) +#define LD_SB3(...) LD_B3(v16i8, __VA_ARGS__) + +#define LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3) do { \ + LD_B2(RTYPE, psrc, stride, out0, out1); \ + LD_B2(RTYPE, psrc + 2 * stride , stride, out2, out3); \ +} while (0) #define LD_UB4(...) LD_B4(v16u8, __VA_ARGS__) #define LD_SB4(...) LD_B4(v16i8, __VA_ARGS__) +#define LD_B8(RTYPE, psrc, stride, \ + out0, out1, out2, out3, out4, out5, out6, out7) do { \ + LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3); \ + LD_B4(RTYPE, psrc + 4 * stride, stride, out4, out5, out6, out7); \ +} while (0) +#define LD_UB8(...) LD_B8(v16u8, __VA_ARGS__) +#define LD_SB8(...) LD_B8(v16i8, __VA_ARGS__) + /* Description : Load vectors with 8 halfword elements with stride * Arguments : Inputs - psrc, stride * Outputs - out0, out1 * Details : Load 8 halfword elements in 'out0' from (psrc) * Load 8 halfword elements in 'out1' from (psrc + stride) */ -#define LD_H2(RTYPE, psrc, stride, out0, out1) { \ - out0 = LD_H(RTYPE, psrc); \ - out1 = LD_H(RTYPE, psrc + stride); \ -} +#define LD_H2(RTYPE, psrc, stride, out0, out1) do { \ + out0 = LD_H(RTYPE, psrc); \ + out1 = LD_H(RTYPE, psrc + stride); \ +} while (0) #define LD_UH2(...) LD_H2(v8u16, __VA_ARGS__) #define LD_SH2(...) LD_H2(v8i16, __VA_ARGS__) +/* Description : Load vectors with 4 word elements with stride + * Arguments : Inputs - psrc, stride + * Outputs - out0, out1, out2, out3 + * Details : Load 4 word elements in 'out0' from (psrc + 0 * stride) + * Load 4 word elements in 'out1' from (psrc + 1 * stride) + * Load 4 word elements in 'out2' from (psrc + 2 * stride) + * Load 4 word elements in 'out3' from (psrc + 3 * stride) + */ +#define LD_W2(RTYPE, psrc, stride, out0, out1) do { \ + out0 = LD_W(RTYPE, psrc); \ + out1 = LD_W(RTYPE, psrc + stride); \ +} while (0) +#define LD_UW2(...) LD_W2(v4u32, __VA_ARGS__) +#define LD_SW2(...) LD_W2(v4i32, __VA_ARGS__) + +#define LD_W3(RTYPE, psrc, stride, out0, out1, out2) do { \ + LD_W2(RTYPE, psrc, stride, out0, out1); \ + out2 = LD_W(RTYPE, psrc + 2 * stride); \ +} while (0) +#define LD_UW3(...) LD_W3(v4u32, __VA_ARGS__) +#define LD_SW3(...) LD_W3(v4i32, __VA_ARGS__) + +#define LD_W4(RTYPE, psrc, stride, out0, out1, out2, out3) do { \ + LD_W2(RTYPE, psrc, stride, out0, out1); \ + LD_W2(RTYPE, psrc + 2 * stride, stride, out2, out3); \ +} while (0) +#define LD_UW4(...) LD_W4(v4u32, __VA_ARGS__) +#define LD_SW4(...) LD_W4(v4i32, __VA_ARGS__) + +/* Description : Store vectors of 16 byte elements with stride + * Arguments : Inputs - in0, in1, pdst, stride + * Details : Store 16 byte elements from 'in0' to (pdst) + * Store 16 byte elements from 'in1' to (pdst + stride) + */ +#define ST_B2(RTYPE, in0, in1, pdst, stride) do { \ + ST_B(RTYPE, in0, pdst); \ + ST_B(RTYPE, in1, pdst + stride); \ +} while (0) +#define ST_UB2(...) ST_B2(v16u8, __VA_ARGS__) +#define ST_SB2(...) ST_B2(v16i8, __VA_ARGS__) + +#define ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride) do { \ + ST_B2(RTYPE, in0, in1, pdst, stride); \ + ST_B2(RTYPE, in2, in3, pdst + 2 * stride, stride); \ +} while (0) +#define ST_UB4(...) ST_B4(v16u8, __VA_ARGS__) +#define ST_SB4(...) ST_B4(v16i8, __VA_ARGS__) + +#define ST_B8(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \ + pdst, stride) do { \ + ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride); \ + ST_B4(RTYPE, in4, in5, in6, in7, pdst + 4 * stride, stride); \ +} while (0) +#define ST_UB8(...) ST_B8(v16u8, __VA_ARGS__) + +/* Description : Store vectors of 4 word elements with stride + * Arguments : Inputs - in0, in1, in2, in3, pdst, stride + * Details : Store 4 word elements from 'in0' to (pdst + 0 * stride) + * Store 4 word elements from 'in1' to (pdst + 1 * stride) + * Store 4 word elements from 'in2' to (pdst + 2 * stride) + * Store 4 word elements from 'in3' to (pdst + 3 * stride) + */ +#define ST_W2(RTYPE, in0, in1, pdst, stride) do { \ + ST_W(RTYPE, in0, pdst); \ + ST_W(RTYPE, in1, pdst + stride); \ +} while (0) +#define ST_UW2(...) ST_W2(v4u32, __VA_ARGS__) +#define ST_SW2(...) ST_W2(v4i32, __VA_ARGS__) + +#define ST_W3(RTYPE, in0, in1, in2, pdst, stride) do { \ + ST_W2(RTYPE, in0, in1, pdst, stride); \ + ST_W(RTYPE, in2, pdst + 2 * stride); \ +} while (0) +#define ST_UW3(...) ST_W3(v4u32, __VA_ARGS__) +#define ST_SW3(...) ST_W3(v4i32, __VA_ARGS__) + +#define ST_W4(RTYPE, in0, in1, in2, in3, pdst, stride) do { \ + ST_W2(RTYPE, in0, in1, pdst, stride); \ + ST_W2(RTYPE, in2, in3, pdst + 2 * stride, stride); \ +} while (0) +#define ST_UW4(...) ST_W4(v4u32, __VA_ARGS__) +#define ST_SW4(...) ST_W4(v4i32, __VA_ARGS__) + +/* Description : Store vectors of 8 halfword elements with stride + * Arguments : Inputs - in0, in1, pdst, stride + * Details : Store 8 halfword elements from 'in0' to (pdst) + * Store 8 halfword elements from 'in1' to (pdst + stride) + */ +#define ST_H2(RTYPE, in0, in1, pdst, stride) do { \ + ST_H(RTYPE, in0, pdst); \ + ST_H(RTYPE, in1, pdst + stride); \ +} while (0) +#define ST_UH2(...) ST_H2(v8u16, __VA_ARGS__) +#define ST_SH2(...) ST_H2(v8i16, __VA_ARGS__) + +/* Description : Store 2x4 byte block to destination memory from input vector + * Arguments : Inputs - in, stidx, pdst, stride + * Details : Index 'stidx' halfword element from 'in' vector is copied to + * the GP register and stored to (pdst) + * Index 'stidx+1' halfword element from 'in' vector is copied to + * the GP register and stored to (pdst + stride) + * Index 'stidx+2' halfword element from 'in' vector is copied to + * the GP register and stored to (pdst + 2 * stride) + * Index 'stidx+3' halfword element from 'in' vector is copied to + * the GP register and stored to (pdst + 3 * stride) + */ +#define ST2x4_UB(in, stidx, pdst, stride) do { \ + uint8_t* pblk_2x4_m = (uint8_t*)pdst; \ + const uint16_t out0_m = __msa_copy_s_h((v8i16)in, stidx); \ + const uint16_t out1_m = __msa_copy_s_h((v8i16)in, stidx + 1); \ + const uint16_t out2_m = __msa_copy_s_h((v8i16)in, stidx + 2); \ + const uint16_t out3_m = __msa_copy_s_h((v8i16)in, stidx + 3); \ + SH(out0_m, pblk_2x4_m); \ + pblk_2x4_m += stride; \ + SH(out1_m, pblk_2x4_m); \ + pblk_2x4_m += stride; \ + SH(out2_m, pblk_2x4_m); \ + pblk_2x4_m += stride; \ + SH(out3_m, pblk_2x4_m); \ +} while (0) + /* Description : Store 4x4 byte block to destination memory from input vector * Arguments : Inputs - in0, in1, pdst, stride * Details : 'Idx0' word element from input vector 'in0' is copied to the @@ -207,14 +389,20 @@ * 'Idx3' word element from input vector 'in0' is copied to the * GP register and stored to (pdst + 3 * stride) */ -#define ST4x4_UB(in0, in1, idx0, idx1, idx2, idx3, pdst, stride) { \ - uint8_t* const pblk_4x4_m = (uint8_t*)pdst; \ - const uint32_t out0_m = __msa_copy_s_w((v4i32)in0, idx0); \ - const uint32_t out1_m = __msa_copy_s_w((v4i32)in0, idx1); \ - const uint32_t out2_m = __msa_copy_s_w((v4i32)in1, idx2); \ - const uint32_t out3_m = __msa_copy_s_w((v4i32)in1, idx3); \ - SW4(out0_m, out1_m, out2_m, out3_m, pblk_4x4_m, stride); \ -} +#define ST4x4_UB(in0, in1, idx0, idx1, idx2, idx3, pdst, stride) do { \ + uint8_t* const pblk_4x4_m = (uint8_t*)pdst; \ + const uint32_t out0_m = __msa_copy_s_w((v4i32)in0, idx0); \ + const uint32_t out1_m = __msa_copy_s_w((v4i32)in0, idx1); \ + const uint32_t out2_m = __msa_copy_s_w((v4i32)in1, idx2); \ + const uint32_t out3_m = __msa_copy_s_w((v4i32)in1, idx3); \ + SW4(out0_m, out1_m, out2_m, out3_m, pblk_4x4_m, stride); \ +} while (0) + +#define ST4x8_UB(in0, in1, pdst, stride) do { \ + uint8_t* const pblk_4x8 = (uint8_t*)pdst; \ + ST4x4_UB(in0, in0, 0, 1, 2, 3, pblk_4x8, stride); \ + ST4x4_UB(in1, in1, 0, 1, 2, 3, pblk_4x8 + 4 * stride, stride); \ +} while (0) /* Description : Immediate number of elements to slide * Arguments : Inputs - in0, in1, slide_val @@ -230,6 +418,30 @@ #define SLDI_SB(...) SLDI_B(v16i8, __VA_ARGS__) #define SLDI_SH(...) SLDI_B(v8i16, __VA_ARGS__) +/* Description : Shuffle byte vector elements as per mask vector + * Arguments : Inputs - in0, in1, in2, in3, mask0, mask1 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Byte elements from 'in0' & 'in1' are copied selectively to + * 'out0' as per control vector 'mask0' + */ +#define VSHF_B(RTYPE, in0, in1, mask) \ + (RTYPE)__msa_vshf_b((v16i8)mask, (v16i8)in1, (v16i8)in0) + +#define VSHF_UB(...) VSHF_B(v16u8, __VA_ARGS__) +#define VSHF_SB(...) VSHF_B(v16i8, __VA_ARGS__) +#define VSHF_UH(...) VSHF_B(v8u16, __VA_ARGS__) +#define VSHF_SH(...) VSHF_B(v8i16, __VA_ARGS__) + +#define VSHF_B2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) do { \ + out0 = VSHF_B(RTYPE, in0, in1, mask0); \ + out1 = VSHF_B(RTYPE, in2, in3, mask1); \ +} while (0) +#define VSHF_B2_UB(...) VSHF_B2(v16u8, __VA_ARGS__) +#define VSHF_B2_SB(...) VSHF_B2(v16i8, __VA_ARGS__) +#define VSHF_B2_UH(...) VSHF_B2(v8u16, __VA_ARGS__) +#define VSHF_B2_SH(...) VSHF_B2(v8i16, __VA_ARGS__) + /* Description : Shuffle halfword vector elements as per mask vector * Arguments : Inputs - in0, in1, in2, in3, mask0, mask1 * Outputs - out0, out1 @@ -237,44 +449,219 @@ * Details : halfword elements from 'in0' & 'in1' are copied selectively to * 'out0' as per control vector 'mask0' */ -#define VSHF_H2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) { \ - out0 = (RTYPE)__msa_vshf_h((v8i16)mask0, (v8i16)in1, (v8i16)in0); \ - out1 = (RTYPE)__msa_vshf_h((v8i16)mask1, (v8i16)in3, (v8i16)in2); \ -} +#define VSHF_H2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) do { \ + out0 = (RTYPE)__msa_vshf_h((v8i16)mask0, (v8i16)in1, (v8i16)in0); \ + out1 = (RTYPE)__msa_vshf_h((v8i16)mask1, (v8i16)in3, (v8i16)in2); \ +} while (0) #define VSHF_H2_UH(...) VSHF_H2(v8u16, __VA_ARGS__) #define VSHF_H2_SH(...) VSHF_H2(v8i16, __VA_ARGS__) +/* Description : Dot product of byte vector elements + * Arguments : Inputs - mult0, mult1, cnst0, cnst1 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Signed byte elements from 'mult0' are multiplied with + * signed byte elements from 'cnst0' producing a result + * twice the size of input i.e. signed halfword. + * The multiplication result of adjacent odd-even elements + * are added together and written to the 'out0' vector +*/ +#define DOTP_SB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) do { \ + out0 = (RTYPE)__msa_dotp_s_h((v16i8)mult0, (v16i8)cnst0); \ + out1 = (RTYPE)__msa_dotp_s_h((v16i8)mult1, (v16i8)cnst1); \ +} while (0) +#define DOTP_SB2_SH(...) DOTP_SB2(v8i16, __VA_ARGS__) + +/* Description : Dot product of halfword vector elements + * Arguments : Inputs - mult0, mult1, cnst0, cnst1 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Signed halfword elements from 'mult0' are multiplied with + * signed halfword elements from 'cnst0' producing a result + * twice the size of input i.e. signed word. + * The multiplication result of adjacent odd-even elements + * are added together and written to the 'out0' vector + */ +#define DOTP_SH2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) do { \ + out0 = (RTYPE)__msa_dotp_s_w((v8i16)mult0, (v8i16)cnst0); \ + out1 = (RTYPE)__msa_dotp_s_w((v8i16)mult1, (v8i16)cnst1); \ +} while (0) +#define DOTP_SH2_SW(...) DOTP_SH2(v4i32, __VA_ARGS__) + +/* Description : Dot product of unsigned word vector elements + * Arguments : Inputs - mult0, mult1, cnst0, cnst1 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Unsigned word elements from 'mult0' are multiplied with + * unsigned word elements from 'cnst0' producing a result + * twice the size of input i.e. unsigned double word. + * The multiplication result of adjacent odd-even elements + * are added together and written to the 'out0' vector + */ +#define DOTP_UW2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) do { \ + out0 = (RTYPE)__msa_dotp_u_d((v4u32)mult0, (v4u32)cnst0); \ + out1 = (RTYPE)__msa_dotp_u_d((v4u32)mult1, (v4u32)cnst1); \ +} while (0) +#define DOTP_UW2_UD(...) DOTP_UW2(v2u64, __VA_ARGS__) + +/* Description : Dot product & addition of halfword vector elements + * Arguments : Inputs - mult0, mult1, cnst0, cnst1 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Signed halfword elements from 'mult0' are multiplied with + * signed halfword elements from 'cnst0' producing a result + * twice the size of input i.e. signed word. + * The multiplication result of adjacent odd-even elements + * are added to the 'out0' vector + */ +#define DPADD_SH2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) do { \ + out0 = (RTYPE)__msa_dpadd_s_w((v4i32)out0, (v8i16)mult0, (v8i16)cnst0); \ + out1 = (RTYPE)__msa_dpadd_s_w((v4i32)out1, (v8i16)mult1, (v8i16)cnst1); \ +} while (0) +#define DPADD_SH2_SW(...) DPADD_SH2(v4i32, __VA_ARGS__) + /* Description : Clips all signed halfword elements of input vector * between 0 & 255 * Arguments : Input/output - val * Return Type - signed halfword */ -#define CLIP_SH_0_255(val) { \ +#define CLIP_SH_0_255(val) do { \ const v8i16 max_m = __msa_ldi_h(255); \ val = __msa_maxi_s_h((v8i16)val, 0); \ val = __msa_min_s_h(max_m, (v8i16)val); \ -} -#define CLIP_SH2_0_255(in0, in1) { \ - CLIP_SH_0_255(in0); \ - CLIP_SH_0_255(in1); \ -} +} while (0) + +#define CLIP_SH2_0_255(in0, in1) do { \ + CLIP_SH_0_255(in0); \ + CLIP_SH_0_255(in1); \ +} while (0) + +#define CLIP_SH4_0_255(in0, in1, in2, in3) do { \ + CLIP_SH2_0_255(in0, in1); \ + CLIP_SH2_0_255(in2, in3); \ +} while (0) + +/* Description : Clips all unsigned halfword elements of input vector + * between 0 & 255 + * Arguments : Input - in + * Output - out_m + * Return Type - unsigned halfword + */ +#define CLIP_UH_0_255(in) do { \ + const v8u16 max_m = (v8u16)__msa_ldi_h(255); \ + in = __msa_maxi_u_h((v8u16) in, 0); \ + in = __msa_min_u_h((v8u16) max_m, (v8u16) in); \ +} while (0) + +#define CLIP_UH2_0_255(in0, in1) do { \ + CLIP_UH_0_255(in0); \ + CLIP_UH_0_255(in1); \ +} while (0) /* Description : Clips all signed word elements of input vector * between 0 & 255 * Arguments : Input/output - val * Return Type - signed word */ -#define CLIP_SW_0_255(val) { \ +#define CLIP_SW_0_255(val) do { \ const v4i32 max_m = __msa_ldi_w(255); \ val = __msa_maxi_s_w((v4i32)val, 0); \ val = __msa_min_s_w(max_m, (v4i32)val); \ +} while (0) + +#define CLIP_SW4_0_255(in0, in1, in2, in3) do { \ + CLIP_SW_0_255(in0); \ + CLIP_SW_0_255(in1); \ + CLIP_SW_0_255(in2); \ + CLIP_SW_0_255(in3); \ +} while (0) + +/* Description : Horizontal addition of 4 signed word elements of input vector + * Arguments : Input - in (signed word vector) + * Output - sum_m (i32 sum) + * Return Type - signed word (GP) + * Details : 4 signed word elements of 'in' vector are added together and + * the resulting integer sum is returned + */ +static WEBP_INLINE int32_t func_hadd_sw_s32(v4i32 in) { + const v2i64 res0_m = __msa_hadd_s_d((v4i32)in, (v4i32)in); + const v2i64 res1_m = __msa_splati_d(res0_m, 1); + const v2i64 out = res0_m + res1_m; + int32_t sum_m = __msa_copy_s_w((v4i32)out, 0); + return sum_m; } -#define CLIP_SW4_0_255(in0, in1, in2, in3) { \ - CLIP_SW_0_255(in0); \ - CLIP_SW_0_255(in1); \ - CLIP_SW_0_255(in2); \ - CLIP_SW_0_255(in3); \ +#define HADD_SW_S32(in) func_hadd_sw_s32(in) + +/* Description : Horizontal addition of 8 signed halfword elements + * Arguments : Input - in (signed halfword vector) + * Output - sum_m (s32 sum) + * Return Type - signed word + * Details : 8 signed halfword elements of input vector are added + * together and the resulting integer sum is returned + */ +static WEBP_INLINE int32_t func_hadd_sh_s32(v8i16 in) { + const v4i32 res = __msa_hadd_s_w(in, in); + const v2i64 res0 = __msa_hadd_s_d(res, res); + const v2i64 res1 = __msa_splati_d(res0, 1); + const v2i64 res2 = res0 + res1; + const int32_t sum_m = __msa_copy_s_w((v4i32)res2, 0); + return sum_m; +} +#define HADD_SH_S32(in) func_hadd_sh_s32(in) + +/* Description : Horizontal addition of 8 unsigned halfword elements + * Arguments : Input - in (unsigned halfword vector) + * Output - sum_m (u32 sum) + * Return Type - unsigned word + * Details : 8 unsigned halfword elements of input vector are added + * together and the resulting integer sum is returned + */ +static WEBP_INLINE uint32_t func_hadd_uh_u32(v8u16 in) { + uint32_t sum_m; + const v4u32 res_m = __msa_hadd_u_w(in, in); + v2u64 res0_m = __msa_hadd_u_d(res_m, res_m); + v2u64 res1_m = (v2u64)__msa_splati_d((v2i64)res0_m, 1); + res0_m = res0_m + res1_m; + sum_m = __msa_copy_s_w((v4i32)res0_m, 0); + return sum_m; } +#define HADD_UH_U32(in) func_hadd_uh_u32(in) + +/* Description : Horizontal addition of signed half word vector elements + Arguments : Inputs - in0, in1 + Outputs - out0, out1 + Return Type - as per RTYPE + Details : Each signed odd half word element from 'in0' is added to + even signed half word element from 'in0' (pairwise) and the + halfword result is written in 'out0' +*/ +#define HADD_SH2(RTYPE, in0, in1, out0, out1) do { \ + out0 = (RTYPE)__msa_hadd_s_w((v8i16)in0, (v8i16)in0); \ + out1 = (RTYPE)__msa_hadd_s_w((v8i16)in1, (v8i16)in1); \ +} while (0) +#define HADD_SH2_SW(...) HADD_SH2(v4i32, __VA_ARGS__) + +#define HADD_SH4(RTYPE, in0, in1, in2, in3, out0, out1, out2, out3) do { \ + HADD_SH2(RTYPE, in0, in1, out0, out1); \ + HADD_SH2(RTYPE, in2, in3, out2, out3); \ +} while (0) +#define HADD_SH4_SW(...) HADD_SH4(v4i32, __VA_ARGS__) + +/* Description : Horizontal subtraction of unsigned byte vector elements + * Arguments : Inputs - in0, in1 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Each unsigned odd byte element from 'in0' is subtracted from + * even unsigned byte element from 'in0' (pairwise) and the + * halfword result is written to 'out0' + */ +#define HSUB_UB2(RTYPE, in0, in1, out0, out1) do { \ + out0 = (RTYPE)__msa_hsub_u_h((v16u8)in0, (v16u8)in0); \ + out1 = (RTYPE)__msa_hsub_u_h((v16u8)in1, (v16u8)in1); \ +} while (0) +#define HSUB_UB2_UH(...) HSUB_UB2(v8u16, __VA_ARGS__) +#define HSUB_UB2_SH(...) HSUB_UB2(v8i16, __VA_ARGS__) +#define HSUB_UB2_SW(...) HSUB_UB2(v4i32, __VA_ARGS__) /* Description : Set element n input vector to GPR value * Arguments : Inputs - in0, in1, in2, in3 @@ -282,23 +669,188 @@ * Return Type - as per RTYPE * Details : Set element 0 in vector 'out' to value specified in 'in0' */ -#define INSERT_W2(RTYPE, in0, in1, out) { \ +#define INSERT_W2(RTYPE, in0, in1, out) do { \ out = (RTYPE)__msa_insert_w((v4i32)out, 0, in0); \ out = (RTYPE)__msa_insert_w((v4i32)out, 1, in1); \ -} +} while (0) #define INSERT_W2_UB(...) INSERT_W2(v16u8, __VA_ARGS__) #define INSERT_W2_SB(...) INSERT_W2(v16i8, __VA_ARGS__) -#define INSERT_W4(RTYPE, in0, in1, in2, in3, out) { \ - out = (RTYPE)__msa_insert_w((v4i32)out, 0, in0); \ - out = (RTYPE)__msa_insert_w((v4i32)out, 1, in1); \ - out = (RTYPE)__msa_insert_w((v4i32)out, 2, in2); \ - out = (RTYPE)__msa_insert_w((v4i32)out, 3, in3); \ -} +#define INSERT_W4(RTYPE, in0, in1, in2, in3, out) do { \ + out = (RTYPE)__msa_insert_w((v4i32)out, 0, in0); \ + out = (RTYPE)__msa_insert_w((v4i32)out, 1, in1); \ + out = (RTYPE)__msa_insert_w((v4i32)out, 2, in2); \ + out = (RTYPE)__msa_insert_w((v4i32)out, 3, in3); \ +} while (0) #define INSERT_W4_UB(...) INSERT_W4(v16u8, __VA_ARGS__) #define INSERT_W4_SB(...) INSERT_W4(v16i8, __VA_ARGS__) #define INSERT_W4_SW(...) INSERT_W4(v4i32, __VA_ARGS__) +/* Description : Set element n of double word input vector to GPR value + * Arguments : Inputs - in0, in1 + * Output - out + * Return Type - as per RTYPE + * Details : Set element 0 in vector 'out' to GPR value specified in 'in0' + * Set element 1 in vector 'out' to GPR value specified in 'in1' + */ +#define INSERT_D2(RTYPE, in0, in1, out) do { \ + out = (RTYPE)__msa_insert_d((v2i64)out, 0, in0); \ + out = (RTYPE)__msa_insert_d((v2i64)out, 1, in1); \ +} while (0) +#define INSERT_D2_UB(...) INSERT_D2(v16u8, __VA_ARGS__) +#define INSERT_D2_SB(...) INSERT_D2(v16i8, __VA_ARGS__) + +/* Description : Interleave even byte elements from vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Even byte elements of 'in0' and 'in1' are interleaved + * and written to 'out0' + */ +#define ILVEV_B2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvev_b((v16i8)in1, (v16i8)in0); \ + out1 = (RTYPE)__msa_ilvev_b((v16i8)in3, (v16i8)in2); \ +} while (0) +#define ILVEV_B2_UB(...) ILVEV_B2(v16u8, __VA_ARGS__) +#define ILVEV_B2_SB(...) ILVEV_B2(v16i8, __VA_ARGS__) +#define ILVEV_B2_UH(...) ILVEV_B2(v8u16, __VA_ARGS__) +#define ILVEV_B2_SH(...) ILVEV_B2(v8i16, __VA_ARGS__) +#define ILVEV_B2_SD(...) ILVEV_B2(v2i64, __VA_ARGS__) + +/* Description : Interleave odd byte elements from vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Odd byte elements of 'in0' and 'in1' are interleaved + * and written to 'out0' + */ +#define ILVOD_B2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvod_b((v16i8)in1, (v16i8)in0); \ + out1 = (RTYPE)__msa_ilvod_b((v16i8)in3, (v16i8)in2); \ +} while (0) +#define ILVOD_B2_UB(...) ILVOD_B2(v16u8, __VA_ARGS__) +#define ILVOD_B2_SB(...) ILVOD_B2(v16i8, __VA_ARGS__) +#define ILVOD_B2_UH(...) ILVOD_B2(v8u16, __VA_ARGS__) +#define ILVOD_B2_SH(...) ILVOD_B2(v8i16, __VA_ARGS__) +#define ILVOD_B2_SD(...) ILVOD_B2(v2i64, __VA_ARGS__) + +/* Description : Interleave even halfword elements from vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Even halfword elements of 'in0' and 'in1' are interleaved + * and written to 'out0' + */ +#define ILVEV_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvev_h((v8i16)in1, (v8i16)in0); \ + out1 = (RTYPE)__msa_ilvev_h((v8i16)in3, (v8i16)in2); \ +} while (0) +#define ILVEV_H2_UB(...) ILVEV_H2(v16u8, __VA_ARGS__) +#define ILVEV_H2_UH(...) ILVEV_H2(v8u16, __VA_ARGS__) +#define ILVEV_H2_SH(...) ILVEV_H2(v8i16, __VA_ARGS__) +#define ILVEV_H2_SW(...) ILVEV_H2(v4i32, __VA_ARGS__) + +/* Description : Interleave odd halfword elements from vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Odd halfword elements of 'in0' and 'in1' are interleaved + * and written to 'out0' + */ +#define ILVOD_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvod_h((v8i16)in1, (v8i16)in0); \ + out1 = (RTYPE)__msa_ilvod_h((v8i16)in3, (v8i16)in2); \ +} while (0) +#define ILVOD_H2_UB(...) ILVOD_H2(v16u8, __VA_ARGS__) +#define ILVOD_H2_UH(...) ILVOD_H2(v8u16, __VA_ARGS__) +#define ILVOD_H2_SH(...) ILVOD_H2(v8i16, __VA_ARGS__) +#define ILVOD_H2_SW(...) ILVOD_H2(v4i32, __VA_ARGS__) + +/* Description : Interleave even word elements from vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Even word elements of 'in0' and 'in1' are interleaved + * and written to 'out0' + */ +#define ILVEV_W2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvev_w((v4i32)in1, (v4i32)in0); \ + out1 = (RTYPE)__msa_ilvev_w((v4i32)in3, (v4i32)in2); \ +} while (0) +#define ILVEV_W2_UB(...) ILVEV_W2(v16u8, __VA_ARGS__) +#define ILVEV_W2_SB(...) ILVEV_W2(v16i8, __VA_ARGS__) +#define ILVEV_W2_UH(...) ILVEV_W2(v8u16, __VA_ARGS__) +#define ILVEV_W2_SD(...) ILVEV_W2(v2i64, __VA_ARGS__) + +/* Description : Interleave even-odd word elements from vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Even word elements of 'in0' and 'in1' are interleaved + * and written to 'out0' + * Odd word elements of 'in2' and 'in3' are interleaved + * and written to 'out1' + */ +#define ILVEVOD_W2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvev_w((v4i32)in1, (v4i32)in0); \ + out1 = (RTYPE)__msa_ilvod_w((v4i32)in3, (v4i32)in2); \ +} while (0) +#define ILVEVOD_W2_UB(...) ILVEVOD_W2(v16u8, __VA_ARGS__) +#define ILVEVOD_W2_UH(...) ILVEVOD_W2(v8u16, __VA_ARGS__) +#define ILVEVOD_W2_SH(...) ILVEVOD_W2(v8i16, __VA_ARGS__) +#define ILVEVOD_W2_SW(...) ILVEVOD_W2(v4i32, __VA_ARGS__) + +/* Description : Interleave even-odd half-word elements from vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Even half-word elements of 'in0' and 'in1' are interleaved + * and written to 'out0' + * Odd half-word elements of 'in2' and 'in3' are interleaved + * and written to 'out1' + */ +#define ILVEVOD_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvev_h((v8i16)in1, (v8i16)in0); \ + out1 = (RTYPE)__msa_ilvod_h((v8i16)in3, (v8i16)in2); \ +} while (0) +#define ILVEVOD_H2_UB(...) ILVEVOD_H2(v16u8, __VA_ARGS__) +#define ILVEVOD_H2_UH(...) ILVEVOD_H2(v8u16, __VA_ARGS__) +#define ILVEVOD_H2_SH(...) ILVEVOD_H2(v8i16, __VA_ARGS__) +#define ILVEVOD_H2_SW(...) ILVEVOD_H2(v4i32, __VA_ARGS__) + +/* Description : Interleave even double word elements from vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Even double word elements of 'in0' and 'in1' are interleaved + * and written to 'out0' + */ +#define ILVEV_D2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvev_d((v2i64)in1, (v2i64)in0); \ + out1 = (RTYPE)__msa_ilvev_d((v2i64)in3, (v2i64)in2); \ +} while (0) +#define ILVEV_D2_UB(...) ILVEV_D2(v16u8, __VA_ARGS__) +#define ILVEV_D2_SB(...) ILVEV_D2(v16i8, __VA_ARGS__) +#define ILVEV_D2_SW(...) ILVEV_D2(v4i32, __VA_ARGS__) +#define ILVEV_D2_SD(...) ILVEV_D2(v2i64, __VA_ARGS__) + +/* Description : Interleave left half of byte elements from vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Left half of byte elements of 'in0' and 'in1' are interleaved + * and written to 'out0'. + */ +#define ILVL_B2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvl_b((v16i8)in0, (v16i8)in1); \ + out1 = (RTYPE)__msa_ilvl_b((v16i8)in2, (v16i8)in3); \ +} while (0) +#define ILVL_B2_UB(...) ILVL_B2(v16u8, __VA_ARGS__) +#define ILVL_B2_SB(...) ILVL_B2(v16i8, __VA_ARGS__) +#define ILVL_B2_UH(...) ILVL_B2(v8u16, __VA_ARGS__) +#define ILVL_B2_SH(...) ILVL_B2(v8i16, __VA_ARGS__) +#define ILVL_B2_SW(...) ILVL_B2(v4i32, __VA_ARGS__) + /* Description : Interleave right half of byte elements from vectors * Arguments : Inputs - in0, in1, in2, in3 * Outputs - out0, out1 @@ -306,10 +858,10 @@ * Details : Right half of byte elements of 'in0' and 'in1' are interleaved * and written to out0. */ -#define ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1) { \ - out0 = (RTYPE)__msa_ilvr_b((v16i8)in0, (v16i8)in1); \ - out1 = (RTYPE)__msa_ilvr_b((v16i8)in2, (v16i8)in3); \ -} +#define ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvr_b((v16i8)in0, (v16i8)in1); \ + out1 = (RTYPE)__msa_ilvr_b((v16i8)in2, (v16i8)in3); \ +} while (0) #define ILVR_B2_UB(...) ILVR_B2(v16u8, __VA_ARGS__) #define ILVR_B2_SB(...) ILVR_B2(v16i8, __VA_ARGS__) #define ILVR_B2_UH(...) ILVR_B2(v8u16, __VA_ARGS__) @@ -317,10 +869,10 @@ #define ILVR_B2_SW(...) ILVR_B2(v4i32, __VA_ARGS__) #define ILVR_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3) { \ + out0, out1, out2, out3) do { \ ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1); \ ILVR_B2(RTYPE, in4, in5, in6, in7, out2, out3); \ -} +} while (0) #define ILVR_B4_UB(...) ILVR_B4(v16u8, __VA_ARGS__) #define ILVR_B4_SB(...) ILVR_B4(v16i8, __VA_ARGS__) #define ILVR_B4_UH(...) ILVR_B4(v8u16, __VA_ARGS__) @@ -334,19 +886,19 @@ * Details : Right half of halfword elements of 'in0' and 'in1' are * interleaved and written to 'out0'. */ -#define ILVR_H2(RTYPE, in0, in1, in2, in3, out0, out1) { \ - out0 = (RTYPE)__msa_ilvr_h((v8i16)in0, (v8i16)in1); \ - out1 = (RTYPE)__msa_ilvr_h((v8i16)in2, (v8i16)in3); \ -} +#define ILVR_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvr_h((v8i16)in0, (v8i16)in1); \ + out1 = (RTYPE)__msa_ilvr_h((v8i16)in2, (v8i16)in3); \ +} while (0) #define ILVR_H2_UB(...) ILVR_H2(v16u8, __VA_ARGS__) #define ILVR_H2_SH(...) ILVR_H2(v8i16, __VA_ARGS__) #define ILVR_H2_SW(...) ILVR_H2(v4i32, __VA_ARGS__) #define ILVR_H4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3) { \ + out0, out1, out2, out3) do { \ ILVR_H2(RTYPE, in0, in1, in2, in3, out0, out1); \ ILVR_H2(RTYPE, in4, in5, in6, in7, out2, out3); \ -} +} while (0) #define ILVR_H4_UB(...) ILVR_H4(v16u8, __VA_ARGS__) #define ILVR_H4_SH(...) ILVR_H4(v8i16, __VA_ARGS__) #define ILVR_H4_SW(...) ILVR_H4(v4i32, __VA_ARGS__) @@ -358,31 +910,57 @@ * Details : Right half of double word elements of 'in0' and 'in1' are * interleaved and written to 'out0'. */ -#define ILVR_D2(RTYPE, in0, in1, in2, in3, out0, out1) { \ - out0 = (RTYPE)__msa_ilvr_d((v2i64)in0, (v2i64)in1); \ - out1 = (RTYPE)__msa_ilvr_d((v2i64)in2, (v2i64)in3); \ -} +#define ILVR_D2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvr_d((v2i64)in0, (v2i64)in1); \ + out1 = (RTYPE)__msa_ilvr_d((v2i64)in2, (v2i64)in3); \ +} while (0) #define ILVR_D2_UB(...) ILVR_D2(v16u8, __VA_ARGS__) #define ILVR_D2_SB(...) ILVR_D2(v16i8, __VA_ARGS__) #define ILVR_D2_SH(...) ILVR_D2(v8i16, __VA_ARGS__) -#define ILVRL_H2(RTYPE, in0, in1, out0, out1) { \ +#define ILVR_D4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \ + out0, out1, out2, out3) do { \ + ILVR_D2(RTYPE, in0, in1, in2, in3, out0, out1); \ + ILVR_D2(RTYPE, in4, in5, in6, in7, out2, out3); \ +} while (0) +#define ILVR_D4_SB(...) ILVR_D4(v16i8, __VA_ARGS__) +#define ILVR_D4_UB(...) ILVR_D4(v16u8, __VA_ARGS__) + +/* Description : Interleave both left and right half of input vectors + * Arguments : Inputs - in0, in1 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Right half of byte elements from 'in0' and 'in1' are + * interleaved and written to 'out0' + */ +#define ILVRL_B2(RTYPE, in0, in1, out0, out1) do { \ + out0 = (RTYPE)__msa_ilvr_b((v16i8)in0, (v16i8)in1); \ + out1 = (RTYPE)__msa_ilvl_b((v16i8)in0, (v16i8)in1); \ +} while (0) +#define ILVRL_B2_UB(...) ILVRL_B2(v16u8, __VA_ARGS__) +#define ILVRL_B2_SB(...) ILVRL_B2(v16i8, __VA_ARGS__) +#define ILVRL_B2_UH(...) ILVRL_B2(v8u16, __VA_ARGS__) +#define ILVRL_B2_SH(...) ILVRL_B2(v8i16, __VA_ARGS__) +#define ILVRL_B2_SW(...) ILVRL_B2(v4i32, __VA_ARGS__) + +#define ILVRL_H2(RTYPE, in0, in1, out0, out1) do { \ out0 = (RTYPE)__msa_ilvr_h((v8i16)in0, (v8i16)in1); \ out1 = (RTYPE)__msa_ilvl_h((v8i16)in0, (v8i16)in1); \ -} +} while (0) #define ILVRL_H2_UB(...) ILVRL_H2(v16u8, __VA_ARGS__) #define ILVRL_H2_SB(...) ILVRL_H2(v16i8, __VA_ARGS__) #define ILVRL_H2_SH(...) ILVRL_H2(v8i16, __VA_ARGS__) #define ILVRL_H2_SW(...) ILVRL_H2(v4i32, __VA_ARGS__) #define ILVRL_H2_UW(...) ILVRL_H2(v4u32, __VA_ARGS__) -#define ILVRL_W2(RTYPE, in0, in1, out0, out1) { \ +#define ILVRL_W2(RTYPE, in0, in1, out0, out1) do { \ out0 = (RTYPE)__msa_ilvr_w((v4i32)in0, (v4i32)in1); \ out1 = (RTYPE)__msa_ilvl_w((v4i32)in0, (v4i32)in1); \ -} +} while (0) #define ILVRL_W2_UB(...) ILVRL_W2(v16u8, __VA_ARGS__) #define ILVRL_W2_SH(...) ILVRL_W2(v8i16, __VA_ARGS__) #define ILVRL_W2_SW(...) ILVRL_W2(v4i32, __VA_ARGS__) +#define ILVRL_W2_UW(...) ILVRL_W2(v4u32, __VA_ARGS__) /* Description : Pack even byte elements of vector pairs * Arguments : Inputs - in0, in1, in2, in3 @@ -392,15 +970,76 @@ * 'out0' & even byte elements of 'in1' are copied to the right * half of 'out0'. */ -#define PCKEV_B2(RTYPE, in0, in1, in2, in3, out0, out1) { \ - out0 = (RTYPE)__msa_pckev_b((v16i8)in0, (v16i8)in1); \ - out1 = (RTYPE)__msa_pckev_b((v16i8)in2, (v16i8)in3); \ -} +#define PCKEV_B2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_pckev_b((v16i8)in0, (v16i8)in1); \ + out1 = (RTYPE)__msa_pckev_b((v16i8)in2, (v16i8)in3); \ +} while (0) #define PCKEV_B2_SB(...) PCKEV_B2(v16i8, __VA_ARGS__) #define PCKEV_B2_UB(...) PCKEV_B2(v16u8, __VA_ARGS__) #define PCKEV_B2_SH(...) PCKEV_B2(v8i16, __VA_ARGS__) #define PCKEV_B2_SW(...) PCKEV_B2(v4i32, __VA_ARGS__) +#define PCKEV_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \ + out0, out1, out2, out3) do { \ + PCKEV_B2(RTYPE, in0, in1, in2, in3, out0, out1); \ + PCKEV_B2(RTYPE, in4, in5, in6, in7, out2, out3); \ +} while (0) +#define PCKEV_B4_SB(...) PCKEV_B4(v16i8, __VA_ARGS__) +#define PCKEV_B4_UB(...) PCKEV_B4(v16u8, __VA_ARGS__) +#define PCKEV_B4_SH(...) PCKEV_B4(v8i16, __VA_ARGS__) +#define PCKEV_B4_SW(...) PCKEV_B4(v4i32, __VA_ARGS__) + +/* Description : Pack even halfword elements of vector pairs + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Even halfword elements of 'in0' are copied to the left half of + * 'out0' & even halfword elements of 'in1' are copied to the + * right half of 'out0'. + */ +#define PCKEV_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_pckev_h((v8i16)in0, (v8i16)in1); \ + out1 = (RTYPE)__msa_pckev_h((v8i16)in2, (v8i16)in3); \ +} while (0) +#define PCKEV_H2_UH(...) PCKEV_H2(v8u16, __VA_ARGS__) +#define PCKEV_H2_SH(...) PCKEV_H2(v8i16, __VA_ARGS__) +#define PCKEV_H2_SW(...) PCKEV_H2(v4i32, __VA_ARGS__) +#define PCKEV_H2_UW(...) PCKEV_H2(v4u32, __VA_ARGS__) + +/* Description : Pack even word elements of vector pairs + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Even word elements of 'in0' are copied to the left half of + * 'out0' & even word elements of 'in1' are copied to the + * right half of 'out0'. + */ +#define PCKEV_W2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_pckev_w((v4i32)in0, (v4i32)in1); \ + out1 = (RTYPE)__msa_pckev_w((v4i32)in2, (v4i32)in3); \ +} while (0) +#define PCKEV_W2_UH(...) PCKEV_W2(v8u16, __VA_ARGS__) +#define PCKEV_W2_SH(...) PCKEV_W2(v8i16, __VA_ARGS__) +#define PCKEV_W2_SW(...) PCKEV_W2(v4i32, __VA_ARGS__) +#define PCKEV_W2_UW(...) PCKEV_W2(v4u32, __VA_ARGS__) + +/* Description : Pack odd halfword elements of vector pairs + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Odd halfword elements of 'in0' are copied to the left half of + * 'out0' & odd halfword elements of 'in1' are copied to the + * right half of 'out0'. + */ +#define PCKOD_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_pckod_h((v8i16)in0, (v8i16)in1); \ + out1 = (RTYPE)__msa_pckod_h((v8i16)in2, (v8i16)in3); \ +} while (0) +#define PCKOD_H2_UH(...) PCKOD_H2(v8u16, __VA_ARGS__) +#define PCKOD_H2_SH(...) PCKOD_H2(v8i16, __VA_ARGS__) +#define PCKOD_H2_SW(...) PCKOD_H2(v4i32, __VA_ARGS__) +#define PCKOD_H2_UW(...) PCKOD_H2(v4u32, __VA_ARGS__) + /* Description : Arithmetic immediate shift right all elements of word vector * Arguments : Inputs - in0, in1, shift * Outputs - in place operation @@ -408,17 +1047,17 @@ * Details : Each element of vector 'in0' is right shifted by 'shift' and * the result is written in-place. 'shift' is a GP variable. */ -#define SRAI_W2(RTYPE, in0, in1, shift_val) { \ - in0 = (RTYPE)SRAI_W(in0, shift_val); \ - in1 = (RTYPE)SRAI_W(in1, shift_val); \ -} +#define SRAI_W2(RTYPE, in0, in1, shift_val) do { \ + in0 = (RTYPE)SRAI_W(in0, shift_val); \ + in1 = (RTYPE)SRAI_W(in1, shift_val); \ +} while (0) #define SRAI_W2_SW(...) SRAI_W2(v4i32, __VA_ARGS__) #define SRAI_W2_UW(...) SRAI_W2(v4u32, __VA_ARGS__) -#define SRAI_W4(RTYPE, in0, in1, in2, in3, shift_val) { \ - SRAI_W2(RTYPE, in0, in1, shift_val); \ - SRAI_W2(RTYPE, in2, in3, shift_val); \ -} +#define SRAI_W4(RTYPE, in0, in1, in2, in3, shift_val) do { \ + SRAI_W2(RTYPE, in0, in1, shift_val); \ + SRAI_W2(RTYPE, in2, in3, shift_val); \ +} while (0) #define SRAI_W4_SW(...) SRAI_W4(v4i32, __VA_ARGS__) #define SRAI_W4_UW(...) SRAI_W4(v4u32, __VA_ARGS__) @@ -429,10 +1068,10 @@ * Details : Each element of vector 'in0' is right shifted by 'shift' and * the result is written in-place. 'shift' is a GP variable. */ -#define SRAI_H2(RTYPE, in0, in1, shift_val) { \ - in0 = (RTYPE)SRAI_H(in0, shift_val); \ - in1 = (RTYPE)SRAI_H(in1, shift_val); \ -} +#define SRAI_H2(RTYPE, in0, in1, shift_val) do { \ + in0 = (RTYPE)SRAI_H(in0, shift_val); \ + in1 = (RTYPE)SRAI_H(in1, shift_val); \ +} while (0) #define SRAI_H2_SH(...) SRAI_H2(v8i16, __VA_ARGS__) #define SRAI_H2_UH(...) SRAI_H2(v8u16, __VA_ARGS__) @@ -443,48 +1082,166 @@ * Details : Each element of vector 'in0' is right shifted by 'shift' and * the result is written in-place. 'shift' is a GP variable. */ -#define SRARI_W2(RTYPE, in0, in1, shift) { \ +#define SRARI_W2(RTYPE, in0, in1, shift) do { \ in0 = (RTYPE)__msa_srari_w((v4i32)in0, shift); \ in1 = (RTYPE)__msa_srari_w((v4i32)in1, shift); \ -} +} while (0) #define SRARI_W2_SW(...) SRARI_W2(v4i32, __VA_ARGS__) -#define SRARI_W4(RTYPE, in0, in1, in2, in3, shift) { \ - SRARI_W2(RTYPE, in0, in1, shift); \ - SRARI_W2(RTYPE, in2, in3, shift); \ -} +#define SRARI_W4(RTYPE, in0, in1, in2, in3, shift) do { \ + SRARI_W2(RTYPE, in0, in1, shift); \ + SRARI_W2(RTYPE, in2, in3, shift); \ +} while (0) #define SRARI_W4_SH(...) SRARI_W4(v8i16, __VA_ARGS__) #define SRARI_W4_UW(...) SRARI_W4(v4u32, __VA_ARGS__) #define SRARI_W4_SW(...) SRARI_W4(v4i32, __VA_ARGS__) +/* Description : Shift right arithmetic rounded double words + * Arguments : Inputs - in0, in1, shift + * Outputs - in place operation + * Return Type - as per RTYPE + * Details : Each element of vector 'in0' is shifted right arithmetically by + * the number of bits in the corresponding element in the vector + * 'shift'. The last discarded bit is added to shifted value for + * rounding and the result is written in-place. + * 'shift' is a vector. + */ +#define SRAR_D2(RTYPE, in0, in1, shift) do { \ + in0 = (RTYPE)__msa_srar_d((v2i64)in0, (v2i64)shift); \ + in1 = (RTYPE)__msa_srar_d((v2i64)in1, (v2i64)shift); \ +} while (0) +#define SRAR_D2_SW(...) SRAR_D2(v4i32, __VA_ARGS__) +#define SRAR_D2_SD(...) SRAR_D2(v2i64, __VA_ARGS__) +#define SRAR_D2_UD(...) SRAR_D2(v2u64, __VA_ARGS__) + +#define SRAR_D4(RTYPE, in0, in1, in2, in3, shift) do { \ + SRAR_D2(RTYPE, in0, in1, shift); \ + SRAR_D2(RTYPE, in2, in3, shift); \ +} while (0) +#define SRAR_D4_SD(...) SRAR_D4(v2i64, __VA_ARGS__) +#define SRAR_D4_UD(...) SRAR_D4(v2u64, __VA_ARGS__) + /* Description : Addition of 2 pairs of half-word vectors * Arguments : Inputs - in0, in1, in2, in3 * Outputs - out0, out1 * Details : Each element in 'in0' is added to 'in1' and result is written * to 'out0'. */ -#define ADDVI_H2(RTYPE, in0, in1, in2, in3, out0, out1) { \ - out0 = (RTYPE)ADDVI_H(in0, in1); \ - out1 = (RTYPE)ADDVI_H(in2, in3); \ -} +#define ADDVI_H2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)ADDVI_H(in0, in1); \ + out1 = (RTYPE)ADDVI_H(in2, in3); \ +} while (0) #define ADDVI_H2_SH(...) ADDVI_H2(v8i16, __VA_ARGS__) #define ADDVI_H2_UH(...) ADDVI_H2(v8u16, __VA_ARGS__) +/* Description : Addition of 2 pairs of word vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Details : Each element in 'in0' is added to 'in1' and result is written + * to 'out0'. + */ +#define ADDVI_W2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)ADDVI_W(in0, in1); \ + out1 = (RTYPE)ADDVI_W(in2, in3); \ +} while (0) +#define ADDVI_W2_SW(...) ADDVI_W2(v4i32, __VA_ARGS__) + +/* Description : Fill 2 pairs of word vectors with GP registers + * Arguments : Inputs - in0, in1 + * Outputs - out0, out1 + * Details : GP register in0 is replicated in each word element of out0 + * GP register in1 is replicated in each word element of out1 + */ +#define FILL_W2(RTYPE, in0, in1, out0, out1) do { \ + out0 = (RTYPE)__msa_fill_w(in0); \ + out1 = (RTYPE)__msa_fill_w(in1); \ +} while (0) +#define FILL_W2_SW(...) FILL_W2(v4i32, __VA_ARGS__) + /* Description : Addition of 2 pairs of vectors * Arguments : Inputs - in0, in1, in2, in3 * Outputs - out0, out1 * Details : Each element in 'in0' is added to 'in1' and result is written * to 'out0'. */ -#define ADD2(in0, in1, in2, in3, out0, out1) { \ - out0 = in0 + in1; \ - out1 = in2 + in3; \ -} +#define ADD2(in0, in1, in2, in3, out0, out1) do { \ + out0 = in0 + in1; \ + out1 = in2 + in3; \ +} while (0) + #define ADD4(in0, in1, in2, in3, in4, in5, in6, in7, \ - out0, out1, out2, out3) { \ + out0, out1, out2, out3) do { \ ADD2(in0, in1, in2, in3, out0, out1); \ ADD2(in4, in5, in6, in7, out2, out3); \ -} +} while (0) + +/* Description : Subtraction of 2 pairs of vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Details : Each element in 'in1' is subtracted from 'in0' and result is + * written to 'out0'. + */ +#define SUB2(in0, in1, in2, in3, out0, out1) do { \ + out0 = in0 - in1; \ + out1 = in2 - in3; \ +} while (0) + +#define SUB3(in0, in1, in2, in3, in4, in5, out0, out1, out2) do { \ + out0 = in0 - in1; \ + out1 = in2 - in3; \ + out2 = in4 - in5; \ +} while (0) + +#define SUB4(in0, in1, in2, in3, in4, in5, in6, in7, \ + out0, out1, out2, out3) do { \ + out0 = in0 - in1; \ + out1 = in2 - in3; \ + out2 = in4 - in5; \ + out3 = in6 - in7; \ +} while (0) + +/* Description : Addition - Subtraction of input vectors + * Arguments : Inputs - in0, in1 + * Outputs - out0, out1 + * Details : Each element in 'in1' is added to 'in0' and result is + * written to 'out0'. + * Each element in 'in1' is subtracted from 'in0' and result is + * written to 'out1'. + */ +#define ADDSUB2(in0, in1, out0, out1) do { \ + out0 = in0 + in1; \ + out1 = in0 - in1; \ +} while (0) + +/* Description : Multiplication of pairs of vectors + * Arguments : Inputs - in0, in1, in2, in3 + * Outputs - out0, out1 + * Details : Each element from 'in0' is multiplied with elements from 'in1' + * and the result is written to 'out0' + */ +#define MUL2(in0, in1, in2, in3, out0, out1) do { \ + out0 = in0 * in1; \ + out1 = in2 * in3; \ +} while (0) + +#define MUL4(in0, in1, in2, in3, in4, in5, in6, in7, \ + out0, out1, out2, out3) do { \ + MUL2(in0, in1, in2, in3, out0, out1); \ + MUL2(in4, in5, in6, in7, out2, out3); \ +} while (0) + +/* Description : Sign extend halfword elements from right half of the vector + * Arguments : Input - in (halfword vector) + * Output - out (sign extended word vector) + * Return Type - signed word + * Details : Sign bit of halfword elements from input vector 'in' is + * extracted and interleaved with same vector 'in0' to generate + * 4 word elements keeping sign intact + */ +#define UNPCK_R_SH_SW(in, out) do { \ + const v8i16 sign_m = __msa_clti_s_h((v8i16)in, 0); \ + out = (v4i32)__msa_ilvr_h(sign_m, (v8i16)in); \ +} while (0) /* Description : Sign extend halfword elements from input vector and return * the result in pair of vectors @@ -497,29 +1254,82 @@ * Then interleaved left with same vector 'in0' to * generate 4 signed word elements in 'out1' */ -#define UNPCK_SH_SW(in, out0, out1) { \ +#define UNPCK_SH_SW(in, out0, out1) do { \ const v8i16 tmp_m = __msa_clti_s_h((v8i16)in, 0); \ ILVRL_H2_SW(tmp_m, in, out0, out1); \ -} +} while (0) /* Description : Butterfly of 4 input vectors * Arguments : Inputs - in0, in1, in2, in3 * Outputs - out0, out1, out2, out3 * Details : Butterfly operation */ -#define BUTTERFLY_4(in0, in1, in2, in3, out0, out1, out2, out3) { \ - out0 = in0 + in3; \ - out1 = in1 + in2; \ - out2 = in1 - in2; \ - out3 = in0 - in3; \ -} +#define BUTTERFLY_4(in0, in1, in2, in3, out0, out1, out2, out3) do { \ + out0 = in0 + in3; \ + out1 = in1 + in2; \ + out2 = in1 - in2; \ + out3 = in0 - in3; \ +} while (0) + +/* Description : Transpose 16x4 block into 4x16 with byte elements in vectors + * Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, + * in8, in9, in10, in11, in12, in13, in14, in15 + * Outputs - out0, out1, out2, out3 + * Return Type - unsigned byte + */ +#define TRANSPOSE16x4_UB_UB(in0, in1, in2, in3, in4, in5, in6, in7, \ + in8, in9, in10, in11, in12, in13, in14, in15, \ + out0, out1, out2, out3) do { \ + v2i64 tmp0_m, tmp1_m, tmp2_m, tmp3_m, tmp4_m, tmp5_m; \ + ILVEV_W2_SD(in0, in4, in8, in12, tmp2_m, tmp3_m); \ + ILVEV_W2_SD(in1, in5, in9, in13, tmp0_m, tmp1_m); \ + ILVEV_D2_UB(tmp2_m, tmp3_m, tmp0_m, tmp1_m, out1, out3); \ + ILVEV_W2_SD(in2, in6, in10, in14, tmp4_m, tmp5_m); \ + ILVEV_W2_SD(in3, in7, in11, in15, tmp0_m, tmp1_m); \ + ILVEV_D2_SD(tmp4_m, tmp5_m, tmp0_m, tmp1_m, tmp2_m, tmp3_m); \ + ILVEV_B2_SD(out1, out3, tmp2_m, tmp3_m, tmp0_m, tmp1_m); \ + ILVEVOD_H2_UB(tmp0_m, tmp1_m, tmp0_m, tmp1_m, out0, out2); \ + ILVOD_B2_SD(out1, out3, tmp2_m, tmp3_m, tmp0_m, tmp1_m); \ + ILVEVOD_H2_UB(tmp0_m, tmp1_m, tmp0_m, tmp1_m, out1, out3); \ +} while (0) + +/* Description : Transpose 16x8 block into 8x16 with byte elements in vectors + * Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, + * in8, in9, in10, in11, in12, in13, in14, in15 + * Outputs - out0, out1, out2, out3, out4, out5, out6, out7 + * Return Type - unsigned byte + */ +#define TRANSPOSE16x8_UB_UB(in0, in1, in2, in3, in4, in5, in6, in7, \ + in8, in9, in10, in11, in12, in13, in14, in15, \ + out0, out1, out2, out3, out4, out5, \ + out6, out7) do { \ + v8i16 tmp0_m, tmp1_m, tmp4_m, tmp5_m, tmp6_m, tmp7_m; \ + v4i32 tmp2_m, tmp3_m; \ + ILVEV_D2_UB(in0, in8, in1, in9, out7, out6); \ + ILVEV_D2_UB(in2, in10, in3, in11, out5, out4); \ + ILVEV_D2_UB(in4, in12, in5, in13, out3, out2); \ + ILVEV_D2_UB(in6, in14, in7, in15, out1, out0); \ + ILVEV_B2_SH(out7, out6, out5, out4, tmp0_m, tmp1_m); \ + ILVOD_B2_SH(out7, out6, out5, out4, tmp4_m, tmp5_m); \ + ILVEV_B2_UB(out3, out2, out1, out0, out5, out7); \ + ILVOD_B2_SH(out3, out2, out1, out0, tmp6_m, tmp7_m); \ + ILVEV_H2_SW(tmp0_m, tmp1_m, out5, out7, tmp2_m, tmp3_m); \ + ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out0, out4); \ + ILVOD_H2_SW(tmp0_m, tmp1_m, out5, out7, tmp2_m, tmp3_m); \ + ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out2, out6); \ + ILVEV_H2_SW(tmp4_m, tmp5_m, tmp6_m, tmp7_m, tmp2_m, tmp3_m); \ + ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out1, out5); \ + ILVOD_H2_SW(tmp4_m, tmp5_m, tmp6_m, tmp7_m, tmp2_m, tmp3_m); \ + ILVEVOD_W2_UB(tmp2_m, tmp3_m, tmp2_m, tmp3_m, out3, out7); \ +} while (0) /* Description : Transpose 4x4 block with word elements in vectors * Arguments : Inputs - in0, in1, in2, in3 * Outputs - out0, out1, out2, out3 * Return Type - as per RTYPE */ -#define TRANSPOSE4x4_W(RTYPE, in0, in1, in2, in3, out0, out1, out2, out3) { \ +#define TRANSPOSE4x4_W(RTYPE, in0, in1, in2, in3, \ + out0, out1, out2, out3) do { \ v4i32 s0_m, s1_m, s2_m, s3_m; \ ILVRL_W2_SW(in1, in0, s0_m, s1_m); \ ILVRL_W2_SW(in3, in2, s2_m, s3_m); \ @@ -527,7 +1337,7 @@ out1 = (RTYPE)__msa_ilvl_d((v2i64)s2_m, (v2i64)s0_m); \ out2 = (RTYPE)__msa_ilvr_d((v2i64)s3_m, (v2i64)s1_m); \ out3 = (RTYPE)__msa_ilvl_d((v2i64)s3_m, (v2i64)s1_m); \ -} +} while (0) #define TRANSPOSE4x4_SW_SW(...) TRANSPOSE4x4_W(v4i32, __VA_ARGS__) /* Description : Add block 4x4 @@ -535,7 +1345,7 @@ * Details : Least significant 4 bytes from each input vector are added to * the destination bytes, clipped between 0-255 and stored. */ -#define ADDBLK_ST4x4_UB(in0, in1, in2, in3, pdst, stride) { \ +#define ADDBLK_ST4x4_UB(in0, in1, in2, in3, pdst, stride) do { \ uint32_t src0_m, src1_m, src2_m, src3_m; \ v8i16 inp0_m, inp1_m, res0_m, res1_m; \ v16i8 dst0_m = { 0 }; \ @@ -550,6 +1360,31 @@ CLIP_SH2_0_255(res0_m, res1_m); \ PCKEV_B2_SB(res0_m, res0_m, res1_m, res1_m, dst0_m, dst1_m); \ ST4x4_UB(dst0_m, dst1_m, 0, 1, 0, 1, pdst, stride); \ -} +} while (0) + +/* Description : Pack even byte elements, extract 0 & 2 index words from pair + * of results and store 4 words in destination memory as per + * stride + * Arguments : Inputs - in0, in1, in2, in3, pdst, stride + */ +#define PCKEV_ST4x4_UB(in0, in1, in2, in3, pdst, stride) do { \ + v16i8 tmp0_m, tmp1_m; \ + PCKEV_B2_SB(in1, in0, in3, in2, tmp0_m, tmp1_m); \ + ST4x4_UB(tmp0_m, tmp1_m, 0, 2, 0, 2, pdst, stride); \ +} while (0) + +/* Description : average with rounding (in0 + in1 + 1) / 2. + * Arguments : Inputs - in0, in1, in2, in3, + * Outputs - out0, out1 + * Return Type - as per RTYPE + * Details : Each unsigned byte element from 'in0' vector is added with + * each unsigned byte element from 'in1' vector. Then the average + * with rounding is calculated and written to 'out0' + */ +#define AVER_UB2(RTYPE, in0, in1, in2, in3, out0, out1) do { \ + out0 = (RTYPE)__msa_aver_u_b((v16u8)in0, (v16u8)in1); \ + out1 = (RTYPE)__msa_aver_u_b((v16u8)in2, (v16u8)in3); \ +} while (0) +#define AVER_UB2_UB(...) AVER_UB2(v16u8, __VA_ARGS__) #endif /* WEBP_DSP_MSA_MACRO_H_ */ diff --git a/thirdparty/libwebp/dsp/neon.h b/thirdparty/libwebp/dsp/neon.h index 0a06266848..3b548a6855 100644 --- a/thirdparty/libwebp/dsp/neon.h +++ b/thirdparty/libwebp/dsp/neon.h @@ -79,4 +79,22 @@ static WEBP_INLINE int32x4x4_t Transpose4x4(const int32x4x4_t rows) { } } +#if 0 // Useful debug macro. +#include <stdio.h> +#define PRINT_REG(REG, SIZE) do { \ + int i; \ + printf("%s \t[%d]: 0x", #REG, SIZE); \ + if (SIZE == 8) { \ + uint8_t _tmp[8]; \ + vst1_u8(_tmp, (REG)); \ + for (i = 0; i < 8; ++i) printf("%.2x ", _tmp[i]); \ + } else if (SIZE == 16) { \ + uint16_t _tmp[4]; \ + vst1_u16(_tmp, (REG)); \ + for (i = 0; i < 4; ++i) printf("%.4x ", _tmp[i]); \ + } \ + printf("\n"); \ +} while (0) +#endif + #endif // WEBP_DSP_NEON_H_ diff --git a/thirdparty/libwebp/dsp/rescaler.c b/thirdparty/libwebp/dsp/rescaler.c index f5b07756cf..0f54502352 100644 --- a/thirdparty/libwebp/dsp/rescaler.c +++ b/thirdparty/libwebp/dsp/rescaler.c @@ -14,7 +14,7 @@ #include <assert.h> #include "./dsp.h" -#include "../utils/rescaler.h" +#include "../utils/rescaler_utils.h" //------------------------------------------------------------------------------ // Implementations of critical functions ImportRow / ExportRow @@ -199,6 +199,7 @@ WebPRescalerExportRowFunc WebPRescalerExportRowShrink; extern void WebPRescalerDspInitSSE2(void); extern void WebPRescalerDspInitMIPS32(void); extern void WebPRescalerDspInitMIPSdspR2(void); +extern void WebPRescalerDspInitMSA(void); extern void WebPRescalerDspInitNEON(void); static volatile VP8CPUInfo rescaler_last_cpuinfo_used = @@ -233,6 +234,11 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInit(void) { WebPRescalerDspInitMIPSdspR2(); } #endif +#if defined(WEBP_USE_MSA) + if (VP8GetCPUInfo(kMSA)) { + WebPRescalerDspInitMSA(); + } +#endif } rescaler_last_cpuinfo_used = VP8GetCPUInfo; } diff --git a/thirdparty/libwebp/dsp/rescaler_mips32.c b/thirdparty/libwebp/dsp/rescaler_mips32.c index ddaa391336..e09ad5d19f 100644 --- a/thirdparty/libwebp/dsp/rescaler_mips32.c +++ b/thirdparty/libwebp/dsp/rescaler_mips32.c @@ -16,7 +16,7 @@ #if defined(WEBP_USE_MIPS32) #include <assert.h> -#include "../utils/rescaler.h" +#include "../utils/rescaler_utils.h" //------------------------------------------------------------------------------ // Row import diff --git a/thirdparty/libwebp/dsp/rescaler_mips_dsp_r2.c b/thirdparty/libwebp/dsp/rescaler_mips_dsp_r2.c index b457d0a30a..2308d64544 100644 --- a/thirdparty/libwebp/dsp/rescaler_mips_dsp_r2.c +++ b/thirdparty/libwebp/dsp/rescaler_mips_dsp_r2.c @@ -16,7 +16,7 @@ #if defined(WEBP_USE_MIPS_DSP_R2) #include <assert.h> -#include "../utils/rescaler.h" +#include "../utils/rescaler_utils.h" #define ROUNDER (WEBP_RESCALER_ONE >> 1) #define MULT_FIX(x, y) (((uint64_t)(x) * (y) + ROUNDER) >> WEBP_RESCALER_RFIX) diff --git a/thirdparty/libwebp/dsp/rescaler_msa.c b/thirdparty/libwebp/dsp/rescaler_msa.c new file mode 100644 index 0000000000..2c10e55d8c --- /dev/null +++ b/thirdparty/libwebp/dsp/rescaler_msa.c @@ -0,0 +1,444 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// MSA version of rescaling functions +// +// Author: Prashant Patil (prashant.patil@imgtec.com) + +#include "./dsp.h" + +#if defined(WEBP_USE_MSA) + +#include <assert.h> + +#include "../utils/rescaler_utils.h" +#include "./msa_macro.h" + +#define ROUNDER (WEBP_RESCALER_ONE >> 1) +#define MULT_FIX(x, y) (((uint64_t)(x) * (y) + ROUNDER) >> WEBP_RESCALER_RFIX) + +#define CALC_MULT_FIX_16(in0, in1, in2, in3, scale, shift, dst) do { \ + v4u32 tmp0, tmp1, tmp2, tmp3; \ + v16u8 t0, t1, t2, t3, t4, t5; \ + v2u64 out0, out1, out2, out3; \ + ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ + ILVRL_W2_UW(zero, in1, tmp2, tmp3); \ + DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ + DOTP_UW2_UD(tmp2, tmp3, scale, scale, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + PCKEV_B2_UB(out1, out0, out3, out2, t0, t1); \ + ILVRL_W2_UW(zero, in2, tmp0, tmp1); \ + ILVRL_W2_UW(zero, in3, tmp2, tmp3); \ + DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ + DOTP_UW2_UD(tmp2, tmp3, scale, scale, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + PCKEV_B2_UB(out1, out0, out3, out2, t2, t3); \ + PCKEV_B2_UB(t1, t0, t3, t2, t4, t5); \ + dst = (v16u8)__msa_pckev_b((v16i8)t5, (v16i8)t4); \ +} while (0) + +#define CALC_MULT_FIX_4(in0, scale, shift, dst) do { \ + v4u32 tmp0, tmp1; \ + v16i8 t0, t1; \ + v2u64 out0, out1; \ + ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ + DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ + SRAR_D2_UD(out0, out1, shift); \ + t0 = __msa_pckev_b((v16i8)out1, (v16i8)out0); \ + t1 = __msa_pckev_b(t0, t0); \ + t0 = __msa_pckev_b(t1, t1); \ + dst = __msa_copy_s_w((v4i32)t0, 0); \ +} while (0) + +#define CALC_MULT_FIX1_16(in0, in1, in2, in3, fyscale, shift, \ + dst0, dst1, dst2, dst3) do { \ + v4u32 tmp0, tmp1, tmp2, tmp3; \ + v2u64 out0, out1, out2, out3; \ + ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ + ILVRL_W2_UW(zero, in1, tmp2, tmp3); \ + DOTP_UW2_UD(tmp0, tmp1, fyscale, fyscale, out0, out1); \ + DOTP_UW2_UD(tmp2, tmp3, fyscale, fyscale, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + PCKEV_W2_UW(out1, out0, out3, out2, dst0, dst1); \ + ILVRL_W2_UW(zero, in2, tmp0, tmp1); \ + ILVRL_W2_UW(zero, in3, tmp2, tmp3); \ + DOTP_UW2_UD(tmp0, tmp1, fyscale, fyscale, out0, out1); \ + DOTP_UW2_UD(tmp2, tmp3, fyscale, fyscale, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + PCKEV_W2_UW(out1, out0, out3, out2, dst2, dst3); \ +} while (0) + +#define CALC_MULT_FIX1_4(in0, scale, shift, dst) do { \ + v4u32 tmp0, tmp1; \ + v2u64 out0, out1; \ + ILVRL_W2_UW(zero, in0, tmp0, tmp1); \ + DOTP_UW2_UD(tmp0, tmp1, scale, scale, out0, out1); \ + SRAR_D2_UD(out0, out1, shift); \ + dst = (v4u32)__msa_pckev_w((v4i32)out1, (v4i32)out0); \ +} while (0) + +#define CALC_MULT_FIX2_16(in0, in1, in2, in3, mult, scale, shift, \ + dst0, dst1) do { \ + v4u32 tmp0, tmp1, tmp2, tmp3; \ + v2u64 out0, out1, out2, out3; \ + ILVRL_W2_UW(in0, in2, tmp0, tmp1); \ + ILVRL_W2_UW(in1, in3, tmp2, tmp3); \ + DOTP_UW2_UD(tmp0, tmp1, mult, mult, out0, out1); \ + DOTP_UW2_UD(tmp2, tmp3, mult, mult, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + DOTP_UW2_UD(out0, out1, scale, scale, out0, out1); \ + DOTP_UW2_UD(out2, out3, scale, scale, out2, out3); \ + SRAR_D4_UD(out0, out1, out2, out3, shift); \ + PCKEV_B2_UB(out1, out0, out3, out2, dst0, dst1); \ +} while (0) + +#define CALC_MULT_FIX2_4(in0, in1, mult, scale, shift, dst) do { \ + v4u32 tmp0, tmp1; \ + v2u64 out0, out1; \ + v16i8 t0, t1; \ + ILVRL_W2_UW(in0, in1, tmp0, tmp1); \ + DOTP_UW2_UD(tmp0, tmp1, mult, mult, out0, out1); \ + SRAR_D2_UD(out0, out1, shift); \ + DOTP_UW2_UD(out0, out1, scale, scale, out0, out1); \ + SRAR_D2_UD(out0, out1, shift); \ + t0 = __msa_pckev_b((v16i8)out1, (v16i8)out0); \ + t1 = __msa_pckev_b(t0, t0); \ + t0 = __msa_pckev_b(t1, t1); \ + dst = __msa_copy_s_w((v4i32)t0, 0); \ +} while (0) + +static WEBP_INLINE void ExportRowExpand_0(const uint32_t* frow, uint8_t* dst, + int length, + WebPRescaler* const wrk) { + const v4u32 scale = (v4u32)__msa_fill_w(wrk->fy_scale); + const v4u32 shift = (v4u32)__msa_fill_w(WEBP_RESCALER_RFIX); + const v4i32 zero = { 0 }; + + while (length >= 16) { + v4u32 src0, src1, src2, src3; + v16u8 out; + LD_UW4(frow, 4, src0, src1, src2, src3); + CALC_MULT_FIX_16(src0, src1, src2, src3, scale, shift, out); + ST_UB(out, dst); + length -= 16; + frow += 16; + dst += 16; + } + if (length > 0) { + int x_out; + if (length >= 12) { + uint32_t val0_m, val1_m, val2_m; + v4u32 src0, src1, src2; + LD_UW3(frow, 4, src0, src1, src2); + CALC_MULT_FIX_4(src0, scale, shift, val0_m); + CALC_MULT_FIX_4(src1, scale, shift, val1_m); + CALC_MULT_FIX_4(src2, scale, shift, val2_m); + SW3(val0_m, val1_m, val2_m, dst, 4); + length -= 12; + frow += 12; + dst += 12; + } else if (length >= 8) { + uint32_t val0_m, val1_m; + v4u32 src0, src1; + LD_UW2(frow, 4, src0, src1); + CALC_MULT_FIX_4(src0, scale, shift, val0_m); + CALC_MULT_FIX_4(src1, scale, shift, val1_m); + SW2(val0_m, val1_m, dst, 4); + length -= 8; + frow += 8; + dst += 8; + } else if (length >= 4) { + uint32_t val0_m; + const v4u32 src0 = LD_UW(frow); + CALC_MULT_FIX_4(src0, scale, shift, val0_m); + SW(val0_m, dst); + length -= 4; + frow += 4; + dst += 4; + } + for (x_out = 0; x_out < length; ++x_out) { + const uint32_t J = frow[x_out]; + const int v = (int)MULT_FIX(J, wrk->fy_scale); + assert(v >= 0 && v <= 255); + dst[x_out] = v; + } + } +} + +static WEBP_INLINE void ExportRowExpand_1(const uint32_t* frow, uint32_t* irow, + uint8_t* dst, int length, + WebPRescaler* const wrk) { + const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub); + const uint32_t A = (uint32_t)(WEBP_RESCALER_ONE - B); + const v4i32 B1 = __msa_fill_w(B); + const v4i32 A1 = __msa_fill_w(A); + const v4i32 AB = __msa_ilvr_w(A1, B1); + const v4u32 scale = (v4u32)__msa_fill_w(wrk->fy_scale); + const v4u32 shift = (v4u32)__msa_fill_w(WEBP_RESCALER_RFIX); + + while (length >= 16) { + v4u32 frow0, frow1, frow2, frow3, irow0, irow1, irow2, irow3; + v16u8 t0, t1, t2, t3, t4, t5; + LD_UW4(frow, 4, frow0, frow1, frow2, frow3); + LD_UW4(irow, 4, irow0, irow1, irow2, irow3); + CALC_MULT_FIX2_16(frow0, frow1, irow0, irow1, AB, scale, shift, t0, t1); + CALC_MULT_FIX2_16(frow2, frow3, irow2, irow3, AB, scale, shift, t2, t3); + PCKEV_B2_UB(t1, t0, t3, t2, t4, t5); + t0 = (v16u8)__msa_pckev_b((v16i8)t5, (v16i8)t4); + ST_UB(t0, dst); + frow += 16; + irow += 16; + dst += 16; + length -= 16; + } + if (length > 0) { + int x_out; + if (length >= 12) { + uint32_t val0_m, val1_m, val2_m; + v4u32 frow0, frow1, frow2, irow0, irow1, irow2; + LD_UW3(frow, 4, frow0, frow1, frow2); + LD_UW3(irow, 4, irow0, irow1, irow2); + CALC_MULT_FIX2_4(frow0, irow0, AB, scale, shift, val0_m); + CALC_MULT_FIX2_4(frow1, irow1, AB, scale, shift, val1_m); + CALC_MULT_FIX2_4(frow2, irow2, AB, scale, shift, val2_m); + SW3(val0_m, val1_m, val2_m, dst, 4); + frow += 12; + irow += 12; + dst += 12; + length -= 12; + } else if (length >= 8) { + uint32_t val0_m, val1_m; + v4u32 frow0, frow1, irow0, irow1; + LD_UW2(frow, 4, frow0, frow1); + LD_UW2(irow, 4, irow0, irow1); + CALC_MULT_FIX2_4(frow0, irow0, AB, scale, shift, val0_m); + CALC_MULT_FIX2_4(frow1, irow1, AB, scale, shift, val1_m); + SW2(val0_m, val1_m, dst, 4); + frow += 4; + irow += 4; + dst += 4; + length -= 4; + } else if (length >= 4) { + uint32_t val0_m; + const v4u32 frow0 = LD_UW(frow + 0); + const v4u32 irow0 = LD_UW(irow + 0); + CALC_MULT_FIX2_4(frow0, irow0, AB, scale, shift, val0_m); + SW(val0_m, dst); + frow += 4; + irow += 4; + dst += 4; + length -= 4; + } + for (x_out = 0; x_out < length; ++x_out) { + const uint64_t I = (uint64_t)A * frow[x_out] + + (uint64_t)B * irow[x_out]; + const uint32_t J = (uint32_t)((I + ROUNDER) >> WEBP_RESCALER_RFIX); + const int v = (int)MULT_FIX(J, wrk->fy_scale); + assert(v >= 0 && v <= 255); + dst[x_out] = v; + } + } +} + +static void RescalerExportRowExpand(WebPRescaler* const wrk) { + uint8_t* dst = wrk->dst; + rescaler_t* irow = wrk->irow; + const int x_out_max = wrk->dst_width * wrk->num_channels; + const rescaler_t* frow = wrk->frow; + assert(!WebPRescalerOutputDone(wrk)); + assert(wrk->y_accum <= 0); + assert(wrk->y_expand); + assert(wrk->y_sub != 0); + if (wrk->y_accum == 0) { + ExportRowExpand_0(frow, dst, x_out_max, wrk); + } else { + ExportRowExpand_1(frow, irow, dst, x_out_max, wrk); + } +} + +static WEBP_INLINE void ExportRowShrink_0(const uint32_t* frow, uint32_t* irow, + uint8_t* dst, int length, + const uint32_t yscale, + WebPRescaler* const wrk) { + const v4u32 y_scale = (v4u32)__msa_fill_w(yscale); + const v4u32 fxyscale = (v4u32)__msa_fill_w(wrk->fxy_scale); + const v4u32 shiftval = (v4u32)__msa_fill_w(WEBP_RESCALER_RFIX); + const v4i32 zero = { 0 }; + + while (length >= 16) { + v4u32 src0, src1, src2, src3, frac0, frac1, frac2, frac3; + v16u8 out; + LD_UW4(frow, 4, src0, src1, src2, src3); + CALC_MULT_FIX1_16(src0, src1, src2, src3, y_scale, shiftval, + frac0, frac1, frac2, frac3); + LD_UW4(irow, 4, src0, src1, src2, src3); + SUB4(src0, frac0, src1, frac1, src2, frac2, src3, frac3, + src0, src1, src2, src3); + CALC_MULT_FIX_16(src0, src1, src2, src3, fxyscale, shiftval, out); + ST_UB(out, dst); + ST_UW4(frac0, frac1, frac2, frac3, irow, 4); + frow += 16; + irow += 16; + dst += 16; + length -= 16; + } + if (length > 0) { + int x_out; + if (length >= 12) { + uint32_t val0_m, val1_m, val2_m; + v4u32 src0, src1, src2, frac0, frac1, frac2; + LD_UW3(frow, 4, src0, src1, src2); + CALC_MULT_FIX1_4(src0, y_scale, shiftval, frac0); + CALC_MULT_FIX1_4(src1, y_scale, shiftval, frac1); + CALC_MULT_FIX1_4(src2, y_scale, shiftval, frac2); + LD_UW3(irow, 4, src0, src1, src2); + SUB3(src0, frac0, src1, frac1, src2, frac2, src0, src1, src2); + CALC_MULT_FIX_4(src0, fxyscale, shiftval, val0_m); + CALC_MULT_FIX_4(src1, fxyscale, shiftval, val1_m); + CALC_MULT_FIX_4(src2, fxyscale, shiftval, val2_m); + SW3(val0_m, val1_m, val2_m, dst, 4); + ST_UW3(frac0, frac1, frac2, irow, 4); + frow += 12; + irow += 12; + dst += 12; + length -= 12; + } else if (length >= 8) { + uint32_t val0_m, val1_m; + v4u32 src0, src1, frac0, frac1; + LD_UW2(frow, 4, src0, src1); + CALC_MULT_FIX1_4(src0, y_scale, shiftval, frac0); + CALC_MULT_FIX1_4(src1, y_scale, shiftval, frac1); + LD_UW2(irow, 4, src0, src1); + SUB2(src0, frac0, src1, frac1, src0, src1); + CALC_MULT_FIX_4(src0, fxyscale, shiftval, val0_m); + CALC_MULT_FIX_4(src1, fxyscale, shiftval, val1_m); + SW2(val0_m, val1_m, dst, 4); + ST_UW2(frac0, frac1, irow, 4); + frow += 8; + irow += 8; + dst += 8; + length -= 8; + } else if (length >= 4) { + uint32_t val0_m; + v4u32 frac0; + v4u32 src0 = LD_UW(frow); + CALC_MULT_FIX1_4(src0, y_scale, shiftval, frac0); + src0 = LD_UW(irow); + src0 = src0 - frac0; + CALC_MULT_FIX_4(src0, fxyscale, shiftval, val0_m); + SW(val0_m, dst); + ST_UW(frac0, irow); + frow += 4; + irow += 4; + dst += 4; + length -= 4; + } + for (x_out = 0; x_out < length; ++x_out) { + const uint32_t frac = (uint32_t)MULT_FIX(frow[x_out], yscale); + const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale); + assert(v >= 0 && v <= 255); + dst[x_out] = v; + irow[x_out] = frac; + } + } +} + +static WEBP_INLINE void ExportRowShrink_1(uint32_t* irow, uint8_t* dst, + int length, + WebPRescaler* const wrk) { + const v4u32 scale = (v4u32)__msa_fill_w(wrk->fxy_scale); + const v4u32 shift = (v4u32)__msa_fill_w(WEBP_RESCALER_RFIX); + const v4i32 zero = { 0 }; + + while (length >= 16) { + v4u32 src0, src1, src2, src3; + v16u8 dst0; + LD_UW4(irow, 4, src0, src1, src2, src3); + CALC_MULT_FIX_16(src0, src1, src2, src3, scale, shift, dst0); + ST_UB(dst0, dst); + ST_SW4(zero, zero, zero, zero, irow, 4); + length -= 16; + irow += 16; + dst += 16; + } + if (length > 0) { + int x_out; + if (length >= 12) { + uint32_t val0_m, val1_m, val2_m; + v4u32 src0, src1, src2; + LD_UW3(irow, 4, src0, src1, src2); + CALC_MULT_FIX_4(src0, scale, shift, val0_m); + CALC_MULT_FIX_4(src1, scale, shift, val1_m); + CALC_MULT_FIX_4(src2, scale, shift, val2_m); + SW3(val0_m, val1_m, val2_m, dst, 4); + ST_SW3(zero, zero, zero, irow, 4); + length -= 12; + irow += 12; + dst += 12; + } else if (length >= 8) { + uint32_t val0_m, val1_m; + v4u32 src0, src1; + LD_UW2(irow, 4, src0, src1); + CALC_MULT_FIX_4(src0, scale, shift, val0_m); + CALC_MULT_FIX_4(src1, scale, shift, val1_m); + SW2(val0_m, val1_m, dst, 4); + ST_SW2(zero, zero, irow, 4); + length -= 8; + irow += 8; + dst += 8; + } else if (length >= 4) { + uint32_t val0_m; + const v4u32 src0 = LD_UW(irow + 0); + CALC_MULT_FIX_4(src0, scale, shift, val0_m); + SW(val0_m, dst); + ST_SW(zero, irow); + length -= 4; + irow += 4; + dst += 4; + } + for (x_out = 0; x_out < length; ++x_out) { + const int v = (int)MULT_FIX(irow[x_out], wrk->fxy_scale); + assert(v >= 0 && v <= 255); + dst[x_out] = v; + irow[x_out] = 0; + } + } +} + +static void RescalerExportRowShrink(WebPRescaler* const wrk) { + uint8_t* dst = wrk->dst; + rescaler_t* irow = wrk->irow; + const int x_out_max = wrk->dst_width * wrk->num_channels; + const rescaler_t* frow = wrk->frow; + const uint32_t yscale = wrk->fy_scale * (-wrk->y_accum); + assert(!WebPRescalerOutputDone(wrk)); + assert(wrk->y_accum <= 0); + assert(!wrk->y_expand); + if (yscale) { + ExportRowShrink_0(frow, irow, dst, x_out_max, yscale, wrk); + } else { + ExportRowShrink_1(irow, dst, x_out_max, wrk); + } +} + +//------------------------------------------------------------------------------ +// Entry point + +extern void WebPRescalerDspInitMSA(void); + +WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitMSA(void) { + WebPRescalerExportRowExpand = RescalerExportRowExpand; + WebPRescalerExportRowShrink = RescalerExportRowShrink; +} + +#else // !WEBP_USE_MSA + +WEBP_DSP_INIT_STUB(WebPRescalerDspInitMSA) + +#endif // WEBP_USE_MSA diff --git a/thirdparty/libwebp/dsp/rescaler_neon.c b/thirdparty/libwebp/dsp/rescaler_neon.c index 16fd450ea3..b2dd8f30cc 100644 --- a/thirdparty/libwebp/dsp/rescaler_neon.c +++ b/thirdparty/libwebp/dsp/rescaler_neon.c @@ -18,7 +18,7 @@ #include <arm_neon.h> #include <assert.h> #include "./neon.h" -#include "../utils/rescaler.h" +#include "../utils/rescaler_utils.h" #define ROUNDER (WEBP_RESCALER_ONE >> 1) #define MULT_FIX_C(x, y) (((uint64_t)(x) * (y) + ROUNDER) >> WEBP_RESCALER_RFIX) diff --git a/thirdparty/libwebp/dsp/rescaler_sse2.c b/thirdparty/libwebp/dsp/rescaler_sse2.c index 5b9702817c..8271c22e05 100644 --- a/thirdparty/libwebp/dsp/rescaler_sse2.c +++ b/thirdparty/libwebp/dsp/rescaler_sse2.c @@ -17,7 +17,7 @@ #include <emmintrin.h> #include <assert.h> -#include "../utils/rescaler.h" +#include "../utils/rescaler_utils.h" #include "../utils/utils.h" //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/dsp/upsampling.c b/thirdparty/libwebp/dsp/upsampling.c index 651274fcee..265e722c10 100644 --- a/thirdparty/libwebp/dsp/upsampling.c +++ b/thirdparty/libwebp/dsp/upsampling.c @@ -215,6 +215,7 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitYUV444Converters(void) { extern void WebPInitUpsamplersSSE2(void); extern void WebPInitUpsamplersNEON(void); extern void WebPInitUpsamplersMIPSdspR2(void); +extern void WebPInitUpsamplersMSA(void); static volatile VP8CPUInfo upsampling_last_cpuinfo_used2 = (VP8CPUInfo)&upsampling_last_cpuinfo_used2; @@ -252,6 +253,11 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplers(void) { WebPInitUpsamplersMIPSdspR2(); } #endif +#if defined(WEBP_USE_MSA) + if (VP8GetCPUInfo(kMSA)) { + WebPInitUpsamplersMSA(); + } +#endif } #endif // FANCY_UPSAMPLING upsampling_last_cpuinfo_used2 = VP8GetCPUInfo; diff --git a/thirdparty/libwebp/dsp/upsampling_msa.c b/thirdparty/libwebp/dsp/upsampling_msa.c new file mode 100644 index 0000000000..f24926fa94 --- /dev/null +++ b/thirdparty/libwebp/dsp/upsampling_msa.c @@ -0,0 +1,678 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// MSA version of YUV to RGB upsampling functions. +// +// Author: Prashant Patil (prashant.patil@imgtec.com) + +#include <string.h> +#include "./dsp.h" + +#if defined(WEBP_USE_MSA) + +#include "./msa_macro.h" +#include "./yuv.h" + +#ifdef FANCY_UPSAMPLING + +#define ILVR_UW2(in, out0, out1) do { \ + const v8i16 t0 = (v8i16)__msa_ilvr_b((v16i8)zero, (v16i8)in); \ + out0 = (v4u32)__msa_ilvr_h((v8i16)zero, t0); \ + out1 = (v4u32)__msa_ilvl_h((v8i16)zero, t0); \ +} while (0) + +#define ILVRL_UW4(in, out0, out1, out2, out3) do { \ + v16u8 t0, t1; \ + ILVRL_B2_UB(zero, in, t0, t1); \ + ILVRL_H2_UW(zero, t0, out0, out1); \ + ILVRL_H2_UW(zero, t1, out2, out3); \ +} while (0) + +#define MULTHI_16(in0, in1, in2, in3, cnst, out0, out1) do { \ + const v4i32 const0 = (v4i32)__msa_fill_w(cnst * 256); \ + v4u32 temp0, temp1, temp2, temp3; \ + MUL4(in0, const0, in1, const0, in2, const0, in3, const0, \ + temp0, temp1, temp2, temp3); \ + PCKOD_H2_UH(temp1, temp0, temp3, temp2, out0, out1); \ +} while (0) + +#define MULTHI_8(in0, in1, cnst, out0) do { \ + const v4i32 const0 = (v4i32)__msa_fill_w(cnst * 256); \ + v4u32 temp0, temp1; \ + MUL2(in0, const0, in1, const0, temp0, temp1); \ + out0 = (v8u16)__msa_pckod_h((v8i16)temp1, (v8i16)temp0); \ +} while (0) + +#define CALC_R16(y0, y1, v0, v1, dst) do { \ + const v8i16 const_a = (v8i16)__msa_fill_h(14234); \ + const v8i16 a0 = __msa_adds_s_h((v8i16)y0, (v8i16)v0); \ + const v8i16 a1 = __msa_adds_s_h((v8i16)y1, (v8i16)v1); \ + v8i16 b0 = __msa_subs_s_h(a0, const_a); \ + v8i16 b1 = __msa_subs_s_h(a1, const_a); \ + SRAI_H2_SH(b0, b1, 6); \ + CLIP_SH2_0_255(b0, b1); \ + dst = (v16u8)__msa_pckev_b((v16i8)b1, (v16i8)b0); \ +} while (0) + +#define CALC_R8(y0, v0, dst) do { \ + const v8i16 const_a = (v8i16)__msa_fill_h(14234); \ + const v8i16 a0 = __msa_adds_s_h((v8i16)y0, (v8i16)v0); \ + v8i16 b0 = __msa_subs_s_h(a0, const_a); \ + b0 = SRAI_H(b0, 6); \ + CLIP_SH_0_255(b0); \ + dst = (v16u8)__msa_pckev_b((v16i8)b0, (v16i8)b0); \ +} while (0) + +#define CALC_G16(y0, y1, u0, u1, v0, v1, dst) do { \ + const v8i16 const_a = (v8i16)__msa_fill_h(8708); \ + v8i16 a0 = __msa_subs_s_h((v8i16)y0, (v8i16)u0); \ + v8i16 a1 = __msa_subs_s_h((v8i16)y1, (v8i16)u1); \ + const v8i16 b0 = __msa_subs_s_h(a0, (v8i16)v0); \ + const v8i16 b1 = __msa_subs_s_h(a1, (v8i16)v1); \ + a0 = __msa_adds_s_h(b0, const_a); \ + a1 = __msa_adds_s_h(b1, const_a); \ + SRAI_H2_SH(a0, a1, 6); \ + CLIP_SH2_0_255(a0, a1); \ + dst = (v16u8)__msa_pckev_b((v16i8)a1, (v16i8)a0); \ +} while (0) + +#define CALC_G8(y0, u0, v0, dst) do { \ + const v8i16 const_a = (v8i16)__msa_fill_h(8708); \ + v8i16 a0 = __msa_subs_s_h((v8i16)y0, (v8i16)u0); \ + const v8i16 b0 = __msa_subs_s_h(a0, (v8i16)v0); \ + a0 = __msa_adds_s_h(b0, const_a); \ + a0 = SRAI_H(a0, 6); \ + CLIP_SH_0_255(a0); \ + dst = (v16u8)__msa_pckev_b((v16i8)a0, (v16i8)a0); \ +} while (0) + +#define CALC_B16(y0, y1, u0, u1, dst) do { \ + const v8u16 const_a = (v8u16)__msa_fill_h(17685); \ + const v8u16 a0 = __msa_adds_u_h((v8u16)y0, u0); \ + const v8u16 a1 = __msa_adds_u_h((v8u16)y1, u1); \ + v8u16 b0 = __msa_subs_u_h(a0, const_a); \ + v8u16 b1 = __msa_subs_u_h(a1, const_a); \ + SRAI_H2_UH(b0, b1, 6); \ + CLIP_UH2_0_255(b0, b1); \ + dst = (v16u8)__msa_pckev_b((v16i8)b1, (v16i8)b0); \ +} while (0) + +#define CALC_B8(y0, u0, dst) do { \ + const v8u16 const_a = (v8u16)__msa_fill_h(17685); \ + const v8u16 a0 = __msa_adds_u_h((v8u16)y0, u0); \ + v8u16 b0 = __msa_subs_u_h(a0, const_a); \ + b0 = SRAI_H(b0, 6); \ + CLIP_UH_0_255(b0); \ + dst = (v16u8)__msa_pckev_b((v16i8)b0, (v16i8)b0); \ +} while (0) + +#define CALC_RGB16(y, u, v, R, G, B) do { \ + const v16u8 zero = { 0 }; \ + v8u16 y0, y1, u0, u1, v0, v1; \ + v4u32 p0, p1, p2, p3; \ + const v16u8 in_y = LD_UB(y); \ + const v16u8 in_u = LD_UB(u); \ + const v16u8 in_v = LD_UB(v); \ + ILVRL_UW4(in_y, p0, p1, p2, p3); \ + MULTHI_16(p0, p1, p2, p3, 19077, y0, y1); \ + ILVRL_UW4(in_v, p0, p1, p2, p3); \ + MULTHI_16(p0, p1, p2, p3, 26149, v0, v1); \ + CALC_R16(y0, y1, v0, v1, R); \ + MULTHI_16(p0, p1, p2, p3, 13320, v0, v1); \ + ILVRL_UW4(in_u, p0, p1, p2, p3); \ + MULTHI_16(p0, p1, p2, p3, 6419, u0, u1); \ + CALC_G16(y0, y1, u0, u1, v0, v1, G); \ + MULTHI_16(p0, p1, p2, p3, 33050, u0, u1); \ + CALC_B16(y0, y1, u0, u1, B); \ +} while (0) + +#define CALC_RGB8(y, u, v, R, G, B) do { \ + const v16u8 zero = { 0 }; \ + v8u16 y0, u0, v0; \ + v4u32 p0, p1; \ + const v16u8 in_y = LD_UB(y); \ + const v16u8 in_u = LD_UB(u); \ + const v16u8 in_v = LD_UB(v); \ + ILVR_UW2(in_y, p0, p1); \ + MULTHI_8(p0, p1, 19077, y0); \ + ILVR_UW2(in_v, p0, p1); \ + MULTHI_8(p0, p1, 26149, v0); \ + CALC_R8(y0, v0, R); \ + MULTHI_8(p0, p1, 13320, v0); \ + ILVR_UW2(in_u, p0, p1); \ + MULTHI_8(p0, p1, 6419, u0); \ + CALC_G8(y0, u0, v0, G); \ + MULTHI_8(p0, p1, 33050, u0); \ + CALC_B8(y0, u0, B); \ +} while (0) + +#define STORE16_3(a0, a1, a2, dst) do { \ + const v16u8 mask0 = { 0, 1, 16, 2, 3, 17, 4, 5, 18, 6, 7, 19, \ + 8, 9, 20, 10 }; \ + const v16u8 mask1 = { 0, 21, 1, 2, 22, 3, 4, 23, 5, 6, 24, 7, \ + 8, 25, 9, 10 }; \ + const v16u8 mask2 = { 26, 0, 1, 27, 2, 3, 28, 4, 5, 29, 6, 7, \ + 30, 8, 9, 31 }; \ + v16u8 out0, out1, out2, tmp0, tmp1, tmp2; \ + ILVRL_B2_UB(a1, a0, tmp0, tmp1); \ + out0 = VSHF_UB(tmp0, a2, mask0); \ + tmp2 = SLDI_UB(tmp1, tmp0, 11); \ + out1 = VSHF_UB(tmp2, a2, mask1); \ + tmp2 = SLDI_UB(tmp1, tmp1, 6); \ + out2 = VSHF_UB(tmp2, a2, mask2); \ + ST_UB(out0, dst + 0); \ + ST_UB(out1, dst + 16); \ + ST_UB(out2, dst + 32); \ +} while (0) + +#define STORE8_3(a0, a1, a2, dst) do { \ + int64_t out_m; \ + const v16u8 mask0 = { 0, 1, 16, 2, 3, 17, 4, 5, 18, 6, 7, 19, \ + 8, 9, 20, 10 }; \ + const v16u8 mask1 = { 11, 21, 12, 13, 22, 14, 15, 23, \ + 255, 255, 255, 255, 255, 255, 255, 255 }; \ + const v16u8 tmp0 = (v16u8)__msa_ilvr_b((v16i8)a1, (v16i8)a0); \ + v16u8 out0, out1; \ + VSHF_B2_UB(tmp0, a2, tmp0, a2, mask0, mask1, out0, out1); \ + ST_UB(out0, dst); \ + out_m = __msa_copy_s_d((v2i64)out1, 0); \ + SD(out_m, dst + 16); \ +} while (0) + +#define STORE16_4(a0, a1, a2, a3, dst) do { \ + v16u8 tmp0, tmp1, tmp2, tmp3; \ + v16u8 out0, out1, out2, out3; \ + ILVRL_B2_UB(a1, a0, tmp0, tmp1); \ + ILVRL_B2_UB(a3, a2, tmp2, tmp3); \ + ILVRL_H2_UB(tmp2, tmp0, out0, out1); \ + ILVRL_H2_UB(tmp3, tmp1, out2, out3); \ + ST_UB(out0, dst + 0); \ + ST_UB(out1, dst + 16); \ + ST_UB(out2, dst + 32); \ + ST_UB(out3, dst + 48); \ +} while (0) + +#define STORE8_4(a0, a1, a2, a3, dst) do { \ + v16u8 tmp0, tmp1, tmp2, tmp3; \ + ILVR_B2_UB(a1, a0, a3, a2, tmp0, tmp1); \ + ILVRL_H2_UB(tmp1, tmp0, tmp2, tmp3); \ + ST_UB(tmp2, dst + 0); \ + ST_UB(tmp3, dst + 16); \ +} while (0) + +#define STORE2_16(a0, a1, dst) do { \ + v16u8 out0, out1; \ + ILVRL_B2_UB(a1, a0, out0, out1); \ + ST_UB(out0, dst + 0); \ + ST_UB(out1, dst + 16); \ +} while (0) + +#define STORE2_8(a0, a1, dst) do { \ + const v16u8 out0 = (v16u8)__msa_ilvr_b((v16i8)a1, (v16i8)a0); \ + ST_UB(out0, dst); \ +} while (0) + +#define CALC_RGBA4444(y, u, v, out0, out1, N, dst) do { \ + CALC_RGB##N(y, u, v, R, G, B); \ + tmp0 = ANDI_B(R, 0xf0); \ + tmp1 = SRAI_B(G, 4); \ + RG = tmp0 | tmp1; \ + tmp0 = ANDI_B(B, 0xf0); \ + BA = ORI_B(tmp0, 0x0f); \ + STORE2_##N(out0, out1, dst); \ +} while (0) + +#define CALC_RGB565(y, u, v, out0, out1, N, dst) do { \ + CALC_RGB##N(y, u, v, R, G, B); \ + tmp0 = ANDI_B(R, 0xf8); \ + tmp1 = SRAI_B(G, 5); \ + RG = tmp0 | tmp1; \ + tmp0 = SLLI_B(G, 3); \ + tmp1 = ANDI_B(tmp0, 0xe0); \ + tmp0 = SRAI_B(B, 3); \ + GB = tmp0 | tmp1; \ + STORE2_##N(out0, out1, dst); \ +} while (0) + +static WEBP_INLINE int Clip8(int v) { + return v < 0 ? 0 : v > 255 ? 255 : v; +} + +static void YuvToRgb(int y, int u, int v, uint8_t* const rgb) { + const int y1 = MultHi(y, 19077); + const int r1 = y1 + MultHi(v, 26149) - 14234; + const int g1 = y1 - MultHi(u, 6419) - MultHi(v, 13320) + 8708; + const int b1 = y1 + MultHi(u, 33050) - 17685; + rgb[0] = Clip8(r1 >> 6); + rgb[1] = Clip8(g1 >> 6); + rgb[2] = Clip8(b1 >> 6); +} + +static void YuvToBgr(int y, int u, int v, uint8_t* const bgr) { + const int y1 = MultHi(y, 19077); + const int r1 = y1 + MultHi(v, 26149) - 14234; + const int g1 = y1 - MultHi(u, 6419) - MultHi(v, 13320) + 8708; + const int b1 = y1 + MultHi(u, 33050) - 17685; + bgr[0] = Clip8(b1 >> 6); + bgr[1] = Clip8(g1 >> 6); + bgr[2] = Clip8(r1 >> 6); +} + +static void YuvToRgb565(int y, int u, int v, uint8_t* const rgb) { + const int y1 = MultHi(y, 19077); + const int r1 = y1 + MultHi(v, 26149) - 14234; + const int g1 = y1 - MultHi(u, 6419) - MultHi(v, 13320) + 8708; + const int b1 = y1 + MultHi(u, 33050) - 17685; + const int r = Clip8(r1 >> 6); + const int g = Clip8(g1 >> 6); + const int b = Clip8(b1 >> 6); + const int rg = (r & 0xf8) | (g >> 5); + const int gb = ((g << 3) & 0xe0) | (b >> 3); +#ifdef WEBP_SWAP_16BIT_CSP + rgb[0] = gb; + rgb[1] = rg; +#else + rgb[0] = rg; + rgb[1] = gb; +#endif +} + +static void YuvToRgba4444(int y, int u, int v, uint8_t* const argb) { + const int y1 = MultHi(y, 19077); + const int r1 = y1 + MultHi(v, 26149) - 14234; + const int g1 = y1 - MultHi(u, 6419) - MultHi(v, 13320) + 8708; + const int b1 = y1 + MultHi(u, 33050) - 17685; + const int r = Clip8(r1 >> 6); + const int g = Clip8(g1 >> 6); + const int b = Clip8(b1 >> 6); + const int rg = (r & 0xf0) | (g >> 4); + const int ba = (b & 0xf0) | 0x0f; // overwrite the lower 4 bits +#ifdef WEBP_SWAP_16BIT_CSP + argb[0] = ba; + argb[1] = rg; +#else + argb[0] = rg; + argb[1] = ba; +#endif +} + +static void YuvToArgb(uint8_t y, uint8_t u, uint8_t v, uint8_t* const argb) { + argb[0] = 0xff; + YuvToRgb(y, u, v, argb + 1); +} + +static void YuvToBgra(uint8_t y, uint8_t u, uint8_t v, uint8_t* const bgra) { + YuvToBgr(y, u, v, bgra); + bgra[3] = 0xff; +} + +static void YuvToRgba(uint8_t y, uint8_t u, uint8_t v, uint8_t* const rgba) { + YuvToRgb(y, u, v, rgba); + rgba[3] = 0xff; +} + +static void YuvToRgbLine(const uint8_t* y, const uint8_t* u, + const uint8_t* v, uint8_t* dst, int length) { + v16u8 R, G, B; + while (length >= 16) { + CALC_RGB16(y, u, v, R, G, B); + STORE16_3(R, G, B, dst); + y += 16; + u += 16; + v += 16; + dst += 16 * 3; + length -= 16; + } + if (length > 8) { + uint8_t temp[3 * 16] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); + CALC_RGB16(temp, u, v, R, G, B); + STORE16_3(R, G, B, temp); + memcpy(dst, temp, length * 3 * sizeof(*dst)); + } else if (length > 0) { + uint8_t temp[3 * 8] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); + CALC_RGB8(temp, u, v, R, G, B); + STORE8_3(R, G, B, temp); + memcpy(dst, temp, length * 3 * sizeof(*dst)); + } +} + +static void YuvToBgrLine(const uint8_t* y, const uint8_t* u, + const uint8_t* v, uint8_t* dst, int length) { + v16u8 R, G, B; + while (length >= 16) { + CALC_RGB16(y, u, v, R, G, B); + STORE16_3(B, G, R, dst); + y += 16; + u += 16; + v += 16; + dst += 16 * 3; + length -= 16; + } + if (length > 8) { + uint8_t temp[3 * 16] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); + CALC_RGB16(temp, u, v, R, G, B); + STORE16_3(B, G, R, temp); + memcpy(dst, temp, length * 3 * sizeof(*dst)); + } else if (length > 0) { + uint8_t temp[3 * 8] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); + CALC_RGB8(temp, u, v, R, G, B); + STORE8_3(B, G, R, temp); + memcpy(dst, temp, length * 3 * sizeof(*dst)); + } +} + +static void YuvToRgbaLine(const uint8_t* y, const uint8_t* u, + const uint8_t* v, uint8_t* dst, int length) { + v16u8 R, G, B; + const v16u8 A = (v16u8)__msa_ldi_b(0xff); + while (length >= 16) { + CALC_RGB16(y, u, v, R, G, B); + STORE16_4(R, G, B, A, dst); + y += 16; + u += 16; + v += 16; + dst += 16 * 4; + length -= 16; + } + if (length > 8) { + uint8_t temp[4 * 16] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); + CALC_RGB16(&temp[0], u, v, R, G, B); + STORE16_4(R, G, B, A, temp); + memcpy(dst, temp, length * 4 * sizeof(*dst)); + } else if (length > 0) { + uint8_t temp[4 * 8] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); + CALC_RGB8(temp, u, v, R, G, B); + STORE8_4(R, G, B, A, temp); + memcpy(dst, temp, length * 4 * sizeof(*dst)); + } +} + +static void YuvToBgraLine(const uint8_t* y, const uint8_t* u, + const uint8_t* v, uint8_t* dst, int length) { + v16u8 R, G, B; + const v16u8 A = (v16u8)__msa_ldi_b(0xff); + while (length >= 16) { + CALC_RGB16(y, u, v, R, G, B); + STORE16_4(B, G, R, A, dst); + y += 16; + u += 16; + v += 16; + dst += 16 * 4; + length -= 16; + } + if (length > 8) { + uint8_t temp[4 * 16] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); + CALC_RGB16(temp, u, v, R, G, B); + STORE16_4(B, G, R, A, temp); + memcpy(dst, temp, length * 4 * sizeof(*dst)); + } else if (length > 0) { + uint8_t temp[4 * 8] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); + CALC_RGB8(temp, u, v, R, G, B); + STORE8_4(B, G, R, A, temp); + memcpy(dst, temp, length * 4 * sizeof(*dst)); + } +} + +static void YuvToArgbLine(const uint8_t* y, const uint8_t* u, + const uint8_t* v, uint8_t* dst, int length) { + v16u8 R, G, B; + const v16u8 A = (v16u8)__msa_ldi_b(0xff); + while (length >= 16) { + CALC_RGB16(y, u, v, R, G, B); + STORE16_4(A, R, G, B, dst); + y += 16; + u += 16; + v += 16; + dst += 16 * 4; + length -= 16; + } + if (length > 8) { + uint8_t temp[4 * 16] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); + CALC_RGB16(temp, u, v, R, G, B); + STORE16_4(A, R, G, B, temp); + memcpy(dst, temp, length * 4 * sizeof(*dst)); + } else if (length > 0) { + uint8_t temp[4 * 8] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); + CALC_RGB8(temp, u, v, R, G, B); + STORE8_4(A, R, G, B, temp); + memcpy(dst, temp, length * 4 * sizeof(*dst)); + } +} + +static void YuvToRgba4444Line(const uint8_t* y, const uint8_t* u, + const uint8_t* v, uint8_t* dst, int length) { + v16u8 R, G, B, RG, BA, tmp0, tmp1; + while (length >= 16) { + #ifdef WEBP_SWAP_16BIT_CSP + CALC_RGBA4444(y, u, v, BA, RG, 16, dst); + #else + CALC_RGBA4444(y, u, v, RG, BA, 16, dst); + #endif + y += 16; + u += 16; + v += 16; + dst += 16 * 2; + length -= 16; + } + if (length > 8) { + uint8_t temp[2 * 16] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); +#ifdef WEBP_SWAP_16BIT_CSP + CALC_RGBA4444(temp, u, v, BA, RG, 16, temp); +#else + CALC_RGBA4444(temp, u, v, RG, BA, 16, temp); +#endif + memcpy(dst, temp, length * 2 * sizeof(*dst)); + } else if (length > 0) { + uint8_t temp[2 * 8] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); +#ifdef WEBP_SWAP_16BIT_CSP + CALC_RGBA4444(temp, u, v, BA, RG, 8, temp); +#else + CALC_RGBA4444(temp, u, v, RG, BA, 8, temp); +#endif + memcpy(dst, temp, length * 2 * sizeof(*dst)); + } +} + +static void YuvToRgb565Line(const uint8_t* y, const uint8_t* u, + const uint8_t* v, uint8_t* dst, int length) { + v16u8 R, G, B, RG, GB, tmp0, tmp1; + while (length >= 16) { + #ifdef WEBP_SWAP_16BIT_CSP + CALC_RGB565(y, u, v, GB, RG, 16, dst); + #else + CALC_RGB565(y, u, v, RG, GB, 16, dst); + #endif + y += 16; + u += 16; + v += 16; + dst += 16 * 2; + length -= 16; + } + if (length > 8) { + uint8_t temp[2 * 16] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); +#ifdef WEBP_SWAP_16BIT_CSP + CALC_RGB565(temp, u, v, GB, RG, 16, temp); +#else + CALC_RGB565(temp, u, v, RG, GB, 16, temp); +#endif + memcpy(dst, temp, length * 2 * sizeof(*dst)); + } else if (length > 0) { + uint8_t temp[2 * 8] = { 0 }; + memcpy(temp, y, length * sizeof(*temp)); +#ifdef WEBP_SWAP_16BIT_CSP + CALC_RGB565(temp, u, v, GB, RG, 8, temp); +#else + CALC_RGB565(temp, u, v, RG, GB, 8, temp); +#endif + memcpy(dst, temp, length * 2 * sizeof(*dst)); + } +} + +#define UPSAMPLE_32PIXELS(a, b, c, d) do { \ + v16u8 s = __msa_aver_u_b(a, d); \ + v16u8 t = __msa_aver_u_b(b, c); \ + const v16u8 st = s ^ t; \ + v16u8 ad = a ^ d; \ + v16u8 bc = b ^ c; \ + v16u8 t0 = ad | bc; \ + v16u8 t1 = t0 | st; \ + v16u8 t2 = ANDI_B(t1, 1); \ + v16u8 t3 = __msa_aver_u_b(s, t); \ + const v16u8 k = t3 - t2; \ + v16u8 diag1, diag2; \ + AVER_UB2_UB(t, k, s, k, t0, t1); \ + bc = bc & st; \ + ad = ad & st; \ + t = t ^ k; \ + s = s ^ k; \ + t2 = bc | t; \ + t3 = ad | s; \ + t2 = ANDI_B(t2, 1); \ + t3 = ANDI_B(t3, 1); \ + SUB2(t0, t2, t1, t3, diag1, diag2); \ + AVER_UB2_UB(a, diag1, b, diag2, t0, t1); \ + ILVRL_B2_UB(t1, t0, a, b); \ + if (pbot_y != NULL) { \ + AVER_UB2_UB(c, diag2, d, diag1, t0, t1); \ + ILVRL_B2_UB(t1, t0, c, d); \ + } \ +} while (0) + +#define UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP) \ +static void FUNC_NAME(const uint8_t* top_y, const uint8_t* bot_y, \ + const uint8_t* top_u, const uint8_t* top_v, \ + const uint8_t* cur_u, const uint8_t* cur_v, \ + uint8_t* top_dst, uint8_t* bot_dst, int len) \ +{ \ + int size = (len - 1) >> 1; \ + uint8_t temp_u[64]; \ + uint8_t temp_v[64]; \ + const uint32_t tl_uv = ((top_u[0]) | ((top_v[0]) << 16)); \ + const uint32_t l_uv = ((cur_u[0]) | ((cur_v[0]) << 16)); \ + const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2; \ + const uint8_t* ptop_y = &top_y[1]; \ + uint8_t *ptop_dst = top_dst + XSTEP; \ + const uint8_t* pbot_y = &bot_y[1]; \ + uint8_t *pbot_dst = bot_dst + XSTEP; \ + \ + FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst); \ + if (bot_y != NULL) { \ + const uint32_t uv1 = (3 * l_uv + tl_uv + 0x00020002u) >> 2; \ + FUNC(bot_y[0], uv1 & 0xff, (uv1 >> 16), bot_dst); \ + } \ + while (size >= 16) { \ + v16u8 tu0, tu1, tv0, tv1, cu0, cu1, cv0, cv1; \ + LD_UB2(top_u, 1, tu0, tu1); \ + LD_UB2(cur_u, 1, cu0, cu1); \ + LD_UB2(top_v, 1, tv0, tv1); \ + LD_UB2(cur_v, 1, cv0, cv1); \ + UPSAMPLE_32PIXELS(tu0, tu1, cu0, cu1); \ + UPSAMPLE_32PIXELS(tv0, tv1, cv0, cv1); \ + ST_UB4(tu0, tu1, cu0, cu1, &temp_u[0], 16); \ + ST_UB4(tv0, tv1, cv0, cv1, &temp_v[0], 16); \ + FUNC##Line(ptop_y, &temp_u[ 0], &temp_v[0], ptop_dst, 32); \ + if (bot_y != NULL) { \ + FUNC##Line(pbot_y, &temp_u[32], &temp_v[32], pbot_dst, 32); \ + } \ + ptop_y += 32; \ + pbot_y += 32; \ + ptop_dst += XSTEP * 32; \ + pbot_dst += XSTEP * 32; \ + top_u += 16; \ + top_v += 16; \ + cur_u += 16; \ + cur_v += 16; \ + size -= 16; \ + } \ + if (size > 0) { \ + v16u8 tu0, tu1, tv0, tv1, cu0, cu1, cv0, cv1; \ + memcpy(&temp_u[ 0], top_u, 17 * sizeof(uint8_t)); \ + memcpy(&temp_u[32], cur_u, 17 * sizeof(uint8_t)); \ + memcpy(&temp_v[ 0], top_v, 17 * sizeof(uint8_t)); \ + memcpy(&temp_v[32], cur_v, 17 * sizeof(uint8_t)); \ + LD_UB2(&temp_u[ 0], 1, tu0, tu1); \ + LD_UB2(&temp_u[32], 1, cu0, cu1); \ + LD_UB2(&temp_v[ 0], 1, tv0, tv1); \ + LD_UB2(&temp_v[32], 1, cv0, cv1); \ + UPSAMPLE_32PIXELS(tu0, tu1, cu0, cu1); \ + UPSAMPLE_32PIXELS(tv0, tv1, cv0, cv1); \ + ST_UB4(tu0, tu1, cu0, cu1, &temp_u[0], 16); \ + ST_UB4(tv0, tv1, cv0, cv1, &temp_v[0], 16); \ + FUNC##Line(ptop_y, &temp_u[ 0], &temp_v[0], ptop_dst, size * 2); \ + if (bot_y != NULL) { \ + FUNC##Line(pbot_y, &temp_u[32], &temp_v[32], pbot_dst, size * 2); \ + } \ + top_u += size; \ + top_v += size; \ + cur_u += size; \ + cur_v += size; \ + } \ + if (!(len & 1)) { \ + const uint32_t t0 = ((top_u[0]) | ((top_v[0]) << 16)); \ + const uint32_t c0 = ((cur_u[0]) | ((cur_v[0]) << 16)); \ + const uint32_t tmp0 = (3 * t0 + c0 + 0x00020002u) >> 2; \ + FUNC(top_y[len - 1], tmp0 & 0xff, (tmp0 >> 16), \ + top_dst + (len - 1) * XSTEP); \ + if (bot_y != NULL) { \ + const uint32_t tmp1 = (3 * c0 + t0 + 0x00020002u) >> 2; \ + FUNC(bot_y[len - 1], tmp1 & 0xff, (tmp1 >> 16), \ + bot_dst + (len - 1) * XSTEP); \ + } \ + } \ +} + +UPSAMPLE_FUNC(UpsampleRgbLinePair, YuvToRgb, 3) +UPSAMPLE_FUNC(UpsampleBgrLinePair, YuvToBgr, 3) +UPSAMPLE_FUNC(UpsampleRgbaLinePair, YuvToRgba, 4) +UPSAMPLE_FUNC(UpsampleBgraLinePair, YuvToBgra, 4) +UPSAMPLE_FUNC(UpsampleArgbLinePair, YuvToArgb, 4) +UPSAMPLE_FUNC(UpsampleRgba4444LinePair, YuvToRgba4444, 2) +UPSAMPLE_FUNC(UpsampleRgb565LinePair, YuvToRgb565, 2) + +//------------------------------------------------------------------------------ +// Entry point + +extern WebPUpsampleLinePairFunc WebPUpsamplers[/* MODE_LAST */]; + +extern void WebPInitUpsamplersMSA(void); + +WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersMSA(void) { + WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair; + WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair; + WebPUpsamplers[MODE_BGR] = UpsampleBgrLinePair; + WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePair; + WebPUpsamplers[MODE_ARGB] = UpsampleArgbLinePair; + WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair; + WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair; + WebPUpsamplers[MODE_Argb] = UpsampleArgbLinePair; + WebPUpsamplers[MODE_RGB_565] = UpsampleRgb565LinePair; + WebPUpsamplers[MODE_RGBA_4444] = UpsampleRgba4444LinePair; + WebPUpsamplers[MODE_rgbA_4444] = UpsampleRgba4444LinePair; +} + +#endif // FANCY_UPSAMPLING + +#endif // WEBP_USE_MSA + +#if !(defined(FANCY_UPSAMPLING) && defined(WEBP_USE_MSA)) +WEBP_DSP_INIT_STUB(WebPInitUpsamplersMSA) +#endif diff --git a/thirdparty/libwebp/dsp/upsampling_neon.c b/thirdparty/libwebp/dsp/upsampling_neon.c index 2b0c99bddb..d371a834ff 100644 --- a/thirdparty/libwebp/dsp/upsampling_neon.c +++ b/thirdparty/libwebp/dsp/upsampling_neon.c @@ -28,47 +28,34 @@ // U/V upsampling // Loads 9 pixels each from rows r1 and r2 and generates 16 pixels. -#define UPSAMPLE_16PIXELS(r1, r2, out) { \ - uint8x8_t a = vld1_u8(r1); \ - uint8x8_t b = vld1_u8(r1 + 1); \ - uint8x8_t c = vld1_u8(r2); \ - uint8x8_t d = vld1_u8(r2 + 1); \ - \ - uint16x8_t al = vshll_n_u8(a, 1); \ - uint16x8_t bl = vshll_n_u8(b, 1); \ - uint16x8_t cl = vshll_n_u8(c, 1); \ - uint16x8_t dl = vshll_n_u8(d, 1); \ - \ - uint8x8_t diag1, diag2; \ - uint16x8_t sl; \ - \ +#define UPSAMPLE_16PIXELS(r1, r2, out) do { \ + const uint8x8_t a = vld1_u8(r1 + 0); \ + const uint8x8_t b = vld1_u8(r1 + 1); \ + const uint8x8_t c = vld1_u8(r2 + 0); \ + const uint8x8_t d = vld1_u8(r2 + 1); \ /* a + b + c + d */ \ - sl = vaddl_u8(a, b); \ - sl = vaddw_u8(sl, c); \ - sl = vaddw_u8(sl, d); \ - \ - al = vaddq_u16(sl, al); /* 3a + b + c + d */ \ - bl = vaddq_u16(sl, bl); /* a + 3b + c + d */ \ - \ - al = vaddq_u16(al, dl); /* 3a + b + c + 3d */ \ - bl = vaddq_u16(bl, cl); /* a + 3b + 3c + d */ \ + const uint16x8_t ad = vaddl_u8(a, d); \ + const uint16x8_t bc = vaddl_u8(b, c); \ + const uint16x8_t abcd = vaddq_u16(ad, bc); \ + /* 3a + b + c + 3d */ \ + const uint16x8_t al = vaddq_u16(abcd, vshlq_n_u16(ad, 1)); \ + /* a + 3b + 3c + d */ \ + const uint16x8_t bl = vaddq_u16(abcd, vshlq_n_u16(bc, 1)); \ \ - diag2 = vshrn_n_u16(al, 3); \ - diag1 = vshrn_n_u16(bl, 3); \ + const uint8x8_t diag2 = vshrn_n_u16(al, 3); \ + const uint8x8_t diag1 = vshrn_n_u16(bl, 3); \ \ - a = vrhadd_u8(a, diag1); \ - b = vrhadd_u8(b, diag2); \ - c = vrhadd_u8(c, diag2); \ - d = vrhadd_u8(d, diag1); \ + const uint8x8_t A = vrhadd_u8(a, diag1); \ + const uint8x8_t B = vrhadd_u8(b, diag2); \ + const uint8x8_t C = vrhadd_u8(c, diag2); \ + const uint8x8_t D = vrhadd_u8(d, diag1); \ \ - { \ - uint8x8x2_t a_b, c_d; \ - INIT_VECTOR2(a_b, a, b); \ - INIT_VECTOR2(c_d, c, d); \ - vst2_u8(out, a_b); \ - vst2_u8(out + 32, c_d); \ - } \ -} + uint8x8x2_t A_B, C_D; \ + INIT_VECTOR2(A_B, A, B); \ + INIT_VECTOR2(C_D, C, D); \ + vst2_u8(out + 0, A_B); \ + vst2_u8(out + 32, C_D); \ +} while (0) // Turn the macro into a function for reducing code-size when non-critical static void Upsample16Pixels(const uint8_t *r1, const uint8_t *r2, @@ -93,7 +80,6 @@ static void Upsample16Pixels(const uint8_t *r1, const uint8_t *r2, static const int16_t kCoeffs1[4] = { 19077, 26149, 6419, 13320 }; #define v255 vdup_n_u8(255) -#define v_0x0f vdup_n_u8(15) #define STORE_Rgb(out, r, g, b) do { \ uint8x8x3_t r_g_b; \ @@ -132,21 +118,16 @@ static const int16_t kCoeffs1[4] = { 19077, 26149, 6419, 13320 }; #endif #define STORE_Rgba4444(out, r, g, b) do { \ - const uint8x8_t r1 = vshl_n_u8(vshr_n_u8(r, 4), 4); /* 4bits */ \ - const uint8x8_t g1 = vshr_n_u8(g, 4); \ - const uint8x8_t ba = vorr_u8(b, v_0x0f); \ - const uint8x8_t rg = vorr_u8(r1, g1); \ + const uint8x8_t rg = vsri_n_u8(r, g, 4); /* shift g, insert r */ \ + const uint8x8_t ba = vsri_n_u8(b, v255, 4); /* shift a, insert b */ \ const uint8x8x2_t rgba4444 = ZIP_U8(rg, ba); \ vst1q_u8(out, vcombine_u8(rgba4444.val[0], rgba4444.val[1])); \ } while (0) #define STORE_Rgb565(out, r, g, b) do { \ - const uint8x8_t r1 = vshl_n_u8(vshr_n_u8(r, 3), 3); /* 5bits */ \ - const uint8x8_t g1 = vshr_n_u8(g, 5); /* upper 3bits */\ - const uint8x8_t g2 = vshl_n_u8(vshr_n_u8(g, 2), 5); /* lower 3bits */\ - const uint8x8_t b1 = vshr_n_u8(b, 3); /* 5bits */ \ - const uint8x8_t rg = vorr_u8(r1, g1); \ - const uint8x8_t gb = vorr_u8(g2, b1); \ + const uint8x8_t rg = vsri_n_u8(r, g, 5); /* shift g and insert r */ \ + const uint8x8_t g1 = vshl_n_u8(g, 3); /* pre-shift g: 3bits */ \ + const uint8x8_t gb = vsri_n_u8(g1, b, 3); /* shift b and insert g */ \ const uint8x8x2_t rgb565 = ZIP_U8(rg, gb); \ vst1q_u8(out, vcombine_u8(rgb565.val[0], rgb565.val[1])); \ } while (0) diff --git a/thirdparty/libwebp/dsp/yuv.c b/thirdparty/libwebp/dsp/yuv.c index f50a253168..dd7d9dedfa 100644 --- a/thirdparty/libwebp/dsp/yuv.c +++ b/thirdparty/libwebp/dsp/yuv.c @@ -13,6 +13,8 @@ #include "./yuv.h" +#include <stdlib.h> + #if defined(WEBP_YUV_USE_TABLE) static int done = 0; @@ -244,6 +246,48 @@ void WebPConvertRGBA32ToUV_C(const uint16_t* rgb, //----------------------------------------------------------------------------- +#define MAX_Y ((1 << 10) - 1) // 10b precision over 16b-arithmetic +static uint16_t clip_y(int v) { + return (v < 0) ? 0 : (v > MAX_Y) ? MAX_Y : (uint16_t)v; +} + +static uint64_t SharpYUVUpdateY_C(const uint16_t* ref, const uint16_t* src, + uint16_t* dst, int len) { + uint64_t diff = 0; + int i; + for (i = 0; i < len; ++i) { + const int diff_y = ref[i] - src[i]; + const int new_y = (int)dst[i] + diff_y; + dst[i] = clip_y(new_y); + diff += (uint64_t)abs(diff_y); + } + return diff; +} + +static void SharpYUVUpdateRGB_C(const int16_t* ref, const int16_t* src, + int16_t* dst, int len) { + int i; + for (i = 0; i < len; ++i) { + const int diff_uv = ref[i] - src[i]; + dst[i] += diff_uv; + } +} + +static void SharpYUVFilterRow_C(const int16_t* A, const int16_t* B, int len, + const uint16_t* best_y, uint16_t* out) { + int i; + for (i = 0; i < len; ++i, ++A, ++B) { + const int v0 = (A[0] * 9 + A[1] * 3 + B[0] * 3 + B[1] + 8) >> 4; + const int v1 = (A[1] * 9 + A[0] * 3 + B[1] * 3 + B[0] + 8) >> 4; + out[2 * i + 0] = clip_y(best_y[2 * i + 0] + v0); + out[2 * i + 1] = clip_y(best_y[2 * i + 1] + v1); + } +} + +#undef MAX_Y + +//----------------------------------------------------------------------------- + void (*WebPConvertRGB24ToY)(const uint8_t* rgb, uint8_t* y, int width); void (*WebPConvertBGR24ToY)(const uint8_t* bgr, uint8_t* y, int width); void (*WebPConvertRGBA32ToUV)(const uint16_t* rgb, @@ -253,10 +297,18 @@ void (*WebPConvertARGBToY)(const uint32_t* argb, uint8_t* y, int width); void (*WebPConvertARGBToUV)(const uint32_t* argb, uint8_t* u, uint8_t* v, int src_width, int do_store); +uint64_t (*WebPSharpYUVUpdateY)(const uint16_t* ref, const uint16_t* src, + uint16_t* dst, int len); +void (*WebPSharpYUVUpdateRGB)(const int16_t* ref, const int16_t* src, + int16_t* dst, int len); +void (*WebPSharpYUVFilterRow)(const int16_t* A, const int16_t* B, int len, + const uint16_t* best_y, uint16_t* out); + static volatile VP8CPUInfo rgba_to_yuv_last_cpuinfo_used = (VP8CPUInfo)&rgba_to_yuv_last_cpuinfo_used; extern void WebPInitConvertARGBToYUVSSE2(void); +extern void WebPInitSharpYUVSSE2(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitConvertARGBToYUV(void) { if (rgba_to_yuv_last_cpuinfo_used == VP8GetCPUInfo) return; @@ -269,10 +321,15 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitConvertARGBToYUV(void) { WebPConvertRGBA32ToUV = WebPConvertRGBA32ToUV_C; + WebPSharpYUVUpdateY = SharpYUVUpdateY_C; + WebPSharpYUVUpdateRGB = SharpYUVUpdateRGB_C; + WebPSharpYUVFilterRow = SharpYUVFilterRow_C; + if (VP8GetCPUInfo != NULL) { #if defined(WEBP_USE_SSE2) if (VP8GetCPUInfo(kSSE2)) { WebPInitConvertARGBToYUVSSE2(); + WebPInitSharpYUVSSE2(); } #endif // WEBP_USE_SSE2 } diff --git a/thirdparty/libwebp/dsp/yuv.h b/thirdparty/libwebp/dsp/yuv.h index 01c40fcb84..1d33b5863b 100644 --- a/thirdparty/libwebp/dsp/yuv.h +++ b/thirdparty/libwebp/dsp/yuv.h @@ -36,7 +36,7 @@ #define WEBP_DSP_YUV_H_ #include "./dsp.h" -#include "../dec/decode_vp8.h" +#include "../dec/vp8_dec.h" #if defined(WEBP_EXPERIMENTAL_FEATURES) // Do NOT activate this feature for real compression. This is only experimental! diff --git a/thirdparty/libwebp/dsp/yuv_sse2.c b/thirdparty/libwebp/dsp/yuv_sse2.c index e19bddff6c..e33c2bbafd 100644 --- a/thirdparty/libwebp/dsp/yuv_sse2.c +++ b/thirdparty/libwebp/dsp/yuv_sse2.c @@ -15,6 +15,8 @@ #if defined(WEBP_USE_SSE2) +#include "./common_sse2.h" +#include <stdlib.h> #include <emmintrin.h> //----------------------------------------------------------------------------- @@ -155,30 +157,13 @@ static WEBP_INLINE void PackAndStore565(const __m128i* const R, _mm_storeu_si128((__m128i*)dst, rgb565); } -// Function used several times in PlanarTo24b. -// It samples the in buffer as follows: one every two unsigned char is stored -// at the beginning of the buffer, while the other half is stored at the end. -static WEBP_INLINE void PlanarTo24bHelper(const __m128i* const in /*in[6]*/, - __m128i* const out /*out[6]*/) { - const __m128i v_mask = _mm_set1_epi16(0x00ff); - - // Take one every two upper 8b values. - out[0] = _mm_packus_epi16(_mm_and_si128(in[0], v_mask), - _mm_and_si128(in[1], v_mask)); - out[1] = _mm_packus_epi16(_mm_and_si128(in[2], v_mask), - _mm_and_si128(in[3], v_mask)); - out[2] = _mm_packus_epi16(_mm_and_si128(in[4], v_mask), - _mm_and_si128(in[5], v_mask)); - // Take one every two lower 8b values. - out[3] = _mm_packus_epi16(_mm_srli_epi16(in[0], 8), _mm_srli_epi16(in[1], 8)); - out[4] = _mm_packus_epi16(_mm_srli_epi16(in[2], 8), _mm_srli_epi16(in[3], 8)); - out[5] = _mm_packus_epi16(_mm_srli_epi16(in[4], 8), _mm_srli_epi16(in[5], 8)); -} - // Pack the planar buffers // rrrr... rrrr... gggg... gggg... bbbb... bbbb.... // triplet by triplet in the output buffer rgb as rgbrgbrgbrgb ... -static WEBP_INLINE void PlanarTo24b(__m128i* const in /*in[6]*/, uint8_t* rgb) { +static WEBP_INLINE void PlanarTo24b(__m128i* const in0, __m128i* const in1, + __m128i* const in2, __m128i* const in3, + __m128i* const in4, __m128i* const in5, + uint8_t* const rgb) { // The input is 6 registers of sixteen 8b but for the sake of explanation, // let's take 6 registers of four 8b values. // To pack, we will keep taking one every two 8b integer and move it @@ -191,22 +176,15 @@ static WEBP_INLINE void PlanarTo24b(__m128i* const in /*in[6]*/, uint8_t* rgb) { // Repeat the same permutations twice more: // r0r4g0g4 | b0b4r1r5 | g1g5b1b5 | r2r6g2g6 | b2b6r3r7 | g3g7b3b7 // r0g0b0r1 | g1b1r2g2 | b2r3g3b3 | r4g4b4r5 | g5b5r6g6 | b6r7g7b7 - __m128i tmp[6]; - PlanarTo24bHelper(in, tmp); - PlanarTo24bHelper(tmp, in); - PlanarTo24bHelper(in, tmp); - // We need to do it two more times than the example as we have sixteen bytes. - PlanarTo24bHelper(tmp, in); - PlanarTo24bHelper(in, tmp); - - _mm_storeu_si128((__m128i*)(rgb + 0), tmp[0]); - _mm_storeu_si128((__m128i*)(rgb + 16), tmp[1]); - _mm_storeu_si128((__m128i*)(rgb + 32), tmp[2]); - _mm_storeu_si128((__m128i*)(rgb + 48), tmp[3]); - _mm_storeu_si128((__m128i*)(rgb + 64), tmp[4]); - _mm_storeu_si128((__m128i*)(rgb + 80), tmp[5]); -} -#undef MK_UINT32 + VP8PlanarTo24b(in0, in1, in2, in3, in4, in5); + + _mm_storeu_si128((__m128i*)(rgb + 0), *in0); + _mm_storeu_si128((__m128i*)(rgb + 16), *in1); + _mm_storeu_si128((__m128i*)(rgb + 32), *in2); + _mm_storeu_si128((__m128i*)(rgb + 48), *in3); + _mm_storeu_si128((__m128i*)(rgb + 64), *in4); + _mm_storeu_si128((__m128i*)(rgb + 80), *in5); +} void VP8YuvToRgba32(const uint8_t* y, const uint8_t* u, const uint8_t* v, uint8_t* dst) { @@ -265,29 +243,29 @@ void VP8YuvToRgb56532(const uint8_t* y, const uint8_t* u, const uint8_t* v, void VP8YuvToRgb32(const uint8_t* y, const uint8_t* u, const uint8_t* v, uint8_t* dst) { __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; - __m128i rgb[6]; + __m128i rgb0, rgb1, rgb2, rgb3, rgb4, rgb5; - YUV444ToRGB(y + 0, u + 0, v + 0, &R0, &G0, &B0); - YUV444ToRGB(y + 8, u + 8, v + 8, &R1, &G1, &B1); + YUV444ToRGB(y + 0, u + 0, v + 0, &R0, &G0, &B0); + YUV444ToRGB(y + 8, u + 8, v + 8, &R1, &G1, &B1); YUV444ToRGB(y + 16, u + 16, v + 16, &R2, &G2, &B2); YUV444ToRGB(y + 24, u + 24, v + 24, &R3, &G3, &B3); // Cast to 8b and store as RRRRGGGGBBBB. - rgb[0] = _mm_packus_epi16(R0, R1); - rgb[1] = _mm_packus_epi16(R2, R3); - rgb[2] = _mm_packus_epi16(G0, G1); - rgb[3] = _mm_packus_epi16(G2, G3); - rgb[4] = _mm_packus_epi16(B0, B1); - rgb[5] = _mm_packus_epi16(B2, B3); + rgb0 = _mm_packus_epi16(R0, R1); + rgb1 = _mm_packus_epi16(R2, R3); + rgb2 = _mm_packus_epi16(G0, G1); + rgb3 = _mm_packus_epi16(G2, G3); + rgb4 = _mm_packus_epi16(B0, B1); + rgb5 = _mm_packus_epi16(B2, B3); // Pack as RGBRGBRGBRGB. - PlanarTo24b(rgb, dst); + PlanarTo24b(&rgb0, &rgb1, &rgb2, &rgb3, &rgb4, &rgb5, dst); } void VP8YuvToBgr32(const uint8_t* y, const uint8_t* u, const uint8_t* v, uint8_t* dst) { __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; - __m128i bgr[6]; + __m128i bgr0, bgr1, bgr2, bgr3, bgr4, bgr5; YUV444ToRGB(y + 0, u + 0, v + 0, &R0, &G0, &B0); YUV444ToRGB(y + 8, u + 8, v + 8, &R1, &G1, &B1); @@ -295,15 +273,15 @@ void VP8YuvToBgr32(const uint8_t* y, const uint8_t* u, const uint8_t* v, YUV444ToRGB(y + 24, u + 24, v + 24, &R3, &G3, &B3); // Cast to 8b and store as BBBBGGGGRRRR. - bgr[0] = _mm_packus_epi16(B0, B1); - bgr[1] = _mm_packus_epi16(B2, B3); - bgr[2] = _mm_packus_epi16(G0, G1); - bgr[3] = _mm_packus_epi16(G2, G3); - bgr[4] = _mm_packus_epi16(R0, R1); - bgr[5] = _mm_packus_epi16(R2, R3); + bgr0 = _mm_packus_epi16(B0, B1); + bgr1 = _mm_packus_epi16(B2, B3); + bgr2 = _mm_packus_epi16(G0, G1); + bgr3 = _mm_packus_epi16(G2, G3); + bgr4 = _mm_packus_epi16(R0, R1); + bgr5= _mm_packus_epi16(R2, R3); // Pack as BGRBGRBGRBGR. - PlanarTo24b(bgr, dst); + PlanarTo24b(&bgr0, &bgr1, &bgr2, &bgr3, &bgr4, &bgr5, dst); } //----------------------------------------------------------------------------- @@ -377,7 +355,7 @@ static void YuvToRgbRow(const uint8_t* y, const uint8_t* u, const uint8_t* v, int n; for (n = 0; n + 32 <= len; n += 32, dst += 32 * 3) { __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; - __m128i rgb[6]; + __m128i rgb0, rgb1, rgb2, rgb3, rgb4, rgb5; YUV420ToRGB(y + 0, u + 0, v + 0, &R0, &G0, &B0); YUV420ToRGB(y + 8, u + 4, v + 4, &R1, &G1, &B1); @@ -385,15 +363,15 @@ static void YuvToRgbRow(const uint8_t* y, const uint8_t* u, const uint8_t* v, YUV420ToRGB(y + 24, u + 12, v + 12, &R3, &G3, &B3); // Cast to 8b and store as RRRRGGGGBBBB. - rgb[0] = _mm_packus_epi16(R0, R1); - rgb[1] = _mm_packus_epi16(R2, R3); - rgb[2] = _mm_packus_epi16(G0, G1); - rgb[3] = _mm_packus_epi16(G2, G3); - rgb[4] = _mm_packus_epi16(B0, B1); - rgb[5] = _mm_packus_epi16(B2, B3); + rgb0 = _mm_packus_epi16(R0, R1); + rgb1 = _mm_packus_epi16(R2, R3); + rgb2 = _mm_packus_epi16(G0, G1); + rgb3 = _mm_packus_epi16(G2, G3); + rgb4 = _mm_packus_epi16(B0, B1); + rgb5 = _mm_packus_epi16(B2, B3); // Pack as RGBRGBRGBRGB. - PlanarTo24b(rgb, dst); + PlanarTo24b(&rgb0, &rgb1, &rgb2, &rgb3, &rgb4, &rgb5, dst); y += 32; u += 16; @@ -413,7 +391,7 @@ static void YuvToBgrRow(const uint8_t* y, const uint8_t* u, const uint8_t* v, int n; for (n = 0; n + 32 <= len; n += 32, dst += 32 * 3) { __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; - __m128i bgr[6]; + __m128i bgr0, bgr1, bgr2, bgr3, bgr4, bgr5; YUV420ToRGB(y + 0, u + 0, v + 0, &R0, &G0, &B0); YUV420ToRGB(y + 8, u + 4, v + 4, &R1, &G1, &B1); @@ -421,15 +399,15 @@ static void YuvToBgrRow(const uint8_t* y, const uint8_t* u, const uint8_t* v, YUV420ToRGB(y + 24, u + 12, v + 12, &R3, &G3, &B3); // Cast to 8b and store as BBBBGGGGRRRR. - bgr[0] = _mm_packus_epi16(B0, B1); - bgr[1] = _mm_packus_epi16(B2, B3); - bgr[2] = _mm_packus_epi16(G0, G1); - bgr[3] = _mm_packus_epi16(G2, G3); - bgr[4] = _mm_packus_epi16(R0, R1); - bgr[5] = _mm_packus_epi16(R2, R3); + bgr0 = _mm_packus_epi16(B0, B1); + bgr1 = _mm_packus_epi16(B2, B3); + bgr2 = _mm_packus_epi16(G0, G1); + bgr3 = _mm_packus_epi16(G2, G3); + bgr4 = _mm_packus_epi16(R0, R1); + bgr5 = _mm_packus_epi16(R2, R3); // Pack as BGRBGRBGRBGR. - PlanarTo24b(bgr, dst); + PlanarTo24b(&bgr0, &bgr1, &bgr2, &bgr3, &bgr4, &bgr5, dst); y += 32; u += 16; @@ -499,25 +477,19 @@ static WEBP_INLINE void RGB24PackedToPlanar(const uint8_t* const rgb, // Convert 8 packed ARGB to r[], g[], b[] static WEBP_INLINE void RGB32PackedToPlanar(const uint32_t* const argb, - __m128i* const r, - __m128i* const g, - __m128i* const b) { + __m128i* const rgb /*in[6]*/) { const __m128i zero = _mm_setzero_si128(); - const __m128i in0 = LOAD_16(argb + 0); // argb3 | argb2 | argb1 | argb0 - const __m128i in1 = LOAD_16(argb + 4); // argb7 | argb6 | argb5 | argb4 - // column-wise transpose - const __m128i A0 = _mm_unpacklo_epi8(in0, in1); - const __m128i A1 = _mm_unpackhi_epi8(in0, in1); - const __m128i B0 = _mm_unpacklo_epi8(A0, A1); - const __m128i B1 = _mm_unpackhi_epi8(A0, A1); - // C0 = g7 g6 ... g1 g0 | b7 b6 ... b1 b0 - // C1 = a7 a6 ... a1 a0 | r7 r6 ... r1 r0 - const __m128i C0 = _mm_unpacklo_epi8(B0, B1); - const __m128i C1 = _mm_unpackhi_epi8(B0, B1); - // store 16b - *r = _mm_unpacklo_epi8(C1, zero); - *g = _mm_unpackhi_epi8(C0, zero); - *b = _mm_unpacklo_epi8(C0, zero); + __m128i a0 = LOAD_16(argb + 0); + __m128i a1 = LOAD_16(argb + 4); + __m128i a2 = LOAD_16(argb + 8); + __m128i a3 = LOAD_16(argb + 12); + VP8L32bToPlanar(&a0, &a1, &a2, &a3); + rgb[0] = _mm_unpacklo_epi8(a1, zero); + rgb[1] = _mm_unpackhi_epi8(a1, zero); + rgb[2] = _mm_unpacklo_epi8(a2, zero); + rgb[3] = _mm_unpackhi_epi8(a2, zero); + rgb[4] = _mm_unpacklo_epi8(a3, zero); + rgb[5] = _mm_unpackhi_epi8(a3, zero); } // This macro computes (RG * MULT_RG + GB * MULT_GB + ROUNDER) >> DESCALE_FIX @@ -649,11 +621,10 @@ static void ConvertARGBToY(const uint32_t* argb, uint8_t* y, int width) { const int max_width = width & ~15; int i; for (i = 0; i < max_width; i += 16) { - __m128i r, g, b, Y0, Y1; - RGB32PackedToPlanar(&argb[i + 0], &r, &g, &b); - ConvertRGBToY(&r, &g, &b, &Y0); - RGB32PackedToPlanar(&argb[i + 8], &r, &g, &b); - ConvertRGBToY(&r, &g, &b, &Y1); + __m128i Y0, Y1, rgb[6]; + RGB32PackedToPlanar(&argb[i], rgb); + ConvertRGBToY(&rgb[0], &rgb[2], &rgb[4], &Y0); + ConvertRGBToY(&rgb[1], &rgb[3], &rgb[5], &Y1); STORE_16(_mm_packus_epi16(Y0, Y1), y + i); } for (; i < width; ++i) { // left-over @@ -678,20 +649,18 @@ static void ConvertARGBToUV(const uint32_t* argb, uint8_t* u, uint8_t* v, const int max_width = src_width & ~31; int i; for (i = 0; i < max_width; i += 32, u += 16, v += 16) { - __m128i r0, g0, b0, r1, g1, b1, U0, V0, U1, V1; - RGB32PackedToPlanar(&argb[i + 0], &r0, &g0, &b0); - RGB32PackedToPlanar(&argb[i + 8], &r1, &g1, &b1); - HorizontalAddPack(&r0, &r1, &r0); - HorizontalAddPack(&g0, &g1, &g0); - HorizontalAddPack(&b0, &b1, &b0); - ConvertRGBToUV(&r0, &g0, &b0, &U0, &V0); - - RGB32PackedToPlanar(&argb[i + 16], &r0, &g0, &b0); - RGB32PackedToPlanar(&argb[i + 24], &r1, &g1, &b1); - HorizontalAddPack(&r0, &r1, &r0); - HorizontalAddPack(&g0, &g1, &g0); - HorizontalAddPack(&b0, &b1, &b0); - ConvertRGBToUV(&r0, &g0, &b0, &U1, &V1); + __m128i rgb[6], U0, V0, U1, V1; + RGB32PackedToPlanar(&argb[i], rgb); + HorizontalAddPack(&rgb[0], &rgb[1], &rgb[0]); + HorizontalAddPack(&rgb[2], &rgb[3], &rgb[2]); + HorizontalAddPack(&rgb[4], &rgb[5], &rgb[4]); + ConvertRGBToUV(&rgb[0], &rgb[2], &rgb[4], &U0, &V0); + + RGB32PackedToPlanar(&argb[i + 16], rgb); + HorizontalAddPack(&rgb[0], &rgb[1], &rgb[0]); + HorizontalAddPack(&rgb[2], &rgb[3], &rgb[2]); + HorizontalAddPack(&rgb[4], &rgb[5], &rgb[4]); + ConvertRGBToUV(&rgb[0], &rgb[2], &rgb[4], &U1, &V1); U0 = _mm_packus_epi16(U0, U1); V0 = _mm_packus_epi16(V0, V1); @@ -767,9 +736,128 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitConvertARGBToYUVSSE2(void) { WebPConvertRGBA32ToUV = ConvertRGBA32ToUV; } +//------------------------------------------------------------------------------ + +#define MAX_Y ((1 << 10) - 1) // 10b precision over 16b-arithmetic +static uint16_t clip_y(int v) { + return (v < 0) ? 0 : (v > MAX_Y) ? MAX_Y : (uint16_t)v; +} + +static uint64_t SharpYUVUpdateY_SSE2(const uint16_t* ref, const uint16_t* src, + uint16_t* dst, int len) { + uint64_t diff = 0; + uint32_t tmp[4]; + int i; + const __m128i zero = _mm_setzero_si128(); + const __m128i max = _mm_set1_epi16(MAX_Y); + const __m128i one = _mm_set1_epi16(1); + __m128i sum = zero; + + for (i = 0; i + 8 <= len; i += 8) { + const __m128i A = _mm_loadu_si128((const __m128i*)(ref + i)); + const __m128i B = _mm_loadu_si128((const __m128i*)(src + i)); + const __m128i C = _mm_loadu_si128((const __m128i*)(dst + i)); + const __m128i D = _mm_sub_epi16(A, B); // diff_y + const __m128i E = _mm_cmpgt_epi16(zero, D); // sign (-1 or 0) + const __m128i F = _mm_add_epi16(C, D); // new_y + const __m128i G = _mm_or_si128(E, one); // -1 or 1 + const __m128i H = _mm_max_epi16(_mm_min_epi16(F, max), zero); + const __m128i I = _mm_madd_epi16(D, G); // sum(abs(...)) + _mm_storeu_si128((__m128i*)(dst + i), H); + sum = _mm_add_epi32(sum, I); + } + _mm_storeu_si128((__m128i*)tmp, sum); + diff = tmp[3] + tmp[2] + tmp[1] + tmp[0]; + for (; i < len; ++i) { + const int diff_y = ref[i] - src[i]; + const int new_y = (int)dst[i] + diff_y; + dst[i] = clip_y(new_y); + diff += (uint64_t)abs(diff_y); + } + return diff; +} + +static void SharpYUVUpdateRGB_SSE2(const int16_t* ref, const int16_t* src, + int16_t* dst, int len) { + int i = 0; + for (i = 0; i + 8 <= len; i += 8) { + const __m128i A = _mm_loadu_si128((const __m128i*)(ref + i)); + const __m128i B = _mm_loadu_si128((const __m128i*)(src + i)); + const __m128i C = _mm_loadu_si128((const __m128i*)(dst + i)); + const __m128i D = _mm_sub_epi16(A, B); // diff_uv + const __m128i E = _mm_add_epi16(C, D); // new_uv + _mm_storeu_si128((__m128i*)(dst + i), E); + } + for (; i < len; ++i) { + const int diff_uv = ref[i] - src[i]; + dst[i] += diff_uv; + } +} + +static void SharpYUVFilterRow_SSE2(const int16_t* A, const int16_t* B, int len, + const uint16_t* best_y, uint16_t* out) { + int i; + const __m128i kCst8 = _mm_set1_epi16(8); + const __m128i max = _mm_set1_epi16(MAX_Y); + const __m128i zero = _mm_setzero_si128(); + for (i = 0; i + 8 <= len; i += 8) { + const __m128i a0 = _mm_loadu_si128((const __m128i*)(A + i + 0)); + const __m128i a1 = _mm_loadu_si128((const __m128i*)(A + i + 1)); + const __m128i b0 = _mm_loadu_si128((const __m128i*)(B + i + 0)); + const __m128i b1 = _mm_loadu_si128((const __m128i*)(B + i + 1)); + const __m128i a0b1 = _mm_add_epi16(a0, b1); + const __m128i a1b0 = _mm_add_epi16(a1, b0); + const __m128i a0a1b0b1 = _mm_add_epi16(a0b1, a1b0); // A0+A1+B0+B1 + const __m128i a0a1b0b1_8 = _mm_add_epi16(a0a1b0b1, kCst8); + const __m128i a0b1_2 = _mm_add_epi16(a0b1, a0b1); // 2*(A0+B1) + const __m128i a1b0_2 = _mm_add_epi16(a1b0, a1b0); // 2*(A1+B0) + const __m128i c0 = _mm_srai_epi16(_mm_add_epi16(a0b1_2, a0a1b0b1_8), 3); + const __m128i c1 = _mm_srai_epi16(_mm_add_epi16(a1b0_2, a0a1b0b1_8), 3); + const __m128i d0 = _mm_add_epi16(c1, a0); + const __m128i d1 = _mm_add_epi16(c0, a1); + const __m128i e0 = _mm_srai_epi16(d0, 1); + const __m128i e1 = _mm_srai_epi16(d1, 1); + const __m128i f0 = _mm_unpacklo_epi16(e0, e1); + const __m128i f1 = _mm_unpackhi_epi16(e0, e1); + const __m128i g0 = _mm_loadu_si128((const __m128i*)(best_y + 2 * i + 0)); + const __m128i g1 = _mm_loadu_si128((const __m128i*)(best_y + 2 * i + 8)); + const __m128i h0 = _mm_add_epi16(g0, f0); + const __m128i h1 = _mm_add_epi16(g1, f1); + const __m128i i0 = _mm_max_epi16(_mm_min_epi16(h0, max), zero); + const __m128i i1 = _mm_max_epi16(_mm_min_epi16(h1, max), zero); + _mm_storeu_si128((__m128i*)(out + 2 * i + 0), i0); + _mm_storeu_si128((__m128i*)(out + 2 * i + 8), i1); + } + for (; i < len; ++i) { + // (9 * A0 + 3 * A1 + 3 * B0 + B1 + 8) >> 4 = + // = (8 * A0 + 2 * (A1 + B0) + (A0 + A1 + B0 + B1 + 8)) >> 4 + // We reuse the common sub-expressions. + const int a0b1 = A[i + 0] + B[i + 1]; + const int a1b0 = A[i + 1] + B[i + 0]; + const int a0a1b0b1 = a0b1 + a1b0 + 8; + const int v0 = (8 * A[i + 0] + 2 * a1b0 + a0a1b0b1) >> 4; + const int v1 = (8 * A[i + 1] + 2 * a0b1 + a0a1b0b1) >> 4; + out[2 * i + 0] = clip_y(best_y[2 * i + 0] + v0); + out[2 * i + 1] = clip_y(best_y[2 * i + 1] + v1); + } +} + +#undef MAX_Y + +//------------------------------------------------------------------------------ + +extern void WebPInitSharpYUVSSE2(void); + +WEBP_TSAN_IGNORE_FUNCTION void WebPInitSharpYUVSSE2(void) { + WebPSharpYUVUpdateY = SharpYUVUpdateY_SSE2; + WebPSharpYUVUpdateRGB = SharpYUVUpdateRGB_SSE2; + WebPSharpYUVFilterRow = SharpYUVFilterRow_SSE2; +} + #else // !WEBP_USE_SSE2 WEBP_DSP_INIT_STUB(WebPInitSamplersSSE2) WEBP_DSP_INIT_STUB(WebPInitConvertARGBToYUVSSE2) +WEBP_DSP_INIT_STUB(WebPInitSharpYUVSSE2) #endif // WEBP_USE_SSE2 diff --git a/thirdparty/libwebp/dsp/yuv_tables_sse2.h b/thirdparty/libwebp/dsp/yuv_tables_sse2.h deleted file mode 100644 index 2b0f057518..0000000000 --- a/thirdparty/libwebp/dsp/yuv_tables_sse2.h +++ /dev/null @@ -1,536 +0,0 @@ -// Copyright 2014 Google Inc. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style license -// that can be found in the COPYING file in the root of the source -// tree. An additional intellectual property rights grant can be found -// in the file PATENTS. All contributing project authors may -// be found in the AUTHORS file in the root of the source tree. -// ----------------------------------------------------------------------------- -// -// SSE2 tables for YUV->RGB conversion (12kB overall) -// -// Author: Skal (pascal.massimino@gmail.com) - -// This file is not compiled, but #include'd directly from yuv.c -// Only used if WEBP_YUV_USE_SSE2_TABLES is defined. - -static const VP8kCstSSE2 VP8kYtoRGBA[256] = { - {{0xfffb77b0, 0xfffb77b0, 0xfffb77b0, 0x003fc000}}, - {{0xfffbc235, 0xfffbc235, 0xfffbc235, 0x003fc000}}, - {{0xfffc0cba, 0xfffc0cba, 0xfffc0cba, 0x003fc000}}, - {{0xfffc573f, 0xfffc573f, 0xfffc573f, 0x003fc000}}, - {{0xfffca1c4, 0xfffca1c4, 0xfffca1c4, 0x003fc000}}, - {{0xfffcec49, 0xfffcec49, 0xfffcec49, 0x003fc000}}, - {{0xfffd36ce, 0xfffd36ce, 0xfffd36ce, 0x003fc000}}, - {{0xfffd8153, 0xfffd8153, 0xfffd8153, 0x003fc000}}, - {{0xfffdcbd8, 0xfffdcbd8, 0xfffdcbd8, 0x003fc000}}, - {{0xfffe165d, 0xfffe165d, 0xfffe165d, 0x003fc000}}, - {{0xfffe60e2, 0xfffe60e2, 0xfffe60e2, 0x003fc000}}, - {{0xfffeab67, 0xfffeab67, 0xfffeab67, 0x003fc000}}, - {{0xfffef5ec, 0xfffef5ec, 0xfffef5ec, 0x003fc000}}, - {{0xffff4071, 0xffff4071, 0xffff4071, 0x003fc000}}, - {{0xffff8af6, 0xffff8af6, 0xffff8af6, 0x003fc000}}, - {{0xffffd57b, 0xffffd57b, 0xffffd57b, 0x003fc000}}, - {{0x00002000, 0x00002000, 0x00002000, 0x003fc000}}, - {{0x00006a85, 0x00006a85, 0x00006a85, 0x003fc000}}, - {{0x0000b50a, 0x0000b50a, 0x0000b50a, 0x003fc000}}, - {{0x0000ff8f, 0x0000ff8f, 0x0000ff8f, 0x003fc000}}, - {{0x00014a14, 0x00014a14, 0x00014a14, 0x003fc000}}, - {{0x00019499, 0x00019499, 0x00019499, 0x003fc000}}, - {{0x0001df1e, 0x0001df1e, 0x0001df1e, 0x003fc000}}, - {{0x000229a3, 0x000229a3, 0x000229a3, 0x003fc000}}, - {{0x00027428, 0x00027428, 0x00027428, 0x003fc000}}, - {{0x0002bead, 0x0002bead, 0x0002bead, 0x003fc000}}, - {{0x00030932, 0x00030932, 0x00030932, 0x003fc000}}, - {{0x000353b7, 0x000353b7, 0x000353b7, 0x003fc000}}, - {{0x00039e3c, 0x00039e3c, 0x00039e3c, 0x003fc000}}, - {{0x0003e8c1, 0x0003e8c1, 0x0003e8c1, 0x003fc000}}, - {{0x00043346, 0x00043346, 0x00043346, 0x003fc000}}, - {{0x00047dcb, 0x00047dcb, 0x00047dcb, 0x003fc000}}, - {{0x0004c850, 0x0004c850, 0x0004c850, 0x003fc000}}, - {{0x000512d5, 0x000512d5, 0x000512d5, 0x003fc000}}, - {{0x00055d5a, 0x00055d5a, 0x00055d5a, 0x003fc000}}, - {{0x0005a7df, 0x0005a7df, 0x0005a7df, 0x003fc000}}, - {{0x0005f264, 0x0005f264, 0x0005f264, 0x003fc000}}, - {{0x00063ce9, 0x00063ce9, 0x00063ce9, 0x003fc000}}, - {{0x0006876e, 0x0006876e, 0x0006876e, 0x003fc000}}, - {{0x0006d1f3, 0x0006d1f3, 0x0006d1f3, 0x003fc000}}, - {{0x00071c78, 0x00071c78, 0x00071c78, 0x003fc000}}, - {{0x000766fd, 0x000766fd, 0x000766fd, 0x003fc000}}, - {{0x0007b182, 0x0007b182, 0x0007b182, 0x003fc000}}, - {{0x0007fc07, 0x0007fc07, 0x0007fc07, 0x003fc000}}, - {{0x0008468c, 0x0008468c, 0x0008468c, 0x003fc000}}, - {{0x00089111, 0x00089111, 0x00089111, 0x003fc000}}, - {{0x0008db96, 0x0008db96, 0x0008db96, 0x003fc000}}, - {{0x0009261b, 0x0009261b, 0x0009261b, 0x003fc000}}, - {{0x000970a0, 0x000970a0, 0x000970a0, 0x003fc000}}, - {{0x0009bb25, 0x0009bb25, 0x0009bb25, 0x003fc000}}, - {{0x000a05aa, 0x000a05aa, 0x000a05aa, 0x003fc000}}, - {{0x000a502f, 0x000a502f, 0x000a502f, 0x003fc000}}, - {{0x000a9ab4, 0x000a9ab4, 0x000a9ab4, 0x003fc000}}, - {{0x000ae539, 0x000ae539, 0x000ae539, 0x003fc000}}, - {{0x000b2fbe, 0x000b2fbe, 0x000b2fbe, 0x003fc000}}, - {{0x000b7a43, 0x000b7a43, 0x000b7a43, 0x003fc000}}, - {{0x000bc4c8, 0x000bc4c8, 0x000bc4c8, 0x003fc000}}, - {{0x000c0f4d, 0x000c0f4d, 0x000c0f4d, 0x003fc000}}, - {{0x000c59d2, 0x000c59d2, 0x000c59d2, 0x003fc000}}, - {{0x000ca457, 0x000ca457, 0x000ca457, 0x003fc000}}, - {{0x000ceedc, 0x000ceedc, 0x000ceedc, 0x003fc000}}, - {{0x000d3961, 0x000d3961, 0x000d3961, 0x003fc000}}, - {{0x000d83e6, 0x000d83e6, 0x000d83e6, 0x003fc000}}, - {{0x000dce6b, 0x000dce6b, 0x000dce6b, 0x003fc000}}, - {{0x000e18f0, 0x000e18f0, 0x000e18f0, 0x003fc000}}, - {{0x000e6375, 0x000e6375, 0x000e6375, 0x003fc000}}, - {{0x000eadfa, 0x000eadfa, 0x000eadfa, 0x003fc000}}, - {{0x000ef87f, 0x000ef87f, 0x000ef87f, 0x003fc000}}, - {{0x000f4304, 0x000f4304, 0x000f4304, 0x003fc000}}, - {{0x000f8d89, 0x000f8d89, 0x000f8d89, 0x003fc000}}, - {{0x000fd80e, 0x000fd80e, 0x000fd80e, 0x003fc000}}, - {{0x00102293, 0x00102293, 0x00102293, 0x003fc000}}, - {{0x00106d18, 0x00106d18, 0x00106d18, 0x003fc000}}, - {{0x0010b79d, 0x0010b79d, 0x0010b79d, 0x003fc000}}, - {{0x00110222, 0x00110222, 0x00110222, 0x003fc000}}, - {{0x00114ca7, 0x00114ca7, 0x00114ca7, 0x003fc000}}, - {{0x0011972c, 0x0011972c, 0x0011972c, 0x003fc000}}, - {{0x0011e1b1, 0x0011e1b1, 0x0011e1b1, 0x003fc000}}, - {{0x00122c36, 0x00122c36, 0x00122c36, 0x003fc000}}, - {{0x001276bb, 0x001276bb, 0x001276bb, 0x003fc000}}, - {{0x0012c140, 0x0012c140, 0x0012c140, 0x003fc000}}, - {{0x00130bc5, 0x00130bc5, 0x00130bc5, 0x003fc000}}, - {{0x0013564a, 0x0013564a, 0x0013564a, 0x003fc000}}, - {{0x0013a0cf, 0x0013a0cf, 0x0013a0cf, 0x003fc000}}, - {{0x0013eb54, 0x0013eb54, 0x0013eb54, 0x003fc000}}, - {{0x001435d9, 0x001435d9, 0x001435d9, 0x003fc000}}, - {{0x0014805e, 0x0014805e, 0x0014805e, 0x003fc000}}, - {{0x0014cae3, 0x0014cae3, 0x0014cae3, 0x003fc000}}, - {{0x00151568, 0x00151568, 0x00151568, 0x003fc000}}, - {{0x00155fed, 0x00155fed, 0x00155fed, 0x003fc000}}, - {{0x0015aa72, 0x0015aa72, 0x0015aa72, 0x003fc000}}, - {{0x0015f4f7, 0x0015f4f7, 0x0015f4f7, 0x003fc000}}, - {{0x00163f7c, 0x00163f7c, 0x00163f7c, 0x003fc000}}, - {{0x00168a01, 0x00168a01, 0x00168a01, 0x003fc000}}, - {{0x0016d486, 0x0016d486, 0x0016d486, 0x003fc000}}, - {{0x00171f0b, 0x00171f0b, 0x00171f0b, 0x003fc000}}, - {{0x00176990, 0x00176990, 0x00176990, 0x003fc000}}, - {{0x0017b415, 0x0017b415, 0x0017b415, 0x003fc000}}, - {{0x0017fe9a, 0x0017fe9a, 0x0017fe9a, 0x003fc000}}, - {{0x0018491f, 0x0018491f, 0x0018491f, 0x003fc000}}, - {{0x001893a4, 0x001893a4, 0x001893a4, 0x003fc000}}, - {{0x0018de29, 0x0018de29, 0x0018de29, 0x003fc000}}, - {{0x001928ae, 0x001928ae, 0x001928ae, 0x003fc000}}, - {{0x00197333, 0x00197333, 0x00197333, 0x003fc000}}, - {{0x0019bdb8, 0x0019bdb8, 0x0019bdb8, 0x003fc000}}, - {{0x001a083d, 0x001a083d, 0x001a083d, 0x003fc000}}, - {{0x001a52c2, 0x001a52c2, 0x001a52c2, 0x003fc000}}, - {{0x001a9d47, 0x001a9d47, 0x001a9d47, 0x003fc000}}, - {{0x001ae7cc, 0x001ae7cc, 0x001ae7cc, 0x003fc000}}, - {{0x001b3251, 0x001b3251, 0x001b3251, 0x003fc000}}, - {{0x001b7cd6, 0x001b7cd6, 0x001b7cd6, 0x003fc000}}, - {{0x001bc75b, 0x001bc75b, 0x001bc75b, 0x003fc000}}, - {{0x001c11e0, 0x001c11e0, 0x001c11e0, 0x003fc000}}, - {{0x001c5c65, 0x001c5c65, 0x001c5c65, 0x003fc000}}, - {{0x001ca6ea, 0x001ca6ea, 0x001ca6ea, 0x003fc000}}, - {{0x001cf16f, 0x001cf16f, 0x001cf16f, 0x003fc000}}, - {{0x001d3bf4, 0x001d3bf4, 0x001d3bf4, 0x003fc000}}, - {{0x001d8679, 0x001d8679, 0x001d8679, 0x003fc000}}, - {{0x001dd0fe, 0x001dd0fe, 0x001dd0fe, 0x003fc000}}, - {{0x001e1b83, 0x001e1b83, 0x001e1b83, 0x003fc000}}, - {{0x001e6608, 0x001e6608, 0x001e6608, 0x003fc000}}, - {{0x001eb08d, 0x001eb08d, 0x001eb08d, 0x003fc000}}, - {{0x001efb12, 0x001efb12, 0x001efb12, 0x003fc000}}, - {{0x001f4597, 0x001f4597, 0x001f4597, 0x003fc000}}, - {{0x001f901c, 0x001f901c, 0x001f901c, 0x003fc000}}, - {{0x001fdaa1, 0x001fdaa1, 0x001fdaa1, 0x003fc000}}, - {{0x00202526, 0x00202526, 0x00202526, 0x003fc000}}, - {{0x00206fab, 0x00206fab, 0x00206fab, 0x003fc000}}, - {{0x0020ba30, 0x0020ba30, 0x0020ba30, 0x003fc000}}, - {{0x002104b5, 0x002104b5, 0x002104b5, 0x003fc000}}, - {{0x00214f3a, 0x00214f3a, 0x00214f3a, 0x003fc000}}, - {{0x002199bf, 0x002199bf, 0x002199bf, 0x003fc000}}, - {{0x0021e444, 0x0021e444, 0x0021e444, 0x003fc000}}, - {{0x00222ec9, 0x00222ec9, 0x00222ec9, 0x003fc000}}, - {{0x0022794e, 0x0022794e, 0x0022794e, 0x003fc000}}, - {{0x0022c3d3, 0x0022c3d3, 0x0022c3d3, 0x003fc000}}, - {{0x00230e58, 0x00230e58, 0x00230e58, 0x003fc000}}, - {{0x002358dd, 0x002358dd, 0x002358dd, 0x003fc000}}, - {{0x0023a362, 0x0023a362, 0x0023a362, 0x003fc000}}, - {{0x0023ede7, 0x0023ede7, 0x0023ede7, 0x003fc000}}, - {{0x0024386c, 0x0024386c, 0x0024386c, 0x003fc000}}, - {{0x002482f1, 0x002482f1, 0x002482f1, 0x003fc000}}, - {{0x0024cd76, 0x0024cd76, 0x0024cd76, 0x003fc000}}, - {{0x002517fb, 0x002517fb, 0x002517fb, 0x003fc000}}, - {{0x00256280, 0x00256280, 0x00256280, 0x003fc000}}, - {{0x0025ad05, 0x0025ad05, 0x0025ad05, 0x003fc000}}, - {{0x0025f78a, 0x0025f78a, 0x0025f78a, 0x003fc000}}, - {{0x0026420f, 0x0026420f, 0x0026420f, 0x003fc000}}, - {{0x00268c94, 0x00268c94, 0x00268c94, 0x003fc000}}, - {{0x0026d719, 0x0026d719, 0x0026d719, 0x003fc000}}, - {{0x0027219e, 0x0027219e, 0x0027219e, 0x003fc000}}, - {{0x00276c23, 0x00276c23, 0x00276c23, 0x003fc000}}, - {{0x0027b6a8, 0x0027b6a8, 0x0027b6a8, 0x003fc000}}, - {{0x0028012d, 0x0028012d, 0x0028012d, 0x003fc000}}, - {{0x00284bb2, 0x00284bb2, 0x00284bb2, 0x003fc000}}, - {{0x00289637, 0x00289637, 0x00289637, 0x003fc000}}, - {{0x0028e0bc, 0x0028e0bc, 0x0028e0bc, 0x003fc000}}, - {{0x00292b41, 0x00292b41, 0x00292b41, 0x003fc000}}, - {{0x002975c6, 0x002975c6, 0x002975c6, 0x003fc000}}, - {{0x0029c04b, 0x0029c04b, 0x0029c04b, 0x003fc000}}, - {{0x002a0ad0, 0x002a0ad0, 0x002a0ad0, 0x003fc000}}, - {{0x002a5555, 0x002a5555, 0x002a5555, 0x003fc000}}, - {{0x002a9fda, 0x002a9fda, 0x002a9fda, 0x003fc000}}, - {{0x002aea5f, 0x002aea5f, 0x002aea5f, 0x003fc000}}, - {{0x002b34e4, 0x002b34e4, 0x002b34e4, 0x003fc000}}, - {{0x002b7f69, 0x002b7f69, 0x002b7f69, 0x003fc000}}, - {{0x002bc9ee, 0x002bc9ee, 0x002bc9ee, 0x003fc000}}, - {{0x002c1473, 0x002c1473, 0x002c1473, 0x003fc000}}, - {{0x002c5ef8, 0x002c5ef8, 0x002c5ef8, 0x003fc000}}, - {{0x002ca97d, 0x002ca97d, 0x002ca97d, 0x003fc000}}, - {{0x002cf402, 0x002cf402, 0x002cf402, 0x003fc000}}, - {{0x002d3e87, 0x002d3e87, 0x002d3e87, 0x003fc000}}, - {{0x002d890c, 0x002d890c, 0x002d890c, 0x003fc000}}, - {{0x002dd391, 0x002dd391, 0x002dd391, 0x003fc000}}, - {{0x002e1e16, 0x002e1e16, 0x002e1e16, 0x003fc000}}, - {{0x002e689b, 0x002e689b, 0x002e689b, 0x003fc000}}, - {{0x002eb320, 0x002eb320, 0x002eb320, 0x003fc000}}, - {{0x002efda5, 0x002efda5, 0x002efda5, 0x003fc000}}, - {{0x002f482a, 0x002f482a, 0x002f482a, 0x003fc000}}, - {{0x002f92af, 0x002f92af, 0x002f92af, 0x003fc000}}, - {{0x002fdd34, 0x002fdd34, 0x002fdd34, 0x003fc000}}, - {{0x003027b9, 0x003027b9, 0x003027b9, 0x003fc000}}, - {{0x0030723e, 0x0030723e, 0x0030723e, 0x003fc000}}, - {{0x0030bcc3, 0x0030bcc3, 0x0030bcc3, 0x003fc000}}, - {{0x00310748, 0x00310748, 0x00310748, 0x003fc000}}, - {{0x003151cd, 0x003151cd, 0x003151cd, 0x003fc000}}, - {{0x00319c52, 0x00319c52, 0x00319c52, 0x003fc000}}, - {{0x0031e6d7, 0x0031e6d7, 0x0031e6d7, 0x003fc000}}, - {{0x0032315c, 0x0032315c, 0x0032315c, 0x003fc000}}, - {{0x00327be1, 0x00327be1, 0x00327be1, 0x003fc000}}, - {{0x0032c666, 0x0032c666, 0x0032c666, 0x003fc000}}, - {{0x003310eb, 0x003310eb, 0x003310eb, 0x003fc000}}, - {{0x00335b70, 0x00335b70, 0x00335b70, 0x003fc000}}, - {{0x0033a5f5, 0x0033a5f5, 0x0033a5f5, 0x003fc000}}, - {{0x0033f07a, 0x0033f07a, 0x0033f07a, 0x003fc000}}, - {{0x00343aff, 0x00343aff, 0x00343aff, 0x003fc000}}, - {{0x00348584, 0x00348584, 0x00348584, 0x003fc000}}, - {{0x0034d009, 0x0034d009, 0x0034d009, 0x003fc000}}, - {{0x00351a8e, 0x00351a8e, 0x00351a8e, 0x003fc000}}, - {{0x00356513, 0x00356513, 0x00356513, 0x003fc000}}, - {{0x0035af98, 0x0035af98, 0x0035af98, 0x003fc000}}, - {{0x0035fa1d, 0x0035fa1d, 0x0035fa1d, 0x003fc000}}, - {{0x003644a2, 0x003644a2, 0x003644a2, 0x003fc000}}, - {{0x00368f27, 0x00368f27, 0x00368f27, 0x003fc000}}, - {{0x0036d9ac, 0x0036d9ac, 0x0036d9ac, 0x003fc000}}, - {{0x00372431, 0x00372431, 0x00372431, 0x003fc000}}, - {{0x00376eb6, 0x00376eb6, 0x00376eb6, 0x003fc000}}, - {{0x0037b93b, 0x0037b93b, 0x0037b93b, 0x003fc000}}, - {{0x003803c0, 0x003803c0, 0x003803c0, 0x003fc000}}, - {{0x00384e45, 0x00384e45, 0x00384e45, 0x003fc000}}, - {{0x003898ca, 0x003898ca, 0x003898ca, 0x003fc000}}, - {{0x0038e34f, 0x0038e34f, 0x0038e34f, 0x003fc000}}, - {{0x00392dd4, 0x00392dd4, 0x00392dd4, 0x003fc000}}, - {{0x00397859, 0x00397859, 0x00397859, 0x003fc000}}, - {{0x0039c2de, 0x0039c2de, 0x0039c2de, 0x003fc000}}, - {{0x003a0d63, 0x003a0d63, 0x003a0d63, 0x003fc000}}, - {{0x003a57e8, 0x003a57e8, 0x003a57e8, 0x003fc000}}, - {{0x003aa26d, 0x003aa26d, 0x003aa26d, 0x003fc000}}, - {{0x003aecf2, 0x003aecf2, 0x003aecf2, 0x003fc000}}, - {{0x003b3777, 0x003b3777, 0x003b3777, 0x003fc000}}, - {{0x003b81fc, 0x003b81fc, 0x003b81fc, 0x003fc000}}, - {{0x003bcc81, 0x003bcc81, 0x003bcc81, 0x003fc000}}, - {{0x003c1706, 0x003c1706, 0x003c1706, 0x003fc000}}, - {{0x003c618b, 0x003c618b, 0x003c618b, 0x003fc000}}, - {{0x003cac10, 0x003cac10, 0x003cac10, 0x003fc000}}, - {{0x003cf695, 0x003cf695, 0x003cf695, 0x003fc000}}, - {{0x003d411a, 0x003d411a, 0x003d411a, 0x003fc000}}, - {{0x003d8b9f, 0x003d8b9f, 0x003d8b9f, 0x003fc000}}, - {{0x003dd624, 0x003dd624, 0x003dd624, 0x003fc000}}, - {{0x003e20a9, 0x003e20a9, 0x003e20a9, 0x003fc000}}, - {{0x003e6b2e, 0x003e6b2e, 0x003e6b2e, 0x003fc000}}, - {{0x003eb5b3, 0x003eb5b3, 0x003eb5b3, 0x003fc000}}, - {{0x003f0038, 0x003f0038, 0x003f0038, 0x003fc000}}, - {{0x003f4abd, 0x003f4abd, 0x003f4abd, 0x003fc000}}, - {{0x003f9542, 0x003f9542, 0x003f9542, 0x003fc000}}, - {{0x003fdfc7, 0x003fdfc7, 0x003fdfc7, 0x003fc000}}, - {{0x00402a4c, 0x00402a4c, 0x00402a4c, 0x003fc000}}, - {{0x004074d1, 0x004074d1, 0x004074d1, 0x003fc000}}, - {{0x0040bf56, 0x0040bf56, 0x0040bf56, 0x003fc000}}, - {{0x004109db, 0x004109db, 0x004109db, 0x003fc000}}, - {{0x00415460, 0x00415460, 0x00415460, 0x003fc000}}, - {{0x00419ee5, 0x00419ee5, 0x00419ee5, 0x003fc000}}, - {{0x0041e96a, 0x0041e96a, 0x0041e96a, 0x003fc000}}, - {{0x004233ef, 0x004233ef, 0x004233ef, 0x003fc000}}, - {{0x00427e74, 0x00427e74, 0x00427e74, 0x003fc000}}, - {{0x0042c8f9, 0x0042c8f9, 0x0042c8f9, 0x003fc000}}, - {{0x0043137e, 0x0043137e, 0x0043137e, 0x003fc000}}, - {{0x00435e03, 0x00435e03, 0x00435e03, 0x003fc000}}, - {{0x0043a888, 0x0043a888, 0x0043a888, 0x003fc000}}, - {{0x0043f30d, 0x0043f30d, 0x0043f30d, 0x003fc000}}, - {{0x00443d92, 0x00443d92, 0x00443d92, 0x003fc000}}, - {{0x00448817, 0x00448817, 0x00448817, 0x003fc000}}, - {{0x0044d29c, 0x0044d29c, 0x0044d29c, 0x003fc000}}, - {{0x00451d21, 0x00451d21, 0x00451d21, 0x003fc000}}, - {{0x004567a6, 0x004567a6, 0x004567a6, 0x003fc000}}, - {{0x0045b22b, 0x0045b22b, 0x0045b22b, 0x003fc000}} -}; - -static const VP8kCstSSE2 VP8kUtoRGBA[256] = { - {{0, 0x000c8980, 0xffbf7300, 0}}, {{0, 0x000c706d, 0xffbff41a, 0}}, - {{0, 0x000c575a, 0xffc07534, 0}}, {{0, 0x000c3e47, 0xffc0f64e, 0}}, - {{0, 0x000c2534, 0xffc17768, 0}}, {{0, 0x000c0c21, 0xffc1f882, 0}}, - {{0, 0x000bf30e, 0xffc2799c, 0}}, {{0, 0x000bd9fb, 0xffc2fab6, 0}}, - {{0, 0x000bc0e8, 0xffc37bd0, 0}}, {{0, 0x000ba7d5, 0xffc3fcea, 0}}, - {{0, 0x000b8ec2, 0xffc47e04, 0}}, {{0, 0x000b75af, 0xffc4ff1e, 0}}, - {{0, 0x000b5c9c, 0xffc58038, 0}}, {{0, 0x000b4389, 0xffc60152, 0}}, - {{0, 0x000b2a76, 0xffc6826c, 0}}, {{0, 0x000b1163, 0xffc70386, 0}}, - {{0, 0x000af850, 0xffc784a0, 0}}, {{0, 0x000adf3d, 0xffc805ba, 0}}, - {{0, 0x000ac62a, 0xffc886d4, 0}}, {{0, 0x000aad17, 0xffc907ee, 0}}, - {{0, 0x000a9404, 0xffc98908, 0}}, {{0, 0x000a7af1, 0xffca0a22, 0}}, - {{0, 0x000a61de, 0xffca8b3c, 0}}, {{0, 0x000a48cb, 0xffcb0c56, 0}}, - {{0, 0x000a2fb8, 0xffcb8d70, 0}}, {{0, 0x000a16a5, 0xffcc0e8a, 0}}, - {{0, 0x0009fd92, 0xffcc8fa4, 0}}, {{0, 0x0009e47f, 0xffcd10be, 0}}, - {{0, 0x0009cb6c, 0xffcd91d8, 0}}, {{0, 0x0009b259, 0xffce12f2, 0}}, - {{0, 0x00099946, 0xffce940c, 0}}, {{0, 0x00098033, 0xffcf1526, 0}}, - {{0, 0x00096720, 0xffcf9640, 0}}, {{0, 0x00094e0d, 0xffd0175a, 0}}, - {{0, 0x000934fa, 0xffd09874, 0}}, {{0, 0x00091be7, 0xffd1198e, 0}}, - {{0, 0x000902d4, 0xffd19aa8, 0}}, {{0, 0x0008e9c1, 0xffd21bc2, 0}}, - {{0, 0x0008d0ae, 0xffd29cdc, 0}}, {{0, 0x0008b79b, 0xffd31df6, 0}}, - {{0, 0x00089e88, 0xffd39f10, 0}}, {{0, 0x00088575, 0xffd4202a, 0}}, - {{0, 0x00086c62, 0xffd4a144, 0}}, {{0, 0x0008534f, 0xffd5225e, 0}}, - {{0, 0x00083a3c, 0xffd5a378, 0}}, {{0, 0x00082129, 0xffd62492, 0}}, - {{0, 0x00080816, 0xffd6a5ac, 0}}, {{0, 0x0007ef03, 0xffd726c6, 0}}, - {{0, 0x0007d5f0, 0xffd7a7e0, 0}}, {{0, 0x0007bcdd, 0xffd828fa, 0}}, - {{0, 0x0007a3ca, 0xffd8aa14, 0}}, {{0, 0x00078ab7, 0xffd92b2e, 0}}, - {{0, 0x000771a4, 0xffd9ac48, 0}}, {{0, 0x00075891, 0xffda2d62, 0}}, - {{0, 0x00073f7e, 0xffdaae7c, 0}}, {{0, 0x0007266b, 0xffdb2f96, 0}}, - {{0, 0x00070d58, 0xffdbb0b0, 0}}, {{0, 0x0006f445, 0xffdc31ca, 0}}, - {{0, 0x0006db32, 0xffdcb2e4, 0}}, {{0, 0x0006c21f, 0xffdd33fe, 0}}, - {{0, 0x0006a90c, 0xffddb518, 0}}, {{0, 0x00068ff9, 0xffde3632, 0}}, - {{0, 0x000676e6, 0xffdeb74c, 0}}, {{0, 0x00065dd3, 0xffdf3866, 0}}, - {{0, 0x000644c0, 0xffdfb980, 0}}, {{0, 0x00062bad, 0xffe03a9a, 0}}, - {{0, 0x0006129a, 0xffe0bbb4, 0}}, {{0, 0x0005f987, 0xffe13cce, 0}}, - {{0, 0x0005e074, 0xffe1bde8, 0}}, {{0, 0x0005c761, 0xffe23f02, 0}}, - {{0, 0x0005ae4e, 0xffe2c01c, 0}}, {{0, 0x0005953b, 0xffe34136, 0}}, - {{0, 0x00057c28, 0xffe3c250, 0}}, {{0, 0x00056315, 0xffe4436a, 0}}, - {{0, 0x00054a02, 0xffe4c484, 0}}, {{0, 0x000530ef, 0xffe5459e, 0}}, - {{0, 0x000517dc, 0xffe5c6b8, 0}}, {{0, 0x0004fec9, 0xffe647d2, 0}}, - {{0, 0x0004e5b6, 0xffe6c8ec, 0}}, {{0, 0x0004cca3, 0xffe74a06, 0}}, - {{0, 0x0004b390, 0xffe7cb20, 0}}, {{0, 0x00049a7d, 0xffe84c3a, 0}}, - {{0, 0x0004816a, 0xffe8cd54, 0}}, {{0, 0x00046857, 0xffe94e6e, 0}}, - {{0, 0x00044f44, 0xffe9cf88, 0}}, {{0, 0x00043631, 0xffea50a2, 0}}, - {{0, 0x00041d1e, 0xffead1bc, 0}}, {{0, 0x0004040b, 0xffeb52d6, 0}}, - {{0, 0x0003eaf8, 0xffebd3f0, 0}}, {{0, 0x0003d1e5, 0xffec550a, 0}}, - {{0, 0x0003b8d2, 0xffecd624, 0}}, {{0, 0x00039fbf, 0xffed573e, 0}}, - {{0, 0x000386ac, 0xffedd858, 0}}, {{0, 0x00036d99, 0xffee5972, 0}}, - {{0, 0x00035486, 0xffeeda8c, 0}}, {{0, 0x00033b73, 0xffef5ba6, 0}}, - {{0, 0x00032260, 0xffefdcc0, 0}}, {{0, 0x0003094d, 0xfff05dda, 0}}, - {{0, 0x0002f03a, 0xfff0def4, 0}}, {{0, 0x0002d727, 0xfff1600e, 0}}, - {{0, 0x0002be14, 0xfff1e128, 0}}, {{0, 0x0002a501, 0xfff26242, 0}}, - {{0, 0x00028bee, 0xfff2e35c, 0}}, {{0, 0x000272db, 0xfff36476, 0}}, - {{0, 0x000259c8, 0xfff3e590, 0}}, {{0, 0x000240b5, 0xfff466aa, 0}}, - {{0, 0x000227a2, 0xfff4e7c4, 0}}, {{0, 0x00020e8f, 0xfff568de, 0}}, - {{0, 0x0001f57c, 0xfff5e9f8, 0}}, {{0, 0x0001dc69, 0xfff66b12, 0}}, - {{0, 0x0001c356, 0xfff6ec2c, 0}}, {{0, 0x0001aa43, 0xfff76d46, 0}}, - {{0, 0x00019130, 0xfff7ee60, 0}}, {{0, 0x0001781d, 0xfff86f7a, 0}}, - {{0, 0x00015f0a, 0xfff8f094, 0}}, {{0, 0x000145f7, 0xfff971ae, 0}}, - {{0, 0x00012ce4, 0xfff9f2c8, 0}}, {{0, 0x000113d1, 0xfffa73e2, 0}}, - {{0, 0x0000fabe, 0xfffaf4fc, 0}}, {{0, 0x0000e1ab, 0xfffb7616, 0}}, - {{0, 0x0000c898, 0xfffbf730, 0}}, {{0, 0x0000af85, 0xfffc784a, 0}}, - {{0, 0x00009672, 0xfffcf964, 0}}, {{0, 0x00007d5f, 0xfffd7a7e, 0}}, - {{0, 0x0000644c, 0xfffdfb98, 0}}, {{0, 0x00004b39, 0xfffe7cb2, 0}}, - {{0, 0x00003226, 0xfffefdcc, 0}}, {{0, 0x00001913, 0xffff7ee6, 0}}, - {{0, 0x00000000, 0x00000000, 0}}, {{0, 0xffffe6ed, 0x0000811a, 0}}, - {{0, 0xffffcdda, 0x00010234, 0}}, {{0, 0xffffb4c7, 0x0001834e, 0}}, - {{0, 0xffff9bb4, 0x00020468, 0}}, {{0, 0xffff82a1, 0x00028582, 0}}, - {{0, 0xffff698e, 0x0003069c, 0}}, {{0, 0xffff507b, 0x000387b6, 0}}, - {{0, 0xffff3768, 0x000408d0, 0}}, {{0, 0xffff1e55, 0x000489ea, 0}}, - {{0, 0xffff0542, 0x00050b04, 0}}, {{0, 0xfffeec2f, 0x00058c1e, 0}}, - {{0, 0xfffed31c, 0x00060d38, 0}}, {{0, 0xfffeba09, 0x00068e52, 0}}, - {{0, 0xfffea0f6, 0x00070f6c, 0}}, {{0, 0xfffe87e3, 0x00079086, 0}}, - {{0, 0xfffe6ed0, 0x000811a0, 0}}, {{0, 0xfffe55bd, 0x000892ba, 0}}, - {{0, 0xfffe3caa, 0x000913d4, 0}}, {{0, 0xfffe2397, 0x000994ee, 0}}, - {{0, 0xfffe0a84, 0x000a1608, 0}}, {{0, 0xfffdf171, 0x000a9722, 0}}, - {{0, 0xfffdd85e, 0x000b183c, 0}}, {{0, 0xfffdbf4b, 0x000b9956, 0}}, - {{0, 0xfffda638, 0x000c1a70, 0}}, {{0, 0xfffd8d25, 0x000c9b8a, 0}}, - {{0, 0xfffd7412, 0x000d1ca4, 0}}, {{0, 0xfffd5aff, 0x000d9dbe, 0}}, - {{0, 0xfffd41ec, 0x000e1ed8, 0}}, {{0, 0xfffd28d9, 0x000e9ff2, 0}}, - {{0, 0xfffd0fc6, 0x000f210c, 0}}, {{0, 0xfffcf6b3, 0x000fa226, 0}}, - {{0, 0xfffcdda0, 0x00102340, 0}}, {{0, 0xfffcc48d, 0x0010a45a, 0}}, - {{0, 0xfffcab7a, 0x00112574, 0}}, {{0, 0xfffc9267, 0x0011a68e, 0}}, - {{0, 0xfffc7954, 0x001227a8, 0}}, {{0, 0xfffc6041, 0x0012a8c2, 0}}, - {{0, 0xfffc472e, 0x001329dc, 0}}, {{0, 0xfffc2e1b, 0x0013aaf6, 0}}, - {{0, 0xfffc1508, 0x00142c10, 0}}, {{0, 0xfffbfbf5, 0x0014ad2a, 0}}, - {{0, 0xfffbe2e2, 0x00152e44, 0}}, {{0, 0xfffbc9cf, 0x0015af5e, 0}}, - {{0, 0xfffbb0bc, 0x00163078, 0}}, {{0, 0xfffb97a9, 0x0016b192, 0}}, - {{0, 0xfffb7e96, 0x001732ac, 0}}, {{0, 0xfffb6583, 0x0017b3c6, 0}}, - {{0, 0xfffb4c70, 0x001834e0, 0}}, {{0, 0xfffb335d, 0x0018b5fa, 0}}, - {{0, 0xfffb1a4a, 0x00193714, 0}}, {{0, 0xfffb0137, 0x0019b82e, 0}}, - {{0, 0xfffae824, 0x001a3948, 0}}, {{0, 0xfffacf11, 0x001aba62, 0}}, - {{0, 0xfffab5fe, 0x001b3b7c, 0}}, {{0, 0xfffa9ceb, 0x001bbc96, 0}}, - {{0, 0xfffa83d8, 0x001c3db0, 0}}, {{0, 0xfffa6ac5, 0x001cbeca, 0}}, - {{0, 0xfffa51b2, 0x001d3fe4, 0}}, {{0, 0xfffa389f, 0x001dc0fe, 0}}, - {{0, 0xfffa1f8c, 0x001e4218, 0}}, {{0, 0xfffa0679, 0x001ec332, 0}}, - {{0, 0xfff9ed66, 0x001f444c, 0}}, {{0, 0xfff9d453, 0x001fc566, 0}}, - {{0, 0xfff9bb40, 0x00204680, 0}}, {{0, 0xfff9a22d, 0x0020c79a, 0}}, - {{0, 0xfff9891a, 0x002148b4, 0}}, {{0, 0xfff97007, 0x0021c9ce, 0}}, - {{0, 0xfff956f4, 0x00224ae8, 0}}, {{0, 0xfff93de1, 0x0022cc02, 0}}, - {{0, 0xfff924ce, 0x00234d1c, 0}}, {{0, 0xfff90bbb, 0x0023ce36, 0}}, - {{0, 0xfff8f2a8, 0x00244f50, 0}}, {{0, 0xfff8d995, 0x0024d06a, 0}}, - {{0, 0xfff8c082, 0x00255184, 0}}, {{0, 0xfff8a76f, 0x0025d29e, 0}}, - {{0, 0xfff88e5c, 0x002653b8, 0}}, {{0, 0xfff87549, 0x0026d4d2, 0}}, - {{0, 0xfff85c36, 0x002755ec, 0}}, {{0, 0xfff84323, 0x0027d706, 0}}, - {{0, 0xfff82a10, 0x00285820, 0}}, {{0, 0xfff810fd, 0x0028d93a, 0}}, - {{0, 0xfff7f7ea, 0x00295a54, 0}}, {{0, 0xfff7ded7, 0x0029db6e, 0}}, - {{0, 0xfff7c5c4, 0x002a5c88, 0}}, {{0, 0xfff7acb1, 0x002adda2, 0}}, - {{0, 0xfff7939e, 0x002b5ebc, 0}}, {{0, 0xfff77a8b, 0x002bdfd6, 0}}, - {{0, 0xfff76178, 0x002c60f0, 0}}, {{0, 0xfff74865, 0x002ce20a, 0}}, - {{0, 0xfff72f52, 0x002d6324, 0}}, {{0, 0xfff7163f, 0x002de43e, 0}}, - {{0, 0xfff6fd2c, 0x002e6558, 0}}, {{0, 0xfff6e419, 0x002ee672, 0}}, - {{0, 0xfff6cb06, 0x002f678c, 0}}, {{0, 0xfff6b1f3, 0x002fe8a6, 0}}, - {{0, 0xfff698e0, 0x003069c0, 0}}, {{0, 0xfff67fcd, 0x0030eada, 0}}, - {{0, 0xfff666ba, 0x00316bf4, 0}}, {{0, 0xfff64da7, 0x0031ed0e, 0}}, - {{0, 0xfff63494, 0x00326e28, 0}}, {{0, 0xfff61b81, 0x0032ef42, 0}}, - {{0, 0xfff6026e, 0x0033705c, 0}}, {{0, 0xfff5e95b, 0x0033f176, 0}}, - {{0, 0xfff5d048, 0x00347290, 0}}, {{0, 0xfff5b735, 0x0034f3aa, 0}}, - {{0, 0xfff59e22, 0x003574c4, 0}}, {{0, 0xfff5850f, 0x0035f5de, 0}}, - {{0, 0xfff56bfc, 0x003676f8, 0}}, {{0, 0xfff552e9, 0x0036f812, 0}}, - {{0, 0xfff539d6, 0x0037792c, 0}}, {{0, 0xfff520c3, 0x0037fa46, 0}}, - {{0, 0xfff507b0, 0x00387b60, 0}}, {{0, 0xfff4ee9d, 0x0038fc7a, 0}}, - {{0, 0xfff4d58a, 0x00397d94, 0}}, {{0, 0xfff4bc77, 0x0039feae, 0}}, - {{0, 0xfff4a364, 0x003a7fc8, 0}}, {{0, 0xfff48a51, 0x003b00e2, 0}}, - {{0, 0xfff4713e, 0x003b81fc, 0}}, {{0, 0xfff4582b, 0x003c0316, 0}}, - {{0, 0xfff43f18, 0x003c8430, 0}}, {{0, 0xfff42605, 0x003d054a, 0}}, - {{0, 0xfff40cf2, 0x003d8664, 0}}, {{0, 0xfff3f3df, 0x003e077e, 0}}, - {{0, 0xfff3dacc, 0x003e8898, 0}}, {{0, 0xfff3c1b9, 0x003f09b2, 0}}, - {{0, 0xfff3a8a6, 0x003f8acc, 0}}, {{0, 0xfff38f93, 0x00400be6, 0}} -}; - -static VP8kCstSSE2 VP8kVtoRGBA[256] = { - {{0xffcced80, 0x001a0400, 0, 0}}, {{0xffcd53a5, 0x0019cff8, 0, 0}}, - {{0xffcdb9ca, 0x00199bf0, 0, 0}}, {{0xffce1fef, 0x001967e8, 0, 0}}, - {{0xffce8614, 0x001933e0, 0, 0}}, {{0xffceec39, 0x0018ffd8, 0, 0}}, - {{0xffcf525e, 0x0018cbd0, 0, 0}}, {{0xffcfb883, 0x001897c8, 0, 0}}, - {{0xffd01ea8, 0x001863c0, 0, 0}}, {{0xffd084cd, 0x00182fb8, 0, 0}}, - {{0xffd0eaf2, 0x0017fbb0, 0, 0}}, {{0xffd15117, 0x0017c7a8, 0, 0}}, - {{0xffd1b73c, 0x001793a0, 0, 0}}, {{0xffd21d61, 0x00175f98, 0, 0}}, - {{0xffd28386, 0x00172b90, 0, 0}}, {{0xffd2e9ab, 0x0016f788, 0, 0}}, - {{0xffd34fd0, 0x0016c380, 0, 0}}, {{0xffd3b5f5, 0x00168f78, 0, 0}}, - {{0xffd41c1a, 0x00165b70, 0, 0}}, {{0xffd4823f, 0x00162768, 0, 0}}, - {{0xffd4e864, 0x0015f360, 0, 0}}, {{0xffd54e89, 0x0015bf58, 0, 0}}, - {{0xffd5b4ae, 0x00158b50, 0, 0}}, {{0xffd61ad3, 0x00155748, 0, 0}}, - {{0xffd680f8, 0x00152340, 0, 0}}, {{0xffd6e71d, 0x0014ef38, 0, 0}}, - {{0xffd74d42, 0x0014bb30, 0, 0}}, {{0xffd7b367, 0x00148728, 0, 0}}, - {{0xffd8198c, 0x00145320, 0, 0}}, {{0xffd87fb1, 0x00141f18, 0, 0}}, - {{0xffd8e5d6, 0x0013eb10, 0, 0}}, {{0xffd94bfb, 0x0013b708, 0, 0}}, - {{0xffd9b220, 0x00138300, 0, 0}}, {{0xffda1845, 0x00134ef8, 0, 0}}, - {{0xffda7e6a, 0x00131af0, 0, 0}}, {{0xffdae48f, 0x0012e6e8, 0, 0}}, - {{0xffdb4ab4, 0x0012b2e0, 0, 0}}, {{0xffdbb0d9, 0x00127ed8, 0, 0}}, - {{0xffdc16fe, 0x00124ad0, 0, 0}}, {{0xffdc7d23, 0x001216c8, 0, 0}}, - {{0xffdce348, 0x0011e2c0, 0, 0}}, {{0xffdd496d, 0x0011aeb8, 0, 0}}, - {{0xffddaf92, 0x00117ab0, 0, 0}}, {{0xffde15b7, 0x001146a8, 0, 0}}, - {{0xffde7bdc, 0x001112a0, 0, 0}}, {{0xffdee201, 0x0010de98, 0, 0}}, - {{0xffdf4826, 0x0010aa90, 0, 0}}, {{0xffdfae4b, 0x00107688, 0, 0}}, - {{0xffe01470, 0x00104280, 0, 0}}, {{0xffe07a95, 0x00100e78, 0, 0}}, - {{0xffe0e0ba, 0x000fda70, 0, 0}}, {{0xffe146df, 0x000fa668, 0, 0}}, - {{0xffe1ad04, 0x000f7260, 0, 0}}, {{0xffe21329, 0x000f3e58, 0, 0}}, - {{0xffe2794e, 0x000f0a50, 0, 0}}, {{0xffe2df73, 0x000ed648, 0, 0}}, - {{0xffe34598, 0x000ea240, 0, 0}}, {{0xffe3abbd, 0x000e6e38, 0, 0}}, - {{0xffe411e2, 0x000e3a30, 0, 0}}, {{0xffe47807, 0x000e0628, 0, 0}}, - {{0xffe4de2c, 0x000dd220, 0, 0}}, {{0xffe54451, 0x000d9e18, 0, 0}}, - {{0xffe5aa76, 0x000d6a10, 0, 0}}, {{0xffe6109b, 0x000d3608, 0, 0}}, - {{0xffe676c0, 0x000d0200, 0, 0}}, {{0xffe6dce5, 0x000ccdf8, 0, 0}}, - {{0xffe7430a, 0x000c99f0, 0, 0}}, {{0xffe7a92f, 0x000c65e8, 0, 0}}, - {{0xffe80f54, 0x000c31e0, 0, 0}}, {{0xffe87579, 0x000bfdd8, 0, 0}}, - {{0xffe8db9e, 0x000bc9d0, 0, 0}}, {{0xffe941c3, 0x000b95c8, 0, 0}}, - {{0xffe9a7e8, 0x000b61c0, 0, 0}}, {{0xffea0e0d, 0x000b2db8, 0, 0}}, - {{0xffea7432, 0x000af9b0, 0, 0}}, {{0xffeada57, 0x000ac5a8, 0, 0}}, - {{0xffeb407c, 0x000a91a0, 0, 0}}, {{0xffeba6a1, 0x000a5d98, 0, 0}}, - {{0xffec0cc6, 0x000a2990, 0, 0}}, {{0xffec72eb, 0x0009f588, 0, 0}}, - {{0xffecd910, 0x0009c180, 0, 0}}, {{0xffed3f35, 0x00098d78, 0, 0}}, - {{0xffeda55a, 0x00095970, 0, 0}}, {{0xffee0b7f, 0x00092568, 0, 0}}, - {{0xffee71a4, 0x0008f160, 0, 0}}, {{0xffeed7c9, 0x0008bd58, 0, 0}}, - {{0xffef3dee, 0x00088950, 0, 0}}, {{0xffefa413, 0x00085548, 0, 0}}, - {{0xfff00a38, 0x00082140, 0, 0}}, {{0xfff0705d, 0x0007ed38, 0, 0}}, - {{0xfff0d682, 0x0007b930, 0, 0}}, {{0xfff13ca7, 0x00078528, 0, 0}}, - {{0xfff1a2cc, 0x00075120, 0, 0}}, {{0xfff208f1, 0x00071d18, 0, 0}}, - {{0xfff26f16, 0x0006e910, 0, 0}}, {{0xfff2d53b, 0x0006b508, 0, 0}}, - {{0xfff33b60, 0x00068100, 0, 0}}, {{0xfff3a185, 0x00064cf8, 0, 0}}, - {{0xfff407aa, 0x000618f0, 0, 0}}, {{0xfff46dcf, 0x0005e4e8, 0, 0}}, - {{0xfff4d3f4, 0x0005b0e0, 0, 0}}, {{0xfff53a19, 0x00057cd8, 0, 0}}, - {{0xfff5a03e, 0x000548d0, 0, 0}}, {{0xfff60663, 0x000514c8, 0, 0}}, - {{0xfff66c88, 0x0004e0c0, 0, 0}}, {{0xfff6d2ad, 0x0004acb8, 0, 0}}, - {{0xfff738d2, 0x000478b0, 0, 0}}, {{0xfff79ef7, 0x000444a8, 0, 0}}, - {{0xfff8051c, 0x000410a0, 0, 0}}, {{0xfff86b41, 0x0003dc98, 0, 0}}, - {{0xfff8d166, 0x0003a890, 0, 0}}, {{0xfff9378b, 0x00037488, 0, 0}}, - {{0xfff99db0, 0x00034080, 0, 0}}, {{0xfffa03d5, 0x00030c78, 0, 0}}, - {{0xfffa69fa, 0x0002d870, 0, 0}}, {{0xfffad01f, 0x0002a468, 0, 0}}, - {{0xfffb3644, 0x00027060, 0, 0}}, {{0xfffb9c69, 0x00023c58, 0, 0}}, - {{0xfffc028e, 0x00020850, 0, 0}}, {{0xfffc68b3, 0x0001d448, 0, 0}}, - {{0xfffcced8, 0x0001a040, 0, 0}}, {{0xfffd34fd, 0x00016c38, 0, 0}}, - {{0xfffd9b22, 0x00013830, 0, 0}}, {{0xfffe0147, 0x00010428, 0, 0}}, - {{0xfffe676c, 0x0000d020, 0, 0}}, {{0xfffecd91, 0x00009c18, 0, 0}}, - {{0xffff33b6, 0x00006810, 0, 0}}, {{0xffff99db, 0x00003408, 0, 0}}, - {{0x00000000, 0x00000000, 0, 0}}, {{0x00006625, 0xffffcbf8, 0, 0}}, - {{0x0000cc4a, 0xffff97f0, 0, 0}}, {{0x0001326f, 0xffff63e8, 0, 0}}, - {{0x00019894, 0xffff2fe0, 0, 0}}, {{0x0001feb9, 0xfffefbd8, 0, 0}}, - {{0x000264de, 0xfffec7d0, 0, 0}}, {{0x0002cb03, 0xfffe93c8, 0, 0}}, - {{0x00033128, 0xfffe5fc0, 0, 0}}, {{0x0003974d, 0xfffe2bb8, 0, 0}}, - {{0x0003fd72, 0xfffdf7b0, 0, 0}}, {{0x00046397, 0xfffdc3a8, 0, 0}}, - {{0x0004c9bc, 0xfffd8fa0, 0, 0}}, {{0x00052fe1, 0xfffd5b98, 0, 0}}, - {{0x00059606, 0xfffd2790, 0, 0}}, {{0x0005fc2b, 0xfffcf388, 0, 0}}, - {{0x00066250, 0xfffcbf80, 0, 0}}, {{0x0006c875, 0xfffc8b78, 0, 0}}, - {{0x00072e9a, 0xfffc5770, 0, 0}}, {{0x000794bf, 0xfffc2368, 0, 0}}, - {{0x0007fae4, 0xfffbef60, 0, 0}}, {{0x00086109, 0xfffbbb58, 0, 0}}, - {{0x0008c72e, 0xfffb8750, 0, 0}}, {{0x00092d53, 0xfffb5348, 0, 0}}, - {{0x00099378, 0xfffb1f40, 0, 0}}, {{0x0009f99d, 0xfffaeb38, 0, 0}}, - {{0x000a5fc2, 0xfffab730, 0, 0}}, {{0x000ac5e7, 0xfffa8328, 0, 0}}, - {{0x000b2c0c, 0xfffa4f20, 0, 0}}, {{0x000b9231, 0xfffa1b18, 0, 0}}, - {{0x000bf856, 0xfff9e710, 0, 0}}, {{0x000c5e7b, 0xfff9b308, 0, 0}}, - {{0x000cc4a0, 0xfff97f00, 0, 0}}, {{0x000d2ac5, 0xfff94af8, 0, 0}}, - {{0x000d90ea, 0xfff916f0, 0, 0}}, {{0x000df70f, 0xfff8e2e8, 0, 0}}, - {{0x000e5d34, 0xfff8aee0, 0, 0}}, {{0x000ec359, 0xfff87ad8, 0, 0}}, - {{0x000f297e, 0xfff846d0, 0, 0}}, {{0x000f8fa3, 0xfff812c8, 0, 0}}, - {{0x000ff5c8, 0xfff7dec0, 0, 0}}, {{0x00105bed, 0xfff7aab8, 0, 0}}, - {{0x0010c212, 0xfff776b0, 0, 0}}, {{0x00112837, 0xfff742a8, 0, 0}}, - {{0x00118e5c, 0xfff70ea0, 0, 0}}, {{0x0011f481, 0xfff6da98, 0, 0}}, - {{0x00125aa6, 0xfff6a690, 0, 0}}, {{0x0012c0cb, 0xfff67288, 0, 0}}, - {{0x001326f0, 0xfff63e80, 0, 0}}, {{0x00138d15, 0xfff60a78, 0, 0}}, - {{0x0013f33a, 0xfff5d670, 0, 0}}, {{0x0014595f, 0xfff5a268, 0, 0}}, - {{0x0014bf84, 0xfff56e60, 0, 0}}, {{0x001525a9, 0xfff53a58, 0, 0}}, - {{0x00158bce, 0xfff50650, 0, 0}}, {{0x0015f1f3, 0xfff4d248, 0, 0}}, - {{0x00165818, 0xfff49e40, 0, 0}}, {{0x0016be3d, 0xfff46a38, 0, 0}}, - {{0x00172462, 0xfff43630, 0, 0}}, {{0x00178a87, 0xfff40228, 0, 0}}, - {{0x0017f0ac, 0xfff3ce20, 0, 0}}, {{0x001856d1, 0xfff39a18, 0, 0}}, - {{0x0018bcf6, 0xfff36610, 0, 0}}, {{0x0019231b, 0xfff33208, 0, 0}}, - {{0x00198940, 0xfff2fe00, 0, 0}}, {{0x0019ef65, 0xfff2c9f8, 0, 0}}, - {{0x001a558a, 0xfff295f0, 0, 0}}, {{0x001abbaf, 0xfff261e8, 0, 0}}, - {{0x001b21d4, 0xfff22de0, 0, 0}}, {{0x001b87f9, 0xfff1f9d8, 0, 0}}, - {{0x001bee1e, 0xfff1c5d0, 0, 0}}, {{0x001c5443, 0xfff191c8, 0, 0}}, - {{0x001cba68, 0xfff15dc0, 0, 0}}, {{0x001d208d, 0xfff129b8, 0, 0}}, - {{0x001d86b2, 0xfff0f5b0, 0, 0}}, {{0x001decd7, 0xfff0c1a8, 0, 0}}, - {{0x001e52fc, 0xfff08da0, 0, 0}}, {{0x001eb921, 0xfff05998, 0, 0}}, - {{0x001f1f46, 0xfff02590, 0, 0}}, {{0x001f856b, 0xffeff188, 0, 0}}, - {{0x001feb90, 0xffefbd80, 0, 0}}, {{0x002051b5, 0xffef8978, 0, 0}}, - {{0x0020b7da, 0xffef5570, 0, 0}}, {{0x00211dff, 0xffef2168, 0, 0}}, - {{0x00218424, 0xffeeed60, 0, 0}}, {{0x0021ea49, 0xffeeb958, 0, 0}}, - {{0x0022506e, 0xffee8550, 0, 0}}, {{0x0022b693, 0xffee5148, 0, 0}}, - {{0x00231cb8, 0xffee1d40, 0, 0}}, {{0x002382dd, 0xffede938, 0, 0}}, - {{0x0023e902, 0xffedb530, 0, 0}}, {{0x00244f27, 0xffed8128, 0, 0}}, - {{0x0024b54c, 0xffed4d20, 0, 0}}, {{0x00251b71, 0xffed1918, 0, 0}}, - {{0x00258196, 0xffece510, 0, 0}}, {{0x0025e7bb, 0xffecb108, 0, 0}}, - {{0x00264de0, 0xffec7d00, 0, 0}}, {{0x0026b405, 0xffec48f8, 0, 0}}, - {{0x00271a2a, 0xffec14f0, 0, 0}}, {{0x0027804f, 0xffebe0e8, 0, 0}}, - {{0x0027e674, 0xffebace0, 0, 0}}, {{0x00284c99, 0xffeb78d8, 0, 0}}, - {{0x0028b2be, 0xffeb44d0, 0, 0}}, {{0x002918e3, 0xffeb10c8, 0, 0}}, - {{0x00297f08, 0xffeadcc0, 0, 0}}, {{0x0029e52d, 0xffeaa8b8, 0, 0}}, - {{0x002a4b52, 0xffea74b0, 0, 0}}, {{0x002ab177, 0xffea40a8, 0, 0}}, - {{0x002b179c, 0xffea0ca0, 0, 0}}, {{0x002b7dc1, 0xffe9d898, 0, 0}}, - {{0x002be3e6, 0xffe9a490, 0, 0}}, {{0x002c4a0b, 0xffe97088, 0, 0}}, - {{0x002cb030, 0xffe93c80, 0, 0}}, {{0x002d1655, 0xffe90878, 0, 0}}, - {{0x002d7c7a, 0xffe8d470, 0, 0}}, {{0x002de29f, 0xffe8a068, 0, 0}}, - {{0x002e48c4, 0xffe86c60, 0, 0}}, {{0x002eaee9, 0xffe83858, 0, 0}}, - {{0x002f150e, 0xffe80450, 0, 0}}, {{0x002f7b33, 0xffe7d048, 0, 0}}, - {{0x002fe158, 0xffe79c40, 0, 0}}, {{0x0030477d, 0xffe76838, 0, 0}}, - {{0x0030ada2, 0xffe73430, 0, 0}}, {{0x003113c7, 0xffe70028, 0, 0}}, - {{0x003179ec, 0xffe6cc20, 0, 0}}, {{0x0031e011, 0xffe69818, 0, 0}}, - {{0x00324636, 0xffe66410, 0, 0}}, {{0x0032ac5b, 0xffe63008, 0, 0}} -}; diff --git a/thirdparty/libwebp/enc/alpha.c b/thirdparty/libwebp/enc/alpha_enc.c index 03e3ad07f5..5a2c931f92 100644 --- a/thirdparty/libwebp/enc/alpha.c +++ b/thirdparty/libwebp/enc/alpha_enc.c @@ -14,10 +14,10 @@ #include <assert.h> #include <stdlib.h> -#include "./vp8enci.h" +#include "./vp8i_enc.h" #include "../dsp/dsp.h" -#include "../utils/filters.h" -#include "../utils/quant_levels.h" +#include "../utils/filters_utils.h" +#include "../utils/quant_levels_utils.h" #include "../utils/utils.h" #include "../webp/format_constants.h" @@ -44,7 +44,7 @@ // invalid quality or method, or // memory allocation for the compressed data fails. -#include "../enc/vp8li.h" +#include "../enc/vp8li_enc.h" static int EncodeLossless(const uint8_t* const data, int width, int height, int effort_level, // in [0..6] range diff --git a/thirdparty/libwebp/enc/analysis.c b/thirdparty/libwebp/enc/analysis_enc.c index 136c331289..dce159b316 100644 --- a/thirdparty/libwebp/enc/analysis.c +++ b/thirdparty/libwebp/enc/analysis_enc.c @@ -15,8 +15,8 @@ #include <string.h> #include <assert.h> -#include "./vp8enci.h" -#include "./cost.h" +#include "./vp8i_enc.h" +#include "./cost_enc.h" #include "../utils/utils.h" #define MAX_ITERS_K_MEANS 6 @@ -262,6 +262,29 @@ static int MBAnalyzeBestIntra16Mode(VP8EncIterator* const it) { return best_alpha; } +static int FastMBAnalyze(VP8EncIterator* const it) { + // Empirical cut-off value, should be around 16 (~=block size). We use the + // [8-17] range and favor intra4 at high quality, intra16 for low quality. + const int q = (int)it->enc_->config_->quality; + const uint32_t kThreshold = 8 + (17 - 8) * q / 100; + int k; + uint32_t dc[16], m, m2; + for (k = 0; k < 16; k += 4) { + VP8Mean16x4(it->yuv_in_ + Y_OFF_ENC + k * BPS, &dc[k]); + } + for (m = 0, m2 = 0, k = 0; k < 16; ++k) { + m += dc[k]; + m2 += dc[k] * dc[k]; + } + if (kThreshold * m2 < m * m) { + VP8SetIntra16Mode(it, 0); // DC16 + } else { + const uint8_t modes[16] = { 0 }; // DC4 + VP8SetIntra4Mode(it, modes); + } + return 0; +} + static int MBAnalyzeBestIntra4Mode(VP8EncIterator* const it, int best_alpha) { uint8_t modes[16]; @@ -344,13 +367,17 @@ static void MBAnalyze(VP8EncIterator* const it, VP8SetSkip(it, 0); // not skipped VP8SetSegment(it, 0); // default segment, spec-wise. - best_alpha = MBAnalyzeBestIntra16Mode(it); - if (enc->method_ >= 5) { - // We go and make a fast decision for intra4/intra16. - // It's usually not a good and definitive pick, but helps seeding the stats - // about level bit-cost. - // TODO(skal): improve criterion. - best_alpha = MBAnalyzeBestIntra4Mode(it, best_alpha); + if (enc->method_ <= 1) { + best_alpha = FastMBAnalyze(it); + } else { + best_alpha = MBAnalyzeBestIntra16Mode(it); + if (enc->method_ >= 5) { + // We go and make a fast decision for intra4/intra16. + // It's usually not a good and definitive pick, but helps seeding the + // stats about level bit-cost. + // TODO(skal): improve criterion. + best_alpha = MBAnalyzeBestIntra4Mode(it, best_alpha); + } } best_uv_alpha = MBAnalyzeBestUVMode(it); @@ -453,7 +480,7 @@ int VP8EncAnalyze(VP8Encoder* const enc) { const int do_segments = enc->config_->emulate_jpeg_size || // We need the complexity evaluation. (enc->segment_hdr_.num_segments_ > 1) || - (enc->method_ == 0); // for method 0, we need preds_[] to be filled. + (enc->method_ <= 1); // for method 0 - 1, we need preds_[] to be filled. if (do_segments) { const int last_row = enc->mb_h_; // We give a little more than a half work to the main thread. diff --git a/thirdparty/libwebp/enc/backward_references.c b/thirdparty/libwebp/enc/backward_references_enc.c index 136a24a8c3..7c0559ff1e 100644 --- a/thirdparty/libwebp/enc/backward_references.c +++ b/thirdparty/libwebp/enc/backward_references_enc.c @@ -13,11 +13,12 @@ #include <assert.h> #include <math.h> -#include "./backward_references.h" -#include "./histogram.h" +#include "./backward_references_enc.h" +#include "./histogram_enc.h" #include "../dsp/lossless.h" +#include "../dsp/lossless_common.h" #include "../dsp/dsp.h" -#include "../utils/color_cache.h" +#include "../utils/color_cache_utils.h" #include "../utils/utils.h" #define VALUES_IN_BYTE 256 @@ -30,8 +31,9 @@ #define WINDOW_SIZE_BITS 20 #define WINDOW_SIZE ((1 << WINDOW_SIZE_BITS) - 120) -// Bounds for the match length. -#define MIN_LENGTH 2 +// Minimum number of pixels for which it is cheaper to encode a +// distance + length instead of each pixel as a literal. +#define MIN_LENGTH 4 // If you change this, you need MAX_LENGTH_BITS + WINDOW_SIZE_BITS <= 32 as it // is used in VP8LHashChain. #define MAX_LENGTH_BITS 12 @@ -211,13 +213,13 @@ void VP8LHashChainClear(VP8LHashChain* const p) { // ----------------------------------------------------------------------------- -#define HASH_MULTIPLIER_HI (0xc6a4a793U) -#define HASH_MULTIPLIER_LO (0x5bd1e996U) +#define HASH_MULTIPLIER_HI (0xc6a4a793ULL) +#define HASH_MULTIPLIER_LO (0x5bd1e996ULL) static WEBP_INLINE uint32_t GetPixPairHash64(const uint32_t* const argb) { uint32_t key; - key = argb[1] * HASH_MULTIPLIER_HI; - key += argb[0] * HASH_MULTIPLIER_LO; + key = (argb[1] * HASH_MULTIPLIER_HI) & 0xffffffffu; + key += (argb[0] * HASH_MULTIPLIER_LO) & 0xffffffffu; key = key >> (32 - HASH_BITS); return key; } @@ -242,19 +244,26 @@ static WEBP_INLINE int MaxFindCopyLength(int len) { } int VP8LHashChainFill(VP8LHashChain* const p, int quality, - const uint32_t* const argb, int xsize, int ysize) { + const uint32_t* const argb, int xsize, int ysize, + int low_effort) { const int size = xsize * ysize; const int iter_max = GetMaxItersForQuality(quality); - const int iter_min = iter_max - quality / 10; const uint32_t window_size = GetWindowSizeForHashChain(quality, xsize); int pos; + int argb_comp; uint32_t base_position; int32_t* hash_to_first_index; // Temporarily use the p->offset_length_ as a hash chain. int32_t* chain = (int32_t*)p->offset_length_; + assert(size > 0); assert(p->size_ != 0); assert(p->offset_length_ != NULL); + if (size <= 2) { + p->offset_length_[0] = p->offset_length_[size - 1] = 0; + return 1; + } + hash_to_first_index = (int32_t*)WebPSafeMalloc(HASH_SIZE, sizeof(*hash_to_first_index)); if (hash_to_first_index == NULL) return 0; @@ -262,48 +271,111 @@ int VP8LHashChainFill(VP8LHashChain* const p, int quality, // Set the int32_t array to -1. memset(hash_to_first_index, 0xff, HASH_SIZE * sizeof(*hash_to_first_index)); // Fill the chain linking pixels with the same hash. - for (pos = 0; pos < size - 1; ++pos) { - const uint32_t hash_code = GetPixPairHash64(argb + pos); - chain[pos] = hash_to_first_index[hash_code]; - hash_to_first_index[hash_code] = pos; + argb_comp = (argb[0] == argb[1]); + for (pos = 0; pos < size - 2;) { + uint32_t hash_code; + const int argb_comp_next = (argb[pos + 1] == argb[pos + 2]); + if (argb_comp && argb_comp_next) { + // Consecutive pixels with the same color will share the same hash. + // We therefore use a different hash: the color and its repetition + // length. + uint32_t tmp[2]; + uint32_t len = 1; + tmp[0] = argb[pos]; + // Figure out how far the pixels are the same. + // The last pixel has a different 64 bit hash, as its next pixel does + // not have the same color, so we just need to get to the last pixel equal + // to its follower. + while (pos + (int)len + 2 < size && argb[pos + len + 2] == argb[pos]) { + ++len; + } + if (len > MAX_LENGTH) { + // Skip the pixels that match for distance=1 and length>MAX_LENGTH + // because they are linked to their predecessor and we automatically + // check that in the main for loop below. Skipping means setting no + // predecessor in the chain, hence -1. + memset(chain + pos, 0xff, (len - MAX_LENGTH) * sizeof(*chain)); + pos += len - MAX_LENGTH; + len = MAX_LENGTH; + } + // Process the rest of the hash chain. + while (len) { + tmp[1] = len--; + hash_code = GetPixPairHash64(tmp); + chain[pos] = hash_to_first_index[hash_code]; + hash_to_first_index[hash_code] = pos++; + } + argb_comp = 0; + } else { + // Just move one pixel forward. + hash_code = GetPixPairHash64(argb + pos); + chain[pos] = hash_to_first_index[hash_code]; + hash_to_first_index[hash_code] = pos++; + argb_comp = argb_comp_next; + } } + // Process the penultimate pixel. + chain[pos] = hash_to_first_index[GetPixPairHash64(argb + pos)]; + WebPSafeFree(hash_to_first_index); // Find the best match interval at each pixel, defined by an offset to the // pixel and a length. The right-most pixel cannot match anything to the right // (hence a best length of 0) and the left-most pixel nothing to the left // (hence an offset of 0). + assert(size > 2); p->offset_length_[0] = p->offset_length_[size - 1] = 0; - for (base_position = size - 2 < 0 ? 0 : size - 2; base_position > 0;) { + for (base_position = size - 2; base_position > 0;) { const int max_len = MaxFindCopyLength(size - 1 - base_position); const uint32_t* const argb_start = argb + base_position; int iter = iter_max; int best_length = 0; uint32_t best_distance = 0; + uint32_t best_argb; const int min_pos = (base_position > window_size) ? base_position - window_size : 0; const int length_max = (max_len < 256) ? max_len : 256; uint32_t max_base_position; - for (pos = chain[base_position]; pos >= min_pos; pos = chain[pos]) { + pos = chain[base_position]; + if (!low_effort) { int curr_length; - if (--iter < 0) { - break; + // Heuristic: use the comparison with the above line as an initialization. + if (base_position >= (uint32_t)xsize) { + curr_length = FindMatchLength(argb_start - xsize, argb_start, + best_length, max_len); + if (curr_length > best_length) { + best_length = curr_length; + best_distance = xsize; + } + --iter; + } + // Heuristic: compare to the previous pixel. + curr_length = + FindMatchLength(argb_start - 1, argb_start, best_length, max_len); + if (curr_length > best_length) { + best_length = curr_length; + best_distance = 1; } + --iter; + // Skip the for loop if we already have the maximum. + if (best_length == MAX_LENGTH) pos = min_pos - 1; + } + best_argb = argb_start[best_length]; + + for (; pos >= min_pos && --iter; pos = chain[pos]) { + int curr_length; assert(base_position > (uint32_t)pos); - curr_length = - FindMatchLength(argb + pos, argb_start, best_length, max_len); + if (argb[pos + best_length] != best_argb) continue; + + curr_length = VP8LVectorMismatch(argb + pos, argb_start, max_len); if (best_length < curr_length) { best_length = curr_length; best_distance = base_position - pos; - // Stop if we have reached the maximum length. Otherwise, make sure - // we have executed a minimum number of iterations depending on the - // quality. - if ((best_length == MAX_LENGTH) || - (curr_length >= length_max && iter < iter_min)) { - break; - } + best_argb = argb_start[best_length]; + // Stop if we have reached a good enough length. + if (best_length >= length_max) break; } } // We have the best match but in case the two intervals continue matching @@ -392,17 +464,16 @@ static int BackwardReferencesRle(int xsize, int ysize, i = 1; while (i < pix_count) { const int max_len = MaxFindCopyLength(pix_count - i); - const int kMinLength = 4; const int rle_len = FindMatchLength(argb + i, argb + i - 1, 0, max_len); const int prev_row_len = (i < xsize) ? 0 : FindMatchLength(argb + i, argb + i - xsize, 0, max_len); - if (rle_len >= prev_row_len && rle_len >= kMinLength) { + if (rle_len >= prev_row_len && rle_len >= MIN_LENGTH) { BackwardRefsCursorAdd(refs, PixOrCopyCreateCopy(1, rle_len)); // We don't need to update the color cache here since it is always the // same pixel being copied, and that does not change the color cache // state. i += rle_len; - } else if (prev_row_len >= kMinLength) { + } else if (prev_row_len >= MIN_LENGTH) { BackwardRefsCursorAdd(refs, PixOrCopyCreateCopy(xsize, prev_row_len)); if (use_color_cache) { for (k = 0; k < prev_row_len; ++k) { @@ -442,7 +513,7 @@ static int BackwardReferencesLz77(int xsize, int ysize, int len = 0; int j; HashChainFindCopy(hash_chain, i, &offset, &len); - if (len > MIN_LENGTH + 1) { + if (len >= MIN_LENGTH) { const int len_ini = len; int max_reach = 0; assert(i + len < pix_count); @@ -457,7 +528,7 @@ static int BackwardReferencesLz77(int xsize, int ysize, for (j = i_last_check + 1; j <= i + len_ini; ++j) { const int len_j = HashChainFindLength(hash_chain, j); const int reach = - j + (len_j > MIN_LENGTH + 1 ? len_j : 1); // 1 for single literal. + j + (len_j >= MIN_LENGTH ? len_j : 1); // 1 for single literal. if (reach > max_reach) { len = j - i; max_reach = reach; @@ -581,9 +652,10 @@ static void AddSingleLiteralWithCostModel(const uint32_t* const argb, uint16_t* const dist_array) { double cost_val = prev_cost; const uint32_t color = argb[0]; - if (use_color_cache && VP8LColorCacheContains(hashers, color)) { + const int ix = use_color_cache ? VP8LColorCacheContains(hashers, color) : -1; + if (ix >= 0) { + // use_color_cache is true and hashers contains color const double mul0 = 0.68; - const int ix = VP8LColorCacheGetIndex(hashers, color); cost_val += GetCacheCost(cost_model, ix) * mul0; } else { const double mul1 = 0.82; @@ -1215,7 +1287,8 @@ static int BackwardReferencesHashChainDistanceOnly( int offset = 0, len = 0; double prev_cost = cost_manager->costs_[i - 1]; HashChainFindCopy(hash_chain, i, &offset, &len); - if (len >= MIN_LENGTH) { + if (len >= 2) { + // If we are dealing with a non-literal. const int code = DistanceToPlaneCode(xsize, offset); const double offset_cost = GetDistanceCost(cost_model, code); const int first_i = i; @@ -1304,20 +1377,17 @@ static int BackwardReferencesHashChainDistanceOnly( } goto next_symbol; } - if (len > MIN_LENGTH) { - int code_min_length; - double cost_total; - offset = HashChainFindOffset(hash_chain, i); - code_min_length = DistanceToPlaneCode(xsize, offset); - cost_total = prev_cost + - GetDistanceCost(cost_model, code_min_length) + - GetLengthCost(cost_model, 1); + if (len > 2) { + // Also try the smallest interval possible (size 2). + double cost_total = + prev_cost + offset_cost + GetLengthCost(cost_model, 1); if (cost_manager->costs_[i + 1] > cost_total) { cost_manager->costs_[i + 1] = (float)cost_total; dist_array[i + 1] = 2; } } - } else { // len < MIN_LENGTH + } else { + // The pixel is added as a single literal so just update the costs. UpdateCostPerIndex(cost_manager, i + 1); } @@ -1393,9 +1463,11 @@ static int BackwardReferencesHashChainFollowChosenPath( i += len; } else { PixOrCopy v; - if (use_color_cache && VP8LColorCacheContains(&hashers, argb[i])) { + const int idx = + use_color_cache ? VP8LColorCacheContains(&hashers, argb[i]) : -1; + if (idx >= 0) { + // use_color_cache is true and hashers contains argb[i] // push pixel as a color cache index - const int idx = VP8LColorCacheGetIndex(&hashers, argb[i]); v = PixOrCopyCreateCacheIdx(idx); } else { if (use_color_cache) VP8LColorCacheInsert(&hashers, argb[i]); @@ -1454,63 +1526,89 @@ static void BackwardReferences2DLocality(int xsize, } } -// Returns entropy for the given cache bits. -static double ComputeCacheEntropy(const uint32_t* argb, - const VP8LBackwardRefs* const refs, - int cache_bits) { - const int use_color_cache = (cache_bits > 0); - int cc_init = 0; - double entropy = MAX_ENTROPY; - const double kSmallPenaltyForLargeCache = 4.0; - VP8LColorCache hashers; +// Computes the entropies for a color cache size (in bits) between 0 (unused) +// and cache_bits_max (inclusive). +// Returns 1 on success, 0 in case of allocation error. +static int ComputeCacheEntropies(const uint32_t* argb, + const VP8LBackwardRefs* const refs, + int cache_bits_max, double entropies[]) { + int cc_init[MAX_COLOR_CACHE_BITS + 1] = { 0 }; + VP8LColorCache hashers[MAX_COLOR_CACHE_BITS + 1]; VP8LRefsCursor c = VP8LRefsCursorInit(refs); - VP8LHistogram* histo = VP8LAllocateHistogram(cache_bits); - if (histo == NULL) goto Error; + VP8LHistogram* histos[MAX_COLOR_CACHE_BITS + 1] = { NULL }; + int ok = 0; + int i; - if (use_color_cache) { - cc_init = VP8LColorCacheInit(&hashers, cache_bits); - if (!cc_init) goto Error; + for (i = 0; i <= cache_bits_max; ++i) { + histos[i] = VP8LAllocateHistogram(i); + if (histos[i] == NULL) goto Error; + if (i == 0) continue; + cc_init[i] = VP8LColorCacheInit(&hashers[i], i); + if (!cc_init[i]) goto Error; } - if (!use_color_cache) { - while (VP8LRefsCursorOk(&c)) { - VP8LHistogramAddSinglePixOrCopy(histo, c.cur_pos); - VP8LRefsCursorNext(&c); - } - } else { + + assert(cache_bits_max >= 0); + // Do not use the color cache for cache_bits=0. + while (VP8LRefsCursorOk(&c)) { + VP8LHistogramAddSinglePixOrCopy(histos[0], c.cur_pos); + VP8LRefsCursorNext(&c); + } + if (cache_bits_max > 0) { + c = VP8LRefsCursorInit(refs); while (VP8LRefsCursorOk(&c)) { const PixOrCopy* const v = c.cur_pos; if (PixOrCopyIsLiteral(v)) { const uint32_t pix = *argb++; - const uint32_t key = VP8LColorCacheGetIndex(&hashers, pix); - if (VP8LColorCacheLookup(&hashers, key) == pix) { - ++histo->literal_[NUM_LITERAL_CODES + NUM_LENGTH_CODES + key]; - } else { - VP8LColorCacheSet(&hashers, key, pix); - ++histo->blue_[pix & 0xff]; - ++histo->literal_[(pix >> 8) & 0xff]; - ++histo->red_[(pix >> 16) & 0xff]; - ++histo->alpha_[pix >> 24]; + // The keys of the caches can be derived from the longest one. + int key = HashPix(pix, 32 - cache_bits_max); + for (i = cache_bits_max; i >= 1; --i, key >>= 1) { + if (VP8LColorCacheLookup(&hashers[i], key) == pix) { + ++histos[i]->literal_[NUM_LITERAL_CODES + NUM_LENGTH_CODES + key]; + } else { + VP8LColorCacheSet(&hashers[i], key, pix); + ++histos[i]->blue_[pix & 0xff]; + ++histos[i]->literal_[(pix >> 8) & 0xff]; + ++histos[i]->red_[(pix >> 16) & 0xff]; + ++histos[i]->alpha_[pix >> 24]; + } } } else { + // Update the histograms for distance/length. int len = PixOrCopyLength(v); - int code, extra_bits; - VP8LPrefixEncodeBits(len, &code, &extra_bits); - ++histo->literal_[NUM_LITERAL_CODES + code]; - VP8LPrefixEncodeBits(PixOrCopyDistance(v), &code, &extra_bits); - ++histo->distance_[code]; + int code_dist, code_len, extra_bits; + uint32_t argb_prev = *argb ^ 0xffffffffu; + VP8LPrefixEncodeBits(len, &code_len, &extra_bits); + VP8LPrefixEncodeBits(PixOrCopyDistance(v), &code_dist, &extra_bits); + for (i = 1; i <= cache_bits_max; ++i) { + ++histos[i]->literal_[NUM_LITERAL_CODES + code_len]; + ++histos[i]->distance_[code_dist]; + } + // Update the colors caches. do { - VP8LColorCacheInsert(&hashers, *argb++); - } while(--len != 0); + if (*argb != argb_prev) { + // Efficiency: insert only if the color changes. + int key = HashPix(*argb, 32 - cache_bits_max); + for (i = cache_bits_max; i >= 1; --i, key >>= 1) { + hashers[i].colors_[key] = *argb; + } + argb_prev = *argb; + } + argb++; + } while (--len != 0); } VP8LRefsCursorNext(&c); } } - entropy = VP8LHistogramEstimateBits(histo) + - kSmallPenaltyForLargeCache * cache_bits; - Error: - if (cc_init) VP8LColorCacheClear(&hashers); - VP8LFreeHistogram(histo); - return entropy; + for (i = 0; i <= cache_bits_max; ++i) { + entropies[i] = VP8LHistogramEstimateBits(histos[i]); + } + ok = 1; +Error: + for (i = 0; i <= cache_bits_max; ++i) { + if (cc_init[i]) VP8LColorCacheClear(&hashers[i]); + VP8LFreeHistogram(histos[i]); + } + return ok; } // Evaluate optimal cache bits for the local color cache. @@ -1524,13 +1622,10 @@ static int CalculateBestCacheSize(const uint32_t* const argb, VP8LBackwardRefs* const refs, int* const lz77_computed, int* const best_cache_bits) { - int eval_low = 1; - int eval_high = 1; - double entropy_low = MAX_ENTROPY; - double entropy_high = MAX_ENTROPY; - const double cost_mul = 5e-4; - int cache_bits_low = 0; + int i; int cache_bits_high = (quality <= 25) ? 0 : *best_cache_bits; + double entropy_min = MAX_ENTROPY; + double entropies[MAX_COLOR_CACHE_BITS + 1]; assert(cache_bits_high <= MAX_COLOR_CACHE_BITS); @@ -1540,34 +1635,23 @@ static int CalculateBestCacheSize(const uint32_t* const argb, // Local color cache is disabled. return 1; } - if (!BackwardReferencesLz77(xsize, ysize, argb, cache_bits_low, hash_chain, - refs)) { + // Compute LZ77 with no cache (0 bits), as the ideal LZ77 with a color cache + // is not that different in practice. + if (!BackwardReferencesLz77(xsize, ysize, argb, 0, hash_chain, refs)) { return 0; } - // Do a binary search to find the optimal entropy for cache_bits. - while (eval_low || eval_high) { - if (eval_low) { - entropy_low = ComputeCacheEntropy(argb, refs, cache_bits_low); - entropy_low += entropy_low * cache_bits_low * cost_mul; - eval_low = 0; - } - if (eval_high) { - entropy_high = ComputeCacheEntropy(argb, refs, cache_bits_high); - entropy_high += entropy_high * cache_bits_high * cost_mul; - eval_high = 0; - } - if (entropy_high < entropy_low) { - const int prev_cache_bits_low = cache_bits_low; - *best_cache_bits = cache_bits_high; - cache_bits_low = (cache_bits_low + cache_bits_high) / 2; - if (cache_bits_low != prev_cache_bits_low) eval_low = 1; - } else { - *best_cache_bits = cache_bits_low; - cache_bits_high = (cache_bits_low + cache_bits_high) / 2; - if (cache_bits_high != cache_bits_low) eval_high = 1; + // Find the cache_bits giving the lowest entropy. The search is done in a + // brute-force way as the function (entropy w.r.t cache_bits) can be + // anything in practice. + if (!ComputeCacheEntropies(argb, refs, cache_bits_high, entropies)) { + return 0; + } + for (i = 0; i <= cache_bits_high; ++i) { + if (i == 0 || entropies[i] < entropy_min) { + entropy_min = entropies[i]; + *best_cache_bits = i; } } - *lz77_computed = 1; return 1; } @@ -1584,8 +1668,9 @@ static int BackwardRefsWithLocalCache(const uint32_t* const argb, PixOrCopy* const v = c.cur_pos; if (PixOrCopyIsLiteral(v)) { const uint32_t argb_literal = v->argb_or_distance; - if (VP8LColorCacheContains(&hashers, argb_literal)) { - const int ix = VP8LColorCacheGetIndex(&hashers, argb_literal); + const int ix = VP8LColorCacheContains(&hashers, argb_literal); + if (ix >= 0) { + // hashers contains argb_literal *v = PixOrCopyCreateCacheIdx(ix); } else { VP8LColorCacheInsert(&hashers, argb_literal); diff --git a/thirdparty/libwebp/enc/backward_references.h b/thirdparty/libwebp/enc/backward_references_enc.h index 0cadb11e11..3a19aa763e 100644 --- a/thirdparty/libwebp/enc/backward_references.h +++ b/thirdparty/libwebp/enc/backward_references_enc.h @@ -130,7 +130,8 @@ struct VP8LHashChain { int VP8LHashChainInit(VP8LHashChain* const p, int size); // Pre-compute the best matches for argb. int VP8LHashChainFill(VP8LHashChain* const p, int quality, - const uint32_t* const argb, int xsize, int ysize); + const uint32_t* const argb, int xsize, int ysize, + int low_effort); void VP8LHashChainClear(VP8LHashChain* const p); // release memory // ----------------------------------------------------------------------------- diff --git a/thirdparty/libwebp/enc/config.c b/thirdparty/libwebp/enc/config_enc.c index f9f7961d58..4589dc0619 100644 --- a/thirdparty/libwebp/enc/config.c +++ b/thirdparty/libwebp/enc/config_enc.c @@ -11,6 +11,10 @@ // // Author: Skal (pascal.massimino@gmail.com) +#ifdef HAVE_CONFIG_H +#include "../webp/config.h" +#endif + #include "../webp/encode.h" //------------------------------------------------------------------------------ @@ -49,9 +53,8 @@ int WebPConfigInitInternal(WebPConfig* config, config->thread_level = 0; config->low_memory = 0; config->near_lossless = 100; -#ifdef WEBP_EXPERIMENTAL_FEATURES - config->delta_palettization = 0; -#endif // WEBP_EXPERIMENTAL_FEATURES + config->use_delta_palette = 0; + config->use_sharp_yuv = 0; // TODO(skal): tune. switch (preset) { @@ -92,60 +95,36 @@ int WebPConfigInitInternal(WebPConfig* config, int WebPValidateConfig(const WebPConfig* config) { if (config == NULL) return 0; - if (config->quality < 0 || config->quality > 100) - return 0; - if (config->target_size < 0) - return 0; - if (config->target_PSNR < 0) - return 0; - if (config->method < 0 || config->method > 6) - return 0; - if (config->segments < 1 || config->segments > 4) - return 0; - if (config->sns_strength < 0 || config->sns_strength > 100) - return 0; - if (config->filter_strength < 0 || config->filter_strength > 100) - return 0; - if (config->filter_sharpness < 0 || config->filter_sharpness > 7) - return 0; - if (config->filter_type < 0 || config->filter_type > 1) - return 0; - if (config->autofilter < 0 || config->autofilter > 1) - return 0; - if (config->pass < 1 || config->pass > 10) - return 0; - if (config->show_compressed < 0 || config->show_compressed > 1) - return 0; - if (config->preprocessing < 0 || config->preprocessing > 7) - return 0; - if (config->partitions < 0 || config->partitions > 3) + if (config->quality < 0 || config->quality > 100) return 0; + if (config->target_size < 0) return 0; + if (config->target_PSNR < 0) return 0; + if (config->method < 0 || config->method > 6) return 0; + if (config->segments < 1 || config->segments > 4) return 0; + if (config->sns_strength < 0 || config->sns_strength > 100) return 0; + if (config->filter_strength < 0 || config->filter_strength > 100) return 0; + if (config->filter_sharpness < 0 || config->filter_sharpness > 7) return 0; + if (config->filter_type < 0 || config->filter_type > 1) return 0; + if (config->autofilter < 0 || config->autofilter > 1) return 0; + if (config->pass < 1 || config->pass > 10) return 0; + if (config->show_compressed < 0 || config->show_compressed > 1) return 0; + if (config->preprocessing < 0 || config->preprocessing > 7) return 0; + if (config->partitions < 0 || config->partitions > 3) return 0; + if (config->partition_limit < 0 || config->partition_limit > 100) return 0; + if (config->alpha_compression < 0) return 0; + if (config->alpha_filtering < 0) return 0; + if (config->alpha_quality < 0 || config->alpha_quality > 100) return 0; + if (config->lossless < 0 || config->lossless > 1) return 0; + if (config->near_lossless < 0 || config->near_lossless > 100) return 0; + if (config->image_hint >= WEBP_HINT_LAST) return 0; + if (config->emulate_jpeg_size < 0 || config->emulate_jpeg_size > 1) return 0; + if (config->thread_level < 0 || config->thread_level > 1) return 0; + if (config->low_memory < 0 || config->low_memory > 1) return 0; + if (config->exact < 0 || config->exact > 1) return 0; + if (config->use_delta_palette < 0 || config->use_delta_palette > 1) { return 0; - if (config->partition_limit < 0 || config->partition_limit > 100) - return 0; - if (config->alpha_compression < 0) - return 0; - if (config->alpha_filtering < 0) - return 0; - if (config->alpha_quality < 0 || config->alpha_quality > 100) - return 0; - if (config->lossless < 0 || config->lossless > 1) - return 0; - if (config->near_lossless < 0 || config->near_lossless > 100) - return 0; - if (config->image_hint >= WEBP_HINT_LAST) - return 0; - if (config->emulate_jpeg_size < 0 || config->emulate_jpeg_size > 1) - return 0; - if (config->thread_level < 0 || config->thread_level > 1) - return 0; - if (config->low_memory < 0 || config->low_memory > 1) - return 0; - if (config->exact < 0 || config->exact > 1) - return 0; -#ifdef WEBP_EXPERIMENTAL_FEATURES - if (config->delta_palettization < 0 || config->delta_palettization > 1) - return 0; -#endif // WEBP_EXPERIMENTAL_FEATURES + } + if (config->use_sharp_yuv < 0 || config->use_sharp_yuv > 1) return 0; + return 1; } diff --git a/thirdparty/libwebp/enc/cost.c b/thirdparty/libwebp/enc/cost_enc.c index 87f89378a7..c823f5a664 100644 --- a/thirdparty/libwebp/enc/cost.c +++ b/thirdparty/libwebp/enc/cost_enc.c @@ -11,7 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) -#include "./cost.h" +#include "./cost_enc.h" //------------------------------------------------------------------------------ // Level cost tables diff --git a/thirdparty/libwebp/enc/cost.h b/thirdparty/libwebp/enc/cost_enc.h index ad7959feb4..99e4b37aa3 100644 --- a/thirdparty/libwebp/enc/cost.h +++ b/thirdparty/libwebp/enc/cost_enc.h @@ -16,7 +16,7 @@ #include <assert.h> #include <stdlib.h> -#include "./vp8enci.h" +#include "./vp8i_enc.h" #ifdef __cplusplus extern "C" { diff --git a/thirdparty/libwebp/enc/delta_palettization.c b/thirdparty/libwebp/enc/delta_palettization_enc.c index 062e588d79..eaf0f050ea 100644 --- a/thirdparty/libwebp/enc/delta_palettization.c +++ b/thirdparty/libwebp/enc/delta_palettization_enc.c @@ -10,7 +10,7 @@ // Author: Mislav Bradac (mislavm@google.com) // -#include "./delta_palettization.h" +#include "./delta_palettization_enc.h" #ifdef WEBP_EXPERIMENTAL_FEATURES #include "../webp/types.h" diff --git a/thirdparty/libwebp/enc/delta_palettization.h b/thirdparty/libwebp/enc/delta_palettization_enc.h index e41c0c5ab5..63048ec6e8 100644 --- a/thirdparty/libwebp/enc/delta_palettization.h +++ b/thirdparty/libwebp/enc/delta_palettization_enc.h @@ -14,7 +14,7 @@ #define WEBP_ENC_DELTA_PALETTIZATION_H_ #include "../webp/encode.h" -#include "../enc/vp8li.h" +#include "../enc/vp8li_enc.h" // Replaces enc->argb_[] input by a palettizable approximation of it, // and generates optimal enc->palette_[]. diff --git a/thirdparty/libwebp/enc/filter.c b/thirdparty/libwebp/enc/filter_enc.c index e8ea8b4ff2..4bc367274c 100644 --- a/thirdparty/libwebp/enc/filter.c +++ b/thirdparty/libwebp/enc/filter_enc.c @@ -12,7 +12,7 @@ // Author: somnath@google.com (Somnath Banerjee) #include <assert.h> -#include "./vp8enci.h" +#include "./vp8i_enc.h" #include "../dsp/dsp.h" // This table gives, for a given sharpness, the filtering strength to be @@ -105,115 +105,28 @@ static void DoFilter(const VP8EncIterator* const it, int level) { } //------------------------------------------------------------------------------ -// SSIM metric - -static const double kMinValue = 1.e-10; // minimal threshold - -void VP8SSIMAddStats(const VP8DistoStats* const src, VP8DistoStats* const dst) { - dst->w += src->w; - dst->xm += src->xm; - dst->ym += src->ym; - dst->xxm += src->xxm; - dst->xym += src->xym; - dst->yym += src->yym; -} - -double VP8SSIMGet(const VP8DistoStats* const stats) { - const double xmxm = stats->xm * stats->xm; - const double ymym = stats->ym * stats->ym; - const double xmym = stats->xm * stats->ym; - const double w2 = stats->w * stats->w; - double sxx = stats->xxm * stats->w - xmxm; - double syy = stats->yym * stats->w - ymym; - double sxy = stats->xym * stats->w - xmym; - double C1, C2; - double fnum; - double fden; - // small errors are possible, due to rounding. Clamp to zero. - if (sxx < 0.) sxx = 0.; - if (syy < 0.) syy = 0.; - C1 = 6.5025 * w2; - C2 = 58.5225 * w2; - fnum = (2 * xmym + C1) * (2 * sxy + C2); - fden = (xmxm + ymym + C1) * (sxx + syy + C2); - return (fden != 0.) ? fnum / fden : kMinValue; -} - -double VP8SSIMGetSquaredError(const VP8DistoStats* const s) { - if (s->w > 0.) { - const double iw2 = 1. / (s->w * s->w); - const double sxx = s->xxm * s->w - s->xm * s->xm; - const double syy = s->yym * s->w - s->ym * s->ym; - const double sxy = s->xym * s->w - s->xm * s->ym; - const double SSE = iw2 * (sxx + syy - 2. * sxy); - if (SSE > kMinValue) return SSE; - } - return kMinValue; -} - -#define LIMIT(A, M) ((A) > (M) ? (M) : (A)) -static void VP8SSIMAccumulateRow(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int y, int W, int H, - VP8DistoStats* const stats) { - int x = 0; - const int w0 = LIMIT(VP8_SSIM_KERNEL, W); - for (x = 0; x < w0; ++x) { - VP8SSIMAccumulateClipped(src1, stride1, src2, stride2, x, y, W, H, stats); - } - for (; x <= W - 8 + VP8_SSIM_KERNEL; ++x) { - VP8SSIMAccumulate( - src1 + (y - VP8_SSIM_KERNEL) * stride1 + (x - VP8_SSIM_KERNEL), stride1, - src2 + (y - VP8_SSIM_KERNEL) * stride2 + (x - VP8_SSIM_KERNEL), stride2, - stats); - } - for (; x < W; ++x) { - VP8SSIMAccumulateClipped(src1, stride1, src2, stride2, x, y, W, H, stats); - } -} - -void VP8SSIMAccumulatePlane(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int W, int H, VP8DistoStats* const stats) { - int x, y; - const int h0 = LIMIT(VP8_SSIM_KERNEL, H); - const int h1 = LIMIT(VP8_SSIM_KERNEL, H - VP8_SSIM_KERNEL); - for (y = 0; y < h0; ++y) { - for (x = 0; x < W; ++x) { - VP8SSIMAccumulateClipped(src1, stride1, src2, stride2, x, y, W, H, stats); - } - } - for (; y < h1; ++y) { - VP8SSIMAccumulateRow(src1, stride1, src2, stride2, y, W, H, stats); - } - for (; y < H; ++y) { - for (x = 0; x < W; ++x) { - VP8SSIMAccumulateClipped(src1, stride1, src2, stride2, x, y, W, H, stats); - } - } -} -#undef LIMIT +// SSIM metric for one macroblock static double GetMBSSIM(const uint8_t* yuv1, const uint8_t* yuv2) { int x, y; - VP8DistoStats s = { .0, .0, .0, .0, .0, .0 }; + double sum = 0.; // compute SSIM in a 10 x 10 window for (y = VP8_SSIM_KERNEL; y < 16 - VP8_SSIM_KERNEL; y++) { for (x = VP8_SSIM_KERNEL; x < 16 - VP8_SSIM_KERNEL; x++) { - VP8SSIMAccumulateClipped(yuv1 + Y_OFF_ENC, BPS, yuv2 + Y_OFF_ENC, BPS, - x, y, 16, 16, &s); + sum += VP8SSIMGetClipped(yuv1 + Y_OFF_ENC, BPS, yuv2 + Y_OFF_ENC, BPS, + x, y, 16, 16); } } for (x = 1; x < 7; x++) { for (y = 1; y < 7; y++) { - VP8SSIMAccumulateClipped(yuv1 + U_OFF_ENC, BPS, yuv2 + U_OFF_ENC, BPS, - x, y, 8, 8, &s); - VP8SSIMAccumulateClipped(yuv1 + V_OFF_ENC, BPS, yuv2 + V_OFF_ENC, BPS, - x, y, 8, 8, &s); + sum += VP8SSIMGetClipped(yuv1 + U_OFF_ENC, BPS, yuv2 + U_OFF_ENC, BPS, + x, y, 8, 8); + sum += VP8SSIMGetClipped(yuv1 + V_OFF_ENC, BPS, yuv2 + V_OFF_ENC, BPS, + x, y, 8, 8); } } - return VP8SSIMGet(&s); + return sum; } //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/enc/frame.c b/thirdparty/libwebp/enc/frame_enc.c index 57fc471d17..abef523bbf 100644 --- a/thirdparty/libwebp/enc/frame.c +++ b/thirdparty/libwebp/enc/frame_enc.c @@ -14,8 +14,8 @@ #include <string.h> #include <math.h> -#include "./cost.h" -#include "./vp8enci.h" +#include "./cost_enc.h" +#include "./vp8i_enc.h" #include "../dsp/dsp.h" #include "../webp/format_constants.h" // RIFF constants @@ -248,8 +248,9 @@ static int PutCoeffs(VP8BitWriter* const bw, int ctx, const VP8Residual* res) { p = res->prob[VP8EncBands[n]][1]; } else { if (!VP8PutBit(bw, v > 4, p[3])) { - if (VP8PutBit(bw, v != 2, p[4])) + if (VP8PutBit(bw, v != 2, p[4])) { VP8PutBit(bw, v == 4, p[5]); + } } else if (!VP8PutBit(bw, v > 10, p[6])) { if (!VP8PutBit(bw, v > 6, p[7])) { VP8PutBit(bw, v == 6, 159); @@ -557,8 +558,9 @@ static uint64_t OneStatPass(VP8Encoder* const enc, VP8RDLevel rd_opt, size += info.R + info.H; size_p0 += info.H; distortion += info.D; - if (percent_delta && !VP8IteratorProgress(&it, percent_delta)) + if (percent_delta && !VP8IteratorProgress(&it, percent_delta)) { return 0; + } VP8IteratorSaveBoundary(&it); } while (VP8IteratorNext(&it) && --nb_mbs > 0); diff --git a/thirdparty/libwebp/enc/histogram.c b/thirdparty/libwebp/enc/histogram_enc.c index 36b7f22625..808b6f78ab 100644 --- a/thirdparty/libwebp/enc/histogram.c +++ b/thirdparty/libwebp/enc/histogram_enc.c @@ -15,9 +15,10 @@ #include <math.h> -#include "./backward_references.h" -#include "./histogram.h" +#include "./backward_references_enc.h" +#include "./histogram_enc.h" #include "../dsp/lossless.h" +#include "../dsp/lossless_common.h" #include "../utils/utils.h" #define MAX_COST 1.e38 @@ -213,10 +214,19 @@ static double InitialHuffmanCost(void) { // Finalize the Huffman cost based on streak numbers and length type (<3 or >=3) static double FinalHuffmanCost(const VP8LStreaks* const stats) { + // The constants in this function are experimental and got rounded from + // their original values in 1/8 when switched to 1/1024. double retval = InitialHuffmanCost(); + // Second coefficient: Many zeros in the histogram are covered efficiently + // by a run-length encode. Originally 2/8. retval += stats->counts[0] * 1.5625 + 0.234375 * stats->streaks[0][1]; + // Second coefficient: Constant values are encoded less efficiently, but still + // RLE'ed. Originally 6/8. retval += stats->counts[1] * 2.578125 + 0.703125 * stats->streaks[1][1]; + // 0s are usually encoded more efficiently than non-0s. + // Originally 15/8. retval += 1.796875 * stats->streaks[0][0]; + // Originally 26/8. retval += 3.28125 * stats->streaks[1][0]; return retval; } @@ -236,14 +246,30 @@ static double PopulationCost(const uint32_t* const population, int length, return BitsEntropyRefine(&bit_entropy) + FinalHuffmanCost(&stats); } +// trivial_at_end is 1 if the two histograms only have one element that is +// non-zero: both the zero-th one, or both the last one. static WEBP_INLINE double GetCombinedEntropy(const uint32_t* const X, const uint32_t* const Y, - int length) { - VP8LBitEntropy bit_entropy; + int length, int trivial_at_end) { VP8LStreaks stats; - VP8LGetCombinedEntropyUnrefined(X, Y, length, &bit_entropy, &stats); + if (trivial_at_end) { + // This configuration is due to palettization that transforms an indexed + // pixel into 0xff000000 | (pixel << 8) in VP8LBundleColorMap. + // BitsEntropyRefine is 0 for histograms with only one non-zero value. + // Only FinalHuffmanCost needs to be evaluated. + memset(&stats, 0, sizeof(stats)); + // Deal with the non-zero value at index 0 or length-1. + stats.streaks[1][0] += 1; + // Deal with the following/previous zero streak. + stats.counts[0] += 1; + stats.streaks[0][1] += length - 1; + return FinalHuffmanCost(&stats); + } else { + VP8LBitEntropy bit_entropy; + VP8LGetCombinedEntropyUnrefined(X, Y, length, &bit_entropy, &stats); - return BitsEntropyRefine(&bit_entropy) + FinalHuffmanCost(&stats); + return BitsEntropyRefine(&bit_entropy) + FinalHuffmanCost(&stats); + } } // Estimates the Entropy + Huffman + other block overhead size cost. @@ -267,24 +293,42 @@ static int GetCombinedHistogramEntropy(const VP8LHistogram* const a, double cost_threshold, double* cost) { const int palette_code_bits = a->palette_code_bits_; + int trivial_at_end = 0; assert(a->palette_code_bits_ == b->palette_code_bits_); *cost += GetCombinedEntropy(a->literal_, b->literal_, - VP8LHistogramNumCodes(palette_code_bits)); + VP8LHistogramNumCodes(palette_code_bits), 0); *cost += VP8LExtraCostCombined(a->literal_ + NUM_LITERAL_CODES, b->literal_ + NUM_LITERAL_CODES, NUM_LENGTH_CODES); if (*cost > cost_threshold) return 0; - *cost += GetCombinedEntropy(a->red_, b->red_, NUM_LITERAL_CODES); + if (a->trivial_symbol_ != VP8L_NON_TRIVIAL_SYM && + a->trivial_symbol_ == b->trivial_symbol_) { + // A, R and B are all 0 or 0xff. + const uint32_t color_a = (a->trivial_symbol_ >> 24) & 0xff; + const uint32_t color_r = (a->trivial_symbol_ >> 16) & 0xff; + const uint32_t color_b = (a->trivial_symbol_ >> 0) & 0xff; + if ((color_a == 0 || color_a == 0xff) && + (color_r == 0 || color_r == 0xff) && + (color_b == 0 || color_b == 0xff)) { + trivial_at_end = 1; + } + } + + *cost += + GetCombinedEntropy(a->red_, b->red_, NUM_LITERAL_CODES, trivial_at_end); if (*cost > cost_threshold) return 0; - *cost += GetCombinedEntropy(a->blue_, b->blue_, NUM_LITERAL_CODES); + *cost += + GetCombinedEntropy(a->blue_, b->blue_, NUM_LITERAL_CODES, trivial_at_end); if (*cost > cost_threshold) return 0; - *cost += GetCombinedEntropy(a->alpha_, b->alpha_, NUM_LITERAL_CODES); + *cost += GetCombinedEntropy(a->alpha_, b->alpha_, NUM_LITERAL_CODES, + trivial_at_end); if (*cost > cost_threshold) return 0; - *cost += GetCombinedEntropy(a->distance_, b->distance_, NUM_DISTANCE_CODES); + *cost += + GetCombinedEntropy(a->distance_, b->distance_, NUM_DISTANCE_CODES, 0); *cost += VP8LExtraCostCombined(a->distance_, b->distance_, NUM_DISTANCE_CODES); if (*cost > cost_threshold) return 0; @@ -292,6 +336,15 @@ static int GetCombinedHistogramEntropy(const VP8LHistogram* const a, return 1; } +static WEBP_INLINE void HistogramAdd(const VP8LHistogram* const a, + const VP8LHistogram* const b, + VP8LHistogram* const out) { + VP8LHistogramAdd(a, b, out); + out->trivial_symbol_ = (a->trivial_symbol_ == b->trivial_symbol_) + ? a->trivial_symbol_ + : VP8L_NON_TRIVIAL_SYM; +} + // Performs out = a + b, computing the cost C(a+b) - C(a) - C(b) while comparing // to the threshold value 'cost_threshold'. The score returned is // Score = C(a+b) - C(a) - C(b), where C(a) + C(b) is known and fixed. @@ -307,11 +360,9 @@ static double HistogramAddEval(const VP8LHistogram* const a, cost_threshold += sum_cost; if (GetCombinedHistogramEntropy(a, b, cost_threshold, &cost)) { - VP8LHistogramAdd(a, b, out); + HistogramAdd(a, b, out); out->bit_cost_ = cost; out->palette_code_bits_ = a->palette_code_bits_; - out->trivial_symbol_ = (a->trivial_symbol_ == b->trivial_symbol_) ? - a->trivial_symbol_ : VP8L_NON_TRIVIAL_SYM; } return cost - sum_cost; @@ -450,113 +501,103 @@ static void HistogramCopyAndAnalyze( // Partition histograms to different entropy bins for three dominant (literal, // red and blue) symbol costs and compute the histogram aggregate bit_cost. static void HistogramAnalyzeEntropyBin(VP8LHistogramSet* const image_histo, - int16_t* const bin_map, int low_effort) { + uint16_t* const bin_map, + int low_effort) { int i; VP8LHistogram** const histograms = image_histo->histograms; const int histo_size = image_histo->size; - const int bin_depth = histo_size + 1; DominantCostRange cost_range; DominantCostRangeInit(&cost_range); // Analyze the dominant (literal, red and blue) entropy costs. for (i = 0; i < histo_size; ++i) { - VP8LHistogram* const histo = histograms[i]; - UpdateDominantCostRange(histo, &cost_range); + UpdateDominantCostRange(histograms[i], &cost_range); } // bin-hash histograms on three of the dominant (literal, red and blue) - // symbol costs. + // symbol costs and store the resulting bin_id for each histogram. for (i = 0; i < histo_size; ++i) { - const VP8LHistogram* const histo = histograms[i]; - const int bin_id = GetHistoBinIndex(histo, &cost_range, low_effort); - const int bin_offset = bin_id * bin_depth; - // bin_map[n][0] for every bin 'n' maintains the counter for the number of - // histograms in that bin. - // Get and increment the num_histos in that bin. - const int num_histos = ++bin_map[bin_offset]; - assert(bin_offset + num_histos < bin_depth * BIN_SIZE); - // Add histogram i'th index at num_histos (last) position in the bin_map. - bin_map[bin_offset + num_histos] = i; - } -} - -// Compact the histogram set by removing unused entries. -static void HistogramCompactBins(VP8LHistogramSet* const image_histo) { - VP8LHistogram** const histograms = image_histo->histograms; - int i, j; - - for (i = 0, j = 0; i < image_histo->size; ++i) { - if (histograms[i] != NULL && histograms[i]->bit_cost_ != 0.) { - if (j < i) { - histograms[j] = histograms[i]; - histograms[i] = NULL; - } - ++j; - } + bin_map[i] = GetHistoBinIndex(histograms[i], &cost_range, low_effort); } - image_histo->size = j; } +// Compact image_histo[] by merging some histograms with same bin_id together if +// it's advantageous. static VP8LHistogram* HistogramCombineEntropyBin( VP8LHistogramSet* const image_histo, VP8LHistogram* cur_combo, - int16_t* const bin_map, int bin_depth, int num_bins, + const uint16_t* const bin_map, int bin_map_size, int num_bins, double combine_cost_factor, int low_effort) { - int bin_id; VP8LHistogram** const histograms = image_histo->histograms; - - for (bin_id = 0; bin_id < num_bins; ++bin_id) { - const int bin_offset = bin_id * bin_depth; - const int num_histos = bin_map[bin_offset]; - const int idx1 = bin_map[bin_offset + 1]; - int num_combine_failures = 0; - int n; - for (n = 2; n <= num_histos; ++n) { - const int idx2 = bin_map[bin_offset + n]; - if (low_effort) { - // Merge all histograms with the same bin index, irrespective of cost of - // the merged histograms. - VP8LHistogramAdd(histograms[idx1], histograms[idx2], histograms[idx1]); - histograms[idx2]->bit_cost_ = 0.; - } else { - const double bit_cost_idx2 = histograms[idx2]->bit_cost_; - if (bit_cost_idx2 > 0.) { - const double bit_cost_thresh = -bit_cost_idx2 * combine_cost_factor; - const double curr_cost_diff = - HistogramAddEval(histograms[idx1], histograms[idx2], - cur_combo, bit_cost_thresh); - if (curr_cost_diff < bit_cost_thresh) { - // Try to merge two histograms only if the combo is a trivial one or - // the two candidate histograms are already non-trivial. - // For some images, 'try_combine' turns out to be false for a lot of - // histogram pairs. In that case, we fallback to combining - // histograms as usual to avoid increasing the header size. - const int try_combine = - (cur_combo->trivial_symbol_ != VP8L_NON_TRIVIAL_SYM) || - ((histograms[idx1]->trivial_symbol_ == VP8L_NON_TRIVIAL_SYM) && - (histograms[idx2]->trivial_symbol_ == VP8L_NON_TRIVIAL_SYM)); - const int max_combine_failures = 32; - if (try_combine || (num_combine_failures >= max_combine_failures)) { - HistogramSwap(&cur_combo, &histograms[idx1]); - histograms[idx2]->bit_cost_ = 0.; - } else { - ++num_combine_failures; - } - } + int idx; + // Work in-place: processed histograms are put at the beginning of + // image_histo[]. At the end, we just have to truncate the array. + int size = 0; + struct { + int16_t first; // position of the histogram that accumulates all + // histograms with the same bin_id + uint16_t num_combine_failures; // number of combine failures per bin_id + } bin_info[BIN_SIZE]; + + assert(num_bins <= BIN_SIZE); + for (idx = 0; idx < num_bins; ++idx) { + bin_info[idx].first = -1; + bin_info[idx].num_combine_failures = 0; + } + + for (idx = 0; idx < bin_map_size; ++idx) { + const int bin_id = bin_map[idx]; + const int first = bin_info[bin_id].first; + assert(size <= idx); + if (first == -1) { + // just move histogram #idx to its final position + histograms[size] = histograms[idx]; + bin_info[bin_id].first = size++; + } else if (low_effort) { + HistogramAdd(histograms[idx], histograms[first], histograms[first]); + } else { + // try to merge #idx into #first (both share the same bin_id) + const double bit_cost = histograms[idx]->bit_cost_; + const double bit_cost_thresh = -bit_cost * combine_cost_factor; + const double curr_cost_diff = + HistogramAddEval(histograms[first], histograms[idx], + cur_combo, bit_cost_thresh); + if (curr_cost_diff < bit_cost_thresh) { + // Try to merge two histograms only if the combo is a trivial one or + // the two candidate histograms are already non-trivial. + // For some images, 'try_combine' turns out to be false for a lot of + // histogram pairs. In that case, we fallback to combining + // histograms as usual to avoid increasing the header size. + const int try_combine = + (cur_combo->trivial_symbol_ != VP8L_NON_TRIVIAL_SYM) || + ((histograms[idx]->trivial_symbol_ == VP8L_NON_TRIVIAL_SYM) && + (histograms[first]->trivial_symbol_ == VP8L_NON_TRIVIAL_SYM)); + const int max_combine_failures = 32; + if (try_combine || + bin_info[bin_id].num_combine_failures >= max_combine_failures) { + // move the (better) merged histogram to its final slot + HistogramSwap(&cur_combo, &histograms[first]); + } else { + histograms[size++] = histograms[idx]; + ++bin_info[bin_id].num_combine_failures; } + } else { + histograms[size++] = histograms[idx]; } } - if (low_effort) { - // Update the bit_cost for the merged histograms (per bin index). - UpdateHistogramCost(histograms[idx1]); + } + image_histo->size = size; + if (low_effort) { + // for low_effort case, update the final cost when everything is merged + for (idx = 0; idx < size; ++idx) { + UpdateHistogramCost(histograms[idx]); } } - HistogramCompactBins(image_histo); return cur_combo; } -static uint32_t MyRand(uint32_t *seed) { - *seed *= 16807U; +static uint32_t MyRand(uint32_t* const seed) { + *seed = (*seed * 16807ull) & 0xffffffffu; if (*seed == 0) { *seed = 1; } @@ -682,7 +723,7 @@ static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo) { HistogramPair* copy_to; const int idx1 = histo_queue.queue[0].idx1; const int idx2 = histo_queue.queue[0].idx2; - VP8LHistogramAdd(histograms[idx2], histograms[idx1], histograms[idx1]); + HistogramAdd(histograms[idx2], histograms[idx1], histograms[idx1]); histograms[idx1]->bit_cost_ = histo_queue.queue[0].cost_combo; // Remove merged histogram. for (i = 0; i + 1 < image_histo_size; ++i) { @@ -748,6 +789,8 @@ static void HistogramCombineStochastic(VP8LHistogramSet* const image_histo, const int outer_iters = image_histo_size * iter_mult; const int num_pairs = image_histo_size / 2; const int num_tries_no_success = outer_iters / 2; + int idx2_max = image_histo_size - 1; + int do_brute_dorce = 0; VP8LHistogram** const histograms = image_histo->histograms; // Collapse similar histograms in 'image_histo'. @@ -758,43 +801,62 @@ static void HistogramCombineStochastic(VP8LHistogramSet* const image_histo, double best_cost_diff = 0.; int best_idx1 = -1, best_idx2 = 1; int j; - const int num_tries = + int num_tries = (num_pairs < image_histo_size) ? num_pairs : image_histo_size; + // Use a brute force approach if: + // - stochastic has not worked for a while and + // - if the number of iterations for brute force is less than the number of + // iterations if we never find a match ever again stochastically (hence + // num_tries times the number of remaining outer iterations). + do_brute_dorce = + (tries_with_no_success > 10) && + (idx2_max * (idx2_max + 1) < 2 * num_tries * (outer_iters - iter)); + if (do_brute_dorce) num_tries = idx2_max; + seed += iter; for (j = 0; j < num_tries; ++j) { double curr_cost_diff; // Choose two histograms at random and try to combine them. - const uint32_t idx1 = MyRand(&seed) % image_histo_size; - const uint32_t tmp = (j & 7) + 1; - const uint32_t diff = - (tmp < 3) ? tmp : MyRand(&seed) % (image_histo_size - 1); - const uint32_t idx2 = (idx1 + diff + 1) % image_histo_size; - if (idx1 == idx2) { - continue; + uint32_t idx1, idx2; + if (do_brute_dorce) { + // Use a brute force approach. + idx1 = (uint32_t)j; + idx2 = (uint32_t)idx2_max; + } else { + const uint32_t tmp = (j & 7) + 1; + const uint32_t diff = + (tmp < 3) ? tmp : MyRand(&seed) % (image_histo_size - 1); + idx1 = MyRand(&seed) % image_histo_size; + idx2 = (idx1 + diff + 1) % image_histo_size; + if (idx1 == idx2) { + continue; + } } // Calculate cost reduction on combining. curr_cost_diff = HistogramAddEval(histograms[idx1], histograms[idx2], tmp_histo, best_cost_diff); - if (curr_cost_diff < best_cost_diff) { // found a better pair? + if (curr_cost_diff < best_cost_diff) { // found a better pair? HistogramSwap(&best_combo, &tmp_histo); best_cost_diff = curr_cost_diff; best_idx1 = idx1; best_idx2 = idx2; } } + if (do_brute_dorce) --idx2_max; if (best_idx1 >= 0) { HistogramSwap(&best_combo, &histograms[best_idx1]); // swap best_idx2 slot with last one (which is now unused) --image_histo_size; + if (idx2_max >= image_histo_size) idx2_max = image_histo_size - 1; if (best_idx2 != image_histo_size) { HistogramSwap(&histograms[image_histo_size], &histograms[best_idx2]); histograms[image_histo_size] = NULL; } tries_with_no_success = 0; } - if (++tries_with_no_success >= num_tries_no_success) { + if (++tries_with_no_success >= num_tries_no_success || idx2_max == 0) { break; } } @@ -843,7 +905,7 @@ static void HistogramRemap(const VP8LHistogramSet* const in, for (i = 0; i < in_size; ++i) { const int idx = symbols[i]; - VP8LHistogramAdd(in_histo[i], out_histo[idx], out_histo[idx]); + HistogramAdd(in_histo[i], out_histo[idx], out_histo[idx]); } } @@ -869,32 +931,18 @@ int VP8LGetHistoImageSymbols(int xsize, int ysize, const int histo_xsize = histo_bits ? VP8LSubSampleSize(xsize, histo_bits) : 1; const int histo_ysize = histo_bits ? VP8LSubSampleSize(ysize, histo_bits) : 1; const int image_histo_raw_size = histo_xsize * histo_ysize; - const int entropy_combine_num_bins = low_effort ? NUM_PARTITIONS : BIN_SIZE; - - // The bin_map for every bin follows following semantics: - // bin_map[n][0] = num_histo; // The number of histograms in that bin. - // bin_map[n][1] = index of first histogram in that bin; - // bin_map[n][num_histo] = index of last histogram in that bin; - // bin_map[n][num_histo + 1] ... bin_map[n][bin_depth - 1] = unused indices. - const int bin_depth = image_histo_raw_size + 1; - int16_t* bin_map = NULL; VP8LHistogramSet* const orig_histo = VP8LAllocateHistogramSet(image_histo_raw_size, cache_bits); VP8LHistogram* cur_combo; + // Don't attempt linear bin-partition heuristic for + // histograms of small sizes (as bin_map will be very sparse) and + // maximum quality q==100 (to preserve the compression gains at that level). + const int entropy_combine_num_bins = low_effort ? NUM_PARTITIONS : BIN_SIZE; const int entropy_combine = (orig_histo->size > entropy_combine_num_bins * 2) && (quality < 100); if (orig_histo == NULL) goto Error; - // Don't attempt linear bin-partition heuristic for: - // histograms of small sizes, as bin_map will be very sparse and; - // Maximum quality (q==100), to preserve the compression gains at that level. - if (entropy_combine) { - const int bin_map_size = bin_depth * entropy_combine_num_bins; - bin_map = (int16_t*)WebPSafeCalloc(bin_map_size, sizeof(*bin_map)); - if (bin_map == NULL) goto Error; - } - // Construct the histograms from backward references. HistogramBuild(xsize, histo_bits, refs, orig_histo); // Copies the histograms and computes its bit_cost. @@ -902,12 +950,17 @@ int VP8LGetHistoImageSymbols(int xsize, int ysize, cur_combo = tmp_histos->histograms[1]; // pick up working slot if (entropy_combine) { + const int bin_map_size = orig_histo->size; + // Reuse histogram_symbols storage. By definition, it's guaranteed to be ok. + uint16_t* const bin_map = histogram_symbols; const double combine_cost_factor = GetCombineCostFactor(image_histo_raw_size, quality); + HistogramAnalyzeEntropyBin(orig_histo, bin_map, low_effort); // Collapse histograms with similar entropy. - cur_combo = HistogramCombineEntropyBin(image_histo, cur_combo, bin_map, - bin_depth, entropy_combine_num_bins, + cur_combo = HistogramCombineEntropyBin(image_histo, cur_combo, + bin_map, bin_map_size, + entropy_combine_num_bins, combine_cost_factor, low_effort); } @@ -932,7 +985,6 @@ int VP8LGetHistoImageSymbols(int xsize, int ysize, ok = 1; Error: - WebPSafeFree(bin_map); VP8LFreeHistogramSet(orig_histo); return ok; } diff --git a/thirdparty/libwebp/enc/histogram.h b/thirdparty/libwebp/enc/histogram_enc.h index d303d1d58b..a9d258a166 100644 --- a/thirdparty/libwebp/enc/histogram.h +++ b/thirdparty/libwebp/enc/histogram_enc.h @@ -16,7 +16,7 @@ #include <string.h> -#include "./backward_references.h" +#include "./backward_references_enc.h" #include "../webp/format_constants.h" #include "../webp/types.h" diff --git a/thirdparty/libwebp/enc/iterator.c b/thirdparty/libwebp/enc/iterator_enc.c index 99d960a547..e48d30bd31 100644 --- a/thirdparty/libwebp/enc/iterator.c +++ b/thirdparty/libwebp/enc/iterator_enc.c @@ -13,7 +13,7 @@ #include <string.h> -#include "./vp8enci.h" +#include "./vp8i_enc.h" //------------------------------------------------------------------------------ // VP8Iterator @@ -53,7 +53,6 @@ void VP8IteratorReset(VP8EncIterator* const it) { VP8IteratorSetRow(it, 0); VP8IteratorSetCountDown(it, enc->mb_w_ * enc->mb_h_); // default InitTop(it); - InitLeft(it); memset(it->bit_count_, 0, sizeof(it->bit_count_)); it->do_trellis_ = 0; } @@ -68,8 +67,6 @@ int VP8IteratorIsDone(const VP8EncIterator* const it) { void VP8IteratorInit(VP8Encoder* const enc, VP8EncIterator* const it) { it->enc_ = enc; - it->y_stride_ = enc->pic_->y_stride; - it->uv_stride_ = enc->pic_->uv_stride; it->yuv_in_ = (uint8_t*)WEBP_ALIGN(it->yuv_mem_); it->yuv_out_ = it->yuv_in_ + YUV_SIZE_ENC; it->yuv_out2_ = it->yuv_out_ + YUV_SIZE_ENC; @@ -309,14 +306,14 @@ void VP8IteratorSaveBoundary(VP8EncIterator* const it) { } int VP8IteratorNext(VP8EncIterator* const it) { - it->preds_ += 4; - it->mb_ += 1; - it->nz_ += 1; - it->y_top_ += 16; - it->uv_top_ += 16; - it->x_ += 1; - if (it->x_ == it->enc_->mb_w_) { + if (++it->x_ == it->enc_->mb_w_) { VP8IteratorSetRow(it, ++it->y_); + } else { + it->preds_ += 4; + it->mb_ += 1; + it->nz_ += 1; + it->y_top_ += 16; + it->uv_top_ += 16; } return (0 < --it->count_down_); } diff --git a/thirdparty/libwebp/enc/near_lossless.c b/thirdparty/libwebp/enc/near_lossless_enc.c index f4ab91f571..2bd03ab20d 100644 --- a/thirdparty/libwebp/enc/near_lossless.c +++ b/thirdparty/libwebp/enc/near_lossless_enc.c @@ -17,9 +17,9 @@ #include <assert.h> #include <stdlib.h> -#include "../dsp/lossless.h" +#include "../dsp/lossless_common.h" #include "../utils/utils.h" -#include "./vp8enci.h" +#include "./vp8i_enc.h" #define MIN_DIM_FOR_NEAR_LOSSLESS 64 #define MAX_LIMIT_BITS 5 diff --git a/thirdparty/libwebp/enc/picture_csp.c b/thirdparty/libwebp/enc/picture_csp_enc.c index 188a3ca55b..e5d1c75a66 100644 --- a/thirdparty/libwebp/enc/picture_csp.c +++ b/thirdparty/libwebp/enc/picture_csp_enc.c @@ -15,8 +15,8 @@ #include <stdlib.h> #include <math.h> -#include "./vp8enci.h" -#include "../utils/random.h" +#include "./vp8i_enc.h" +#include "../utils/random_utils.h" #include "../utils/utils.h" #include "../dsp/yuv.h" @@ -153,9 +153,9 @@ static int RGBToV(int r, int g, int b, VP8Random* const rg) { } //------------------------------------------------------------------------------ -// Smart RGB->YUV conversion +// Sharp RGB->YUV conversion -static const int kNumIterations = 6; +static const int kNumIterations = 4; static const int kMinDimensionIterativeConversion = 4; // We could use SFIX=0 and only uint8_t for fixed_y_t, but it produces some @@ -171,9 +171,9 @@ typedef uint16_t fixed_y_t; // unsigned type with extra SFIX precision for W #if defined(USE_GAMMA_COMPRESSION) // float variant of gamma-correction -// We use tables of different size and precision, along with a 'real-world' -// Gamma value close to ~2. -#define kGammaF 2.2 +// We use tables of different size and precision for the Rec709 +// transfer function. +#define kGammaF (1./0.45) static float kGammaToLinearTabF[MAX_Y_T + 1]; // size scales with Y_FIX static float kLinearToGammaTabF[kGammaTabSize + 2]; static volatile int kGammaTablesFOk = 0; @@ -183,11 +183,26 @@ static WEBP_TSAN_IGNORE_FUNCTION void InitGammaTablesF(void) { int v; const double norm = 1. / MAX_Y_T; const double scale = 1. / kGammaTabSize; + const double a = 0.099; + const double thresh = 0.018; for (v = 0; v <= MAX_Y_T; ++v) { - kGammaToLinearTabF[v] = (float)pow(norm * v, kGammaF); + const double g = norm * v; + if (g <= thresh * 4.5) { + kGammaToLinearTabF[v] = (float)(g / 4.5); + } else { + const double a_rec = 1. / (1. + a); + kGammaToLinearTabF[v] = (float)pow(a_rec * (g + a), kGammaF); + } } for (v = 0; v <= kGammaTabSize; ++v) { - kLinearToGammaTabF[v] = (float)(MAX_Y_T * pow(scale * v, 1. / kGammaF)); + const double g = scale * v; + double value; + if (g <= thresh) { + value = 4.5 * g; + } else { + value = (1. + a) * pow(g, 1. / kGammaF) - a; + } + kLinearToGammaTabF[v] = (float)(MAX_Y_T * value); } // to prevent small rounding errors to cause read-overflow: kLinearToGammaTabF[kGammaTabSize + 1] = kLinearToGammaTabF[kGammaTabSize]; @@ -235,12 +250,12 @@ static fixed_y_t clip_y(int y) { //------------------------------------------------------------------------------ static int RGBToGray(int r, int g, int b) { - const int luma = 19595 * r + 38470 * g + 7471 * b + YUV_HALF; + const int luma = 13933 * r + 46871 * g + 4732 * b + YUV_HALF; return (luma >> YUV_FIX); } static float RGBToGrayF(float r, float g, float b) { - return 0.299f * r + 0.587f * g + 0.114f * b; + return (float)(0.2126 * r + 0.7152 * g + 0.0722 * b); } static int ScaleDown(int a, int b, int c, int d) { @@ -251,58 +266,50 @@ static int ScaleDown(int a, int b, int c, int d) { return LinearToGammaF(0.25f * (A + B + C + D)); } -static WEBP_INLINE void UpdateW(const fixed_y_t* src, fixed_y_t* dst, int len) { - while (len-- > 0) { - const float R = GammaToLinearF(src[0]); - const float G = GammaToLinearF(src[1]); - const float B = GammaToLinearF(src[2]); +static WEBP_INLINE void UpdateW(const fixed_y_t* src, fixed_y_t* dst, int w) { + int i; + for (i = 0; i < w; ++i) { + const float R = GammaToLinearF(src[0 * w + i]); + const float G = GammaToLinearF(src[1 * w + i]); + const float B = GammaToLinearF(src[2 * w + i]); const float Y = RGBToGrayF(R, G, B); - *dst++ = (fixed_y_t)LinearToGammaF(Y); - src += 3; + dst[i] = (fixed_y_t)LinearToGammaF(Y); } } -static int UpdateChroma(const fixed_y_t* src1, - const fixed_y_t* src2, - fixed_t* dst, fixed_y_t* tmp, int len) { - int diff = 0; - while (len--> 0) { - const int r = ScaleDown(src1[0], src1[3], src2[0], src2[3]); - const int g = ScaleDown(src1[1], src1[4], src2[1], src2[4]); - const int b = ScaleDown(src1[2], src1[5], src2[2], src2[5]); +static void UpdateChroma(const fixed_y_t* src1, const fixed_y_t* src2, + fixed_t* dst, int uv_w) { + int i; + for (i = 0; i < uv_w; ++i) { + const int r = ScaleDown(src1[0 * uv_w + 0], src1[0 * uv_w + 1], + src2[0 * uv_w + 0], src2[0 * uv_w + 1]); + const int g = ScaleDown(src1[2 * uv_w + 0], src1[2 * uv_w + 1], + src2[2 * uv_w + 0], src2[2 * uv_w + 1]); + const int b = ScaleDown(src1[4 * uv_w + 0], src1[4 * uv_w + 1], + src2[4 * uv_w + 0], src2[4 * uv_w + 1]); const int W = RGBToGray(r, g, b); - const int r_avg = (src1[0] + src1[3] + src2[0] + src2[3] + 2) >> 2; - const int g_avg = (src1[1] + src1[4] + src2[1] + src2[4] + 2) >> 2; - const int b_avg = (src1[2] + src1[5] + src2[2] + src2[5] + 2) >> 2; - dst[0] = (fixed_t)(r - W); - dst[1] = (fixed_t)(g - W); - dst[2] = (fixed_t)(b - W); - dst += 3; - src1 += 6; - src2 += 6; - if (tmp != NULL) { - tmp[0] = tmp[1] = clip_y(W); - tmp += 2; - } - diff += abs(RGBToGray(r_avg, g_avg, b_avg) - W); + dst[0 * uv_w] = (fixed_t)(r - W); + dst[1 * uv_w] = (fixed_t)(g - W); + dst[2 * uv_w] = (fixed_t)(b - W); + dst += 1; + src1 += 2; + src2 += 2; } - return diff; } -//------------------------------------------------------------------------------ - -static WEBP_INLINE int Filter(const fixed_t* const A, const fixed_t* const B, - int rightwise) { - int v; - if (!rightwise) { - v = (A[0] * 9 + A[-3] * 3 + B[0] * 3 + B[-3]); - } else { - v = (A[0] * 9 + A[+3] * 3 + B[0] * 3 + B[+3]); +static void StoreGray(const fixed_y_t* rgb, fixed_y_t* y, int w) { + int i; + for (i = 0; i < w; ++i) { + y[i] = RGBToGray(rgb[0 * w + i], rgb[1 * w + i], rgb[2 * w + i]); } - return (v + 8) >> 4; } -static WEBP_INLINE int Filter2(int A, int B) { return (A * 3 + B + 2) >> 2; } +//------------------------------------------------------------------------------ + +static WEBP_INLINE fixed_y_t Filter2(int A, int B, int W0) { + const int v0 = (A * 3 + B + 2) >> 2; + return clip_y(v0 + W0); +} //------------------------------------------------------------------------------ @@ -317,52 +324,50 @@ static void ImportOneRow(const uint8_t* const r_ptr, int pic_width, fixed_y_t* const dst) { int i; + const int w = (pic_width + 1) & ~1; for (i = 0; i < pic_width; ++i) { const int off = i * step; - dst[3 * i + 0] = UpLift(r_ptr[off]); - dst[3 * i + 1] = UpLift(g_ptr[off]); - dst[3 * i + 2] = UpLift(b_ptr[off]); + dst[i + 0 * w] = UpLift(r_ptr[off]); + dst[i + 1 * w] = UpLift(g_ptr[off]); + dst[i + 2 * w] = UpLift(b_ptr[off]); } if (pic_width & 1) { // replicate rightmost pixel - memcpy(dst + 3 * pic_width, dst + 3 * (pic_width - 1), 3 * sizeof(*dst)); + dst[pic_width + 0 * w] = dst[pic_width + 0 * w - 1]; + dst[pic_width + 1 * w] = dst[pic_width + 1 * w - 1]; + dst[pic_width + 2 * w] = dst[pic_width + 2 * w - 1]; } } static void InterpolateTwoRows(const fixed_y_t* const best_y, - const fixed_t* const prev_uv, - const fixed_t* const cur_uv, - const fixed_t* const next_uv, + const fixed_t* prev_uv, + const fixed_t* cur_uv, + const fixed_t* next_uv, int w, - fixed_y_t* const out1, - fixed_y_t* const out2) { - int i, k; - { // special boundary case for i==0 - const int W0 = best_y[0]; - const int W1 = best_y[w]; - for (k = 0; k <= 2; ++k) { - out1[k] = clip_y(Filter2(cur_uv[k], prev_uv[k]) + W0); - out2[k] = clip_y(Filter2(cur_uv[k], next_uv[k]) + W1); - } - } - for (i = 1; i < w - 1; ++i) { - const int W0 = best_y[i + 0]; - const int W1 = best_y[i + w]; - const int off = 3 * (i >> 1); - for (k = 0; k <= 2; ++k) { - const int tmp0 = Filter(cur_uv + off + k, prev_uv + off + k, i & 1); - const int tmp1 = Filter(cur_uv + off + k, next_uv + off + k, i & 1); - out1[3 * i + k] = clip_y(tmp0 + W0); - out2[3 * i + k] = clip_y(tmp1 + W1); - } - } - { // special boundary case for i == w - 1 - const int W0 = best_y[i + 0]; - const int W1 = best_y[i + w]; - const int off = 3 * (i >> 1); - for (k = 0; k <= 2; ++k) { - out1[3 * i + k] = clip_y(Filter2(cur_uv[off + k], prev_uv[off + k]) + W0); - out2[3 * i + k] = clip_y(Filter2(cur_uv[off + k], next_uv[off + k]) + W1); + fixed_y_t* out1, + fixed_y_t* out2) { + const int uv_w = w >> 1; + const int len = (w - 1) >> 1; // length to filter + int k = 3; + while (k-- > 0) { // process each R/G/B segments in turn + // special boundary case for i==0 + out1[0] = Filter2(cur_uv[0], prev_uv[0], best_y[0]); + out2[0] = Filter2(cur_uv[0], next_uv[0], best_y[w]); + + WebPSharpYUVFilterRow(cur_uv, prev_uv, len, best_y + 0 + 1, out1 + 1); + WebPSharpYUVFilterRow(cur_uv, next_uv, len, best_y + w + 1, out2 + 1); + + // special boundary case for i == w - 1 when w is even + if (!(w & 1)) { + out1[w - 1] = Filter2(cur_uv[uv_w - 1], prev_uv[uv_w - 1], + best_y[w - 1 + 0]); + out2[w - 1] = Filter2(cur_uv[uv_w - 1], next_uv[uv_w - 1], + best_y[w - 1 + w]); } + out1 += w; + out2 += w; + prev_uv += uv_w; + cur_uv += uv_w; + next_uv += uv_w; } } @@ -394,11 +399,11 @@ static int ConvertWRGBToYUV(const fixed_y_t* best_y, const fixed_t* best_uv, const int uv_h = h >> 1; for (best_uv = best_uv_base, j = 0; j < picture->height; ++j) { for (i = 0; i < picture->width; ++i) { - const int off = 3 * (i >> 1); + const int off = (i >> 1); const int W = best_y[i]; - const int r = best_uv[off + 0] + W; - const int g = best_uv[off + 1] + W; - const int b = best_uv[off + 2] + W; + const int r = best_uv[off + 0 * uv_w] + W; + const int g = best_uv[off + 1 * uv_w] + W; + const int b = best_uv[off + 2 * uv_w] + W; dst_y[i] = ConvertRGBToY(r, g, b); } best_y += w; @@ -407,10 +412,10 @@ static int ConvertWRGBToYUV(const fixed_y_t* best_y, const fixed_t* best_uv, } for (best_uv = best_uv_base, j = 0; j < uv_h; ++j) { for (i = 0; i < uv_w; ++i) { - const int off = 3 * i; - const int r = best_uv[off + 0]; - const int g = best_uv[off + 1]; - const int b = best_uv[off + 2]; + const int off = i; + const int r = best_uv[off + 0 * uv_w]; + const int g = best_uv[off + 1 * uv_w]; + const int b = best_uv[off + 2 * uv_w]; dst_u[i] = ConvertRGBToU(r, g, b); dst_v[i] = ConvertRGBToV(r, g, b); } @@ -436,7 +441,8 @@ static int PreprocessARGB(const uint8_t* r_ptr, const int h = (picture->height + 1) & ~1; const int uv_w = w >> 1; const int uv_h = h >> 1; - int i, j, iter; + uint64_t prev_diff_y_sum = ~0; + int j, iter; // TODO(skal): allocate one big memory chunk. But for now, it's easier // for valgrind debugging to have several chunks. @@ -451,11 +457,8 @@ static int PreprocessARGB(const uint8_t* r_ptr, fixed_y_t* target_y = target_y_base; fixed_t* best_uv = best_uv_base; fixed_t* target_uv = target_uv_base; + const uint64_t diff_y_threshold = (uint64_t)(3.0 * w * h); int ok; - int diff_sum = 0; - const int first_diff_threshold = (int)(2.5 * w * h); - const int min_improvement = 5; // stop if improvement is below this % - const int min_first_improvement = 80; if (best_y_base == NULL || best_uv_base == NULL || target_y_base == NULL || target_uv_base == NULL || @@ -467,10 +470,12 @@ static int PreprocessARGB(const uint8_t* r_ptr, assert(picture->width >= kMinDimensionIterativeConversion); assert(picture->height >= kMinDimensionIterativeConversion); + WebPInitConvertARGBToYUV(); + // Import RGB samples to W/RGB representation. for (j = 0; j < picture->height; j += 2) { const int is_last_row = (j == picture->height - 1); - fixed_y_t* const src1 = tmp_buffer; + fixed_y_t* const src1 = tmp_buffer + 0 * w; fixed_y_t* const src2 = tmp_buffer + 3 * w; // prepare two rows of input @@ -481,11 +486,13 @@ static int PreprocessARGB(const uint8_t* r_ptr, } else { memcpy(src2, src1, 3 * w * sizeof(*src2)); } + StoreGray(src1, best_y + 0, w); + StoreGray(src2, best_y + w, w); + UpdateW(src1, target_y, w); UpdateW(src2, target_y + w, w); - diff_sum += UpdateChroma(src1, src2, target_uv, best_y, uv_w); + UpdateChroma(src1, src2, target_uv, uv_w); memcpy(best_uv, target_uv, 3 * uv_w * sizeof(*best_uv)); - memcpy(best_y + w, best_y, w * sizeof(*best_y)); best_y += 2 * w; best_uv += 3 * uv_w; target_y += 2 * w; @@ -497,18 +504,16 @@ static int PreprocessARGB(const uint8_t* r_ptr, // Iterate and resolve clipping conflicts. for (iter = 0; iter < kNumIterations; ++iter) { - int k; const fixed_t* cur_uv = best_uv_base; const fixed_t* prev_uv = best_uv_base; - const int old_diff_sum = diff_sum; - diff_sum = 0; + uint64_t diff_y_sum = 0; best_y = best_y_base; best_uv = best_uv_base; target_y = target_y_base; target_uv = target_uv_base; for (j = 0; j < h; j += 2) { - fixed_y_t* const src1 = tmp_buffer; + fixed_y_t* const src1 = tmp_buffer + 0 * w; fixed_y_t* const src2 = tmp_buffer + 3 * w; { const fixed_t* const next_uv = cur_uv + ((j < h - 2) ? 3 * uv_w : 0); @@ -519,50 +524,24 @@ static int PreprocessARGB(const uint8_t* r_ptr, UpdateW(src1, best_rgb_y + 0 * w, w); UpdateW(src2, best_rgb_y + 1 * w, w); - diff_sum += UpdateChroma(src1, src2, best_rgb_uv, NULL, uv_w); + UpdateChroma(src1, src2, best_rgb_uv, uv_w); // update two rows of Y and one row of RGB - for (i = 0; i < 2 * w; ++i) { - const int diff_y = target_y[i] - best_rgb_y[i]; - const int new_y = (int)best_y[i] + diff_y; - best_y[i] = clip_y(new_y); - } - for (i = 0; i < uv_w; ++i) { - const int off = 3 * i; - int W; - for (k = 0; k <= 2; ++k) { - const int diff_uv = (int)target_uv[off + k] - best_rgb_uv[off + k]; - best_uv[off + k] += diff_uv; - } - W = RGBToGray(best_uv[off + 0], best_uv[off + 1], best_uv[off + 2]); - for (k = 0; k <= 2; ++k) { - best_uv[off + k] -= W; - } - } + diff_y_sum += WebPSharpYUVUpdateY(target_y, best_rgb_y, best_y, 2 * w); + WebPSharpYUVUpdateRGB(target_uv, best_rgb_uv, best_uv, 3 * uv_w); + best_y += 2 * w; best_uv += 3 * uv_w; target_y += 2 * w; target_uv += 3 * uv_w; } // test exit condition - if (diff_sum > 0) { - const int improvement = 100 * abs(diff_sum - old_diff_sum) / diff_sum; - // Check if first iteration gave good result already, without a large - // jump of improvement (otherwise it means we need to try few extra - // iterations, just to be sure). - if (iter == 0 && diff_sum < first_diff_threshold && - improvement < min_first_improvement) { - break; - } - // then, check if improvement is stalling. - if (improvement < min_improvement) { - break; - } - } else { - break; + if (iter > 0) { + if (diff_y_sum < diff_y_threshold) break; + if (diff_y_sum > prev_diff_y_sum) break; } + prev_diff_y_sum = diff_y_sum; } - // final reconstruction ok = ConvertWRGBToYUV(best_y_base, best_uv_base, picture); @@ -1032,9 +1011,13 @@ int WebPPictureARGBToYUVA(WebPPicture* picture, WebPEncCSP colorspace) { return PictureARGBToYUVA(picture, colorspace, 0.f, 0); } -int WebPPictureSmartARGBToYUVA(WebPPicture* picture) { +int WebPPictureSharpARGBToYUVA(WebPPicture* picture) { return PictureARGBToYUVA(picture, WEBP_YUV420, 0.f, 1); } +// for backward compatibility +int WebPPictureSmartARGBToYUVA(WebPPicture* picture) { + return WebPPictureSharpARGBToYUVA(picture); +} //------------------------------------------------------------------------------ // call for YUVA -> ARGB conversion diff --git a/thirdparty/libwebp/enc/picture.c b/thirdparty/libwebp/enc/picture_enc.c index 28c56cd6e5..dfa66510fb 100644 --- a/thirdparty/libwebp/enc/picture.c +++ b/thirdparty/libwebp/enc/picture_enc.c @@ -14,7 +14,7 @@ #include <assert.h> #include <stdlib.h> -#include "./vp8enci.h" +#include "./vp8i_enc.h" #include "../dsp/dsp.h" #include "../utils/utils.h" diff --git a/thirdparty/libwebp/enc/picture_psnr.c b/thirdparty/libwebp/enc/picture_psnr.c deleted file mode 100644 index 329757deb1..0000000000 --- a/thirdparty/libwebp/enc/picture_psnr.c +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2014 Google Inc. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style license -// that can be found in the COPYING file in the root of the source -// tree. An additional intellectual property rights grant can be found -// in the file PATENTS. All contributing project authors may -// be found in the AUTHORS file in the root of the source tree. -// ----------------------------------------------------------------------------- -// -// WebPPicture tools for measuring distortion -// -// Author: Skal (pascal.massimino@gmail.com) - -#include <math.h> -#include <stdlib.h> - -#include "./vp8enci.h" -#include "../utils/utils.h" - -//------------------------------------------------------------------------------ -// local-min distortion -// -// For every pixel in the *reference* picture, we search for the local best -// match in the compressed image. This is not a symmetrical measure. - -#define RADIUS 2 // search radius. Shouldn't be too large. - -static void AccumulateLSIM(const uint8_t* src, int src_stride, - const uint8_t* ref, int ref_stride, - int w, int h, VP8DistoStats* stats) { - int x, y; - double total_sse = 0.; - for (y = 0; y < h; ++y) { - const int y_0 = (y - RADIUS < 0) ? 0 : y - RADIUS; - const int y_1 = (y + RADIUS + 1 >= h) ? h : y + RADIUS + 1; - for (x = 0; x < w; ++x) { - const int x_0 = (x - RADIUS < 0) ? 0 : x - RADIUS; - const int x_1 = (x + RADIUS + 1 >= w) ? w : x + RADIUS + 1; - double best_sse = 255. * 255.; - const double value = (double)ref[y * ref_stride + x]; - int i, j; - for (j = y_0; j < y_1; ++j) { - const uint8_t* const s = src + j * src_stride; - for (i = x_0; i < x_1; ++i) { - const double diff = s[i] - value; - const double sse = diff * diff; - if (sse < best_sse) best_sse = sse; - } - } - total_sse += best_sse; - } - } - stats->w = w * h; - stats->xm = 0; - stats->ym = 0; - stats->xxm = total_sse; - stats->yym = 0; - stats->xxm = 0; -} -#undef RADIUS - -//------------------------------------------------------------------------------ -// Distortion - -// Max value returned in case of exact similarity. -static const double kMinDistortion_dB = 99.; -static float GetPSNR(const double v) { - return (float)((v > 0.) ? -4.3429448 * log(v / (255 * 255.)) - : kMinDistortion_dB); -} - -int WebPPictureDistortion(const WebPPicture* src, const WebPPicture* ref, - int type, float result[5]) { - VP8DistoStats stats[5]; - int w, h; - - memset(stats, 0, sizeof(stats)); - - VP8SSIMDspInit(); - - if (src == NULL || ref == NULL || - src->width != ref->width || src->height != ref->height || - src->use_argb != ref->use_argb || result == NULL) { - return 0; - } - w = src->width; - h = src->height; - - if (src->use_argb == 1) { - if (src->argb == NULL || ref->argb == NULL) { - return 0; - } else { - int i, j, c; - uint8_t* tmp1, *tmp2; - uint8_t* const tmp_plane = - (uint8_t*)WebPSafeMalloc(2ULL * w * h, sizeof(*tmp_plane)); - if (tmp_plane == NULL) return 0; - tmp1 = tmp_plane; - tmp2 = tmp_plane + w * h; - for (c = 0; c < 4; ++c) { - for (j = 0; j < h; ++j) { - for (i = 0; i < w; ++i) { - tmp1[j * w + i] = src->argb[i + j * src->argb_stride] >> (c * 8); - tmp2[j * w + i] = ref->argb[i + j * ref->argb_stride] >> (c * 8); - } - } - if (type >= 2) { - AccumulateLSIM(tmp1, w, tmp2, w, w, h, &stats[c]); - } else { - VP8SSIMAccumulatePlane(tmp1, w, tmp2, w, w, h, &stats[c]); - } - } - WebPSafeFree(tmp_plane); - } - } else { - int has_alpha, uv_w, uv_h; - if (src->y == NULL || ref->y == NULL || - src->u == NULL || ref->u == NULL || - src->v == NULL || ref->v == NULL) { - return 0; - } - has_alpha = !!(src->colorspace & WEBP_CSP_ALPHA_BIT); - if (has_alpha != !!(ref->colorspace & WEBP_CSP_ALPHA_BIT) || - (has_alpha && (src->a == NULL || ref->a == NULL))) { - return 0; - } - - uv_w = (src->width + 1) >> 1; - uv_h = (src->height + 1) >> 1; - if (type >= 2) { - AccumulateLSIM(src->y, src->y_stride, ref->y, ref->y_stride, - w, h, &stats[0]); - AccumulateLSIM(src->u, src->uv_stride, ref->u, ref->uv_stride, - uv_w, uv_h, &stats[1]); - AccumulateLSIM(src->v, src->uv_stride, ref->v, ref->uv_stride, - uv_w, uv_h, &stats[2]); - if (has_alpha) { - AccumulateLSIM(src->a, src->a_stride, ref->a, ref->a_stride, - w, h, &stats[3]); - } - } else { - VP8SSIMAccumulatePlane(src->y, src->y_stride, - ref->y, ref->y_stride, - w, h, &stats[0]); - VP8SSIMAccumulatePlane(src->u, src->uv_stride, - ref->u, ref->uv_stride, - uv_w, uv_h, &stats[1]); - VP8SSIMAccumulatePlane(src->v, src->uv_stride, - ref->v, ref->uv_stride, - uv_w, uv_h, &stats[2]); - if (has_alpha) { - VP8SSIMAccumulatePlane(src->a, src->a_stride, - ref->a, ref->a_stride, - w, h, &stats[3]); - } - } - } - // Final stat calculations. - { - int c; - for (c = 0; c <= 4; ++c) { - if (type == 1) { - const double v = VP8SSIMGet(&stats[c]); - result[c] = (float)((v < 1.) ? -10.0 * log10(1. - v) - : kMinDistortion_dB); - } else { - const double v = VP8SSIMGetSquaredError(&stats[c]); - result[c] = GetPSNR(v); - } - // Accumulate forward - if (c < 4) VP8SSIMAddStats(&stats[c], &stats[4]); - } - } - return 1; -} - -//------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/enc/picture_psnr_enc.c b/thirdparty/libwebp/enc/picture_psnr_enc.c new file mode 100644 index 0000000000..9c0b229507 --- /dev/null +++ b/thirdparty/libwebp/enc/picture_psnr_enc.c @@ -0,0 +1,213 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// WebPPicture tools for measuring distortion +// +// Author: Skal (pascal.massimino@gmail.com) + +#include <math.h> +#include <stdlib.h> + +#include "./vp8i_enc.h" +#include "../utils/utils.h" + +typedef double (*AccumulateFunc)(const uint8_t* src, int src_stride, + const uint8_t* ref, int ref_stride, + int w, int h); + +//------------------------------------------------------------------------------ +// local-min distortion +// +// For every pixel in the *reference* picture, we search for the local best +// match in the compressed image. This is not a symmetrical measure. + +#define RADIUS 2 // search radius. Shouldn't be too large. + +static double AccumulateLSIM(const uint8_t* src, int src_stride, + const uint8_t* ref, int ref_stride, + int w, int h) { + int x, y; + double total_sse = 0.; + for (y = 0; y < h; ++y) { + const int y_0 = (y - RADIUS < 0) ? 0 : y - RADIUS; + const int y_1 = (y + RADIUS + 1 >= h) ? h : y + RADIUS + 1; + for (x = 0; x < w; ++x) { + const int x_0 = (x - RADIUS < 0) ? 0 : x - RADIUS; + const int x_1 = (x + RADIUS + 1 >= w) ? w : x + RADIUS + 1; + double best_sse = 255. * 255.; + const double value = (double)ref[y * ref_stride + x]; + int i, j; + for (j = y_0; j < y_1; ++j) { + const uint8_t* const s = src + j * src_stride; + for (i = x_0; i < x_1; ++i) { + const double diff = s[i] - value; + const double sse = diff * diff; + if (sse < best_sse) best_sse = sse; + } + } + total_sse += best_sse; + } + } + return total_sse; +} +#undef RADIUS + +static double AccumulateSSE(const uint8_t* src, int src_stride, + const uint8_t* ref, int ref_stride, + int w, int h) { + int y; + double total_sse = 0.; + for (y = 0; y < h; ++y) { + total_sse += VP8AccumulateSSE(src, ref, w); + src += src_stride; + ref += ref_stride; + } + return total_sse; +} + +//------------------------------------------------------------------------------ + +static double AccumulateSSIM(const uint8_t* src, int src_stride, + const uint8_t* ref, int ref_stride, + int w, int h) { + const int w0 = (w < VP8_SSIM_KERNEL) ? w : VP8_SSIM_KERNEL; + const int w1 = w - VP8_SSIM_KERNEL - 1; + const int h0 = (h < VP8_SSIM_KERNEL) ? h : VP8_SSIM_KERNEL; + const int h1 = h - VP8_SSIM_KERNEL - 1; + int x, y; + double sum = 0.; + for (y = 0; y < h0; ++y) { + for (x = 0; x < w; ++x) { + sum += VP8SSIMGetClipped(src, src_stride, ref, ref_stride, x, y, w, h); + } + } + for (; y < h1; ++y) { + for (x = 0; x < w0; ++x) { + sum += VP8SSIMGetClipped(src, src_stride, ref, ref_stride, x, y, w, h); + } + for (; x < w1; ++x) { + const int off1 = x - VP8_SSIM_KERNEL + (y - VP8_SSIM_KERNEL) * src_stride; + const int off2 = x - VP8_SSIM_KERNEL + (y - VP8_SSIM_KERNEL) * ref_stride; + sum += VP8SSIMGet(src + off1, src_stride, ref + off2, ref_stride); + } + for (; x < w; ++x) { + sum += VP8SSIMGetClipped(src, src_stride, ref, ref_stride, x, y, w, h); + } + } + for (; y < h; ++y) { + for (x = 0; x < w; ++x) { + sum += VP8SSIMGetClipped(src, src_stride, ref, ref_stride, x, y, w, h); + } + } + return sum; +} + +//------------------------------------------------------------------------------ +// Distortion + +// Max value returned in case of exact similarity. +static const double kMinDistortion_dB = 99.; + +static double GetPSNR(double v, double size) { + return (v > 0. && size > 0.) ? -4.3429448 * log(v / (size * 255 * 255.)) + : kMinDistortion_dB; +} + +static double GetLogSSIM(double v, double size) { + v = (size > 0.) ? v / size : 1.; + return (v < 1.) ? -10.0 * log10(1. - v) : kMinDistortion_dB; +} + +int WebPPlaneDistortion(const uint8_t* src, size_t src_stride, + const uint8_t* ref, size_t ref_stride, + int width, int height, size_t x_step, + int type, float* distortion, float* result) { + uint8_t* allocated = NULL; + const AccumulateFunc metric = (type == 0) ? AccumulateSSE : + (type == 1) ? AccumulateSSIM : + AccumulateLSIM; + if (src == NULL || ref == NULL || + src_stride < x_step * width || ref_stride < x_step * width || + result == NULL || distortion == NULL) { + return 0; + } + + VP8SSIMDspInit(); + if (x_step != 1) { // extract a packed plane if needed + int x, y; + uint8_t* tmp1; + uint8_t* tmp2; + allocated = + (uint8_t*)WebPSafeMalloc(2ULL * width * height, sizeof(*allocated)); + if (allocated == NULL) return 0; + tmp1 = allocated; + tmp2 = tmp1 + (size_t)width * height; + for (y = 0; y < height; ++y) { + for (x = 0; x < width; ++x) { + tmp1[x + y * width] = src[x * x_step + y * src_stride]; + tmp2[x + y * width] = ref[x * x_step + y * ref_stride]; + } + } + src = tmp1; + ref = tmp2; + } + *distortion = (float)metric(src, width, ref, width, width, height); + WebPSafeFree(allocated); + + *result = (type == 1) ? (float)GetLogSSIM(*distortion, (double)width * height) + : (float)GetPSNR(*distortion, (double)width * height); + return 1; +} + +int WebPPictureDistortion(const WebPPicture* src, const WebPPicture* ref, + int type, float results[5]) { + int w, h, c; + int ok = 0; + WebPPicture p0, p1; + double total_size = 0., total_distortion = 0.; + if (src == NULL || ref == NULL || + src->width != ref->width || src->height != ref->height || + results == NULL) { + return 0; + } + + VP8SSIMDspInit(); + if (!WebPPictureInit(&p0) || !WebPPictureInit(&p1)) return 0; + w = src->width; + h = src->height; + if (!WebPPictureView(src, 0, 0, w, h, &p0)) goto Error; + if (!WebPPictureView(ref, 0, 0, w, h, &p1)) goto Error; + + // We always measure distortion in ARGB space. + if (p0.use_argb == 0 && !WebPPictureYUVAToARGB(&p0)) goto Error; + if (p1.use_argb == 0 && !WebPPictureYUVAToARGB(&p1)) goto Error; + for (c = 0; c < 4; ++c) { + float distortion; + const size_t stride0 = 4 * (size_t)p0.argb_stride; + const size_t stride1 = 4 * (size_t)p1.argb_stride; + if (!WebPPlaneDistortion((const uint8_t*)p0.argb + c, stride0, + (const uint8_t*)p1.argb + c, stride1, + w, h, 4, type, &distortion, results + c)) { + goto Error; + } + total_distortion += distortion; + total_size += w * h; + } + + results[4] = (type == 1) ? (float)GetLogSSIM(total_distortion, total_size) + : (float)GetPSNR(total_distortion, total_size); + ok = 1; + + Error: + WebPPictureFree(&p0); + WebPPictureFree(&p1); + return ok; +} + +//------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/enc/picture_rescale.c b/thirdparty/libwebp/enc/picture_rescale_enc.c index 9f19e8e80f..0b7181c0d7 100644 --- a/thirdparty/libwebp/enc/picture_rescale.c +++ b/thirdparty/libwebp/enc/picture_rescale_enc.c @@ -14,8 +14,8 @@ #include <assert.h> #include <stdlib.h> -#include "./vp8enci.h" -#include "../utils/rescaler.h" +#include "./vp8i_enc.h" +#include "../utils/rescaler_utils.h" #include "../utils/utils.h" #define HALVE(x) (((x) + 1) >> 1) diff --git a/thirdparty/libwebp/enc/picture_tools.c b/thirdparty/libwebp/enc/picture_tools_enc.c index bf97af8408..895df51156 100644 --- a/thirdparty/libwebp/enc/picture_tools.c +++ b/thirdparty/libwebp/enc/picture_tools_enc.c @@ -13,7 +13,7 @@ #include <assert.h> -#include "./vp8enci.h" +#include "./vp8i_enc.h" #include "../dsp/yuv.h" static WEBP_INLINE uint32_t MakeARGB32(int r, int g, int b) { diff --git a/thirdparty/libwebp/enc/predictor_enc.c b/thirdparty/libwebp/enc/predictor_enc.c new file mode 100644 index 0000000000..0639b74f1c --- /dev/null +++ b/thirdparty/libwebp/enc/predictor_enc.c @@ -0,0 +1,750 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Image transform methods for lossless encoder. +// +// Authors: Vikas Arora (vikaas.arora@gmail.com) +// Jyrki Alakuijala (jyrki@google.com) +// Urvang Joshi (urvang@google.com) +// Vincent Rabaud (vrabaud@google.com) + +#include "../dsp/lossless.h" +#include "../dsp/lossless_common.h" +#include "./vp8li_enc.h" + +#define MAX_DIFF_COST (1e30f) + +static const float kSpatialPredictorBias = 15.f; +static const int kPredLowEffort = 11; +static const uint32_t kMaskAlpha = 0xff000000; + +// Mostly used to reduce code size + readability +static WEBP_INLINE int GetMin(int a, int b) { return (a > b) ? b : a; } +static WEBP_INLINE int GetMax(int a, int b) { return (a < b) ? b : a; } + +//------------------------------------------------------------------------------ +// Methods to calculate Entropy (Shannon). + +static float PredictionCostSpatial(const int counts[256], int weight_0, + double exp_val) { + const int significant_symbols = 256 >> 4; + const double exp_decay_factor = 0.6; + double bits = weight_0 * counts[0]; + int i; + for (i = 1; i < significant_symbols; ++i) { + bits += exp_val * (counts[i] + counts[256 - i]); + exp_val *= exp_decay_factor; + } + return (float)(-0.1 * bits); +} + +static float PredictionCostSpatialHistogram(const int accumulated[4][256], + const int tile[4][256]) { + int i; + double retval = 0; + for (i = 0; i < 4; ++i) { + const double kExpValue = 0.94; + retval += PredictionCostSpatial(tile[i], 1, kExpValue); + retval += VP8LCombinedShannonEntropy(tile[i], accumulated[i]); + } + return (float)retval; +} + +static WEBP_INLINE void UpdateHisto(int histo_argb[4][256], uint32_t argb) { + ++histo_argb[0][argb >> 24]; + ++histo_argb[1][(argb >> 16) & 0xff]; + ++histo_argb[2][(argb >> 8) & 0xff]; + ++histo_argb[3][argb & 0xff]; +} + +//------------------------------------------------------------------------------ +// Spatial transform functions. + +static WEBP_INLINE void PredictBatch(int mode, int x_start, int y, + int num_pixels, const uint32_t* current, + const uint32_t* upper, uint32_t* out) { + if (x_start == 0) { + if (y == 0) { + // ARGB_BLACK. + VP8LPredictorsSub[0](current, NULL, 1, out); + } else { + // Top one. + VP8LPredictorsSub[2](current, upper, 1, out); + } + ++x_start; + ++out; + --num_pixels; + } + if (y == 0) { + // Left one. + VP8LPredictorsSub[1](current + x_start, NULL, num_pixels, out); + } else { + VP8LPredictorsSub[mode](current + x_start, upper + x_start, num_pixels, + out); + } +} + +static int MaxDiffBetweenPixels(uint32_t p1, uint32_t p2) { + const int diff_a = abs((int)(p1 >> 24) - (int)(p2 >> 24)); + const int diff_r = abs((int)((p1 >> 16) & 0xff) - (int)((p2 >> 16) & 0xff)); + const int diff_g = abs((int)((p1 >> 8) & 0xff) - (int)((p2 >> 8) & 0xff)); + const int diff_b = abs((int)(p1 & 0xff) - (int)(p2 & 0xff)); + return GetMax(GetMax(diff_a, diff_r), GetMax(diff_g, diff_b)); +} + +static int MaxDiffAroundPixel(uint32_t current, uint32_t up, uint32_t down, + uint32_t left, uint32_t right) { + const int diff_up = MaxDiffBetweenPixels(current, up); + const int diff_down = MaxDiffBetweenPixels(current, down); + const int diff_left = MaxDiffBetweenPixels(current, left); + const int diff_right = MaxDiffBetweenPixels(current, right); + return GetMax(GetMax(diff_up, diff_down), GetMax(diff_left, diff_right)); +} + +static uint32_t AddGreenToBlueAndRed(uint32_t argb) { + const uint32_t green = (argb >> 8) & 0xff; + uint32_t red_blue = argb & 0x00ff00ffu; + red_blue += (green << 16) | green; + red_blue &= 0x00ff00ffu; + return (argb & 0xff00ff00u) | red_blue; +} + +static void MaxDiffsForRow(int width, int stride, const uint32_t* const argb, + uint8_t* const max_diffs, int used_subtract_green) { + uint32_t current, up, down, left, right; + int x; + if (width <= 2) return; + current = argb[0]; + right = argb[1]; + if (used_subtract_green) { + current = AddGreenToBlueAndRed(current); + right = AddGreenToBlueAndRed(right); + } + // max_diffs[0] and max_diffs[width - 1] are never used. + for (x = 1; x < width - 1; ++x) { + up = argb[-stride + x]; + down = argb[stride + x]; + left = current; + current = right; + right = argb[x + 1]; + if (used_subtract_green) { + up = AddGreenToBlueAndRed(up); + down = AddGreenToBlueAndRed(down); + right = AddGreenToBlueAndRed(right); + } + max_diffs[x] = MaxDiffAroundPixel(current, up, down, left, right); + } +} + +// Quantize the difference between the actual component value and its prediction +// to a multiple of quantization, working modulo 256, taking care not to cross +// a boundary (inclusive upper limit). +static uint8_t NearLosslessComponent(uint8_t value, uint8_t predict, + uint8_t boundary, int quantization) { + const int residual = (value - predict) & 0xff; + const int boundary_residual = (boundary - predict) & 0xff; + const int lower = residual & ~(quantization - 1); + const int upper = lower + quantization; + // Resolve ties towards a value closer to the prediction (i.e. towards lower + // if value comes after prediction and towards upper otherwise). + const int bias = ((boundary - value) & 0xff) < boundary_residual; + if (residual - lower < upper - residual + bias) { + // lower is closer to residual than upper. + if (residual > boundary_residual && lower <= boundary_residual) { + // Halve quantization step to avoid crossing boundary. This midpoint is + // on the same side of boundary as residual because midpoint >= residual + // (since lower is closer than upper) and residual is above the boundary. + return lower + (quantization >> 1); + } + return lower; + } else { + // upper is closer to residual than lower. + if (residual <= boundary_residual && upper > boundary_residual) { + // Halve quantization step to avoid crossing boundary. This midpoint is + // on the same side of boundary as residual because midpoint <= residual + // (since upper is closer than lower) and residual is below the boundary. + return lower + (quantization >> 1); + } + return upper & 0xff; + } +} + +// Quantize every component of the difference between the actual pixel value and +// its prediction to a multiple of a quantization (a power of 2, not larger than +// max_quantization which is a power of 2, smaller than max_diff). Take care if +// value and predict have undergone subtract green, which means that red and +// blue are represented as offsets from green. +static uint32_t NearLossless(uint32_t value, uint32_t predict, + int max_quantization, int max_diff, + int used_subtract_green) { + int quantization; + uint8_t new_green = 0; + uint8_t green_diff = 0; + uint8_t a, r, g, b; + if (max_diff <= 2) { + return VP8LSubPixels(value, predict); + } + quantization = max_quantization; + while (quantization >= max_diff) { + quantization >>= 1; + } + if ((value >> 24) == 0 || (value >> 24) == 0xff) { + // Preserve transparency of fully transparent or fully opaque pixels. + a = ((value >> 24) - (predict >> 24)) & 0xff; + } else { + a = NearLosslessComponent(value >> 24, predict >> 24, 0xff, quantization); + } + g = NearLosslessComponent((value >> 8) & 0xff, (predict >> 8) & 0xff, 0xff, + quantization); + if (used_subtract_green) { + // The green offset will be added to red and blue components during decoding + // to obtain the actual red and blue values. + new_green = ((predict >> 8) + g) & 0xff; + // The amount by which green has been adjusted during quantization. It is + // subtracted from red and blue for compensation, to avoid accumulating two + // quantization errors in them. + green_diff = (new_green - (value >> 8)) & 0xff; + } + r = NearLosslessComponent(((value >> 16) - green_diff) & 0xff, + (predict >> 16) & 0xff, 0xff - new_green, + quantization); + b = NearLosslessComponent((value - green_diff) & 0xff, predict & 0xff, + 0xff - new_green, quantization); + return ((uint32_t)a << 24) | ((uint32_t)r << 16) | ((uint32_t)g << 8) | b; +} + +// Stores the difference between the pixel and its prediction in "out". +// In case of a lossy encoding, updates the source image to avoid propagating +// the deviation further to pixels which depend on the current pixel for their +// predictions. +static WEBP_INLINE void GetResidual( + int width, int height, uint32_t* const upper_row, + uint32_t* const current_row, const uint8_t* const max_diffs, int mode, + int x_start, int x_end, int y, int max_quantization, int exact, + int used_subtract_green, uint32_t* const out) { + if (exact) { + PredictBatch(mode, x_start, y, x_end - x_start, current_row, upper_row, + out); + } else { + const VP8LPredictorFunc pred_func = VP8LPredictors[mode]; + int x; + for (x = x_start; x < x_end; ++x) { + uint32_t predict; + uint32_t residual; + if (y == 0) { + predict = (x == 0) ? ARGB_BLACK : current_row[x - 1]; // Left. + } else if (x == 0) { + predict = upper_row[x]; // Top. + } else { + predict = pred_func(current_row[x - 1], upper_row + x); + } + if (max_quantization == 1 || mode == 0 || y == 0 || y == height - 1 || + x == 0 || x == width - 1) { + residual = VP8LSubPixels(current_row[x], predict); + } else { + residual = NearLossless(current_row[x], predict, max_quantization, + max_diffs[x], used_subtract_green); + // Update the source image. + current_row[x] = VP8LAddPixels(predict, residual); + // x is never 0 here so we do not need to update upper_row like below. + } + if ((current_row[x] & kMaskAlpha) == 0) { + // If alpha is 0, cleanup RGB. We can choose the RGB values of the + // residual for best compression. The prediction of alpha itself can be + // non-zero and must be kept though. We choose RGB of the residual to be + // 0. + residual &= kMaskAlpha; + // Update the source image. + current_row[x] = predict & ~kMaskAlpha; + // The prediction for the rightmost pixel in a row uses the leftmost + // pixel + // in that row as its top-right context pixel. Hence if we change the + // leftmost pixel of current_row, the corresponding change must be + // applied + // to upper_row as well where top-right context is being read from. + if (x == 0 && y != 0) upper_row[width] = current_row[0]; + } + out[x - x_start] = residual; + } + } +} + +// Returns best predictor and updates the accumulated histogram. +// If max_quantization > 1, assumes that near lossless processing will be +// applied, quantizing residuals to multiples of quantization levels up to +// max_quantization (the actual quantization level depends on smoothness near +// the given pixel). +static int GetBestPredictorForTile(int width, int height, + int tile_x, int tile_y, int bits, + int accumulated[4][256], + uint32_t* const argb_scratch, + const uint32_t* const argb, + int max_quantization, + int exact, int used_subtract_green, + const uint32_t* const modes) { + const int kNumPredModes = 14; + const int start_x = tile_x << bits; + const int start_y = tile_y << bits; + const int tile_size = 1 << bits; + const int max_y = GetMin(tile_size, height - start_y); + const int max_x = GetMin(tile_size, width - start_x); + // Whether there exist columns just outside the tile. + const int have_left = (start_x > 0); + const int have_right = (max_x < width - start_x); + // Position and size of the strip covering the tile and adjacent columns if + // they exist. + const int context_start_x = start_x - have_left; + const int context_width = max_x + have_left + have_right; + const int tiles_per_row = VP8LSubSampleSize(width, bits); + // Prediction modes of the left and above neighbor tiles. + const int left_mode = (tile_x > 0) ? + (modes[tile_y * tiles_per_row + tile_x - 1] >> 8) & 0xff : 0xff; + const int above_mode = (tile_y > 0) ? + (modes[(tile_y - 1) * tiles_per_row + tile_x] >> 8) & 0xff : 0xff; + // The width of upper_row and current_row is one pixel larger than image width + // to allow the top right pixel to point to the leftmost pixel of the next row + // when at the right edge. + uint32_t* upper_row = argb_scratch; + uint32_t* current_row = upper_row + width + 1; + uint8_t* const max_diffs = (uint8_t*)(current_row + width + 1); + float best_diff = MAX_DIFF_COST; + int best_mode = 0; + int mode; + int histo_stack_1[4][256]; + int histo_stack_2[4][256]; + // Need pointers to be able to swap arrays. + int (*histo_argb)[256] = histo_stack_1; + int (*best_histo)[256] = histo_stack_2; + int i, j; + uint32_t residuals[1 << MAX_TRANSFORM_BITS]; + assert(bits <= MAX_TRANSFORM_BITS); + assert(max_x <= (1 << MAX_TRANSFORM_BITS)); + + for (mode = 0; mode < kNumPredModes; ++mode) { + float cur_diff; + int relative_y; + memset(histo_argb, 0, sizeof(histo_stack_1)); + if (start_y > 0) { + // Read the row above the tile which will become the first upper_row. + // Include a pixel to the left if it exists; include a pixel to the right + // in all cases (wrapping to the leftmost pixel of the next row if it does + // not exist). + memcpy(current_row + context_start_x, + argb + (start_y - 1) * width + context_start_x, + sizeof(*argb) * (max_x + have_left + 1)); + } + for (relative_y = 0; relative_y < max_y; ++relative_y) { + const int y = start_y + relative_y; + int relative_x; + uint32_t* tmp = upper_row; + upper_row = current_row; + current_row = tmp; + // Read current_row. Include a pixel to the left if it exists; include a + // pixel to the right in all cases except at the bottom right corner of + // the image (wrapping to the leftmost pixel of the next row if it does + // not exist in the current row). + memcpy(current_row + context_start_x, + argb + y * width + context_start_x, + sizeof(*argb) * (max_x + have_left + (y + 1 < height))); + if (max_quantization > 1 && y >= 1 && y + 1 < height) { + MaxDiffsForRow(context_width, width, argb + y * width + context_start_x, + max_diffs + context_start_x, used_subtract_green); + } + + GetResidual(width, height, upper_row, current_row, max_diffs, mode, + start_x, start_x + max_x, y, max_quantization, exact, + used_subtract_green, residuals); + for (relative_x = 0; relative_x < max_x; ++relative_x) { + UpdateHisto(histo_argb, residuals[relative_x]); + } + } + cur_diff = PredictionCostSpatialHistogram( + (const int (*)[256])accumulated, (const int (*)[256])histo_argb); + // Favor keeping the areas locally similar. + if (mode == left_mode) cur_diff -= kSpatialPredictorBias; + if (mode == above_mode) cur_diff -= kSpatialPredictorBias; + + if (cur_diff < best_diff) { + int (*tmp)[256] = histo_argb; + histo_argb = best_histo; + best_histo = tmp; + best_diff = cur_diff; + best_mode = mode; + } + } + + for (i = 0; i < 4; i++) { + for (j = 0; j < 256; j++) { + accumulated[i][j] += best_histo[i][j]; + } + } + + return best_mode; +} + +// Converts pixels of the image to residuals with respect to predictions. +// If max_quantization > 1, applies near lossless processing, quantizing +// residuals to multiples of quantization levels up to max_quantization +// (the actual quantization level depends on smoothness near the given pixel). +static void CopyImageWithPrediction(int width, int height, + int bits, uint32_t* const modes, + uint32_t* const argb_scratch, + uint32_t* const argb, + int low_effort, int max_quantization, + int exact, int used_subtract_green) { + const int tiles_per_row = VP8LSubSampleSize(width, bits); + // The width of upper_row and current_row is one pixel larger than image width + // to allow the top right pixel to point to the leftmost pixel of the next row + // when at the right edge. + uint32_t* upper_row = argb_scratch; + uint32_t* current_row = upper_row + width + 1; + uint8_t* current_max_diffs = (uint8_t*)(current_row + width + 1); + uint8_t* lower_max_diffs = current_max_diffs + width; + int y; + + for (y = 0; y < height; ++y) { + int x; + uint32_t* const tmp32 = upper_row; + upper_row = current_row; + current_row = tmp32; + memcpy(current_row, argb + y * width, + sizeof(*argb) * (width + (y + 1 < height))); + + if (low_effort) { + PredictBatch(kPredLowEffort, 0, y, width, current_row, upper_row, + argb + y * width); + } else { + if (max_quantization > 1) { + // Compute max_diffs for the lower row now, because that needs the + // contents of argb for the current row, which we will overwrite with + // residuals before proceeding with the next row. + uint8_t* const tmp8 = current_max_diffs; + current_max_diffs = lower_max_diffs; + lower_max_diffs = tmp8; + if (y + 2 < height) { + MaxDiffsForRow(width, width, argb + (y + 1) * width, lower_max_diffs, + used_subtract_green); + } + } + for (x = 0; x < width;) { + const int mode = + (modes[(y >> bits) * tiles_per_row + (x >> bits)] >> 8) & 0xff; + int x_end = x + (1 << bits); + if (x_end > width) x_end = width; + GetResidual(width, height, upper_row, current_row, current_max_diffs, + mode, x, x_end, y, max_quantization, exact, + used_subtract_green, argb + y * width + x); + x = x_end; + } + } + } +} + +// Finds the best predictor for each tile, and converts the image to residuals +// with respect to predictions. If near_lossless_quality < 100, applies +// near lossless processing, shaving off more bits of residuals for lower +// qualities. +void VP8LResidualImage(int width, int height, int bits, int low_effort, + uint32_t* const argb, uint32_t* const argb_scratch, + uint32_t* const image, int near_lossless_quality, + int exact, int used_subtract_green) { + const int tiles_per_row = VP8LSubSampleSize(width, bits); + const int tiles_per_col = VP8LSubSampleSize(height, bits); + int tile_y; + int histo[4][256]; + const int max_quantization = 1 << VP8LNearLosslessBits(near_lossless_quality); + if (low_effort) { + int i; + for (i = 0; i < tiles_per_row * tiles_per_col; ++i) { + image[i] = ARGB_BLACK | (kPredLowEffort << 8); + } + } else { + memset(histo, 0, sizeof(histo)); + for (tile_y = 0; tile_y < tiles_per_col; ++tile_y) { + int tile_x; + for (tile_x = 0; tile_x < tiles_per_row; ++tile_x) { + const int pred = GetBestPredictorForTile(width, height, tile_x, tile_y, + bits, histo, argb_scratch, argb, max_quantization, exact, + used_subtract_green, image); + image[tile_y * tiles_per_row + tile_x] = ARGB_BLACK | (pred << 8); + } + } + } + + CopyImageWithPrediction(width, height, bits, image, argb_scratch, argb, + low_effort, max_quantization, exact, + used_subtract_green); +} + +//------------------------------------------------------------------------------ +// Color transform functions. + +static WEBP_INLINE void MultipliersClear(VP8LMultipliers* const m) { + m->green_to_red_ = 0; + m->green_to_blue_ = 0; + m->red_to_blue_ = 0; +} + +static WEBP_INLINE void ColorCodeToMultipliers(uint32_t color_code, + VP8LMultipliers* const m) { + m->green_to_red_ = (color_code >> 0) & 0xff; + m->green_to_blue_ = (color_code >> 8) & 0xff; + m->red_to_blue_ = (color_code >> 16) & 0xff; +} + +static WEBP_INLINE uint32_t MultipliersToColorCode( + const VP8LMultipliers* const m) { + return 0xff000000u | + ((uint32_t)(m->red_to_blue_) << 16) | + ((uint32_t)(m->green_to_blue_) << 8) | + m->green_to_red_; +} + +static float PredictionCostCrossColor(const int accumulated[256], + const int counts[256]) { + // Favor low entropy, locally and globally. + // Favor small absolute values for PredictionCostSpatial + static const double kExpValue = 2.4; + return VP8LCombinedShannonEntropy(counts, accumulated) + + PredictionCostSpatial(counts, 3, kExpValue); +} + +static float GetPredictionCostCrossColorRed( + const uint32_t* argb, int stride, int tile_width, int tile_height, + VP8LMultipliers prev_x, VP8LMultipliers prev_y, int green_to_red, + const int accumulated_red_histo[256]) { + int histo[256] = { 0 }; + float cur_diff; + + VP8LCollectColorRedTransforms(argb, stride, tile_width, tile_height, + green_to_red, histo); + + cur_diff = PredictionCostCrossColor(accumulated_red_histo, histo); + if ((uint8_t)green_to_red == prev_x.green_to_red_) { + cur_diff -= 3; // favor keeping the areas locally similar + } + if ((uint8_t)green_to_red == prev_y.green_to_red_) { + cur_diff -= 3; // favor keeping the areas locally similar + } + if (green_to_red == 0) { + cur_diff -= 3; + } + return cur_diff; +} + +static void GetBestGreenToRed( + const uint32_t* argb, int stride, int tile_width, int tile_height, + VP8LMultipliers prev_x, VP8LMultipliers prev_y, int quality, + const int accumulated_red_histo[256], VP8LMultipliers* const best_tx) { + const int kMaxIters = 4 + ((7 * quality) >> 8); // in range [4..6] + int green_to_red_best = 0; + int iter, offset; + float best_diff = GetPredictionCostCrossColorRed( + argb, stride, tile_width, tile_height, prev_x, prev_y, + green_to_red_best, accumulated_red_histo); + for (iter = 0; iter < kMaxIters; ++iter) { + // ColorTransformDelta is a 3.5 bit fixed point, so 32 is equal to + // one in color computation. Having initial delta here as 1 is sufficient + // to explore the range of (-2, 2). + const int delta = 32 >> iter; + // Try a negative and a positive delta from the best known value. + for (offset = -delta; offset <= delta; offset += 2 * delta) { + const int green_to_red_cur = offset + green_to_red_best; + const float cur_diff = GetPredictionCostCrossColorRed( + argb, stride, tile_width, tile_height, prev_x, prev_y, + green_to_red_cur, accumulated_red_histo); + if (cur_diff < best_diff) { + best_diff = cur_diff; + green_to_red_best = green_to_red_cur; + } + } + } + best_tx->green_to_red_ = green_to_red_best; +} + +static float GetPredictionCostCrossColorBlue( + const uint32_t* argb, int stride, int tile_width, int tile_height, + VP8LMultipliers prev_x, VP8LMultipliers prev_y, + int green_to_blue, int red_to_blue, const int accumulated_blue_histo[256]) { + int histo[256] = { 0 }; + float cur_diff; + + VP8LCollectColorBlueTransforms(argb, stride, tile_width, tile_height, + green_to_blue, red_to_blue, histo); + + cur_diff = PredictionCostCrossColor(accumulated_blue_histo, histo); + if ((uint8_t)green_to_blue == prev_x.green_to_blue_) { + cur_diff -= 3; // favor keeping the areas locally similar + } + if ((uint8_t)green_to_blue == prev_y.green_to_blue_) { + cur_diff -= 3; // favor keeping the areas locally similar + } + if ((uint8_t)red_to_blue == prev_x.red_to_blue_) { + cur_diff -= 3; // favor keeping the areas locally similar + } + if ((uint8_t)red_to_blue == prev_y.red_to_blue_) { + cur_diff -= 3; // favor keeping the areas locally similar + } + if (green_to_blue == 0) { + cur_diff -= 3; + } + if (red_to_blue == 0) { + cur_diff -= 3; + } + return cur_diff; +} + +#define kGreenRedToBlueNumAxis 8 +#define kGreenRedToBlueMaxIters 7 +static void GetBestGreenRedToBlue( + const uint32_t* argb, int stride, int tile_width, int tile_height, + VP8LMultipliers prev_x, VP8LMultipliers prev_y, int quality, + const int accumulated_blue_histo[256], + VP8LMultipliers* const best_tx) { + const int8_t offset[kGreenRedToBlueNumAxis][2] = + {{0, -1}, {0, 1}, {-1, 0}, {1, 0}, {-1, -1}, {-1, 1}, {1, -1}, {1, 1}}; + const int8_t delta_lut[kGreenRedToBlueMaxIters] = { 16, 16, 8, 4, 2, 2, 2 }; + const int iters = + (quality < 25) ? 1 : (quality > 50) ? kGreenRedToBlueMaxIters : 4; + int green_to_blue_best = 0; + int red_to_blue_best = 0; + int iter; + // Initial value at origin: + float best_diff = GetPredictionCostCrossColorBlue( + argb, stride, tile_width, tile_height, prev_x, prev_y, + green_to_blue_best, red_to_blue_best, accumulated_blue_histo); + for (iter = 0; iter < iters; ++iter) { + const int delta = delta_lut[iter]; + int axis; + for (axis = 0; axis < kGreenRedToBlueNumAxis; ++axis) { + const int green_to_blue_cur = + offset[axis][0] * delta + green_to_blue_best; + const int red_to_blue_cur = offset[axis][1] * delta + red_to_blue_best; + const float cur_diff = GetPredictionCostCrossColorBlue( + argb, stride, tile_width, tile_height, prev_x, prev_y, + green_to_blue_cur, red_to_blue_cur, accumulated_blue_histo); + if (cur_diff < best_diff) { + best_diff = cur_diff; + green_to_blue_best = green_to_blue_cur; + red_to_blue_best = red_to_blue_cur; + } + if (quality < 25 && iter == 4) { + // Only axis aligned diffs for lower quality. + break; // next iter. + } + } + if (delta == 2 && green_to_blue_best == 0 && red_to_blue_best == 0) { + // Further iterations would not help. + break; // out of iter-loop. + } + } + best_tx->green_to_blue_ = green_to_blue_best; + best_tx->red_to_blue_ = red_to_blue_best; +} +#undef kGreenRedToBlueMaxIters +#undef kGreenRedToBlueNumAxis + +static VP8LMultipliers GetBestColorTransformForTile( + int tile_x, int tile_y, int bits, + VP8LMultipliers prev_x, + VP8LMultipliers prev_y, + int quality, int xsize, int ysize, + const int accumulated_red_histo[256], + const int accumulated_blue_histo[256], + const uint32_t* const argb) { + const int max_tile_size = 1 << bits; + const int tile_y_offset = tile_y * max_tile_size; + const int tile_x_offset = tile_x * max_tile_size; + const int all_x_max = GetMin(tile_x_offset + max_tile_size, xsize); + const int all_y_max = GetMin(tile_y_offset + max_tile_size, ysize); + const int tile_width = all_x_max - tile_x_offset; + const int tile_height = all_y_max - tile_y_offset; + const uint32_t* const tile_argb = argb + tile_y_offset * xsize + + tile_x_offset; + VP8LMultipliers best_tx; + MultipliersClear(&best_tx); + + GetBestGreenToRed(tile_argb, xsize, tile_width, tile_height, + prev_x, prev_y, quality, accumulated_red_histo, &best_tx); + GetBestGreenRedToBlue(tile_argb, xsize, tile_width, tile_height, + prev_x, prev_y, quality, accumulated_blue_histo, + &best_tx); + return best_tx; +} + +static void CopyTileWithColorTransform(int xsize, int ysize, + int tile_x, int tile_y, + int max_tile_size, + VP8LMultipliers color_transform, + uint32_t* argb) { + const int xscan = GetMin(max_tile_size, xsize - tile_x); + int yscan = GetMin(max_tile_size, ysize - tile_y); + argb += tile_y * xsize + tile_x; + while (yscan-- > 0) { + VP8LTransformColor(&color_transform, argb, xscan); + argb += xsize; + } +} + +void VP8LColorSpaceTransform(int width, int height, int bits, int quality, + uint32_t* const argb, uint32_t* image) { + const int max_tile_size = 1 << bits; + const int tile_xsize = VP8LSubSampleSize(width, bits); + const int tile_ysize = VP8LSubSampleSize(height, bits); + int accumulated_red_histo[256] = { 0 }; + int accumulated_blue_histo[256] = { 0 }; + int tile_x, tile_y; + VP8LMultipliers prev_x, prev_y; + MultipliersClear(&prev_y); + MultipliersClear(&prev_x); + for (tile_y = 0; tile_y < tile_ysize; ++tile_y) { + for (tile_x = 0; tile_x < tile_xsize; ++tile_x) { + int y; + const int tile_x_offset = tile_x * max_tile_size; + const int tile_y_offset = tile_y * max_tile_size; + const int all_x_max = GetMin(tile_x_offset + max_tile_size, width); + const int all_y_max = GetMin(tile_y_offset + max_tile_size, height); + const int offset = tile_y * tile_xsize + tile_x; + if (tile_y != 0) { + ColorCodeToMultipliers(image[offset - tile_xsize], &prev_y); + } + prev_x = GetBestColorTransformForTile(tile_x, tile_y, bits, + prev_x, prev_y, + quality, width, height, + accumulated_red_histo, + accumulated_blue_histo, + argb); + image[offset] = MultipliersToColorCode(&prev_x); + CopyTileWithColorTransform(width, height, tile_x_offset, tile_y_offset, + max_tile_size, prev_x, argb); + + // Gather accumulated histogram data. + for (y = tile_y_offset; y < all_y_max; ++y) { + int ix = y * width + tile_x_offset; + const int ix_end = ix + all_x_max - tile_x_offset; + for (; ix < ix_end; ++ix) { + const uint32_t pix = argb[ix]; + if (ix >= 2 && + pix == argb[ix - 2] && + pix == argb[ix - 1]) { + continue; // repeated pixels are handled by backward references + } + if (ix >= width + 2 && + argb[ix - 2] == argb[ix - width - 2] && + argb[ix - 1] == argb[ix - width - 1] && + pix == argb[ix - width]) { + continue; // repeated pixels are handled by backward references + } + ++accumulated_red_histo[(pix >> 16) & 0xff]; + ++accumulated_blue_histo[(pix >> 0) & 0xff]; + } + } + } + } +} diff --git a/thirdparty/libwebp/enc/quant.c b/thirdparty/libwebp/enc/quant_enc.c index 07ffaf0aeb..b118fb2a13 100644 --- a/thirdparty/libwebp/enc/quant.c +++ b/thirdparty/libwebp/enc/quant_enc.c @@ -15,8 +15,8 @@ #include <math.h> #include <stdlib.h> // for abs() -#include "./vp8enci.h" -#include "./cost.h" +#include "./vp8i_enc.h" +#include "./cost_enc.h" #define DO_TRELLIS_I4 1 #define DO_TRELLIS_I16 1 // not a huge gain, but ok at low bitrate. @@ -643,6 +643,8 @@ static int TrellisQuantizeBlock(const VP8Encoder* const enc, const int sign = (in[j] < 0); const uint32_t coeff0 = (sign ? -in[j] : in[j]) + mtx->sharpen_[j]; int level0 = QUANTDIV(coeff0, iQ, B); + int thresh_level = QUANTDIV(coeff0, iQ, BIAS(0x80)); + if (thresh_level > MAX_LEVEL) thresh_level = MAX_LEVEL; if (level0 > MAX_LEVEL) level0 = MAX_LEVEL; { // Swap current and previous score states @@ -657,23 +659,17 @@ static int TrellisQuantizeBlock(const VP8Encoder* const enc, int level = level0 + m; const int ctx = (level > 2) ? 2 : level; const int band = VP8EncBands[n + 1]; - score_t base_score, last_pos_score; + score_t base_score; score_t best_cur_score = MAX_COST; int best_prev = 0; // default, in case ss_cur[m].score = MAX_COST; ss_cur[m].costs = costs[n + 1][ctx]; - if (level > MAX_LEVEL || level < 0) { // node is dead? + if (level < 0 || level > thresh_level) { + // Node is dead. continue; } - // Compute extra rate cost if last coeff's position is < 15 - { - const score_t last_pos_cost = - (n < 15) ? VP8BitCost(0, probas[band][ctx][0]) : 0; - last_pos_score = RDScoreTrellis(lambda, last_pos_cost, 0); - } - { // Compute delta_error = how much coding this level will // subtract to max_error as distortion. @@ -705,6 +701,9 @@ static int TrellisQuantizeBlock(const VP8Encoder* const enc, // Now, record best terminal node (and thus best entry in the graph). if (level != 0) { + const score_t last_pos_cost = + (n < 15) ? VP8BitCost(0, probas[band][ctx][0]) : 0; + const score_t last_pos_score = RDScoreTrellis(lambda, last_pos_cost, 0); const score_t score = best_cur_score + last_pos_score; if (score < best_score) { best_score = score; diff --git a/thirdparty/libwebp/enc/syntax.c b/thirdparty/libwebp/enc/syntax_enc.c index a0e79ef404..90665bd7e5 100644 --- a/thirdparty/libwebp/enc/syntax.c +++ b/thirdparty/libwebp/enc/syntax_enc.c @@ -16,7 +16,7 @@ #include "../utils/utils.h" #include "../webp/format_constants.h" // RIFF constants #include "../webp/mux_types.h" // ALPHA_FLAG -#include "./vp8enci.h" +#include "./vp8i_enc.h" //------------------------------------------------------------------------------ // Helper functions @@ -362,8 +362,7 @@ int VP8EncWrite(VP8Encoder* const enc) { for (p = 0; p < enc->num_parts_; ++p) { const uint8_t* const buf = VP8BitWriterBuf(enc->parts_ + p); const size_t size = VP8BitWriterSize(enc->parts_ + p); - if (size) - ok = ok && pic->writer(buf, size, pic); + if (size) ok = ok && pic->writer(buf, size, pic); VP8BitWriterWipeOut(enc->parts_ + p); // will free the internal buffer. ok = ok && WebPReportProgress(pic, enc->percent_ + percent_per_part, &enc->percent_); diff --git a/thirdparty/libwebp/enc/token.c b/thirdparty/libwebp/enc/token_enc.c index 087940e5ff..02a0d72cc6 100644 --- a/thirdparty/libwebp/enc/token.c +++ b/thirdparty/libwebp/enc/token_enc.c @@ -20,8 +20,8 @@ #include <stdlib.h> #include <string.h> -#include "./cost.h" -#include "./vp8enci.h" +#include "./cost_enc.h" +#include "./vp8i_enc.h" #include "../utils/utils.h" #if !defined(DISABLE_TOKEN_BUFFER) @@ -137,8 +137,9 @@ int VP8RecordCoeffTokens(int ctx, const struct VP8Residual* const res, s = res->stats[VP8EncBands[n]][1]; } else { if (!AddToken(tokens, v > 4, base_id + 3, s + 3)) { - if (AddToken(tokens, v != 2, base_id + 4, s + 4)) + if (AddToken(tokens, v != 2, base_id + 4, s + 4)) { AddToken(tokens, v == 4, base_id + 5, s + 5); + } } else if (!AddToken(tokens, v > 10, base_id + 6, s + 6)) { if (!AddToken(tokens, v > 6, base_id + 7, s + 7)) { AddConstantToken(tokens, v == 6, 159); diff --git a/thirdparty/libwebp/enc/tree.c b/thirdparty/libwebp/enc/tree_enc.c index f141006d19..2c40fe7f3d 100644 --- a/thirdparty/libwebp/enc/tree.c +++ b/thirdparty/libwebp/enc/tree_enc.c @@ -11,7 +11,7 @@ // // Author: Skal (pascal.massimino@gmail.com) -#include "./vp8enci.h" +#include "./vp8i_enc.h" //------------------------------------------------------------------------------ // Default probabilities diff --git a/thirdparty/libwebp/enc/vp8enci.h b/thirdparty/libwebp/enc/vp8i_enc.h index 5b4e162a58..93c95ecbfb 100644 --- a/thirdparty/libwebp/enc/vp8enci.h +++ b/thirdparty/libwebp/enc/vp8i_enc.h @@ -15,10 +15,10 @@ #define WEBP_ENC_VP8ENCI_H_ #include <string.h> // for memcpy() -#include "../dec/common.h" +#include "../dec/common_dec.h" #include "../dsp/dsp.h" -#include "../utils/bit_writer.h" -#include "../utils/thread.h" +#include "../utils/bit_writer_utils.h" +#include "../utils/thread_utils.h" #include "../utils/utils.h" #include "../webp/encode.h" @@ -31,8 +31,8 @@ extern "C" { // version numbers #define ENC_MAJ_VERSION 0 -#define ENC_MIN_VERSION 5 -#define ENC_REV_VERSION 2 +#define ENC_MIN_VERSION 6 +#define ENC_REV_VERSION 0 enum { MAX_LF_LEVELS = 64, // Maximum loop filter level MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost @@ -219,7 +219,6 @@ typedef struct { // right neighbouring data (samples, predictions, contexts, ...) typedef struct { int x_, y_; // current macroblock - int y_stride_, uv_stride_; // respective strides uint8_t* yuv_in_; // input samples uint8_t* yuv_out_; // output samples uint8_t* yuv_out2_; // secondary buffer swapped with yuv_out_. @@ -474,14 +473,6 @@ int VP8EncStartAlpha(VP8Encoder* const enc); // start alpha coding process int VP8EncFinishAlpha(VP8Encoder* const enc); // finalize compressed data int VP8EncDeleteAlpha(VP8Encoder* const enc); // delete compressed data - // in filter.c -void VP8SSIMAddStats(const VP8DistoStats* const src, VP8DistoStats* const dst); -void VP8SSIMAccumulatePlane(const uint8_t* src1, int stride1, - const uint8_t* src2, int stride2, - int W, int H, VP8DistoStats* const stats); -double VP8SSIMGet(const VP8DistoStats* const stats); -double VP8SSIMGetSquaredError(const VP8DistoStats* const stats); - // autofilter void VP8InitFilter(VP8EncIterator* const it); void VP8StoreFilterStats(VP8EncIterator* const it); diff --git a/thirdparty/libwebp/enc/vp8l.c b/thirdparty/libwebp/enc/vp8l_enc.c index e4ad2959b8..b1a793d956 100644 --- a/thirdparty/libwebp/enc/vp8l.c +++ b/thirdparty/libwebp/enc/vp8l_enc.c @@ -15,17 +15,18 @@ #include <assert.h> #include <stdlib.h> -#include "./backward_references.h" -#include "./histogram.h" -#include "./vp8enci.h" -#include "./vp8li.h" +#include "./backward_references_enc.h" +#include "./histogram_enc.h" +#include "./vp8i_enc.h" +#include "./vp8li_enc.h" #include "../dsp/lossless.h" -#include "../utils/bit_writer.h" -#include "../utils/huffman_encode.h" +#include "../dsp/lossless_common.h" +#include "../utils/bit_writer_utils.h" +#include "../utils/huffman_encode_utils.h" #include "../utils/utils.h" #include "../webp/format_constants.h" -#include "./delta_palettization.h" +#include "./delta_palettization_enc.h" #define PALETTE_KEY_RIGHT_SHIFT 22 // Key for 1K buffer. // Maximum number of histogram images (sub-blocks). @@ -163,18 +164,25 @@ typedef enum { kHistoTotal // Must be last. } HistoIx; -static void AddSingleSubGreen(uint32_t p, uint32_t* r, uint32_t* b) { - const uint32_t green = p >> 8; // The upper bits are masked away later. +static void AddSingleSubGreen(int p, uint32_t* const r, uint32_t* const b) { + const int green = p >> 8; // The upper bits are masked away later. ++r[((p >> 16) - green) & 0xff]; - ++b[(p - green) & 0xff]; + ++b[((p >> 0) - green) & 0xff]; } static void AddSingle(uint32_t p, - uint32_t* a, uint32_t* r, uint32_t* g, uint32_t* b) { - ++a[p >> 24]; + uint32_t* const a, uint32_t* const r, + uint32_t* const g, uint32_t* const b) { + ++a[(p >> 24) & 0xff]; ++r[(p >> 16) & 0xff]; - ++g[(p >> 8) & 0xff]; - ++b[(p & 0xff)]; + ++g[(p >> 8) & 0xff]; + ++b[(p >> 0) & 0xff]; +} + +static WEBP_INLINE uint32_t HashPix(uint32_t pix) { + // Note that masking with 0xffffffffu is for preventing an + // 'unsigned int overflow' warning. Doesn't impact the compiled code. + return ((((uint64_t)pix + (pix >> 19)) * 0x39c5fba7ull) & 0xffffffffu) >> 24; } static int AnalyzeEntropy(const uint32_t* argb, @@ -214,8 +222,8 @@ static int AnalyzeEntropy(const uint32_t* argb, &histo[kHistoBluePredSubGreen * 256]); { // Approximate the palette by the entropy of the multiplicative hash. - const int hash = ((pix + (pix >> 19)) * 0x39c5fba7) >> 24; - ++histo[kHistoPalette * 256 + (hash & 0xff)]; + const uint32_t hash = HashPix(pix); + ++histo[kHistoPalette * 256 + hash]; } } prev_row = curr_row; @@ -311,7 +319,10 @@ static int GetHistoBits(int method, int use_palette, int width, int height) { static int GetTransformBits(int method, int histo_bits) { const int max_transform_bits = (method < 4) ? 6 : (method > 4) ? 4 : 5; - return (histo_bits > max_transform_bits) ? max_transform_bits : histo_bits; + const int res = + (histo_bits > max_transform_bits) ? max_transform_bits : histo_bits; + assert(res <= MAX_TRANSFORM_BITS); + return res; } static int AnalyzeAndInit(VP8LEncoder* const enc) { @@ -696,7 +707,7 @@ static WebPEncodingError EncodeImageNoHuffman(VP8LBitWriter* const bw, VP8LHashChain* const hash_chain, VP8LBackwardRefs refs_array[2], int width, int height, - int quality) { + int quality, int low_effort) { int i; int max_tokens = 0; WebPEncodingError err = VP8_ENC_OK; @@ -714,7 +725,8 @@ static WebPEncodingError EncodeImageNoHuffman(VP8LBitWriter* const bw, } // Calculate backward references from ARGB image. - if (VP8LHashChainFill(hash_chain, quality, argb, width, height) == 0) { + if (!VP8LHashChainFill(hash_chain, quality, argb, width, height, + low_effort)) { err = VP8_ENC_ERROR_OUT_OF_MEMORY; goto Error; } @@ -814,11 +826,18 @@ static WebPEncodingError EncodeImageInternal(VP8LBitWriter* const bw, goto Error; } - *cache_bits = use_cache ? MAX_COLOR_CACHE_BITS : 0; + if (use_cache) { + // If the value is different from zero, it has been set during the + // palette analysis. + if (*cache_bits == 0) *cache_bits = MAX_COLOR_CACHE_BITS; + } else { + *cache_bits = 0; + } // 'best_refs' is the reference to the best backward refs and points to one // of refs_array[0] or refs_array[1]. // Calculate backward references from ARGB image. - if (VP8LHashChainFill(hash_chain, quality, argb, width, height) == 0) { + if (!VP8LHashChainFill(hash_chain, quality, argb, width, height, + low_effort)) { err = VP8_ENC_ERROR_OUT_OF_MEMORY; goto Error; } @@ -899,7 +918,7 @@ static WebPEncodingError EncodeImageInternal(VP8LBitWriter* const bw, err = EncodeImageNoHuffman(bw, histogram_argb, hash_chain, refs_array, VP8LSubSampleSize(width, histogram_bits), VP8LSubSampleSize(height, histogram_bits), - quality); + quality, low_effort); WebPSafeFree(histogram_argb); if (err != VP8_ENC_OK) goto Error; } @@ -990,12 +1009,12 @@ static WebPEncodingError ApplyPredictFilter(const VP8LEncoder* const enc, (VP8LHashChain*)&enc->hash_chain_, (VP8LBackwardRefs*)enc->refs_, // cast const away transform_width, transform_height, - quality); + quality, low_effort); } static WebPEncodingError ApplyCrossColorFilter(const VP8LEncoder* const enc, int width, int height, - int quality, + int quality, int low_effort, VP8LBitWriter* const bw) { const int ccolor_transform_bits = enc->transform_bits_; const int transform_width = VP8LSubSampleSize(width, ccolor_transform_bits); @@ -1011,7 +1030,7 @@ static WebPEncodingError ApplyCrossColorFilter(const VP8LEncoder* const enc, (VP8LHashChain*)&enc->hash_chain_, (VP8LBackwardRefs*)enc->refs_, // cast const away transform_width, transform_height, - quality); + quality, low_effort); } // ----------------------------------------------------------------------------- @@ -1156,7 +1175,8 @@ static WebPEncodingError MakeInputImageCopy(VP8LEncoder* const enc) { // ----------------------------------------------------------------------------- -static int SearchColor(const uint32_t sorted[], uint32_t color, int hi) { +static WEBP_INLINE int SearchColorNoIdx(const uint32_t sorted[], uint32_t color, + int hi) { int low = 0; if (sorted[low] == color) return low; // loop invariant: sorted[low] != color while (1) { @@ -1171,35 +1191,68 @@ static int SearchColor(const uint32_t sorted[], uint32_t color, int hi) { } } +#define APPLY_PALETTE_GREEDY_MAX 4 + +static WEBP_INLINE uint32_t SearchColorGreedy(const uint32_t palette[], + int palette_size, + uint32_t color) { + (void)palette_size; + assert(palette_size < APPLY_PALETTE_GREEDY_MAX); + assert(3 == APPLY_PALETTE_GREEDY_MAX - 1); + if (color == palette[0]) return 0; + if (color == palette[1]) return 1; + if (color == palette[2]) return 2; + return 3; +} + +static WEBP_INLINE uint32_t ApplyPaletteHash0(uint32_t color) { + // Focus on the green color. + return (color >> 8) & 0xff; +} + +#define PALETTE_INV_SIZE_BITS 11 +#define PALETTE_INV_SIZE (1 << PALETTE_INV_SIZE_BITS) + +static WEBP_INLINE uint32_t ApplyPaletteHash1(uint32_t color) { + // Forget about alpha. + return ((color & 0x00ffffffu) * 4222244071u) >> (32 - PALETTE_INV_SIZE_BITS); +} + +static WEBP_INLINE uint32_t ApplyPaletteHash2(uint32_t color) { + // Forget about alpha. + return (color & 0x00ffffffu) * ((1u << 31) - 1) >> + (32 - PALETTE_INV_SIZE_BITS); +} + // Sort palette in increasing order and prepare an inverse mapping array. static void PrepareMapToPalette(const uint32_t palette[], int num_colors, - uint32_t sorted[], int idx_map[]) { + uint32_t sorted[], uint32_t idx_map[]) { int i; memcpy(sorted, palette, num_colors * sizeof(*sorted)); qsort(sorted, num_colors, sizeof(*sorted), PaletteCompareColorsForQsort); for (i = 0; i < num_colors; ++i) { - idx_map[SearchColor(sorted, palette[i], num_colors)] = i; + idx_map[SearchColorNoIdx(sorted, palette[i], num_colors)] = i; } } -static void MapToPalette(const uint32_t sorted_palette[], int num_colors, - uint32_t* const last_pix, int* const last_idx, - const int idx_map[], - const uint32_t* src, uint8_t* dst, int width) { - int x; - int prev_idx = *last_idx; - uint32_t prev_pix = *last_pix; - for (x = 0; x < width; ++x) { - const uint32_t pix = src[x]; - if (pix != prev_pix) { - prev_idx = idx_map[SearchColor(sorted_palette, pix, num_colors)]; - prev_pix = pix; - } - dst[x] = prev_idx; - } - *last_idx = prev_idx; - *last_pix = prev_pix; -} +// Use 1 pixel cache for ARGB pixels. +#define APPLY_PALETTE_FOR(COLOR_INDEX) do { \ + uint32_t prev_pix = palette[0]; \ + uint32_t prev_idx = 0; \ + for (y = 0; y < height; ++y) { \ + for (x = 0; x < width; ++x) { \ + const uint32_t pix = src[x]; \ + if (pix != prev_pix) { \ + prev_idx = COLOR_INDEX; \ + prev_pix = pix; \ + } \ + tmp_row[x] = prev_idx; \ + } \ + VP8LBundleColorMap(tmp_row, width, xbits, dst); \ + src += src_stride; \ + dst += dst_stride; \ + } \ +} while (0) // Remap argb values in src[] to packed palettes entries in dst[] // using 'row' as a temporary buffer of size 'width'. @@ -1212,52 +1265,59 @@ static WebPEncodingError ApplyPalette(const uint32_t* src, uint32_t src_stride, // TODO(skal): this tmp buffer is not needed if VP8LBundleColorMap() can be // made to work in-place. uint8_t* const tmp_row = (uint8_t*)WebPSafeMalloc(width, sizeof(*tmp_row)); - int i, x, y; - int use_LUT = 1; + int x, y; if (tmp_row == NULL) return VP8_ENC_ERROR_OUT_OF_MEMORY; - for (i = 0; i < palette_size; ++i) { - if ((palette[i] & 0xffff00ffu) != 0) { - use_LUT = 0; - break; - } - } - if (use_LUT) { - uint8_t inv_palette[MAX_PALETTE_SIZE] = { 0 }; - for (i = 0; i < palette_size; ++i) { - const int color = (palette[i] >> 8) & 0xff; - inv_palette[color] = i; - } - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - const int color = (src[x] >> 8) & 0xff; - tmp_row[x] = inv_palette[color]; + if (palette_size < APPLY_PALETTE_GREEDY_MAX) { + APPLY_PALETTE_FOR(SearchColorGreedy(palette, palette_size, pix)); + } else { + int i, j; + uint16_t buffer[PALETTE_INV_SIZE]; + uint32_t (*const hash_functions[])(uint32_t) = { + ApplyPaletteHash0, ApplyPaletteHash1, ApplyPaletteHash2 + }; + + // Try to find a perfect hash function able to go from a color to an index + // within 1 << PALETTE_INV_SIZE_BITS in order to build a hash map to go + // from color to index in palette. + for (i = 0; i < 3; ++i) { + int use_LUT = 1; + // Set each element in buffer to max uint16_t. + memset(buffer, 0xff, sizeof(buffer)); + for (j = 0; j < palette_size; ++j) { + const uint32_t ind = hash_functions[i](palette[j]); + if (buffer[ind] != 0xffffu) { + use_LUT = 0; + break; + } else { + buffer[ind] = j; + } } - VP8LBundleColorMap(tmp_row, width, xbits, dst); - src += src_stride; - dst += dst_stride; + if (use_LUT) break; } - } else { - // Use 1 pixel cache for ARGB pixels. - uint32_t last_pix; - int last_idx; - uint32_t sorted[MAX_PALETTE_SIZE]; - int idx_map[MAX_PALETTE_SIZE]; - PrepareMapToPalette(palette, palette_size, sorted, idx_map); - last_pix = palette[0]; - last_idx = 0; - for (y = 0; y < height; ++y) { - MapToPalette(sorted, palette_size, &last_pix, &last_idx, - idx_map, src, tmp_row, width); - VP8LBundleColorMap(tmp_row, width, xbits, dst); - src += src_stride; - dst += dst_stride; + + if (i == 0) { + APPLY_PALETTE_FOR(buffer[ApplyPaletteHash0(pix)]); + } else if (i == 1) { + APPLY_PALETTE_FOR(buffer[ApplyPaletteHash1(pix)]); + } else if (i == 2) { + APPLY_PALETTE_FOR(buffer[ApplyPaletteHash2(pix)]); + } else { + uint32_t idx_map[MAX_PALETTE_SIZE]; + uint32_t palette_sorted[MAX_PALETTE_SIZE]; + PrepareMapToPalette(palette, palette_size, palette_sorted, idx_map); + APPLY_PALETTE_FOR( + idx_map[SearchColorNoIdx(palette_sorted, pix, palette_size)]); } } WebPSafeFree(tmp_row); return VP8_ENC_OK; } +#undef APPLY_PALETTE_FOR +#undef PALETTE_INV_SIZE_BITS +#undef PALETTE_INV_SIZE +#undef APPLY_PALETTE_GREEDY_MAX // Note: Expects "enc->palette_" to be set properly. static WebPEncodingError MapImageFromPalette(VP8LEncoder* const enc, @@ -1290,7 +1350,7 @@ static WebPEncodingError MapImageFromPalette(VP8LEncoder* const enc, } // Save palette_[] to bitstream. -static WebPEncodingError EncodePalette(VP8LBitWriter* const bw, +static WebPEncodingError EncodePalette(VP8LBitWriter* const bw, int low_effort, VP8LEncoder* const enc) { int i; uint32_t tmp_palette[MAX_PALETTE_SIZE]; @@ -1305,13 +1365,14 @@ static WebPEncodingError EncodePalette(VP8LBitWriter* const bw, } tmp_palette[0] = palette[0]; return EncodeImageNoHuffman(bw, tmp_palette, &enc->hash_chain_, enc->refs_, - palette_size, 1, 20 /* quality */); + palette_size, 1, 20 /* quality */, low_effort); } #ifdef WEBP_EXPERIMENTAL_FEATURES static WebPEncodingError EncodeDeltaPalettePredictorImage( - VP8LBitWriter* const bw, VP8LEncoder* const enc, int quality) { + VP8LBitWriter* const bw, VP8LEncoder* const enc, int quality, + int low_effort) { const WebPPicture* const pic = enc->pic_; const int width = pic->width; const int height = pic->height; @@ -1342,7 +1403,7 @@ static WebPEncodingError EncodeDeltaPalettePredictorImage( err = EncodeImageNoHuffman(bw, predictors, &enc->hash_chain_, (VP8LBackwardRefs*)enc->refs_, // cast const away transform_width, transform_height, - quality); + quality, low_effort); WebPSafeFree(predictors); return err; } @@ -1393,7 +1454,7 @@ WebPEncodingError VP8LEncodeStream(const WebPConfig* const config, int use_near_lossless = 0; int hdr_size = 0; int data_size = 0; - int use_delta_palettization = 0; + int use_delta_palette = 0; if (enc == NULL) { err = VP8_ENC_ERROR_OUT_OF_MEMORY; @@ -1420,7 +1481,7 @@ WebPEncodingError VP8LEncodeStream(const WebPConfig* const config, } #ifdef WEBP_EXPERIMENTAL_FEATURES - if (config->delta_palettization) { + if (config->use_delta_palette) { enc->use_predict_ = 1; enc->use_cross_color_ = 0; enc->use_subtract_green_ = 0; @@ -1432,21 +1493,25 @@ WebPEncodingError VP8LEncodeStream(const WebPConfig* const config, if (enc->use_palette_) { err = AllocateTransformBuffer(enc, width, height); if (err != VP8_ENC_OK) goto Error; - err = EncodeDeltaPalettePredictorImage(bw, enc, quality); + err = EncodeDeltaPalettePredictorImage(bw, enc, quality, low_effort); if (err != VP8_ENC_OK) goto Error; - use_delta_palettization = 1; + use_delta_palette = 1; } } #endif // WEBP_EXPERIMENTAL_FEATURES // Encode palette if (enc->use_palette_) { - err = EncodePalette(bw, enc); + err = EncodePalette(bw, low_effort, enc); if (err != VP8_ENC_OK) goto Error; - err = MapImageFromPalette(enc, use_delta_palettization); + err = MapImageFromPalette(enc, use_delta_palette); if (err != VP8_ENC_OK) goto Error; + // If using a color cache, do not have it bigger than the number of colors. + if (use_cache && enc->palette_size_ < (1 << MAX_COLOR_CACHE_BITS)) { + enc->cache_bits_ = BitsLog2Floor(enc->palette_size_) + 1; + } } - if (!use_delta_palettization) { + if (!use_delta_palette) { // In case image is not packed. if (enc->argb_ == NULL) { err = MakeInputImageCopy(enc); @@ -1468,7 +1533,7 @@ WebPEncodingError VP8LEncodeStream(const WebPConfig* const config, if (enc->use_cross_color_) { err = ApplyCrossColorFilter(enc, enc->current_width_, - height, quality, bw); + height, quality, low_effort, bw); if (err != VP8_ENC_OK) goto Error; } } diff --git a/thirdparty/libwebp/enc/vp8li.h b/thirdparty/libwebp/enc/vp8li_enc.h index 371e276ee0..8c5fbcbb2e 100644 --- a/thirdparty/libwebp/enc/vp8li.h +++ b/thirdparty/libwebp/enc/vp8li_enc.h @@ -14,9 +14,9 @@ #ifndef WEBP_ENC_VP8LI_H_ #define WEBP_ENC_VP8LI_H_ -#include "./backward_references.h" -#include "./histogram.h" -#include "../utils/bit_writer.h" +#include "./backward_references_enc.h" +#include "./histogram_enc.h" +#include "../utils/bit_writer_utils.h" #include "../webp/encode.h" #include "../webp/format_constants.h" @@ -24,6 +24,9 @@ extern "C" { #endif +// maximum value of transform_bits_ in VP8LEncoder. +#define MAX_TRANSFORM_BITS 6 + typedef struct { const WebPConfig* config_; // user configuration and parameters const WebPPicture* pic_; // input picture. @@ -39,7 +42,7 @@ typedef struct { // Encoding parameters derived from quality parameter. int histo_bits_; - int transform_bits_; + int transform_bits_; // <= MAX_TRANSFORM_BITS. int cache_bits_; // If equal to 0, don't use color cache. // Encoding parameters derived from image characteristics. @@ -73,6 +76,17 @@ WebPEncodingError VP8LEncodeStream(const WebPConfig* const config, VP8LBitWriter* const bw, int use_cache); //------------------------------------------------------------------------------ +// Image transforms in predictor.c. + +void VP8LResidualImage(int width, int height, int bits, int low_effort, + uint32_t* const argb, uint32_t* const argb_scratch, + uint32_t* const image, int near_lossless, int exact, + int used_subtract_green); + +void VP8LColorSpaceTransform(int width, int height, int bits, int quality, + uint32_t* const argb, uint32_t* image); + +//------------------------------------------------------------------------------ #ifdef __cplusplus } // extern "C" diff --git a/thirdparty/libwebp/enc/webpenc.c b/thirdparty/libwebp/enc/webp_enc.c index a7d04ea2ce..f18461ef92 100644 --- a/thirdparty/libwebp/enc/webpenc.c +++ b/thirdparty/libwebp/enc/webp_enc.c @@ -16,9 +16,9 @@ #include <string.h> #include <math.h> -#include "./cost.h" -#include "./vp8enci.h" -#include "./vp8li.h" +#include "./cost_enc.h" +#include "./vp8i_enc.h" +#include "./vp8li_enc.h" #include "../utils/utils.h" // #define PRINT_MEMORY_INFO @@ -75,7 +75,7 @@ static void ResetBoundaryPredictions(VP8Encoder* const enc) { //-------------------+---+---+---+---+---+---+---+ // dynamic proba | ~ | x | x | x | x | x | x | //-------------------+---+---+---+---+---+---+---+ -// fast mode analysis| | | | | x | x | x | +// fast mode analysis|[x]|[x]| | | x | x | x | //-------------------+---+---+---+---+---+---+---+ // basic rd-opt | | | | x | x | x | x | //-------------------+---+---+---+---+---+---+---+ @@ -315,18 +315,21 @@ int WebPReportProgress(const WebPPicture* const pic, int WebPEncode(const WebPConfig* config, WebPPicture* pic) { int ok = 0; + if (pic == NULL) return 0; - if (pic == NULL) - return 0; WebPEncodingSetError(pic, VP8_ENC_OK); // all ok so far - if (config == NULL) // bad params + if (config == NULL) { // bad params return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER); - if (!WebPValidateConfig(config)) + } + if (!WebPValidateConfig(config)) { return WebPEncodingSetError(pic, VP8_ENC_ERROR_INVALID_CONFIGURATION); - if (pic->width <= 0 || pic->height <= 0) + } + if (pic->width <= 0 || pic->height <= 0) { return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_DIMENSION); - if (pic->width > WEBP_MAX_DIMENSION || pic->height > WEBP_MAX_DIMENSION) + } + if (pic->width > WEBP_MAX_DIMENSION || pic->height > WEBP_MAX_DIMENSION) { return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_DIMENSION); + } if (pic->stats != NULL) memset(pic->stats, 0, sizeof(*pic->stats)); @@ -339,8 +342,8 @@ int WebPEncode(const WebPConfig* config, WebPPicture* pic) { if (pic->use_argb || pic->y == NULL || pic->u == NULL || pic->v == NULL) { // Make sure we have YUVA samples. - if (config->preprocessing & 4) { - if (!WebPPictureSmartARGBToYUVA(pic)) { + if (config->use_sharp_yuv || (config->preprocessing & 4)) { + if (!WebPPictureSharpARGBToYUVA(pic)) { return 0; } } else { diff --git a/thirdparty/libwebp/mux/anim_encode.c b/thirdparty/libwebp/mux/anim_encode.c index 398ba8d850..6066388727 100644 --- a/thirdparty/libwebp/mux/anim_encode.c +++ b/thirdparty/libwebp/mux/anim_encode.c @@ -16,6 +16,7 @@ #include <stdio.h> #include <stdlib.h> // for abs() +#include "../mux/animi.h" #include "../utils/utils.h" #include "../webp/decode.h" #include "../webp/encode.h" @@ -128,14 +129,13 @@ static void SanitizeEncoderOptions(WebPAnimEncoderOptions* const enc_options) { DisableKeyframes(enc_options); } - if (enc_options->kmin <= 0) { - DisableKeyframes(enc_options); - print_warning = 0; - } - if (enc_options->kmax <= 0) { // All frames will be key-frames. + if (enc_options->kmax == 1) { // All frames will be key-frames. enc_options->kmin = 0; enc_options->kmax = 0; return; + } else if (enc_options->kmax <= 0) { + DisableKeyframes(enc_options); + print_warning = 0; } if (enc_options->kmin >= enc_options->kmax) { @@ -378,10 +378,10 @@ static WEBP_INLINE int PixelsAreSimilar(uint32_t src, uint32_t dst, const int dst_g = (dst >> 8) & 0xff; const int dst_b = (dst >> 0) & 0xff; - return (abs(src_r * src_a - dst_r * dst_a) <= (max_allowed_diff * 255)) && - (abs(src_g * src_a - dst_g * dst_a) <= (max_allowed_diff * 255)) && - (abs(src_b * src_a - dst_b * dst_a) <= (max_allowed_diff * 255)) && - (abs(src_a - dst_a) <= max_allowed_diff); + return (src_a == dst_a) && + (abs(src_r - dst_r) * dst_a <= (max_allowed_diff * 255)) && + (abs(src_g - dst_g) * dst_a <= (max_allowed_diff * 255)) && + (abs(src_b - dst_b) * dst_a <= (max_allowed_diff * 255)); } // Returns true if 'length' number of pixels in 'src' and 'dst' are within an @@ -586,6 +586,39 @@ static int GetSubRects(const WebPPicture* const prev_canvas, ¶ms->rect_lossy_, ¶ms->sub_frame_lossy_); } +static WEBP_INLINE int clip(int v, int min_v, int max_v) { + return (v < min_v) ? min_v : (v > max_v) ? max_v : v; +} + +int WebPAnimEncoderRefineRect( + const WebPPicture* const prev_canvas, const WebPPicture* const curr_canvas, + int is_lossless, float quality, int* const x_offset, int* const y_offset, + int* const width, int* const height) { + FrameRect rect; + const int right = clip(*x_offset + *width, 0, curr_canvas->width); + const int left = clip(*x_offset, 0, curr_canvas->width - 1); + const int bottom = clip(*y_offset + *height, 0, curr_canvas->height); + const int top = clip(*y_offset, 0, curr_canvas->height - 1); + if (prev_canvas == NULL || curr_canvas == NULL || + prev_canvas->width != curr_canvas->width || + prev_canvas->height != curr_canvas->height || + !prev_canvas->use_argb || !curr_canvas->use_argb) { + return 0; + } + rect.x_offset_ = left; + rect.y_offset_ = top; + rect.width_ = clip(right - left, 0, curr_canvas->width - rect.x_offset_); + rect.height_ = clip(bottom - top, 0, curr_canvas->height - rect.y_offset_); + MinimizeChangeRectangle(prev_canvas, curr_canvas, &rect, is_lossless, + quality); + SnapToEvenOffsets(&rect); + *x_offset = rect.x_offset_; + *y_offset = rect.y_offset_; + *width = rect.width_; + *height = rect.height_; + return 1; +} + static void DisposeFrameRectangle(int dispose_method, const FrameRect* const rect, WebPPicture* const curr_canvas) { diff --git a/thirdparty/libwebp/mux/animi.h b/thirdparty/libwebp/mux/animi.h new file mode 100644 index 0000000000..cecaf1fee5 --- /dev/null +++ b/thirdparty/libwebp/mux/animi.h @@ -0,0 +1,43 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Use of this source code is governed by a BSD-style license +// that can be found in the COPYING file in the root of the source +// tree. An additional intellectual property rights grant can be found +// in the file PATENTS. All contributing project authors may +// be found in the AUTHORS file in the root of the source tree. +// ----------------------------------------------------------------------------- +// +// Internal header for animation related functions. +// +// Author: Hui Su (huisu@google.com) + +#ifndef WEBP_MUX_ANIMI_H_ +#define WEBP_MUX_ANIMI_H_ + +#include "../webp/mux.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Picks the optimal rectangle between two pictures, starting with initial +// values of offsets and dimensions that are passed in. The initial +// values will be clipped, if necessary, to make sure the rectangle is +// within the canvas. "use_argb" must be true for both pictures. +// Parameters: +// prev_canvas, curr_canvas - (in) two input pictures to compare. +// is_lossless, quality - (in) encoding settings. +// x_offset, y_offset, width, height - (in/out) rectangle between the two +// input pictures. +// Returns true on success. +int WebPAnimEncoderRefineRect( + const struct WebPPicture* const prev_canvas, + const struct WebPPicture* const curr_canvas, + int is_lossless, float quality, int* const x_offset, int* const y_offset, + int* const width, int* const height); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /* WEBP_MUX_ANIMI_H_ */ diff --git a/thirdparty/libwebp/mux/muxedit.c b/thirdparty/libwebp/mux/muxedit.c index 9bbed42b1a..d2c5305372 100644 --- a/thirdparty/libwebp/mux/muxedit.c +++ b/thirdparty/libwebp/mux/muxedit.c @@ -93,34 +93,32 @@ static WebPMuxError MuxSet(WebPMux* const mux, uint32_t tag, uint32_t nth, } #undef SWITCH_ID_LIST -// Create data for frame/fragment given image data, offsets and duration. -static WebPMuxError CreateFrameFragmentData( - int width, int height, const WebPMuxFrameInfo* const info, int is_frame, - WebPData* const frame_frgm) { - uint8_t* frame_frgm_bytes; - const size_t frame_frgm_size = kChunks[is_frame ? IDX_ANMF : IDX_FRGM].size; +// Create data for frame given image data, offsets and duration. +static WebPMuxError CreateFrameData( + int width, int height, const WebPMuxFrameInfo* const info, + WebPData* const frame) { + uint8_t* frame_bytes; + const size_t frame_size = kChunks[IDX_ANMF].size; assert(width > 0 && height > 0 && info->duration >= 0); assert(info->dispose_method == (info->dispose_method & 1)); // Note: assertion on upper bounds is done in PutLE24(). - frame_frgm_bytes = (uint8_t*)WebPSafeMalloc(1ULL, frame_frgm_size); - if (frame_frgm_bytes == NULL) return WEBP_MUX_MEMORY_ERROR; + frame_bytes = (uint8_t*)WebPSafeMalloc(1ULL, frame_size); + if (frame_bytes == NULL) return WEBP_MUX_MEMORY_ERROR; - PutLE24(frame_frgm_bytes + 0, info->x_offset / 2); - PutLE24(frame_frgm_bytes + 3, info->y_offset / 2); + PutLE24(frame_bytes + 0, info->x_offset / 2); + PutLE24(frame_bytes + 3, info->y_offset / 2); - if (is_frame) { - PutLE24(frame_frgm_bytes + 6, width - 1); - PutLE24(frame_frgm_bytes + 9, height - 1); - PutLE24(frame_frgm_bytes + 12, info->duration); - frame_frgm_bytes[15] = - (info->blend_method == WEBP_MUX_NO_BLEND ? 2 : 0) | - (info->dispose_method == WEBP_MUX_DISPOSE_BACKGROUND ? 1 : 0); - } + PutLE24(frame_bytes + 6, width - 1); + PutLE24(frame_bytes + 9, height - 1); + PutLE24(frame_bytes + 12, info->duration); + frame_bytes[15] = + (info->blend_method == WEBP_MUX_NO_BLEND ? 2 : 0) | + (info->dispose_method == WEBP_MUX_DISPOSE_BACKGROUND ? 1 : 0); - frame_frgm->bytes = frame_frgm_bytes; - frame_frgm->size = frame_frgm_size; + frame->bytes = frame_bytes; + frame->size = frame_size; return WEBP_MUX_OK; } @@ -264,23 +262,16 @@ WebPMuxError WebPMuxSetImage(WebPMux* mux, const WebPData* bitstream, return err; } -WebPMuxError WebPMuxPushFrame(WebPMux* mux, const WebPMuxFrameInfo* frame, +WebPMuxError WebPMuxPushFrame(WebPMux* mux, const WebPMuxFrameInfo* info, int copy_data) { WebPMuxImage wpi; WebPMuxError err; - int is_frame; - const WebPData* const bitstream = &frame->bitstream; + const WebPData* const bitstream = &info->bitstream; // Sanity checks. - if (mux == NULL || frame == NULL) return WEBP_MUX_INVALID_ARGUMENT; + if (mux == NULL || info == NULL) return WEBP_MUX_INVALID_ARGUMENT; - is_frame = (frame->id == WEBP_CHUNK_ANMF); - if (!(is_frame || (frame->id == WEBP_CHUNK_FRGM))) { - return WEBP_MUX_INVALID_ARGUMENT; - } - if (frame->id == WEBP_CHUNK_FRGM) { // Dead experiment. - return WEBP_MUX_INVALID_ARGUMENT; - } + if (info->id != WEBP_CHUNK_ANMF) return WEBP_MUX_INVALID_ARGUMENT; if (bitstream->bytes == NULL || bitstream->size > MAX_CHUNK_PAYLOAD) { return WEBP_MUX_INVALID_ARGUMENT; @@ -290,7 +281,7 @@ WebPMuxError WebPMuxPushFrame(WebPMux* mux, const WebPMuxFrameInfo* frame, const WebPMuxImage* const image = mux->images_; const uint32_t image_id = (image->header_ != NULL) ? ChunkGetIdFromTag(image->header_->tag_) : WEBP_CHUNK_IMAGE; - if (image_id != frame->id) { + if (image_id != info->id) { return WEBP_MUX_INVALID_ARGUMENT; // Conflicting frame types. } } @@ -301,16 +292,11 @@ WebPMuxError WebPMuxPushFrame(WebPMux* mux, const WebPMuxFrameInfo* frame, assert(wpi.img_ != NULL); // As SetAlphaAndImageChunks() was successful. { - WebPData frame_frgm; - const uint32_t tag = kChunks[is_frame ? IDX_ANMF : IDX_FRGM].tag; - WebPMuxFrameInfo tmp = *frame; + WebPData frame; + const uint32_t tag = kChunks[IDX_ANMF].tag; + WebPMuxFrameInfo tmp = *info; tmp.x_offset &= ~1; // Snap offsets to even. tmp.y_offset &= ~1; - if (!is_frame) { // Reset unused values. - tmp.duration = 1; - tmp.dispose_method = WEBP_MUX_DISPOSE_NONE; - tmp.blend_method = WEBP_MUX_BLEND; - } if (tmp.x_offset < 0 || tmp.x_offset >= MAX_POSITION_OFFSET || tmp.y_offset < 0 || tmp.y_offset >= MAX_POSITION_OFFSET || (tmp.duration < 0 || tmp.duration >= MAX_DURATION) || @@ -318,12 +304,11 @@ WebPMuxError WebPMuxPushFrame(WebPMux* mux, const WebPMuxFrameInfo* frame, err = WEBP_MUX_INVALID_ARGUMENT; goto Err; } - err = CreateFrameFragmentData(wpi.width_, wpi.height_, &tmp, is_frame, - &frame_frgm); + err = CreateFrameData(wpi.width_, wpi.height_, &tmp, &frame); if (err != WEBP_MUX_OK) goto Err; - // Add frame/fragment chunk (with copy_data = 1). - err = AddDataToChunkList(&frame_frgm, 1, tag, &wpi.header_); - WebPDataClear(&frame_frgm); // frame_frgm owned by wpi.header_ now. + // Add frame chunk (with copy_data = 1). + err = AddDataToChunkList(&frame, 1, tag, &wpi.header_); + WebPDataClear(&frame); // frame owned by wpi.header_ now. if (err != WEBP_MUX_OK) goto Err; } @@ -402,21 +387,18 @@ WebPMuxError WebPMuxDeleteFrame(WebPMux* mux, uint32_t nth) { //------------------------------------------------------------------------------ // Assembly of the WebP RIFF file. -static WebPMuxError GetFrameFragmentInfo( - const WebPChunk* const frame_frgm_chunk, +static WebPMuxError GetFrameInfo( + const WebPChunk* const frame_chunk, int* const x_offset, int* const y_offset, int* const duration) { - const uint32_t tag = frame_frgm_chunk->tag_; - const int is_frame = (tag == kChunks[IDX_ANMF].tag); - const WebPData* const data = &frame_frgm_chunk->data_; - const size_t expected_data_size = - is_frame ? ANMF_CHUNK_SIZE : FRGM_CHUNK_SIZE; - assert(frame_frgm_chunk != NULL); - assert(tag == kChunks[IDX_ANMF].tag || tag == kChunks[IDX_FRGM].tag); + const WebPData* const data = &frame_chunk->data_; + const size_t expected_data_size = ANMF_CHUNK_SIZE; + assert(frame_chunk->tag_ == kChunks[IDX_ANMF].tag); + assert(frame_chunk != NULL); if (data->size != expected_data_size) return WEBP_MUX_INVALID_ARGUMENT; *x_offset = 2 * GetLE24(data->bytes + 0); *y_offset = 2 * GetLE24(data->bytes + 3); - if (is_frame) *duration = GetLE24(data->bytes + 12); + *duration = GetLE24(data->bytes + 12); return WEBP_MUX_OK; } @@ -424,13 +406,13 @@ static WebPMuxError GetImageInfo(const WebPMuxImage* const wpi, int* const x_offset, int* const y_offset, int* const duration, int* const width, int* const height) { - const WebPChunk* const frame_frgm_chunk = wpi->header_; + const WebPChunk* const frame_chunk = wpi->header_; WebPMuxError err; assert(wpi != NULL); - assert(frame_frgm_chunk != NULL); + assert(frame_chunk != NULL); - // Get offsets and duration from ANMF/FRGM chunk. - err = GetFrameFragmentInfo(frame_frgm_chunk, x_offset, y_offset, duration); + // Get offsets and duration from ANMF chunk. + err = GetFrameInfo(frame_chunk, x_offset, y_offset, duration); if (err != WEBP_MUX_OK) return err; // Get width and height from VP8/VP8L chunk. @@ -441,7 +423,6 @@ static WebPMuxError GetImageInfo(const WebPMuxImage* const wpi, // Returns the tightest dimension for the canvas considering the image list. static WebPMuxError GetAdjustedCanvasSize(const WebPMux* const mux, - uint32_t flags, int* const width, int* const height) { WebPMuxImage* wpi = NULL; assert(mux != NULL); @@ -452,12 +433,10 @@ static WebPMuxError GetAdjustedCanvasSize(const WebPMux* const mux, assert(wpi->img_ != NULL); if (wpi->next_ != NULL) { - int max_x = 0; - int max_y = 0; - int64_t image_area = 0; + int max_x = 0, max_y = 0; // if we have a chain of wpi's, header_ is necessarily set assert(wpi->header_ != NULL); - // Aggregate the bounding box for animation frames & fragmented images. + // Aggregate the bounding box for animation frames. for (; wpi != NULL; wpi = wpi->next_) { int x_offset = 0, y_offset = 0, duration = 0, w = 0, h = 0; const WebPMuxError err = GetImageInfo(wpi, &x_offset, &y_offset, @@ -470,19 +449,9 @@ static WebPMuxError GetAdjustedCanvasSize(const WebPMux* const mux, if (max_x_pos > max_x) max_x = max_x_pos; if (max_y_pos > max_y) max_y = max_y_pos; - image_area += w * h; } *width = max_x; *height = max_y; - // Crude check to validate that there are no image overlaps/holes for - // fragmented images. Check that the aggregated image area for individual - // fragments exactly matches the image area of the constructed canvas. - // However, the area-match is necessary but not sufficient condition. - if ((flags & FRAGMENTS_FLAG) && (image_area != (max_x * max_y))) { - *width = 0; - *height = 0; - return WEBP_MUX_INVALID_ARGUMENT; - } } else { // For a single image, canvas dimensions are same as image dimensions. *width = wpi->width_; @@ -528,10 +497,7 @@ static WebPMuxError CreateVP8XChunk(WebPMux* const mux) { flags |= XMP_FLAG; } if (images->header_ != NULL) { - if (images->header_->tag_ == kChunks[IDX_FRGM].tag) { - // This is a fragmented image. - flags |= FRAGMENTS_FLAG; - } else if (images->header_->tag_ == kChunks[IDX_ANMF].tag) { + if (images->header_->tag_ == kChunks[IDX_ANMF].tag) { // This is an image with animation. flags |= ANIMATION_FLAG; } @@ -540,7 +506,7 @@ static WebPMuxError CreateVP8XChunk(WebPMux* const mux) { flags |= ALPHA_FLAG; // Some images have an alpha channel. } - err = GetAdjustedCanvasSize(mux, flags, &width, &height); + err = GetAdjustedCanvasSize(mux, &width, &height); if (err != WEBP_MUX_OK) return err; if (width <= 0 || height <= 0) { @@ -580,31 +546,26 @@ static WebPMuxError CreateVP8XChunk(WebPMux* const mux) { // Cleans up 'mux' by removing any unnecessary chunks. static WebPMuxError MuxCleanup(WebPMux* const mux) { int num_frames; - int num_fragments; int num_anim_chunks; - // If we have an image with a single fragment or frame, and its rectangle - // covers the whole canvas, convert it to a non-animated non-fragmented image - // (to avoid writing FRGM/ANMF chunk unnecessarily). + // If we have an image with a single frame, and its rectangle + // covers the whole canvas, convert it to a non-animated image + // (to avoid writing ANMF chunk unnecessarily). WebPMuxError err = WebPMuxNumChunks(mux, kChunks[IDX_ANMF].id, &num_frames); if (err != WEBP_MUX_OK) return err; - err = WebPMuxNumChunks(mux, kChunks[IDX_FRGM].id, &num_fragments); - if (err != WEBP_MUX_OK) return err; - if (num_frames == 1 || num_fragments == 1) { - WebPMuxImage* frame_frag; - err = MuxImageGetNth((const WebPMuxImage**)&mux->images_, 1, &frame_frag); - assert(err == WEBP_MUX_OK); // We know that one frame/fragment does exist. - assert(frame_frag != NULL); - if (frame_frag->header_ != NULL && + if (num_frames == 1) { + WebPMuxImage* frame = NULL; + err = MuxImageGetNth((const WebPMuxImage**)&mux->images_, 1, &frame); + assert(err == WEBP_MUX_OK); // We know that one frame does exist. + assert(frame != NULL); + if (frame->header_ != NULL && ((mux->canvas_width_ == 0 && mux->canvas_height_ == 0) || - (frame_frag->width_ == mux->canvas_width_ && - frame_frag->height_ == mux->canvas_height_))) { - assert(frame_frag->header_->tag_ == kChunks[IDX_ANMF].tag || - frame_frag->header_->tag_ == kChunks[IDX_FRGM].tag); - ChunkDelete(frame_frag->header_); // Removes ANMF/FRGM chunk. - frame_frag->header_ = NULL; + (frame->width_ == mux->canvas_width_ && + frame->height_ == mux->canvas_height_))) { + assert(frame->header_->tag_ == kChunks[IDX_ANMF].tag); + ChunkDelete(frame->header_); // Removes ANMF chunk. + frame->header_ = NULL; num_frames = 0; - num_fragments = 0; } } // Remove ANIM chunk if this is a non-animated image. diff --git a/thirdparty/libwebp/mux/muxi.h b/thirdparty/libwebp/mux/muxi.h index b4865fe36f..e6606aa5d1 100644 --- a/thirdparty/libwebp/mux/muxi.h +++ b/thirdparty/libwebp/mux/muxi.h @@ -15,8 +15,8 @@ #define WEBP_MUX_MUXI_H_ #include <stdlib.h> -#include "../dec/vp8i.h" -#include "../dec/vp8li.h" +#include "../dec/vp8i_dec.h" +#include "../dec/vp8li_dec.h" #include "../webp/mux.h" #ifdef __cplusplus @@ -27,8 +27,8 @@ extern "C" { // Defines and constants. #define MUX_MAJ_VERSION 0 -#define MUX_MIN_VERSION 3 -#define MUX_REV_VERSION 2 +#define MUX_MIN_VERSION 4 +#define MUX_REV_VERSION 0 // Chunk object. typedef struct WebPChunk WebPChunk; @@ -36,16 +36,16 @@ struct WebPChunk { uint32_t tag_; int owner_; // True if *data_ memory is owned internally. // VP8X, ANIM, and other internally created chunks - // like ANMF/FRGM are always owned. + // like ANMF are always owned. WebPData data_; WebPChunk* next_; }; -// MuxImage object. Store a full WebP image (including ANMF/FRGM chunk, ALPH +// MuxImage object. Store a full WebP image (including ANMF chunk, ALPH // chunk and VP8/VP8L chunk), typedef struct WebPMuxImage WebPMuxImage; struct WebPMuxImage { - WebPChunk* header_; // Corresponds to WEBP_CHUNK_ANMF/WEBP_CHUNK_FRGM. + WebPChunk* header_; // Corresponds to WEBP_CHUNK_ANMF. WebPChunk* alpha_; // Corresponds to WEBP_CHUNK_ALPHA. WebPChunk* img_; // Corresponds to WEBP_CHUNK_IMAGE. WebPChunk* unknown_; // Corresponds to WEBP_CHUNK_UNKNOWN. @@ -79,7 +79,6 @@ typedef enum { IDX_ICCP, IDX_ANIM, IDX_ANMF, - IDX_FRGM, IDX_ALPHA, IDX_VP8, IDX_VP8L, @@ -185,7 +184,6 @@ int MuxImageFinalize(WebPMuxImage* const wpi); static WEBP_INLINE int IsWPI(WebPChunkId id) { switch (id) { case WEBP_CHUNK_ANMF: - case WEBP_CHUNK_FRGM: case WEBP_CHUNK_ALPHA: case WEBP_CHUNK_IMAGE: return 1; default: return 0; diff --git a/thirdparty/libwebp/mux/muxinternal.c b/thirdparty/libwebp/mux/muxinternal.c index 372c6a9674..387b57e8fe 100644 --- a/thirdparty/libwebp/mux/muxinternal.c +++ b/thirdparty/libwebp/mux/muxinternal.c @@ -23,7 +23,6 @@ const ChunkInfo kChunks[] = { { MKFOURCC('I', 'C', 'C', 'P'), WEBP_CHUNK_ICCP, UNDEFINED_CHUNK_SIZE }, { MKFOURCC('A', 'N', 'I', 'M'), WEBP_CHUNK_ANIM, ANIM_CHUNK_SIZE }, { MKFOURCC('A', 'N', 'M', 'F'), WEBP_CHUNK_ANMF, ANMF_CHUNK_SIZE }, - { MKFOURCC('F', 'R', 'G', 'M'), WEBP_CHUNK_FRGM, FRGM_CHUNK_SIZE }, { MKFOURCC('A', 'L', 'P', 'H'), WEBP_CHUNK_ALPHA, UNDEFINED_CHUNK_SIZE }, { MKFOURCC('V', 'P', '8', ' '), WEBP_CHUNK_IMAGE, UNDEFINED_CHUNK_SIZE }, { MKFOURCC('V', 'P', '8', 'L'), WEBP_CHUNK_IMAGE, UNDEFINED_CHUNK_SIZE }, @@ -251,8 +250,7 @@ static WebPChunk** GetChunkListFromId(const WebPMuxImage* const wpi, WebPChunkId id) { assert(wpi != NULL); switch (id) { - case WEBP_CHUNK_ANMF: - case WEBP_CHUNK_FRGM: return (WebPChunk**)&wpi->header_; + case WEBP_CHUNK_ANMF: return (WebPChunk**)&wpi->header_; case WEBP_CHUNK_ALPHA: return (WebPChunk**)&wpi->alpha_; case WEBP_CHUNK_IMAGE: return (WebPChunk**)&wpi->img_; default: return NULL; @@ -372,13 +370,12 @@ size_t MuxImageDiskSize(const WebPMuxImage* const wpi) { return size; } -// Special case as ANMF/FRGM chunk encapsulates other image chunks. +// Special case as ANMF chunk encapsulates other image chunks. static uint8_t* ChunkEmitSpecial(const WebPChunk* const header, size_t total_size, uint8_t* dst) { const size_t header_size = header->data_.size; const size_t offset_to_next = total_size - CHUNK_HEADER_SIZE; - assert(header->tag_ == kChunks[IDX_ANMF].tag || - header->tag_ == kChunks[IDX_FRGM].tag); + assert(header->tag_ == kChunks[IDX_ANMF].tag); PutLE32(dst + 0, header->tag_); PutLE32(dst + TAG_SIZE, (uint32_t)offset_to_next); assert(header_size == (uint32_t)header_size); @@ -391,7 +388,7 @@ static uint8_t* ChunkEmitSpecial(const WebPChunk* const header, uint8_t* MuxImageEmit(const WebPMuxImage* const wpi, uint8_t* dst) { // Ordering of chunks to be emitted is strictly as follows: - // 1. ANMF/FRGM chunk (if present). + // 1. ANMF chunk (if present). // 2. ALPH chunk (if present). // 3. VP8/VP8L chunk. assert(wpi); @@ -465,7 +462,6 @@ WebPMuxError MuxValidate(const WebPMux* const mux) { int num_xmp; int num_anim; int num_frames; - int num_fragments; int num_vp8x; int num_images; int num_alpha; @@ -510,10 +506,6 @@ WebPMuxError MuxValidate(const WebPMux* const mux) { } } - // Fragmentation: FRAGMENTS_FLAG and FRGM chunk(s) are consistent. - err = ValidateChunk(mux, IDX_FRGM, FRAGMENTS_FLAG, flags, -1, &num_fragments); - if (err != WEBP_MUX_OK) return err; - // Verify either VP8X chunk is present OR there is only one elem in // mux->images_. err = ValidateChunk(mux, IDX_VP8X, NO_FLAG, flags, 1, &num_vp8x); @@ -537,11 +529,6 @@ WebPMuxError MuxValidate(const WebPMux* const mux) { if (flags & ALPHA_FLAG) return WEBP_MUX_INVALID_ARGUMENT; } - // num_fragments & num_images are consistent. - if (num_fragments > 0 && num_images != num_fragments) { - return WEBP_MUX_INVALID_ARGUMENT; - } - return WEBP_MUX_OK; } diff --git a/thirdparty/libwebp/mux/muxread.c b/thirdparty/libwebp/mux/muxread.c index 8957a1e46e..410acd9119 100644 --- a/thirdparty/libwebp/mux/muxread.c +++ b/thirdparty/libwebp/mux/muxread.c @@ -104,17 +104,15 @@ static int MuxImageParse(const WebPChunk* const chunk, int copy_data, size_t subchunk_size; ChunkInit(&subchunk); - assert(chunk->tag_ == kChunks[IDX_ANMF].tag || - chunk->tag_ == kChunks[IDX_FRGM].tag); + assert(chunk->tag_ == kChunks[IDX_ANMF].tag); assert(!wpi->is_partial_); - // ANMF/FRGM. + // ANMF. { - const size_t hdr_size = (chunk->tag_ == kChunks[IDX_ANMF].tag) ? - ANMF_CHUNK_SIZE : FRGM_CHUNK_SIZE; + const size_t hdr_size = ANMF_CHUNK_SIZE; const WebPData temp = { bytes, hdr_size }; - // Each of ANMF and FRGM chunk contain a header at the beginning. So, its - // size should at least be 'hdr_size'. + // Each of ANMF chunk contain a header at the beginning. So, its size should + // be at least 'hdr_size'. if (size < hdr_size) goto Fail; ChunkAssignData(&subchunk, &temp, copy_data, chunk->tag_); } @@ -292,16 +290,15 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data, static WebPMuxError ValidateForSingleImage(const WebPMux* const mux) { const int num_images = MuxImageCount(mux->images_, WEBP_CHUNK_IMAGE); const int num_frames = MuxImageCount(mux->images_, WEBP_CHUNK_ANMF); - const int num_fragments = MuxImageCount(mux->images_, WEBP_CHUNK_FRGM); if (num_images == 0) { // No images in mux. return WEBP_MUX_NOT_FOUND; - } else if (num_images == 1 && num_frames == 0 && num_fragments == 0) { + } else if (num_images == 1 && num_frames == 0) { // Valid case (single image). return WEBP_MUX_OK; } else { - // Frame/Fragment case OR an invalid mux. + // Frame case OR an invalid mux. return WEBP_MUX_INVALID_ARGUMENT; } } @@ -379,7 +376,7 @@ static WebPMuxError SynthesizeBitstream(const WebPMuxImage* const wpi, const int need_vp8x = (wpi->alpha_ != NULL); const size_t vp8x_size = need_vp8x ? CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE : 0; const size_t alpha_size = need_vp8x ? ChunkDiskSize(wpi->alpha_) : 0; - // Note: No need to output ANMF/FRGM chunk for a single image. + // Note: No need to output ANMF chunk for a single image. const size_t size = RIFF_HEADER_SIZE + vp8x_size + alpha_size + ChunkDiskSize(wpi->img_); uint8_t* const data = (uint8_t*)WebPSafeMalloc(1ULL, size); @@ -436,29 +433,24 @@ static WebPMuxError MuxGetImageInternal(const WebPMuxImage* const wpi, return SynthesizeBitstream(wpi, &info->bitstream); } -static WebPMuxError MuxGetFrameFragmentInternal(const WebPMuxImage* const wpi, - WebPMuxFrameInfo* const frame) { +static WebPMuxError MuxGetFrameInternal(const WebPMuxImage* const wpi, + WebPMuxFrameInfo* const frame) { const int is_frame = (wpi->header_->tag_ == kChunks[IDX_ANMF].tag); - const CHUNK_INDEX idx = is_frame ? IDX_ANMF : IDX_FRGM; - const WebPData* frame_frgm_data; + const WebPData* frame_data; if (!is_frame) return WEBP_MUX_INVALID_ARGUMENT; assert(wpi->header_ != NULL); // Already checked by WebPMuxGetFrame(). - // Get frame/fragment chunk. - frame_frgm_data = &wpi->header_->data_; - if (frame_frgm_data->size < kChunks[idx].size) return WEBP_MUX_BAD_DATA; + // Get frame chunk. + frame_data = &wpi->header_->data_; + if (frame_data->size < kChunks[IDX_ANMF].size) return WEBP_MUX_BAD_DATA; // Extract info. - frame->x_offset = 2 * GetLE24(frame_frgm_data->bytes + 0); - frame->y_offset = 2 * GetLE24(frame_frgm_data->bytes + 3); - if (is_frame) { - const uint8_t bits = frame_frgm_data->bytes[15]; - frame->duration = GetLE24(frame_frgm_data->bytes + 12); + frame->x_offset = 2 * GetLE24(frame_data->bytes + 0); + frame->y_offset = 2 * GetLE24(frame_data->bytes + 3); + { + const uint8_t bits = frame_data->bytes[15]; + frame->duration = GetLE24(frame_data->bytes + 12); frame->dispose_method = (bits & 1) ? WEBP_MUX_DISPOSE_BACKGROUND : WEBP_MUX_DISPOSE_NONE; frame->blend_method = (bits & 2) ? WEBP_MUX_NO_BLEND : WEBP_MUX_BLEND; - } else { // Defaults for unused values. - frame->duration = 1; - frame->dispose_method = WEBP_MUX_DISPOSE_NONE; - frame->blend_method = WEBP_MUX_BLEND; } frame->id = ChunkGetIdFromTag(wpi->header_->tag_); return SynthesizeBitstream(wpi, &frame->bitstream); @@ -482,7 +474,7 @@ WebPMuxError WebPMuxGetFrame( if (wpi->header_ == NULL) { return MuxGetImageInternal(wpi, frame); } else { - return MuxGetFrameFragmentInternal(wpi, frame); + return MuxGetFrameInternal(wpi, frame); } } diff --git a/thirdparty/libwebp/utils/bit_reader_inl.h b/thirdparty/libwebp/utils/bit_reader_inl_utils.h index 99ed3137d2..fd7fb0446c 100644 --- a/thirdparty/libwebp/utils/bit_reader_inl.h +++ b/thirdparty/libwebp/utils/bit_reader_inl_utils.h @@ -20,13 +20,12 @@ #include "../webp/config.h" #endif -#ifdef WEBP_FORCE_ALIGNED -#include <string.h> // memcpy -#endif +#include <string.h> // for memcpy #include "../dsp/dsp.h" -#include "./bit_reader.h" -#include "./endian_inl.h" +#include "./bit_reader_utils.h" +#include "./endian_inl_utils.h" +#include "./utils.h" #ifdef __cplusplus extern "C" { @@ -62,10 +61,7 @@ void VP8LoadNewBytes(VP8BitReader* const br) { if (br->buf_ < br->buf_max_) { // convert memory type to register type (with some zero'ing!) bit_t bits; -#if defined(WEBP_FORCE_ALIGNED) - lbit_t in_bits; - memcpy(&in_bits, br->buf_, sizeof(in_bits)); -#elif defined(WEBP_USE_MIPS32) +#if defined(WEBP_USE_MIPS32) // This is needed because of un-aligned read. lbit_t in_bits; lbit_t* p_buf_ = (lbit_t*)br->buf_; @@ -80,7 +76,8 @@ void VP8LoadNewBytes(VP8BitReader* const br) { : "memory", "at" ); #else - const lbit_t in_bits = *(const lbit_t*)br->buf_; + lbit_t in_bits; + memcpy(&in_bits, br->buf_, sizeof(in_bits)); #endif br->buf_ += BITS >> 3; #if !defined(WORDS_BIGENDIAN) @@ -119,37 +116,26 @@ static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, int prob) { const int pos = br->bits_; const range_t split = (range * prob) >> 8; const range_t value = (range_t)(br->value_ >> pos); -#if defined(__arm__) || defined(_M_ARM) // ARM-specific - const int bit = ((int)(split - value) >> 31) & 1; - if (value > split) { - range -= split + 1; - br->value_ -= (bit_t)(split + 1) << pos; - } else { - range = split; - } -#else // faster version on x86 - int bit; // Don't use 'const int bit = (value > split);", it's slower. - if (value > split) { - range -= split + 1; + const int bit = (value > split); + if (bit) { + range -= split; br->value_ -= (bit_t)(split + 1) << pos; - bit = 1; } else { - range = split; - bit = 0; + range = split + 1; } -#endif - if (range <= (range_t)0x7e) { - const int shift = kVP8Log2Range[range]; - range = kVP8NewRange[range]; + { + const int shift = 7 ^ BitsLog2Floor(range); + range <<= shift; br->bits_ -= shift; } - br->range_ = range; + br->range_ = range - 1; return bit; } } // simplified version of VP8GetBit() for prob=0x80 (note shift is always 1 here) -static WEBP_INLINE int VP8GetSigned(VP8BitReader* const br, int v) { +static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE +int VP8GetSigned(VP8BitReader* const br, int v) { if (br->bits_ < 0) { VP8LoadNewBytes(br); } @@ -166,6 +152,37 @@ static WEBP_INLINE int VP8GetSigned(VP8BitReader* const br, int v) { } } +static WEBP_INLINE int VP8GetBitAlt(VP8BitReader* const br, int prob) { + // Don't move this declaration! It makes a big speed difference to store + // 'range' *before* calling VP8LoadNewBytes(), even if this function doesn't + // alter br->range_ value. + range_t range = br->range_; + if (br->bits_ < 0) { + VP8LoadNewBytes(br); + } + { + const int pos = br->bits_; + const range_t split = (range * prob) >> 8; + const range_t value = (range_t)(br->value_ >> pos); + int bit; // Don't use 'const int bit = (value > split);", it's slower. + if (value > split) { + range -= split + 1; + br->value_ -= (bit_t)(split + 1) << pos; + bit = 1; + } else { + range = split; + bit = 0; + } + if (range <= (range_t)0x7e) { + const int shift = kVP8Log2Range[range]; + range = kVP8NewRange[range]; + br->bits_ -= shift; + } + br->range_ = range; + return bit; + } +} + #ifdef __cplusplus } // extern "C" #endif diff --git a/thirdparty/libwebp/utils/bit_reader.c b/thirdparty/libwebp/utils/bit_reader_utils.c index 2eb46e0b4b..053b710bb8 100644 --- a/thirdparty/libwebp/utils/bit_reader.c +++ b/thirdparty/libwebp/utils/bit_reader_utils.c @@ -15,7 +15,7 @@ #include "../webp/config.h" #endif -#include "./bit_reader_inl.h" +#include "./bit_reader_inl_utils.h" #include "../utils/utils.h" //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/utils/bit_reader.h b/thirdparty/libwebp/utils/bit_reader_utils.h index ea5c584eb4..ea5c584eb4 100644 --- a/thirdparty/libwebp/utils/bit_reader.h +++ b/thirdparty/libwebp/utils/bit_reader_utils.h diff --git a/thirdparty/libwebp/utils/bit_writer.c b/thirdparty/libwebp/utils/bit_writer_utils.c index 064428691b..ab0c49dce8 100644 --- a/thirdparty/libwebp/utils/bit_writer.c +++ b/thirdparty/libwebp/utils/bit_writer_utils.c @@ -16,8 +16,8 @@ #include <string.h> // for memcpy() #include <stdlib.h> -#include "./bit_writer.h" -#include "./endian_inl.h" +#include "./bit_writer_utils.h" +#include "./endian_inl_utils.h" #include "./utils.h" //------------------------------------------------------------------------------ @@ -143,13 +143,13 @@ int VP8PutBitUniform(VP8BitWriter* const bw, int bit) { void VP8PutBits(VP8BitWriter* const bw, uint32_t value, int nb_bits) { uint32_t mask; assert(nb_bits > 0 && nb_bits < 32); - for (mask = 1u << (nb_bits - 1); mask; mask >>= 1) + for (mask = 1u << (nb_bits - 1); mask; mask >>= 1) { VP8PutBitUniform(bw, value & mask); + } } void VP8PutSignedBits(VP8BitWriter* const bw, int value, int nb_bits) { - if (!VP8PutBitUniform(bw, value != 0)) - return; + if (!VP8PutBitUniform(bw, value != 0)) return; if (value < 0) { VP8PutBits(bw, ((-value) << 1) | 1, nb_bits + 1); } else { diff --git a/thirdparty/libwebp/utils/bit_writer.h b/thirdparty/libwebp/utils/bit_writer_utils.h index ef360d1dc6..9c02bbc06d 100644 --- a/thirdparty/libwebp/utils/bit_writer.h +++ b/thirdparty/libwebp/utils/bit_writer_utils.h @@ -54,7 +54,8 @@ int VP8BitWriterAppend(VP8BitWriter* const bw, // return approximate write position (in bits) static WEBP_INLINE uint64_t VP8BitWriterPos(const VP8BitWriter* const bw) { - return (uint64_t)(bw->pos_ + bw->run_) * 8 + 8 + bw->nb_bits_; + const uint64_t nb_bits = 8 + bw->nb_bits_; // bw->nb_bits_ is <= 0, note + return (bw->pos_ + bw->run_) * 8 + nb_bits; } // Returns a pointer to the internal buffer. diff --git a/thirdparty/libwebp/utils/color_cache.c b/thirdparty/libwebp/utils/color_cache_utils.c index c34b2e7f1a..0172590c48 100644 --- a/thirdparty/libwebp/utils/color_cache.c +++ b/thirdparty/libwebp/utils/color_cache_utils.c @@ -14,7 +14,7 @@ #include <assert.h> #include <stdlib.h> #include <string.h> -#include "./color_cache.h" +#include "./color_cache_utils.h" #include "./utils.h" //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/utils/color_cache.h b/thirdparty/libwebp/utils/color_cache_utils.h index a9a9f64270..c373e6b361 100644 --- a/thirdparty/libwebp/utils/color_cache.h +++ b/thirdparty/libwebp/utils/color_cache_utils.h @@ -28,7 +28,11 @@ typedef struct { int hash_bits_; } VP8LColorCache; -static const uint32_t kHashMul = 0x1e35a7bd; +static const uint64_t kHashMul = 0x1e35a7bdull; + +static WEBP_INLINE int HashPix(uint32_t argb, int shift) { + return (int)(((argb * kHashMul) & 0xffffffffu) >> shift); +} static WEBP_INLINE uint32_t VP8LColorCacheLookup( const VP8LColorCache* const cc, uint32_t key) { @@ -44,19 +48,20 @@ static WEBP_INLINE void VP8LColorCacheSet(const VP8LColorCache* const cc, static WEBP_INLINE void VP8LColorCacheInsert(const VP8LColorCache* const cc, uint32_t argb) { - const uint32_t key = (kHashMul * argb) >> cc->hash_shift_; + const int key = HashPix(argb, cc->hash_shift_); cc->colors_[key] = argb; } static WEBP_INLINE int VP8LColorCacheGetIndex(const VP8LColorCache* const cc, uint32_t argb) { - return (kHashMul * argb) >> cc->hash_shift_; + return HashPix(argb, cc->hash_shift_); } +// Return the key if cc contains argb, and -1 otherwise. static WEBP_INLINE int VP8LColorCacheContains(const VP8LColorCache* const cc, uint32_t argb) { - const uint32_t key = (kHashMul * argb) >> cc->hash_shift_; - return (cc->colors_[key] == argb); + const int key = HashPix(argb, cc->hash_shift_); + return (cc->colors_[key] == argb) ? key : -1; } //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/utils/endian_inl.h b/thirdparty/libwebp/utils/endian_inl_utils.h index e11260ff7d..e11260ff7d 100644 --- a/thirdparty/libwebp/utils/endian_inl.h +++ b/thirdparty/libwebp/utils/endian_inl_utils.h diff --git a/thirdparty/libwebp/utils/filters.c b/thirdparty/libwebp/utils/filters_utils.c index 15543b1271..49c1d18a22 100644 --- a/thirdparty/libwebp/utils/filters.c +++ b/thirdparty/libwebp/utils/filters_utils.c @@ -11,7 +11,7 @@ // // Author: Urvang (urvang@google.com) -#include "./filters.h" +#include "./filters_utils.h" #include <stdlib.h> #include <string.h> diff --git a/thirdparty/libwebp/utils/filters.h b/thirdparty/libwebp/utils/filters_utils.h index 088b132fc5..088b132fc5 100644 --- a/thirdparty/libwebp/utils/filters.h +++ b/thirdparty/libwebp/utils/filters_utils.h diff --git a/thirdparty/libwebp/utils/huffman_encode.c b/thirdparty/libwebp/utils/huffman_encode_utils.c index 4e5ef6b447..f9504658ea 100644 --- a/thirdparty/libwebp/utils/huffman_encode.c +++ b/thirdparty/libwebp/utils/huffman_encode_utils.c @@ -14,7 +14,7 @@ #include <assert.h> #include <stdlib.h> #include <string.h> -#include "./huffman_encode.h" +#include "./huffman_encode_utils.h" #include "./utils.h" #include "../webp/format_constants.h" diff --git a/thirdparty/libwebp/utils/huffman_encode.h b/thirdparty/libwebp/utils/huffman_encode_utils.h index a157165148..a157165148 100644 --- a/thirdparty/libwebp/utils/huffman_encode.h +++ b/thirdparty/libwebp/utils/huffman_encode_utils.h diff --git a/thirdparty/libwebp/utils/huffman.c b/thirdparty/libwebp/utils/huffman_utils.c index 36e5502836..008b5d746f 100644 --- a/thirdparty/libwebp/utils/huffman.c +++ b/thirdparty/libwebp/utils/huffman_utils.c @@ -14,7 +14,7 @@ #include <assert.h> #include <stdlib.h> #include <string.h> -#include "./huffman.h" +#include "./huffman_utils.h" #include "./utils.h" #include "../webp/format_constants.h" @@ -45,7 +45,7 @@ static WEBP_INLINE uint32_t GetNextKey(uint32_t key, int len) { while (key & step) { step >>= 1; } - return (key & (step - 1)) + step; + return step ? (key & (step - 1)) + step : key; } // Stores code in table[0], table[step], table[2*step], ..., table[end]. @@ -75,11 +75,13 @@ static WEBP_INLINE int NextTableBitSize(const int* const count, return len - root_bits; } -int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits, - const int code_lengths[], int code_lengths_size) { +// sorted[code_lengths_size] is a pre-allocated array for sorting symbols +// by code length. +static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits, + const int code_lengths[], int code_lengths_size, + uint16_t sorted[]) { HuffmanCode* table = root_table; // next available space in table int total_size = 1 << root_bits; // total size root table + 2nd level table - int* sorted = NULL; // symbols sorted by code length int len; // current code length int symbol; // symbol index in original or sorted table // number of codes of each length: @@ -114,11 +116,6 @@ int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits, offset[len + 1] = offset[len] + count[len]; } - sorted = (int*)WebPSafeMalloc(code_lengths_size, sizeof(*sorted)); - if (sorted == NULL) { - return 0; - } - // Sort symbols by length, by symbol order within each length. for (symbol = 0; symbol < code_lengths_size; ++symbol) { const int symbol_code_length = code_lengths[symbol]; @@ -133,7 +130,6 @@ int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits, code.bits = 0; code.value = (uint16_t)sorted[0]; ReplicateValue(table, 1, total_size, code); - WebPSafeFree(sorted); return total_size; } @@ -153,7 +149,6 @@ int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits, num_nodes += num_open; num_open -= count[len]; if (num_open < 0) { - WebPSafeFree(sorted); return 0; } for (; count[len] > 0; --count[len]) { @@ -172,7 +167,6 @@ int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits, num_nodes += num_open; num_open -= count[len]; if (num_open < 0) { - WebPSafeFree(sorted); return 0; } for (; count[len] > 0; --count[len]) { @@ -195,11 +189,35 @@ int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits, // Check if tree is full. if (num_nodes != 2 * offset[MAX_ALLOWED_CODE_LENGTH] - 1) { - WebPSafeFree(sorted); return 0; } } - WebPSafeFree(sorted); + return total_size; +} + +// Maximum code_lengths_size is 2328 (reached for 11-bit color_cache_bits). +// More commonly, the value is around ~280. +#define MAX_CODE_LENGTHS_SIZE \ + ((1 << MAX_CACHE_BITS) + NUM_LITERAL_CODES + NUM_LENGTH_CODES) +// Cut-off value for switching between heap and stack allocation. +#define SORTED_SIZE_CUTOFF 512 +int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits, + const int code_lengths[], int code_lengths_size) { + int total_size; + assert(code_lengths_size <= MAX_CODE_LENGTHS_SIZE); + if (code_lengths_size <= SORTED_SIZE_CUTOFF) { + // use local stack-allocated array. + uint16_t sorted[SORTED_SIZE_CUTOFF]; + total_size = BuildHuffmanTable(root_table, root_bits, + code_lengths, code_lengths_size, sorted); + } else { // rare case. Use heap allocation. + uint16_t* const sorted = + (uint16_t*)WebPSafeMalloc(code_lengths_size, sizeof(*sorted)); + if (sorted == NULL) return 0; + total_size = BuildHuffmanTable(root_table, root_bits, + code_lengths, code_lengths_size, sorted); + WebPSafeFree(sorted); + } return total_size; } diff --git a/thirdparty/libwebp/utils/huffman.h b/thirdparty/libwebp/utils/huffman_utils.h index c6dd6aaa45..c6dd6aaa45 100644 --- a/thirdparty/libwebp/utils/huffman.h +++ b/thirdparty/libwebp/utils/huffman_utils.h diff --git a/thirdparty/libwebp/utils/quant_levels_dec.c b/thirdparty/libwebp/utils/quant_levels_dec_utils.c index ee0a3fe127..d4d23d3147 100644 --- a/thirdparty/libwebp/utils/quant_levels_dec.c +++ b/thirdparty/libwebp/utils/quant_levels_dec_utils.c @@ -14,7 +14,7 @@ // // Author: Skal (pascal.massimino@gmail.com) -#include "./quant_levels_dec.h" +#include "./quant_levels_dec_utils.h" #include <string.h> // for memset diff --git a/thirdparty/libwebp/utils/quant_levels_dec.h b/thirdparty/libwebp/utils/quant_levels_dec_utils.h index 59a13495d3..59a13495d3 100644 --- a/thirdparty/libwebp/utils/quant_levels_dec.h +++ b/thirdparty/libwebp/utils/quant_levels_dec_utils.h diff --git a/thirdparty/libwebp/utils/quant_levels.c b/thirdparty/libwebp/utils/quant_levels_utils.c index d7c8aab922..73174e8ab9 100644 --- a/thirdparty/libwebp/utils/quant_levels.c +++ b/thirdparty/libwebp/utils/quant_levels_utils.c @@ -14,7 +14,7 @@ #include <assert.h> -#include "./quant_levels.h" +#include "./quant_levels_utils.h" #define NUM_SYMBOLS 256 diff --git a/thirdparty/libwebp/utils/quant_levels.h b/thirdparty/libwebp/utils/quant_levels_utils.h index 1cb5a32cae..1cb5a32cae 100644 --- a/thirdparty/libwebp/utils/quant_levels.h +++ b/thirdparty/libwebp/utils/quant_levels_utils.h diff --git a/thirdparty/libwebp/utils/random.c b/thirdparty/libwebp/utils/random_utils.c index 24e96ad648..9f1e4154a6 100644 --- a/thirdparty/libwebp/utils/random.c +++ b/thirdparty/libwebp/utils/random_utils.c @@ -12,7 +12,7 @@ // Author: Skal (pascal.massimino@gmail.com) #include <string.h> -#include "./random.h" +#include "./random_utils.h" //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/utils/random.h b/thirdparty/libwebp/utils/random_utils.h index c392a615ca..c392a615ca 100644 --- a/thirdparty/libwebp/utils/random.h +++ b/thirdparty/libwebp/utils/random_utils.h diff --git a/thirdparty/libwebp/utils/rescaler.c b/thirdparty/libwebp/utils/rescaler_utils.c index d2278a52ff..0d1f80da24 100644 --- a/thirdparty/libwebp/utils/rescaler.c +++ b/thirdparty/libwebp/utils/rescaler_utils.c @@ -15,7 +15,7 @@ #include <stdlib.h> #include <string.h> #include "../dsp/dsp.h" -#include "./rescaler.h" +#include "./rescaler_utils.h" //------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/utils/rescaler.h b/thirdparty/libwebp/utils/rescaler_utils.h index 98b01a76d0..98b01a76d0 100644 --- a/thirdparty/libwebp/utils/rescaler.h +++ b/thirdparty/libwebp/utils/rescaler_utils.h diff --git a/thirdparty/libwebp/utils/thread.c b/thirdparty/libwebp/utils/thread_utils.c index 93f7622797..1729060c70 100644 --- a/thirdparty/libwebp/utils/thread.c +++ b/thirdparty/libwebp/utils/thread_utils.c @@ -13,7 +13,7 @@ #include <assert.h> #include <string.h> // for memset() -#include "./thread.h" +#include "./thread_utils.h" #include "./utils.h" #ifdef WEBP_USE_THREAD @@ -183,8 +183,7 @@ static int pthread_cond_wait(pthread_cond_t* const condition, #else // note that there is a consumer available so the signal isn't dropped in // pthread_cond_signal - if (!ReleaseSemaphore(condition->waiting_sem_, 1, NULL)) - return 1; + if (!ReleaseSemaphore(condition->waiting_sem_, 1, NULL)) return 1; // now unlock the mutex so pthread_cond_signal may be issued pthread_mutex_unlock(mutex); ok = (WaitForSingleObject(condition->signal_event_, INFINITE) == @@ -226,8 +225,7 @@ static THREADFN ThreadLoop(void* ptr) { } // main thread state control -static void ChangeState(WebPWorker* const worker, - WebPWorkerStatus new_status) { +static void ChangeState(WebPWorker* const worker, WebPWorkerStatus new_status) { // No-op when attempting to change state on a thread that didn't come up. // Checking status_ without acquiring the lock first would result in a data // race. diff --git a/thirdparty/libwebp/utils/thread.h b/thirdparty/libwebp/utils/thread_utils.h index 8408311855..8408311855 100644 --- a/thirdparty/libwebp/utils/thread.h +++ b/thirdparty/libwebp/utils/thread_utils.h diff --git a/thirdparty/libwebp/utils/utils.c b/thirdparty/libwebp/utils/utils.c index 82dbf8d5e5..504d924b60 100644 --- a/thirdparty/libwebp/utils/utils.c +++ b/thirdparty/libwebp/utils/utils.c @@ -25,7 +25,7 @@ // http://valgrind.org/docs/manual/ms-manual.html // Here is an example command line: /* valgrind --tool=massif --massif-out-file=massif.out \ - --stacks=yes --alloc-fn=WebPSafeAlloc --alloc-fn=WebPSafeCalloc + --stacks=yes --alloc-fn=WebPSafeMalloc --alloc-fn=WebPSafeCalloc ms_print massif.out */ // In addition: @@ -243,8 +243,7 @@ void WebPCopyPixels(const WebPPicture* const src, WebPPicture* const dst) { //------------------------------------------------------------------------------ -#define MAX_COLOR_COUNT MAX_PALETTE_SIZE -#define COLOR_HASH_SIZE (MAX_COLOR_COUNT * 4) +#define COLOR_HASH_SIZE (MAX_PALETTE_SIZE * 4) #define COLOR_HASH_RIGHT_SHIFT 22 // 32 - log2(COLOR_HASH_SIZE). int WebPGetColorPalette(const WebPPicture* const pic, uint32_t* const palette) { @@ -253,7 +252,7 @@ int WebPGetColorPalette(const WebPPicture* const pic, uint32_t* const palette) { int num_colors = 0; uint8_t in_use[COLOR_HASH_SIZE] = { 0 }; uint32_t colors[COLOR_HASH_SIZE]; - static const uint32_t kHashMul = 0x1e35a7bdU; + static const uint64_t kHashMul = 0x1e35a7bdull; const uint32_t* argb = pic->argb; const int width = pic->width; const int height = pic->height; @@ -268,14 +267,14 @@ int WebPGetColorPalette(const WebPPicture* const pic, uint32_t* const palette) { continue; } last_pix = argb[x]; - key = (kHashMul * last_pix) >> COLOR_HASH_RIGHT_SHIFT; + key = ((last_pix * kHashMul) & 0xffffffffu) >> COLOR_HASH_RIGHT_SHIFT; while (1) { if (!in_use[key]) { colors[key] = last_pix; in_use[key] = 1; ++num_colors; - if (num_colors > MAX_COLOR_COUNT) { - return MAX_COLOR_COUNT + 1; // Exact count not needed. + if (num_colors > MAX_PALETTE_SIZE) { + return MAX_PALETTE_SIZE + 1; // Exact count not needed. } break; } else if (colors[key] == last_pix) { @@ -302,8 +301,30 @@ int WebPGetColorPalette(const WebPPicture* const pic, uint32_t* const palette) { return num_colors; } -#undef MAX_COLOR_COUNT #undef COLOR_HASH_SIZE #undef COLOR_HASH_RIGHT_SHIFT //------------------------------------------------------------------------------ + +#if defined(WEBP_NEED_LOG_TABLE_8BIT) +const uint8_t WebPLogTable8bit[256] = { // 31 ^ clz(i) + 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 +}; +#endif + +//------------------------------------------------------------------------------ diff --git a/thirdparty/libwebp/utils/utils.h b/thirdparty/libwebp/utils/utils.h index 3a5d4e6a78..3ab459050a 100644 --- a/thirdparty/libwebp/utils/utils.h +++ b/thirdparty/libwebp/utils/utils.h @@ -62,7 +62,6 @@ WEBP_EXTERN(void) WebPSafeFree(void* const ptr); #define WEBP_ALIGN_CST 31 #define WEBP_ALIGN(PTR) (((uintptr_t)(PTR) + WEBP_ALIGN_CST) & ~WEBP_ALIGN_CST) -#if defined(WEBP_FORCE_ALIGNED) #include <string.h> // memcpy() is the safe way of moving potentially unaligned 32b memory. static WEBP_INLINE uint32_t WebPMemToUint32(const uint8_t* const ptr) { @@ -73,16 +72,6 @@ static WEBP_INLINE uint32_t WebPMemToUint32(const uint8_t* const ptr) { static WEBP_INLINE void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) { memcpy(ptr, &val, sizeof(val)); } -#else -static WEBP_UBSAN_IGNORE_UNDEF WEBP_INLINE -uint32_t WebPMemToUint32(const uint8_t* const ptr) { - return *(const uint32_t*)ptr; -} -static WEBP_UBSAN_IGNORE_UNDEF WEBP_INLINE -void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) { - *(uint32_t*)ptr = val; -} -#endif //------------------------------------------------------------------------------ // Reading/writing data. @@ -118,6 +107,19 @@ static WEBP_INLINE void PutLE32(uint8_t* const data, uint32_t val) { PutLE16(data + 2, (int)(val >> 16)); } +// Returns 31 ^ clz(n) = log2(n). This is the default C-implementation, either +// based on table or not. Can be used as fallback if clz() is not available. +#define WEBP_NEED_LOG_TABLE_8BIT +extern const uint8_t WebPLogTable8bit[256]; +static WEBP_INLINE int WebPLog2FloorC(uint32_t n) { + int log = 0; + while (n >= 256) { + log += 8; + n >>= 8; + } + return log + WebPLogTable8bit[n]; +} + // Returns (int)floor(log2(n)). n must be > 0. // use GNU builtins where available. #if defined(__GNUC__) && \ @@ -135,22 +137,8 @@ static WEBP_INLINE int BitsLog2Floor(uint32_t n) { _BitScanReverse(&first_set_bit, n); return first_set_bit; } -#else -static WEBP_INLINE int BitsLog2Floor(uint32_t n) { - int log = 0; - uint32_t value = n; - int i; - - for (i = 4; i >= 0; --i) { - const int shift = (1 << i); - const uint32_t x = value >> shift; - if (x != 0) { - value = x; - log += shift; - } - } - return log; -} +#else // default: use the C-version. +static WEBP_INLINE int BitsLog2Floor(uint32_t n) { return WebPLog2FloorC(n); } #endif //------------------------------------------------------------------------------ @@ -172,12 +160,12 @@ WEBP_EXTERN(void) WebPCopyPixels(const struct WebPPicture* const src, // Unique colors. // Returns count of unique colors in 'pic', assuming pic->use_argb is true. -// If the unique color count is more than MAX_COLOR_COUNT, returns -// MAX_COLOR_COUNT+1. +// If the unique color count is more than MAX_PALETTE_SIZE, returns +// MAX_PALETTE_SIZE+1. // If 'palette' is not NULL and number of unique colors is less than or equal to -// MAX_COLOR_COUNT, also outputs the actual unique colors into 'palette'. +// MAX_PALETTE_SIZE, also outputs the actual unique colors into 'palette'. // Note: 'palette' is assumed to be an array already allocated with at least -// MAX_COLOR_COUNT elements. +// MAX_PALETTE_SIZE elements. WEBP_EXTERN(int) WebPGetColorPalette(const struct WebPPicture* const pic, uint32_t* const palette); diff --git a/thirdparty/libwebp/webp/config.h b/thirdparty/libwebp/webp/config.h deleted file mode 100644 index 0ce1c7064d..0000000000 --- a/thirdparty/libwebp/webp/config.h +++ /dev/null @@ -1,150 +0,0 @@ -/* src/webp/config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - -/* Set to 1 if __builtin_bswap16 is available */ -#undef HAVE_BUILTIN_BSWAP16 - -/* Set to 1 if __builtin_bswap32 is available */ -#undef HAVE_BUILTIN_BSWAP32 - -/* Set to 1 if __builtin_bswap64 is available */ -#undef HAVE_BUILTIN_BSWAP64 - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the <GLUT/glut.h> header file. */ -#undef HAVE_GLUT_GLUT_H - -/* Define to 1 if you have the <GL/glut.h> header file. */ -#undef HAVE_GL_GLUT_H - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the <OpenGL/glut.h> header file. */ -#undef HAVE_OPENGL_GLUT_H - -/* Have PTHREAD_PRIO_INHERIT. */ -#undef HAVE_PTHREAD_PRIO_INHERIT - -/* Define to 1 if you have the <shlwapi.h> header file. */ -#undef HAVE_SHLWAPI_H - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the <wincodec.h> header file. */ -#undef HAVE_WINCODEC_H - -/* Define to 1 if you have the <windows.h> header file. */ -#undef HAVE_WINDOWS_H - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ -#undef PTHREAD_CREATE_JOINABLE - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Enable experimental code */ -#undef WEBP_EXPERIMENTAL_FEATURES - -/* Define to 1 to force aligned memory operations */ -#undef WEBP_FORCE_ALIGNED - -/* Set to 1 if AVX2 is supported */ -#undef WEBP_HAVE_AVX2 - -/* Set to 1 if GIF library is installed */ -#undef WEBP_HAVE_GIF - -/* Set to 1 if OpenGL is supported */ -#undef WEBP_HAVE_GL - -/* Set to 1 if JPEG library is installed */ -#undef WEBP_HAVE_JPEG - -/* Set to 1 if NEON is supported */ -#undef WEBP_HAVE_NEON - -/* Set to 1 if runtime detection of NEON is enabled */ -#undef WEBP_HAVE_NEON_RTCD - -/* Set to 1 if PNG library is installed */ -#undef WEBP_HAVE_PNG - -/* Set to 1 if SSE2 is supported */ -#undef WEBP_HAVE_SSE2 - -/* Set to 1 if SSE4.1 is supported */ -#undef WEBP_HAVE_SSE41 - -/* Set to 1 if TIFF library is installed */ -#undef WEBP_HAVE_TIFF - -/* Undefine this to disable thread support. */ -#undef WEBP_USE_THREAD - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif diff --git a/thirdparty/libwebp/webp/encode.h b/thirdparty/libwebp/webp/encode.h index b65e27e7fd..35fde1d052 100644 --- a/thirdparty/libwebp/webp/encode.h +++ b/thirdparty/libwebp/webp/encode.h @@ -20,7 +20,7 @@ extern "C" { #endif -#define WEBP_ENCODER_ABI_VERSION 0x0209 // MAJOR(8b) + MINOR(8b) +#define WEBP_ENCODER_ABI_VERSION 0x020e // MAJOR(8b) + MINOR(8b) // Note: forward declaring enumerations is not allowed in (strict) C and C++, // the types are left here for reference. @@ -141,12 +141,10 @@ struct WebPConfig { // RGB information for better compression. The default // value is 0. -#ifdef WEBP_EXPERIMENTAL_FEATURES - int delta_palettization; + int use_delta_palette; // reserved for future lossless feature + int use_sharp_yuv; // if needed, use sharp (and slow) RGB->YUV conversion + uint32_t pad[2]; // padding for later use -#else - uint32_t pad[3]; // padding for later use -#endif // WEBP_EXPERIMENTAL_FEATURES }; // Enumerate some predefined settings for WebPConfig, depending on the type @@ -388,9 +386,24 @@ WEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture); // Returns false in case of memory allocation error. WEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst); +// Compute the single distortion for packed planes of samples. +// 'src' will be compared to 'ref', and the raw distortion stored into +// '*distortion'. The refined metric (log(MSE), log(1 - ssim),...' will be +// stored in '*result'. +// 'x_step' is the horizontal stride (in bytes) between samples. +// 'src/ref_stride' is the byte distance between rows. +// Returns false in case of error (bad parameter, memory allocation error, ...). +WEBP_EXTERN(int) WebPPlaneDistortion(const uint8_t* src, size_t src_stride, + const uint8_t* ref, size_t ref_stride, + int width, int height, + size_t x_step, + int type, // 0 = PSNR, 1 = SSIM, 2 = LSIM + float* distortion, float* result); + // Compute PSNR, SSIM or LSIM distortion metric between two pictures. Results -// are in dB, stored in result[] in the Y/U/V/Alpha/All or B/G/R/A/All order. -// Returns false in case of error (src and ref don't have same dimension, ...) +// are in dB, stored in result[] in the B/G/R/A/All order. The distortion is +// always performed using ARGB samples. Hence if the input is YUV(A), the +// picture will be internally converted to ARGB (just for the measurement). // Warning: this function is rather CPU-intensive. WEBP_EXTERN(int) WebPPictureDistortion( const WebPPicture* src, const WebPPicture* ref, @@ -473,11 +486,13 @@ WEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture, WEBP_EXTERN(int) WebPPictureARGBToYUVADithered( WebPPicture* picture, WebPEncCSP colorspace, float dithering); -// Performs 'smart' RGBA->YUVA420 downsampling and colorspace conversion. +// Performs 'sharp' RGBA->YUVA420 downsampling and colorspace conversion. // Downsampling is handled with extra care in case of color clipping. This // method is roughly 2x slower than WebPPictureARGBToYUVA() but produces better -// YUV representation. +// and sharper YUV representation. // Returns false in case of error. +WEBP_EXTERN(int) WebPPictureSharpARGBToYUVA(WebPPicture* picture); +// kept for backward compatibility: WEBP_EXTERN(int) WebPPictureSmartARGBToYUVA(WebPPicture* picture); // Converts picture->yuv to picture->argb and sets picture->use_argb to true. diff --git a/thirdparty/libwebp/webp/format_constants.h b/thirdparty/libwebp/webp/format_constants.h index b6e78a643e..329fc8a3b0 100644 --- a/thirdparty/libwebp/webp/format_constants.h +++ b/thirdparty/libwebp/webp/format_constants.h @@ -72,14 +72,13 @@ typedef enum { #define RIFF_HEADER_SIZE 12 // Size of the RIFF header ("RIFFnnnnWEBP"). #define ANMF_CHUNK_SIZE 16 // Size of an ANMF chunk. #define ANIM_CHUNK_SIZE 6 // Size of an ANIM chunk. -#define FRGM_CHUNK_SIZE 6 // Size of a FRGM chunk. #define VP8X_CHUNK_SIZE 10 // Size of a VP8X chunk. #define MAX_CANVAS_SIZE (1 << 24) // 24-bit max for VP8X width/height. #define MAX_IMAGE_AREA (1ULL << 32) // 32-bit max for width x height. #define MAX_LOOP_COUNT (1 << 16) // maximum value for loop-count #define MAX_DURATION (1 << 24) // maximum duration -#define MAX_POSITION_OFFSET (1 << 24) // maximum frame/fragment x/y offset +#define MAX_POSITION_OFFSET (1 << 24) // maximum frame x/y offset // Maximum chunk payload is such that adding the header and padding won't // overflow a uint32_t. diff --git a/thirdparty/libwebp/webp/mux.h b/thirdparty/libwebp/webp/mux.h index b72658c741..daccc65e86 100644 --- a/thirdparty/libwebp/webp/mux.h +++ b/thirdparty/libwebp/webp/mux.h @@ -21,13 +21,13 @@ extern "C" { #endif -#define WEBP_MUX_ABI_VERSION 0x0106 // MAJOR(8b) + MINOR(8b) +#define WEBP_MUX_ABI_VERSION 0x0108 // MAJOR(8b) + MINOR(8b) //------------------------------------------------------------------------------ // Mux API // // This API allows manipulation of WebP container images containing features -// like color profile, metadata, animation and fragmented images. +// like color profile, metadata, animation. // // Code Example#1: Create a WebPMux object with image data, color profile and // XMP metadata. @@ -81,16 +81,16 @@ typedef enum WebPMuxError { // IDs for different types of chunks. typedef enum WebPChunkId { - WEBP_CHUNK_VP8X, // VP8X - WEBP_CHUNK_ICCP, // ICCP - WEBP_CHUNK_ANIM, // ANIM - WEBP_CHUNK_ANMF, // ANMF - WEBP_CHUNK_FRGM, // FRGM - WEBP_CHUNK_ALPHA, // ALPH - WEBP_CHUNK_IMAGE, // VP8/VP8L - WEBP_CHUNK_EXIF, // EXIF - WEBP_CHUNK_XMP, // XMP - WEBP_CHUNK_UNKNOWN, // Other chunks. + WEBP_CHUNK_VP8X, // VP8X + WEBP_CHUNK_ICCP, // ICCP + WEBP_CHUNK_ANIM, // ANIM + WEBP_CHUNK_ANMF, // ANMF + WEBP_CHUNK_DEPRECATED, // (deprecated from FRGM) + WEBP_CHUNK_ALPHA, // ALPH + WEBP_CHUNK_IMAGE, // VP8/VP8L + WEBP_CHUNK_EXIF, // EXIF + WEBP_CHUNK_XMP, // XMP + WEBP_CHUNK_UNKNOWN, // Other chunks. WEBP_CHUNK_NIL } WebPChunkId; @@ -142,7 +142,7 @@ static WEBP_INLINE WebPMux* WebPMuxCreate(const WebPData* bitstream, // Non-image chunks. // Note: Only non-image related chunks should be managed through chunk APIs. -// (Image related chunks are: "ANMF", "FRGM", "VP8 ", "VP8L" and "ALPH"). +// (Image related chunks are: "ANMF", "VP8 ", "VP8L" and "ALPH"). // To add, get and delete images, use WebPMuxSetImage(), WebPMuxPushFrame(), // WebPMuxGetFrame() and WebPMuxDeleteFrame(). @@ -195,7 +195,7 @@ WEBP_EXTERN(WebPMuxError) WebPMuxDeleteChunk( //------------------------------------------------------------------------------ // Images. -// Encapsulates data about a single frame/fragment. +// Encapsulates data about a single frame. struct WebPMuxFrameInfo { WebPData bitstream; // image data: can be a raw VP8/VP8L bitstream // or a single-image WebP file. @@ -203,19 +203,19 @@ struct WebPMuxFrameInfo { int y_offset; // y-offset of the frame. int duration; // duration of the frame (in milliseconds). - WebPChunkId id; // frame type: should be one of WEBP_CHUNK_ANMF, - // WEBP_CHUNK_FRGM or WEBP_CHUNK_IMAGE + WebPChunkId id; // frame type: should be one of WEBP_CHUNK_ANMF + // or WEBP_CHUNK_IMAGE WebPMuxAnimDispose dispose_method; // Disposal method for the frame. WebPMuxAnimBlend blend_method; // Blend operation for the frame. uint32_t pad[1]; // padding for later use }; -// Sets the (non-animated and non-fragmented) image in the mux object. -// Note: Any existing images (including frames/fragments) will be removed. +// Sets the (non-animated) image in the mux object. +// Note: Any existing images (including frames) will be removed. // Parameters: // mux - (in/out) object in which the image is to be set // bitstream - (in) can be a raw VP8/VP8L bitstream or a single-image -// WebP file (non-animated and non-fragmented) +// WebP file (non-animated) // copy_data - (in) value 1 indicates given data WILL be copied to the mux // object and value 0 indicates data will NOT be copied. // Returns: @@ -226,9 +226,8 @@ WEBP_EXTERN(WebPMuxError) WebPMuxSetImage( WebPMux* mux, const WebPData* bitstream, int copy_data); // Adds a frame at the end of the mux object. -// Notes: (1) frame.id should be one of WEBP_CHUNK_ANMF or WEBP_CHUNK_FRGM -// (2) For setting a non-animated non-fragmented image, use -// WebPMuxSetImage() instead. +// Notes: (1) frame.id should be WEBP_CHUNK_ANMF +// (2) For setting a non-animated image, use WebPMuxSetImage() instead. // (3) Type of frame being pushed must be same as the frames in mux. // (4) As WebP only supports even offsets, any odd offset will be snapped // to an even location using: offset &= ~1 @@ -431,9 +430,10 @@ struct WebPAnimEncoderOptions { // frames in the output. The library may insert some key // frames as needed to satisfy this criteria. // Note that these conditions should hold: kmax > kmin - // and kmin >= kmax / 2 + 1. Also, if kmin == 0, then - // key-frame insertion is disabled; and if kmax == 0, - // then all frames will be key-frames. + // and kmin >= kmax / 2 + 1. Also, if kmax <= 0, then + // key-frame insertion is disabled; and if kmax == 1, + // then all frames will be key-frames (kmin value does + // not matter for these special cases). int allow_mixed; // If true, use mixed compression mode; may choose // either lossy and lossless for each frame. int verbose; // If true, print info and warning messages to stderr. diff --git a/thirdparty/libwebp/webp/mux_types.h b/thirdparty/libwebp/webp/mux_types.h index c94043a3c0..b37e2c67aa 100644 --- a/thirdparty/libwebp/webp/mux_types.h +++ b/thirdparty/libwebp/webp/mux_types.h @@ -31,12 +31,13 @@ typedef struct WebPData WebPData; // VP8X Feature Flags. typedef enum WebPFeatureFlags { - FRAGMENTS_FLAG = 0x00000001, ANIMATION_FLAG = 0x00000002, XMP_FLAG = 0x00000004, EXIF_FLAG = 0x00000008, ALPHA_FLAG = 0x00000010, - ICCP_FLAG = 0x00000020 + ICCP_FLAG = 0x00000020, + + ALL_VALID_FLAGS = 0x0000003e } WebPFeatureFlags; // Dispose method (animation only). Indicates how the area used by the current diff --git a/tools/editor/editor_import_export.h b/tools/editor/editor_import_export.h deleted file mode 100644 index 2654a4ea33..0000000000 --- a/tools/editor/editor_import_export.h +++ /dev/null @@ -1,425 +0,0 @@ -/*************************************************************************/ -/* editor_import_export.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan 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 EDITOR_IMPORT_EXPORT_H -#define EDITOR_IMPORT_EXPORT_H - -#if 0 - -#include "resource.h" -#include "scene/main/node.h" -#include "scene/resources/texture.h" - - -class EditorExportPlatform; -class FileAccess; -struct EditorProgress; - -class EditorImportPlugin : public Reference { - - GDCLASS( EditorImportPlugin, Reference); - -protected: - - static void _bind_methods(); - - String _validate_source_path(const String& p_path); - String _expand_source_path(const String& p_path); - - -public: - - - static String validate_source_path(const String& p_path); - static String expand_source_path(const String& p_path); - - virtual String get_name() const; - virtual String get_visible_name() const; - virtual void import_dialog(const String& p_from=""); - virtual Error import(const String& p_path, const Ref<ResourceImportMetadata>& p_from); - virtual void import_from_drop(const Vector<String>& p_drop,const String& p_dest_path); - virtual void reimport_multiple_files(const Vector<String>& p_list); - virtual bool can_reimport_multiple_files() const; - virtual Vector<uint8_t> custom_export(const String& p_path,const Ref<EditorExportPlatform> &p_platform); - - EditorImportPlugin(); -}; - -class EditorExportPlugin : public Reference { - - GDCLASS( EditorExportPlugin, Reference); - -protected: - static void _bind_methods(); - -public: - - virtual Vector<uint8_t> custom_export(String& p_path,const Ref<EditorExportPlatform> &p_platform); - - EditorExportPlugin(); -}; - -class EditorExportPlatform : public Reference { - - GDCLASS( EditorExportPlatform,Reference ); - -public: - - typedef Error (*EditorExportSaveFunction)(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total); - -private: - - bool debugging_enabled; - -protected: - - bool _set(const StringName& p_name, const Variant& p_value); - bool _get(const StringName& p_name,Variant &r_ret) const; - void _get_property_list( List<PropertyInfo> *p_list) const; - - Vector<uint8_t> get_exported_file_default(String& p_fname) const; - virtual Vector<uint8_t> get_exported_file(String& p_fname) const; - virtual Vector<StringName> get_dependencies(bool p_bundles) const; - virtual String find_export_template(String template_file_name, String *err=NULL) const; - virtual bool exists_export_template(String template_file_name, String *err=NULL) const; - - struct TempData { - - uint64_t pos; - uint64_t ofs; - uint64_t size; - }; - - struct PackData { - - FileAccess *ftmp; - FileAccess *f; - Vector<TempData> file_ofs; - EditorProgress *ep; - int count; - int alignment; - - }; - - struct ZipData { - - void* zip; - EditorProgress *ep; - int count; - - }; - - void gen_export_flags(Vector<String> &r_flags, int p_flags); - static Error save_pack_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total); - static Error save_zip_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total); - -public: - - enum ImageCompression { - - IMAGE_COMPRESSION_NONE, - IMAGE_COMPRESSION_INDEXED, // used for older hardware - IMAGE_COMPRESSION_BC, // directx compression format - IMAGE_COMPRESSION_PVRTC, // powervr compression format - IMAGE_COMPRESSION_PVRTC_SQUARE, // powervr compression format, square (ios) - IMAGE_COMPRESSION_ETC1, // ericsson compression format (alpha is uncompressed) - IMAGE_COMPRESSION_ETC2, // ericsson new compression format (can handle alpha) - }; - - enum ExportFlags { - EXPORT_DUMB_CLIENT=1, - EXPORT_REMOTE_DEBUG=2, - EXPORT_REMOTE_DEBUG_LOCALHOST=4, - EXPORT_VIEW_COLLISONS=8, - EXPORT_VIEW_NAVIGATION=16, - }; - - bool is_debugging_enabled() const; - void set_debugging_enabled( bool p_enabled ); - - Error export_project_files(EditorExportSaveFunction p_func, void* p_udata,bool p_make_bundles); - - Error save_pack(FileAccess *p_where, bool p_make_bundles=false, int p_alignment = 1); - Error save_zip(const String& p_path, bool p_make_bundles=false); - - virtual String get_name() const =0; - virtual ImageCompression get_image_compression() const=0; - virtual Ref<Texture> get_logo() const =0; - - virtual bool poll_devices() { return false; } - virtual int get_device_count() const { return 0; } - virtual String get_device_name(int p_device) const { return ""; } - virtual String get_device_info(int p_device) const { return ""; } - virtual Error run(int p_device,int p_flags) { return OK; } - - virtual bool can_export(String *r_error=NULL) const=0; - - - virtual bool requires_password(bool p_debug) const { return false; } - virtual String get_binary_extension() const=0; - virtual Error export_project(const String& p_path,bool p_debug,int p_flags=0)=0; - - EditorExportPlatform(); -}; - -class EditorExportPlatformPC : public EditorExportPlatform { - - GDCLASS( EditorExportPlatformPC,EditorExportPlatform ); - -public: - - enum ExportMode { - EXPORT_EXE, - EXPORT_PACK, - EXPORT_ZIP - }; - - -private: - - - String binary_extension; - String platform; - - String custom_release_binary; - String custom_debug_binary; - String release_binary32; - String debug_binary32; - String release_binary64; - String debug_binary64; - String name; - bool use64; - - Ref<Texture> logo; - - ExportMode export_mode; - bool bundle; -protected: - - bool _set(const StringName& p_name, const Variant& p_value); - bool _get(const StringName& p_name,Variant &r_ret) const; - void _get_property_list( List<PropertyInfo> *p_list) const; - -public: - - virtual String get_name() const { return name; } - virtual Ref<Texture> get_logo() const { return logo; } - virtual ImageCompression get_image_compression() const { return IMAGE_COMPRESSION_BC; } - - virtual String get_binary_extension() const { return binary_extension; } - virtual Error export_project(const String& p_path, bool p_debug, int p_flags=0); - virtual void set_release_binary32(const String& p_binary) { release_binary32=p_binary; } - virtual void set_debug_binary32(const String& p_binary) { debug_binary32=p_binary; } - virtual void set_release_binary64(const String& p_binary) { release_binary64=p_binary; } - virtual void set_debug_binary64(const String& p_binary) { debug_binary64=p_binary; } - virtual void set_name(const String& p_name) { name=p_name; } - virtual void set_logo(const Ref<Texture>& p_logo) { logo=p_logo; } - - virtual bool can_export(String *r_error=NULL) const; - - void set_binary_extension(const String& p_extension); - - EditorExportPlatformPC(); -}; - - -class EditorImportExport : public Node { - GDCLASS(EditorImportExport,Node); -public: - - enum FileAction { - - ACTION_NONE, - ACTION_COPY, - ACTION_BUNDLE - }; - - enum ExportFilter { - EXPORT_SELECTED, - EXPORT_RESOURCES, - EXPORT_ALL, - - }; - - enum ImageAction { - IMAGE_ACTION_NONE, - IMAGE_ACTION_COMPRESS_DISK, - IMAGE_ACTION_COMPRESS_RAM, - IMAGE_ACTION_KEEP //for group - - }; - - enum ScriptAction { - SCRIPT_ACTION_NONE, - SCRIPT_ACTION_COMPILE, - SCRIPT_ACTION_ENCRYPT - }; - - enum SampleAction { - - SAMPLE_ACTION_NONE, - SAMPLE_ACTION_COMPRESS_RAM, - }; - -protected: - - struct ImageGroup { - - ImageAction action; - bool make_atlas; - float lossy_quality; - float shrink; - }; - - Vector<Ref<EditorExportPlugin> > export_plugins; - Vector<Ref<EditorImportPlugin> > plugins; - Map<String,int> by_idx; - ImageAction image_action; - float image_action_compress_quality; - float image_shrink; - Set<String> image_formats; - - ExportFilter export_filter; - String export_custom_filter, export_custom_filter_exclude; - Map<StringName,FileAction> files; - Map<StringName,Ref<EditorExportPlatform> > exporters; - Map<StringName,ImageGroup> image_groups; - Map<StringName,StringName> image_group_files; - Vector<String> diff_packs; - - ScriptAction script_action; - String script_key; - - SampleAction sample_action; - int sample_action_max_hz; - bool sample_action_trim; - - bool convert_text_scenes; - - static EditorImportExport* singleton; - - PoolVector<String> _get_export_file_list(); - PoolVector<String> _get_export_platforms(); - - static void _bind_methods(); -public: - - static EditorImportExport* get_singleton() { return singleton; } - - void add_import_plugin(const Ref<EditorImportPlugin>& p_plugin); - void remove_import_plugin(const Ref<EditorImportPlugin>& p_plugin); - int get_import_plugin_count() const; - Ref<EditorImportPlugin> get_import_plugin(int p_idx) const; - Ref<EditorImportPlugin> get_import_plugin_by_name(const String& p_string) const; - - void add_export_plugin(const Ref<EditorExportPlugin>& p_plugin); - void remove_export_plugin(const Ref<EditorExportPlugin>& p_plugin); - int get_export_plugin_count() const; - Ref<EditorExportPlugin> get_export_plugin(int p_idx) const; - - bool poll_export_platforms(); - - void set_export_file_action(const StringName& p_export_file, FileAction p_action); - FileAction get_export_file_action(const StringName& p_export_file) const; - void get_export_file_list(List<StringName> *p_export_files); - - void add_export_platform(const Ref<EditorExportPlatform>& p_export); - Ref<EditorExportPlatform> get_export_platform(const StringName& p_platform); - void get_export_platforms(List<StringName> *r_platforms); - - void set_export_filter(ExportFilter p_enable); - ExportFilter get_export_filter() const; - - void set_export_custom_filter(const String& p_custom_filter); - void set_export_custom_filter_exclude(const String& p_custom_filter); - String get_export_custom_filter() const; - String get_export_custom_filter_exclude() const; - - void set_export_image_action(ImageAction p_action); - ImageAction get_export_image_action() const; - - void set_export_image_shrink(float p_shrink); - float get_export_image_shrink() const; - - void set_export_image_quality(float p_quality); - float get_export_image_quality() const; - - Vector<String>& get_diff_packs() { return diff_packs; } - - void image_export_group_create(const StringName& p_name); - void image_export_group_remove(const StringName& p_name); - bool image_export_has_group(const StringName& p_name) const; - void image_export_get_groups(List<StringName> *r_name) const; - void image_export_group_set_image_action(const StringName& p_export_group,ImageAction p_action); - ImageAction image_export_group_get_image_action(const StringName& p_export_group) const; - void image_export_group_set_make_atlas(const StringName& p_export_group,bool p_make); - bool image_export_group_get_make_atlas(const StringName& p_export_group) const; - void image_export_group_set_shrink(const StringName& p_export_group,float p_amount); - float image_export_group_get_shrink(const StringName& p_export_group) const; - void image_export_group_set_lossy_quality(const StringName& p_export_group,float p_quality); - float image_export_group_get_lossy_quality(const StringName& p_export_group) const; - - void image_add_to_export_group(const StringName& p_image,const StringName& p_export_group); - StringName image_get_export_group(const StringName& p_image) const; - void image_export_get_images_in_group(const StringName& p_group, List<StringName> *r_images) const; - - Set<String>& get_image_formats() { return image_formats; } - - void script_set_action(ScriptAction p_action); - ScriptAction script_get_action() const; - - void script_set_encryption_key(const String& p_key); - String script_get_encryption_key() const; - - void sample_set_action(SampleAction p_action); - SampleAction sample_get_action() const; - - void sample_set_max_hz(int p_hz); - int sample_get_max_hz() const; - - void sample_set_trim(bool p_trim); - bool sample_get_trim() const; - - void set_convert_text_scenes(bool p_convert); - bool get_convert_text_scenes() const; - - void load_config(); - void save_config(); - - EditorImportExport(); - ~EditorImportExport(); -}; - -VARIANT_ENUM_CAST(EditorImportExport::FileAction); -VARIANT_ENUM_CAST(EditorImportExport::ExportFilter); -VARIANT_ENUM_CAST(EditorImportExport::ImageAction); -VARIANT_ENUM_CAST(EditorImportExport::ScriptAction); -VARIANT_ENUM_CAST(EditorImportExport::SampleAction); - -#endif -#endif // EDITOR_IMPORT_EXPORT_H diff --git a/tools/editor/import/resource_importer_csv_translation.h b/tools/editor/import/resource_importer_csv_translation.h deleted file mode 100644 index d08218e7d9..0000000000 --- a/tools/editor/import/resource_importer_csv_translation.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef RESOURCEIMPORTERCSVTRANSLATION_H -#define RESOURCEIMPORTERCSVTRANSLATION_H - -#include "io/resource_import.h" - - -class ResourceImporterCSVTranslation : public ResourceImporter { - GDCLASS(ResourceImporterCSVTranslation,ResourceImporter) -public: - virtual String get_importer_name() const; - virtual String get_visible_name() const; - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual String get_save_extension() const; - virtual String get_resource_type() const; - - virtual int get_preset_count() const; - virtual String get_preset_name(int p_idx) const; - - virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; - virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; - - virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); - - ResourceImporterCSVTranslation(); -}; - -#endif // RESOURCEIMPORTERCSVTRANSLATION_H diff --git a/tools/editor/import/resource_importer_obj.h b/tools/editor/import/resource_importer_obj.h deleted file mode 100644 index d2a3c4fddd..0000000000 --- a/tools/editor/import/resource_importer_obj.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef RESOURCEIMPORTEROBJ_H -#define RESOURCEIMPORTEROBJ_H - - -#include "io/resource_import.h" - -class ResourceImporterOBJ : public ResourceImporter { - GDCLASS(ResourceImporterOBJ,ResourceImporter) -public: - virtual String get_importer_name() const; - virtual String get_visible_name() const; - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual String get_save_extension() const; - virtual String get_resource_type() const; - - virtual int get_preset_count() const; - virtual String get_preset_name(int p_idx) const; - - virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; - virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; - - virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); - - ResourceImporterOBJ(); -}; - - -#endif // RESOURCEIMPORTEROBJ_H diff --git a/tools/editor/import/resource_importer_texture.h b/tools/editor/import/resource_importer_texture.h deleted file mode 100644 index 4c795e132c..0000000000 --- a/tools/editor/import/resource_importer_texture.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef RESOURCEIMPORTTEXTURE_H -#define RESOURCEIMPORTTEXTURE_H - -#include "io/resource_import.h" -class StreamTexture; - -class ResourceImporterTexture : public ResourceImporter { - GDCLASS(ResourceImporterTexture,ResourceImporter) - - - -protected: - - enum { - MAKE_3D_FLAG=1, - MAKE_SRGB_FLAG=2 - }; - - Mutex *mutex; - Map<StringName,int> make_flags; - - static void _texture_reimport_srgb(const Ref<StreamTexture>& p_tex); - static void _texture_reimport_3d(const Ref<StreamTexture>& p_tex); - - - - - static ResourceImporterTexture *singleton; -public: - - static ResourceImporterTexture *get_singleton() { return singleton; } - virtual String get_importer_name() const; - virtual String get_visible_name() const; - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual String get_save_extension() const; - virtual String get_resource_type() const; - - - enum Preset { - PRESET_DETECT, - PRESET_2D, - PRESET_2D_PIXEL, - PRESET_3D, - }; - - enum CompressMode { - COMPRESS_LOSSLESS, - COMPRESS_LOSSY, - COMPRESS_VIDEO_RAM, - COMPRESS_UNCOMPRESSED - }; - - virtual int get_preset_count() const; - virtual String get_preset_name(int p_idx) const; - - virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; - virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; - - void _save_stex(const Image& p_image, const String& p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable,bool p_detect_3d,bool p_detect_srgb); - - virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); - - - void update_imports(); - - ResourceImporterTexture(); - ~ResourceImporterTexture(); -}; - -#endif // RESOURCEIMPORTTEXTURE_H diff --git a/tools/editor/import/resource_importer_wav.h b/tools/editor/import/resource_importer_wav.h deleted file mode 100644 index 9f1bd57da7..0000000000 --- a/tools/editor/import/resource_importer_wav.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef RESOURCEIMPORTWAV_H -#define RESOURCEIMPORTWAV_H - - -#include "io/resource_import.h" - -class ResourceImporterWAV : public ResourceImporter { - GDCLASS(ResourceImporterWAV,ResourceImporter) -public: - virtual String get_importer_name() const; - virtual String get_visible_name() const; - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual String get_save_extension() const; - virtual String get_resource_type() const; - - - virtual int get_preset_count() const; - virtual String get_preset_name(int p_idx) const; - - virtual void get_import_options(List<ImportOption> *r_options,int p_preset=0) const; - virtual bool get_option_visibility(const String& p_option,const Map<StringName,Variant>& p_options) const; - - void _compress_ima_adpcm(const Vector<float>& p_data,PoolVector<uint8_t>& dst_data); - - virtual Error import(const String& p_source_file,const String& p_save_path,const Map<StringName,Variant>& p_options,List<String>* r_platform_variants,List<String>* r_gen_files=NULL); - - ResourceImporterWAV(); -}; - -#endif // RESOURCEIMPORTWAV_H diff --git a/tools/editor/import_dock.h b/tools/editor/import_dock.h deleted file mode 100644 index bddf5480b8..0000000000 --- a/tools/editor/import_dock.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef IMPORTDOCK_H -#define IMPORTDOCK_H - -#include "io/resource_import.h" -#include "editor_file_system.h" -#include "scene/gui/box_container.h" -#include "scene/gui/option_button.h" -#include "scene/gui/popup_menu.h" -#include "property_editor.h" - -class ImportDockParameters; -class ImportDock : public VBoxContainer { - GDCLASS(ImportDock,VBoxContainer) - - LineEdit *imported; - OptionButton *import_as; - MenuButton *preset; - PropertyEditor *import_opts; - - List<PropertyInfo> properties; - Map<StringName,Variant> property_values; - - Button *import; - - ImportDockParameters *params; - - void _preset_selected(int p_idx); - - void _reimport(); -protected: - static void _bind_methods(); -public: - - void set_edit_path(const String& p_path); - void set_edit_multiple_paths(const Vector<String>& p_paths); - void clear(); - - ImportDock(); - ~ImportDock(); -}; - -#endif // IMPORTDOCK_H diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp deleted file mode 100644 index 2fa62df5bc..0000000000 --- a/tools/editor/project_export.cpp +++ /dev/null @@ -1,2130 +0,0 @@ -/*************************************************************************/ -/* project_export.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan 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 "project_export.h" -#if 0 -#include "os/dir_access.h" -#include "os/file_access.h" -#include "globals.h" -#include "io/resource_loader.h" -#include "io/resource_saver.h" -#include "os/os.h" -#include "scene/gui/box_container.h" -#include "scene/gui/tab_container.h" -#include "scene/gui/scroll_container.h" -#include "editor_data.h" -#include "io/image_loader.h" -#include "compressed_translation.h" -#include "editor_node.h" -#include "io_plugins/editor_texture_import_plugin.h" -#include "editor_settings.h" - -const char *ProjectExportDialog::da_string[ProjectExportDialog::ACTION_MAX]={ - "", - "Copy", - "Bundle" -}; - -bool ProjectExportDialog::_create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir) { - - TreeItem *item = tree->create_item(p_parent); - item->set_text(0,p_dir->get_name()+"/"); - item->set_icon(0,get_icon("Folder","EditorIcons")); - - - bool has_items=false; - - for(int i=0;i<p_dir->get_subdir_count();i++) { - - if (_create_tree(item,p_dir->get_subdir(i))) - has_items=true; - } - - //int cc = p_options.get_slice_count(","); - - for (int i=0;i<p_dir->get_file_count();i++) { - - TreeItem *fitem = tree->create_item(item); - //fitem->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); - //fitem->set_editable(0,true); - //fitem->set_checked(0,isfave); - fitem->set_text(0,p_dir->get_file(i)); - String path = p_dir->get_file_path(i); - fitem->set_tooltip(0,path); - fitem->set_metadata(0,path); - Ref<Texture> icon = get_icon( (has_icon(p_dir->get_file_type(i),ei)?p_dir->get_file_type(i):ot),ei); - fitem->set_icon(0,icon); - - fitem->set_cell_mode(1,TreeItem::CELL_MODE_RANGE); - fitem->set_range_config(1,0,2,1); - fitem->set_text(1,expopt); - fitem->set_editable(1,true); - - EditorImportExport::FileAction fa = EditorImportExport::get_singleton()->get_export_file_action(path); - fitem->set_range(1,fa); - - has_items=true; - - } - - if (!has_items) { - - memdelete(item); - return false; - - } - - return true; -} - - -void ProjectExportDialog::_tree_changed() { - - TreeItem *t=tree->get_selected(); - if (!t) - return; - - String selected = t->get_metadata(0); - - EditorImportExport::get_singleton()->set_export_file_action(selected,EditorImportExport::FileAction(int(t->get_range(1)))); - _save_export_cfg(); - - //editor->save_import_export(true); - //EditorImportDB::get_singleton()->save_settings(); - -} - -void ProjectExportDialog::popup_export() { - popup_centered_ratio(); - if (pending_update_tree) { - _update_tree(); - _update_group_tree(); - pending_update_tree=false; - } -} - -void ProjectExportDialog::_update_tree() { - - - - updating_tree=true; - tree->clear(); - EditorFileSystemDirectory *efsd = EditorFileSystem::get_singleton()->get_filesystem(); - - if (efsd) { - _create_tree(NULL,efsd); - } - - updating_tree=false; -} - - - - -void ProjectExportDialog::_update_platform() { - - _validate_platform(); - TreeItem *selected = platforms->get_selected(); - if (!selected) - return; - - String platform = selected->get_metadata(0); - Ref<EditorExportPlatform> exporter = EditorImportExport::get_singleton()->get_export_platform(platform); - platform_options->edit( exporter.ptr() ); -} - -void ProjectExportDialog::_platform_selected() { - - String p =platforms->get_selected()->get_metadata(0); - _update_platform(); - //editor->save_import_export(); - //EditorFileSystem::get_singleton()->scan(); - -} - -void ProjectExportDialog::_scan_finished() { - -/* print_line("**********SCAN DONEEE********"); - print_line("**********SCAN DONEEE********"); - print_line("**********SCAN DONEEE********"); - print_line("**********SCAN DONEEE********");*/ - - if (!is_visible_in_tree()) { - pending_update_tree=true; - return; - } - - _update_tree(); - _update_group_tree(); -} - -void ProjectExportDialog::_rescan() { - - EditorFileSystem::get_singleton()->scan(); - -} - -void ProjectExportDialog::_update_exporter() { - - -} - - -void ProjectExportDialog::_save_export_cfg() { - - EditorImportExport::get_singleton()->save_config(); -} - -void ProjectExportDialog::_prop_edited(String what) { - - _save_export_cfg(); - - _validate_platform(); - -} - -void ProjectExportDialog::_filters_edited(String what) { - - EditorImportExport::get_singleton()->set_export_custom_filter(what); - _save_export_cfg(); -} - -void ProjectExportDialog::_filters_exclude_edited(String what) { - EditorImportExport::get_singleton()->set_export_custom_filter_exclude(what); - _save_export_cfg(); -} - -void ProjectExportDialog::_quality_edited(float what) { - - EditorImportExport::get_singleton()->set_export_image_quality(what); - _save_export_cfg(); -} - -void ProjectExportDialog::_shrink_edited(float what) { - - EditorImportExport::get_singleton()->set_export_image_shrink(what); - _save_export_cfg(); -} - -void ProjectExportDialog::_image_export_edited(int what) { - - EditorImportExport::get_singleton()->set_export_image_action(EditorImportExport::ImageAction(what)); - _save_export_cfg(); -} - -void ProjectExportDialog::_format_toggled() { - - EditorImportExport::get_singleton()->get_image_formats().clear(); - - for(int i=0;i<formats.size();i++) { - if (formats[i]->is_checked(0)) - EditorImportExport::get_singleton()->get_image_formats().insert( formats[i]->get_text(0)); - - } - _save_export_cfg(); -} - - -void ProjectExportDialog::_script_edited(Variant v) { - - if (updating_script) - return; - updating_script=true; - EditorNode::get_undo_redo()->create_action(TTR("Edit Script Options")); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"script_set_action",script_mode->get_selected()); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"script_set_action",EditorImportExport::get_singleton()->script_get_action()); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"script_set_encryption_key",script_key->get_text()); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"script_set_encryption_key",EditorImportExport::get_singleton()->script_get_encryption_key()); - EditorNode::get_undo_redo()->add_do_method(this,"_update_script"); - EditorNode::get_undo_redo()->add_undo_method(this,"_update_script"); - EditorNode::get_undo_redo()->add_do_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->add_undo_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->commit_action(); - updating_script=false; - - -} - -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_value() ); - EditorImportExport::get_singleton()->sample_set_trim( sample_trim->is_pressed() ); - _save_export_cfg(); - -} - -void ProjectExportDialog::_notification(int p_what) { - - switch(p_what) { - - case NOTIFICATION_ENTER_TREE: { - - - CenterContainer *cc = memnew( CenterContainer ); - TextureRect *tf = memnew( TextureRect); - tf->set_texture(get_icon("ErrorSign","EditorIcons")); - cc->add_child(tf); - plat_errors->add_child(cc); - platform_error_string->raise(); - - TreeItem *root = platforms->create_item(NULL); - List<StringName> ep; - EditorImportExport::get_singleton()->get_export_platforms(&ep); - ep.sort_custom<StringName::AlphCompare>(); - - for(List<StringName>::Element *E=ep.front();E;E=E->next()) { - - - Ref<EditorExportPlatform> eep = EditorImportExport::get_singleton()->get_export_platform(E->get()); - TreeItem *p = platforms->create_item(root); - p->set_text(0,eep->get_name()); - p->set_icon(0,eep->get_logo()); - p->set_metadata(0,eep->get_name()); - if (eep->get_name()==OS::get_singleton()->get_name()) - p->select(0); - - } - - EditorFileSystem::get_singleton()->connect("filesystem_changed",this,"_scan_finished"); - //_rescan(); - _update_platform(); - export_mode->select( EditorImportExport::get_singleton()->get_export_filter() ); - convert_text_scenes->set_pressed( EditorImportExport::get_singleton()->get_convert_text_scenes() ); - filters->set_text( EditorImportExport::get_singleton()->get_export_custom_filter() ); - filters_exclude->set_text( EditorImportExport::get_singleton()->get_export_custom_filter_exclude() ); - if (EditorImportExport::get_singleton()->get_export_filter()!=EditorImportExport::EXPORT_SELECTED) - tree_vb->hide(); - else - tree_vb->show(); - - image_action->select(EditorImportExport::get_singleton()->get_export_image_action()); - image_quality->set_value(EditorImportExport::get_singleton()->get_export_image_quality()); - image_shrink->set_value(EditorImportExport::get_singleton()->get_export_image_shrink()); - _update_script(); - - - image_quality->connect("value_changed",this,"_quality_edited"); - image_shrink->connect("value_changed",this,"_shrink_edited"); - image_action->connect("item_selected",this,"_image_export_edited"); - - script_mode->connect("item_selected",this,"_script_edited"); - script_key->connect("text_changed",this,"_script_edited"); - - for(int i=0;i<formats.size();i++) { - if (EditorImportExport::get_singleton()->get_image_formats().has(formats[i]->get_text(0))) - formats[i]->set_checked(0,true); - } - image_formats->connect("item_edited",this,"_format_toggled"); - group_add->set_icon(get_icon("Add","EditorIcons")); - //group_del->set_icon(get_icon("Del","EditorIcons")); - - _update_group_list(); - _update_group(); - _update_group_tree(); - - sample_mode->select( EditorImportExport::get_singleton()->sample_get_action() ); - sample_max_hz->set_value( EditorImportExport::get_singleton()->sample_get_max_hz() ); - sample_trim->set_pressed( EditorImportExport::get_singleton()->sample_get_trim() ); - - sample_mode->connect("item_selected",this,"_sample_convert_edited"); - sample_max_hz->connect("value_changed",this,"_sample_convert_edited"); - sample_trim->connect("toggled",this,"_sample_convert_edited"); - - - } break; - case NOTIFICATION_EXIT_TREE: { - - } break; - case MainLoop::NOTIFICATION_WM_FOCUS_IN: { - //something may have changed - _validate_platform(); - - } break; - case NOTIFICATION_VISIBILITY_CHANGED: { - if (is_visible_in_tree()) - _validate_platform(); - - } break; - case NOTIFICATION_PROCESS: { - - } break; - } - -} - - -void ProjectExportDialog::_validate_platform() { - - get_ok()->set_disabled(true); - button_export->set_disabled(true); - TreeItem *selected = platforms->get_selected(); - plat_errors->hide(); - if (!selected) { - return; - } - - String platform = selected->get_metadata(0); - Ref<EditorExportPlatform> exporter = EditorImportExport::get_singleton()->get_export_platform(platform); - if (!exporter.is_valid()) { - return; - } - - String err; - if (!exporter->can_export(&err)) { - Vector<String> items = err.strip_edges().split("\n"); - err=""; - for(int i=0;i<items.size();i++) { - if (i!=0) - err+="\n"; - err+=" -"+items[i]; - } - - platform_error_string->set_text(err); - plat_errors->show(); - return; - } - - List<String> pl; - EditorFileSystem::get_singleton()->get_changed_sources(&pl); - - if (false && pl.size()) { - if (pl.size()==1) - platform_error_string->set_text(" -One Resource is pending re-import."); - else - platform_error_string->set_text(" "+itos(pl.size())+" Resources are pending re-import."); - - plat_errors->show(); - return; - } - - get_ok()->set_disabled(false); - button_export->set_disabled(false); - -} - -void ProjectExportDialog::_export_mode_changed(int p_idx) { - - if (EditorImportExport::get_singleton()->get_export_filter()==p_idx) - return; - EditorImportExport::get_singleton()->set_export_filter(EditorImportExport::ExportFilter(p_idx)); - - if (p_idx!=EditorImportExport::EXPORT_SELECTED) - tree_vb->hide(); - else - tree_vb->show(); - - EditorImportExport::get_singleton()->set_convert_text_scenes( convert_text_scenes->is_pressed() ); - - _save_export_cfg(); - -} - -void ProjectExportDialog::_export_action(const String& p_file) { - - String location = GlobalConfig::get_singleton()->globalize_path(p_file).get_base_dir().replace("\\","/"); - - while(true) { - - print_line("TESTING: "+location.plus_file("godot.cfg")); - if (FileAccess::exists(location.plus_file("godot.cfg"))) { - - error->set_text(TTR("Please export outside the project folder!")); - error->popup_centered_minsize(); - return; - } - String nl = (location+"/..").simplify_path(); - if (nl.find("/")==location.find_last("/")) - break; - location=nl; - } - - /* Checked if the export location is outside the project directory, - * now will check if a file name has been entered */ - if (p_file.ends_with("/")) { - - error->set_text("Please enter a file name!"); - error->popup_centered_minsize(); - return; - } - - TreeItem *selected = platforms->get_selected(); - if (!selected) - return; - - String platform = selected->get_metadata(0); - bool debugging_enabled = EditorImportExport::get_singleton()->get_export_platform(platform)->is_debugging_enabled(); - Error err = export_platform(platform,p_file,debugging_enabled,file_export_password->get_text(),false); - if (err!=OK) { - error->set_text(TTR("Error exporting project!")); - error->popup_centered_minsize(); - } - -} - -void ProjectExportDialog::_export_action_pck(const String& p_file) { - - TreeItem *selected = platforms->get_selected(); - if (!selected) - return; - - Ref<EditorExportPlatform> exporter = EditorImportExport::get_singleton()->get_export_platform(selected->get_metadata(0)); - if (exporter.is_null()) { - ERR_PRINT("Invalid platform for export of PCK"); - return; - } - - if (p_file.ends_with(".pck")) { - FileAccess *f = FileAccess::open(p_file,FileAccess::WRITE); - if (!f) { - error->set_text(TTR("Error writing the project PCK!")); - error->popup_centered_minsize(); - } - ERR_FAIL_COND(!f); - - Error err = exporter->save_pack(f,false); - memdelete(f); - - if (err!=OK) { - error->set_text(TTR("Error exporting project!")); - error->popup_centered_minsize(); - return; - } - } else if (p_file.ends_with(".zip")) { - - Error err = exporter->save_zip(p_file,false); - - if (err!=OK) { - error->set_text(TTR("Error exporting project!")); - error->popup_centered_minsize(); - return; - } - } -} - - -Error ProjectExportDialog::export_platform(const String& p_platform, const String& p_path, bool p_debug,const String& p_password, bool p_quit_after) { - - Ref<EditorExportPlatform> exporter = EditorImportExport::get_singleton()->get_export_platform(p_platform); - if (exporter.is_null()) { - ERR_PRINT("Invalid platform for export"); - - List<StringName> platforms; - EditorImportExport::get_singleton()->get_export_platforms(&platforms); - print_line("Valid export plaftorms are:"); - for (List<StringName>::Element *E=platforms.front();E;E=E->next()) - print_line(" \""+E->get()+"\""); - - if (p_quit_after) { - OS::get_singleton()->set_exit_code(255); - get_tree()->quit(); - } - - return ERR_INVALID_PARAMETER; - } - Error err = exporter->export_project(p_path,p_debug); - if (err!=OK) { - error->set_text(TTR("Error exporting project!")); - error->popup_centered_minsize(); - ERR_PRINT("Exporting failed!"); - if (p_quit_after) { - OS::get_singleton()->set_exit_code(255); - get_tree()->quit(); - } - return ERR_CANT_CREATE; - } else { - if (p_quit_after) { - get_tree()->quit(); - } - } - - return OK; - -} - -void ProjectExportDialog::ok_pressed() { - //export pck - pck_export->popup_centered_ratio(); - -} -void ProjectExportDialog::custom_action(const String&) { - //real export - - TreeItem *selected = platforms->get_selected(); - if (!selected) - return; - - String platform = selected->get_metadata(0); - Ref<EditorExportPlatform> exporter = EditorImportExport::get_singleton()->get_export_platform(platform); - - if (exporter.is_null()) { - error->set_text(vformat(TTR("No exporter for platform '%s' yet."),platform)); - error->popup_centered_minsize(); - return; - } - - if (platform.to_lower()=="android" && _check_android_setting(exporter)==false){ - // not filled all field for Android release - return; - } - - String extension = exporter->get_binary_extension(); - - file_export_password->set_editable( exporter->requires_password(exporter->is_debugging_enabled()) ); - - file_export->clear_filters(); - if (extension!="") { - file_export->add_filter("*."+extension); - } - file_export->popup_centered_ratio(); - - -} - -LineEdit* ProjectExportDialog::_create_keystore_input(Control* container, const String& p_label, const String& name) { - - HBoxContainer* hb=memnew(HBoxContainer); - Label* lb=memnew(Label); - LineEdit* input=memnew(LineEdit); - - lb->set_text(p_label); - lb->set_custom_minimum_size(Size2(140*EDSCALE,0)); - lb->set_align(Label::ALIGN_RIGHT); - - input->set_custom_minimum_size(Size2(170*EDSCALE,0)); - input->set_name(name); - - hb->add_constant_override("separation", 10*EDSCALE); - hb->add_child(lb); - hb->add_child(input); - container->add_child(hb); - - return input; - -} - -void ProjectExportDialog::_create_android_keystore_window() { - - keystore_file_dialog = memnew( EditorFileDialog ); - add_child(keystore_file_dialog); - keystore_file_dialog->set_mode(EditorFileDialog::MODE_OPEN_DIR); - keystore_file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - keystore_file_dialog->set_current_dir( "res://" ); - - keystore_file_dialog->set_title(TTR("Target Path:")); - keystore_file_dialog->connect("dir_selected", this,"_keystore_dir_selected"); - - keystore_create_dialog=memnew(ConfirmationDialog); - VBoxContainer* vb=memnew(VBoxContainer); - vb->set_size(Size2(340*EDSCALE,0)); - keystore_create_dialog->set_title(TTR("Create Android keystore")); - - _create_keystore_input(vb, TTR("Full name"), "name"); - _create_keystore_input(vb, TTR("Organizational unit"), "unit"); - _create_keystore_input(vb, TTR("Organization"), "org"); - _create_keystore_input(vb, TTR("City"), "city"); - _create_keystore_input(vb, TTR("State"), "state"); - _create_keystore_input(vb, TTR("2 letter country code"), "code"); - _create_keystore_input(vb, TTR("User alias"), "alias"); - LineEdit* pass=_create_keystore_input(vb, TTR("Password"), "pass"); - pass->set_placeholder(TTR("at least 6 characters")); - _create_keystore_input(vb, TTR("File name"), "file"); - - Label* lb_path=memnew(Label); - LineEdit* path=memnew(LineEdit); - Button* btn=memnew(Button); - HBoxContainer* hb=memnew(HBoxContainer); - - lb_path->set_text(TTR("Path : (better to save outside of project)")); - path->set_h_size_flags(SIZE_EXPAND_FILL); - path->set_name("path"); - btn->set_text(" .. "); - btn->connect("pressed", keystore_file_dialog, "popup_centered_ratio"); - - vb->add_spacer(); - vb->add_child(lb_path); - hb->add_child(path); - hb->add_child(btn); - vb->add_child(hb); - - keystore_create_dialog->add_child(vb); - //keystore_create_dialog->set_child_rect(vb); - add_child(keystore_create_dialog); - - keystore_create_dialog->connect("confirmed", this, "_create_android_keystore"); - path->connect("text_changed", this, "_check_keystore_path"); - - confirm_keystore = memnew(ConfirmationDialog); - confirm_keystore->connect("confirmed", keystore_create_dialog, "popup_centered_minsize"); - add_child(confirm_keystore); - -} - -void ProjectExportDialog::_keystore_dir_selected(const String& path) { - - LineEdit* edit=keystore_create_dialog->find_node("path", true, false)->cast_to<LineEdit>(); - edit->set_text(path.simplify_path()); - -} - -void ProjectExportDialog::_keystore_created() { - - if (error->is_connected("popup_hide", this, "_keystore_created")){ - error->disconnect("popup_hide", this, "_keystore_created"); - } - custom_action("export_pck"); - -} - -void ProjectExportDialog::_check_keystore_path(const String& path) { - - LineEdit* edit=keystore_create_dialog->find_node("path", true, false)->cast_to<LineEdit>(); - bool exists = DirAccess::exists(path); - if (!exists) { - edit->add_color_override("font_color", Color(1,0,0,1)); - } else { - edit->add_color_override("font_color", Color(0,1,0,1)); - } - -} - -void ProjectExportDialog::_create_android_keystore() { - - Vector<String> names=String("name,unit,org,city,state,code,alias,pass").split(","); - String path=keystore_create_dialog->find_node("path", true, false)->cast_to<LineEdit>()->get_text(); - String file=keystore_create_dialog->find_node("file", true, false)->cast_to<LineEdit>()->get_text(); - - if (file.ends_with(".keystore")==false) { - file+=".keystore"; - } - String fullpath=path.plus_file(file); - String info="CN=$name, OU=$unit, O=$org, L=$city, S=$state, C=$code"; - Dictionary dic; - - for (int i=0;i<names.size();i++){ - LineEdit* edit = keystore_create_dialog->find_node(names[i], true, false)->cast_to<LineEdit>(); - dic[names[i]]=edit->get_text(); - info=info.replace("$"+names[i], edit->get_text()); - } - - String jarsigner=EditorSettings::get_singleton()->get("export/android/jarsigner"); - String keytool=jarsigner.get_base_dir().plus_file("keytool"); - String os_name=OS::get_singleton()->get_name(); - if (os_name.to_lower()=="windows") { - keytool+=".exe"; - } - - bool exist=FileAccess::exists(keytool); - if (!exist) { - error->set_text("Can't find 'keytool'"); - error->popup_centered_minsize(); - return; - } - - List<String> args; - args.push_back("-genkey"); - args.push_back("-v"); - args.push_back("-keystore"); - args.push_back(fullpath); - args.push_back("-alias"); - args.push_back(dic["alias"]); - args.push_back("-storepass"); - args.push_back(dic["pass"]); - args.push_back("-keypass"); - args.push_back(dic["pass"]); - args.push_back("-keyalg"); - args.push_back("RSA"); - args.push_back("-keysize"); - args.push_back("2048"); - args.push_back("-validity"); - args.push_back("10000"); - args.push_back("-dname"); - args.push_back(info); - int retval; - OS::get_singleton()->execute(keytool,args,true,NULL,NULL,&retval); - - if (retval==0) { // success - platform_options->_edit_set("keystore/release", fullpath); - platform_options->_edit_set("keystore/release_user", dic["alias"]); - platform_options->_edit_set("keystore/release_password", dic["pass"]); - - error->set_text("Android keystore created at \n"+fullpath); - error->connect("popup_hide", this, "_keystore_created"); - error->popup_centered_minsize(); - } else { // fail - error->set_text("Fail to create android keystore at \n"+fullpath); - error->popup_centered_minsize(); - } - -} - -bool ProjectExportDialog::_check_android_setting(const Ref<EditorExportPlatform>& exporter) { - - bool is_debugging = exporter->get("debug/debugging_enabled"); - String release = exporter->get("keystore/release"); - String user = exporter->get("keystore/release_user"); - String password = exporter->get("keystore/release_password"); - - if (!is_debugging && (release=="" || user=="" || password=="")){ - if (release==""){ - confirm_keystore->set_text(TTR("Release keystore is not set.\nDo you want to create one?")); - confirm_keystore->popup_centered_minsize(); - } else { - error->set_text(TTR("Fill Keystore/Release User and Release Password")); - error->popup_centered_minsize(); - } - return false; - } - - return true; - -} - -void ProjectExportDialog::_group_selected() { - - - _update_group(); //? - - _update_group_tree(); -} - -String ProjectExportDialog::_get_selected_group() { - - TreeItem *sel = groups->get_selected(); - if (!sel) - return String(); - - return sel->get_text(0); - - -} - -void ProjectExportDialog::_update_group_list() { - - String current = _get_selected_group(); - - groups->clear(); - List<StringName> grouplist; - EditorImportExport::get_singleton()->image_export_get_groups(&grouplist); - grouplist.sort_custom<StringName::AlphCompare>(); - - TreeItem *r = groups->create_item(); - for (List<StringName>::Element *E=grouplist.front();E;E=E->next()) { - - TreeItem *ti = groups->create_item(r); - ti->set_text(0,E->get()); - ti->add_button(0,get_icon("Remove","EditorIcons")); - if (E->get()==current) { - ti->select(0); - } - } - - _update_group(); -} - -void ProjectExportDialog::_select_group(const String& p_by_name) { - - TreeItem *c = groups->get_root(); - if (!c) - return; - c=c->get_children(); - - if (!c) - return; - - while(c) { - - if (c->get_text(0)==p_by_name) { - c->select(0); - _update_group(); - return; - } - c=c->get_next(); - } -} - -void ProjectExportDialog::_update_group() { - - if (updating) - return; - updating=true; - - - if (_get_selected_group()=="") { - group_options->hide(); - //group_del->set_disabled(true); - - } else { - group_options->show(); - //group_del->set_disabled(false); - StringName name = _get_selected_group(); - group_image_action->select(EditorImportExport::get_singleton()->image_export_group_get_image_action(name)); - group_atlas->set_pressed(EditorImportExport::get_singleton()->image_export_group_get_make_atlas(name)); - group_shrink->set_value(EditorImportExport::get_singleton()->image_export_group_get_shrink(name)); - group_lossy_quality->set_value(EditorImportExport::get_singleton()->image_export_group_get_lossy_quality(name)); - if (group_atlas->is_pressed()) - atlas_preview->show(); - else - atlas_preview->hide(); - - } - - _update_group_tree(); - - updating=false; - - -} - -bool ProjectExportDialog::_update_group_treef(TreeItem *p_parent,EditorFileSystemDirectory *p_dir,const Set<String>& p_extensions,const String& p_groups,const Map<StringName,int>& p_group_index) { - - TreeItem *ti = group_images->create_item(p_parent); - ti->set_text(0,p_dir->get_name()+"/"); - bool has_child=false; - for(int i=0;i<p_dir->get_subdir_count();i++) { - - if (_update_group_treef(ti,p_dir->get_subdir(i),p_extensions,p_groups,p_group_index)) { - has_child=true; - } - } - - String filter=group_images_filter->get_text(); - StringName current_group = _get_selected_group(); - String check_text=TTR("Include"); - - for(int i=0;i<p_dir->get_file_count();i++) { - - String fname = p_dir->get_file(i); - if (p_extensions.has(fname.to_lower().get_extension())) { - String path = p_dir->get_file_path(i); - - if (filter!=String() && path.find(filter)==-1) - continue; - - has_child=true; - TreeItem *file = group_images->create_item(ti); - file->set_text(0,fname); - - StringName g = EditorImportExport::get_singleton()->image_get_export_group(path); - - if (current_group==g || g==StringName()) { - - file->set_cell_mode(1,TreeItem::CELL_MODE_CHECK); - file->set_text(1,check_text); - file->set_editable(1,true); - file->set_checked(1,current_group==g); - } else { - - file->set_text(1,g); - file->set_editable(1,false); - file->set_selectable(1,false); - } - - file->set_metadata(0,path); - } - } - - if (!has_child) { - memdelete(ti); - return false; - } - - return true; - -} -void ProjectExportDialog::_update_group_tree() { - - if (updating) - return; - - group_images->clear(); - - if (_get_selected_group()=="") - return; - - updating=true; - print_line("****UGT"); - List<String> img_extensions; - ImageLoader::get_recognized_extensions(&img_extensions); - Set<String> extensions; - for(List<String>::Element *E=img_extensions.front();E;E=E->next()) { - - extensions.insert(E->get()); - } - - List<StringName> grouplist; - EditorImportExport::get_singleton()->image_export_get_groups(&grouplist); - grouplist.sort_custom<StringName::AlphCompare>(); - Map<StringName,int> group_index; - group_index[StringName()]=0; - int idx=1; - String groupenum="--"; - for(List<StringName>::Element *E=grouplist.front();E;E=E->next()) { - - group_index[E->get()]=idx++; - groupenum+=","+String(E->get()); - } - - updating=false; - - - _update_group_treef(NULL,EditorFileSystem::get_singleton()->get_filesystem(),extensions,groupenum,group_index); - -} - -void ProjectExportDialog::_group_changed(Variant v) { - - if (updating) - return; - if (_get_selected_group()=="") - return; - updating=true; - StringName name = _get_selected_group(); - EditorNode::get_undo_redo()->create_action(TTR("Change Image Group")); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_image_action",name,group_image_action->get_selected()); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_make_atlas",name,group_atlas->is_pressed()); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,group_shrink->get_value()); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_lossy_quality",name,group_lossy_quality->get_value()); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_image_action",name,EditorImportExport::get_singleton()->image_export_group_get_image_action(name)); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_make_atlas",name,EditorImportExport::get_singleton()->image_export_group_get_make_atlas(name)); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,EditorImportExport::get_singleton()->image_export_group_get_shrink(name)); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_lossy_quality",name,EditorImportExport::get_singleton()->image_export_group_get_lossy_quality(name)); - EditorNode::get_undo_redo()->add_do_method(this,"_update_group"); - EditorNode::get_undo_redo()->add_undo_method(this,"_update_group"); - EditorNode::get_undo_redo()->add_do_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->add_undo_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->commit_action(); - updating=false; - // update atlas preview button - _update_group(); -} - -void ProjectExportDialog::_group_item_edited() { - - TreeItem *item = group_images->get_edited(); - if (!item) - return; - if (_get_selected_group()==String()) - return; - - StringName path = item->get_metadata(0); - String group; - if (item->is_checked(1)) { - group=_get_selected_group(); - } else { - group=String(); - } - - print_line("changed "+path+" to group: "+group); - EditorNode::get_undo_redo()->create_action(TTR("Change Image Group")); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_add_to_export_group",path,group); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_add_to_export_group",path,EditorImportExport::get_singleton()->image_get_export_group(path)); - EditorNode::get_undo_redo()->add_undo_method(this,"_update_group_tree"); - EditorNode::get_undo_redo()->add_do_method(this,"_update_group_tree"); - EditorNode::get_undo_redo()->add_do_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->add_undo_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->commit_action(); - -} - -void ProjectExportDialog::_group_add() { - - String name = group_new_name->get_text(); - - if (name=="") { - group_new_name_error->show(); - group_new_name_error->set_text(TTR("Group name can't be empty!")); - return; - } - if (name.find("/")!=-1 || name.find(":")!=-1 || name.find(",")!=-1 || name.find("-")!=-1) { - group_new_name_error->set_text(TTR("Invalid character in group name!")); - group_new_name_error->show(); - return; - } - - if (EditorImportExport::get_singleton()->image_export_has_group(name)) { - group_new_name_error->set_text(TTR("Group name already exists!")); - group_new_name_error->show(); - return; - } - group_new_name_error->hide(); - - String current=_get_selected_group(); - - - EditorNode::get_undo_redo()->create_action(TTR("Add Image Group")); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_create",name); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_remove",name); - EditorNode::get_undo_redo()->add_do_method(this,"_update_group_list"); - EditorNode::get_undo_redo()->add_undo_method(this,"_update_group_list"); - EditorNode::get_undo_redo()->add_do_method(this,"_select_group",name); - if (current!="") - EditorNode::get_undo_redo()->add_undo_method(this,"_select_group",current); - - EditorNode::get_undo_redo()->add_undo_method(this,"_update_group_tree"); - EditorNode::get_undo_redo()->add_do_method(this,"_update_group_tree"); - EditorNode::get_undo_redo()->add_do_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->add_undo_method(this,"_save_export_cfg"); - - EditorNode::get_undo_redo()->commit_action(); - -} - - -void ProjectExportDialog::_group_del(Object *p_item, int p_column, int p_button){ - - TreeItem *item = p_item->cast_to<TreeItem>(); - if (!item) - return; - String name = item->get_text(0); - - EditorNode::get_undo_redo()->create_action(TTR("Delete Image Group")); - List<StringName> images_used; - EditorImportExport::get_singleton()->image_export_get_images_in_group(name,&images_used); - for (List<StringName>::Element*E=images_used.front();E;E=E->next()) { - - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_add_to_export_group",E->get(),StringName()); - - } - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_remove",name); - - - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_create",name); - for (List<StringName>::Element*E=images_used.front();E;E=E->next()) { - - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_add_to_export_group",E->get(),name); - - } - - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_image_action",name,EditorImportExport::get_singleton()->image_export_group_get_image_action(name)); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_make_atlas",name,EditorImportExport::get_singleton()->image_export_group_get_make_atlas(name)); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,EditorImportExport::get_singleton()->image_export_group_get_shrink(name)); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_lossy_quality",name,EditorImportExport::get_singleton()->image_export_group_get_lossy_quality(name)); - - EditorNode::get_undo_redo()->add_do_method(this,"_update_group_list"); - EditorNode::get_undo_redo()->add_do_method(this,"_update_group"); - EditorNode::get_undo_redo()->add_undo_method(this,"_update_group_list"); - EditorNode::get_undo_redo()->add_undo_method(this,"_select_group",name); - - EditorNode::get_undo_redo()->add_do_method(this,"_update_group_tree"); - EditorNode::get_undo_redo()->add_undo_method(this,"_update_group_tree"); - EditorNode::get_undo_redo()->add_do_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->add_undo_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->commit_action(); - -} - -void ProjectExportDialog::_group_select_all() { - - - String group = _get_selected_group(); - if (group=="") - return; - - TreeItem *item = group_images->get_root(); - if (!item) - return; - - List<StringName> items; - while(item) { - - if (item->get_cell_mode(1)==TreeItem::CELL_MODE_CHECK && !item->is_checked(1)) - items.push_back(item->get_metadata(0)); - item=item->get_next_visible(); - } - - - if (items.size()==0) - return; - - EditorNode::get_undo_redo()->create_action(TTR("Select All")); - - for (List<StringName>::Element *E=items.front();E;E=E->next()) { - - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_add_to_export_group",E->get(),group); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_add_to_export_group",E->get(),String()); - - } - EditorNode::get_undo_redo()->add_do_method(this,"_update_group_tree"); - EditorNode::get_undo_redo()->add_undo_method(this,"_update_group_tree"); - EditorNode::get_undo_redo()->add_do_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->add_undo_method(this,"_save_export_cfg"); - - EditorNode::get_undo_redo()->commit_action(); - -} - -void ProjectExportDialog::_group_select_none(){ - - String group = _get_selected_group(); - if (group=="") - return; - - TreeItem *item = group_images->get_root(); - if (!item) - return; - - List<StringName> items; - while(item) { - - if (item->get_cell_mode(1)==TreeItem::CELL_MODE_CHECK && item->is_checked(1)) - items.push_back(item->get_metadata(0)); - item=item->get_next_visible(); - } - - - if (items.size()==0) - return; - - EditorNode::get_undo_redo()->create_action(TTR("Select All")); - - for (List<StringName>::Element *E=items.front();E;E=E->next()) { - - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_add_to_export_group",E->get(),String()); - EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_add_to_export_group",E->get(),group); - - } - EditorNode::get_undo_redo()->add_do_method(this,"_update_group_tree"); - EditorNode::get_undo_redo()->add_undo_method(this,"_update_group_tree"); - EditorNode::get_undo_redo()->add_do_method(this,"_save_export_cfg"); - EditorNode::get_undo_redo()->add_undo_method(this,"_save_export_cfg"); - - EditorNode::get_undo_redo()->commit_action(); - -} - -void ProjectExportDialog::_group_atlas_preview() { - - StringName group = _get_selected_group(); - if (!group) - return; - - atlas_preview_frame->set_texture(Ref<Texture>()); //clear previous - - List<StringName> images; - EditorImportExport::get_singleton()->image_export_get_images_in_group(group,&images); - images.sort_custom<StringName::AlphCompare>(); - - String dst_file = EditorSettings::get_singleton()->get_settings_path()+"/tmp/atlas-preview.tex"; - Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata ); - //imd->set_editor(); - - for (List<StringName>::Element *F=images.front();F;F=F->next()) { - - imd->add_source(EditorImportPlugin::validate_source_path(F->get())); - } - - - int flags=0; - - if (GlobalConfig::get_singleton()->get("image_loader/filter")) - flags|=EditorTextureImportPlugin::IMAGE_FLAG_FILTER; - if (!GlobalConfig::get_singleton()->get("image_loader/gen_mipmaps")) - flags|=EditorTextureImportPlugin::IMAGE_FLAG_NO_MIPMAPS; - if (!GlobalConfig::get_singleton()->get("image_loader/repeat")) - flags|=EditorTextureImportPlugin::IMAGE_FLAG_REPEAT; - - flags|=EditorTextureImportPlugin::IMAGE_FLAG_FIX_BORDER_ALPHA; - - imd->set_option("format",EditorTextureImportPlugin::IMAGE_FORMAT_COMPRESS_DISK_LOSSLESS); - imd->set_option("flags",flags); - imd->set_option("quality",0.7); - imd->set_option("atlas",true); - imd->set_option("crop",true); - - Ref<EditorTextureImportPlugin> plugin = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture"); - Error err = plugin->import2(dst_file,imd,EditorExportPlatform::IMAGE_COMPRESSION_NONE,true); - if (err) { - - EditorNode::add_io_error(TTR("Error saving atlas:")+" "+dst_file.get_file()); - return; - } - - Ref<Texture> tex = ResourceLoader::load(dst_file); - atlas_preview_frame->set_texture(tex); //clear previous - atlas_preview_dialog->set_title(TTR("Atlas Preview")+" ("+itos(tex->get_width())+"x"+itos(tex->get_height())+")"); - atlas_preview_dialog->popup_centered_ratio(0.9); - -} - -void ProjectExportDialog::_update_script() { - - if (updating_script) - return; - updating_script=true; - script_mode->select(EditorImportExport::get_singleton()->script_get_action()); - script_key->set_text(EditorImportExport::get_singleton()->script_get_encryption_key()); - updating_script=false; - -} - -void ProjectExportDialog::_image_filter_changed(String) { - - _update_group_tree(); -} - -void ProjectExportDialog::_bind_methods() { - - - ClassDB::bind_method(_MD("_rescan"),&ProjectExportDialog::_rescan); - ClassDB::bind_method(_MD("_tree_changed"),&ProjectExportDialog::_tree_changed); - ClassDB::bind_method(_MD("_scan_finished"),&ProjectExportDialog::_scan_finished); - ClassDB::bind_method(_MD("_platform_selected"),&ProjectExportDialog::_platform_selected); - ClassDB::bind_method(_MD("_prop_edited"),&ProjectExportDialog::_prop_edited); - ClassDB::bind_method(_MD("_export_mode_changed"),&ProjectExportDialog::_export_mode_changed); - ClassDB::bind_method(_MD("_filters_edited"),&ProjectExportDialog::_filters_edited); - ClassDB::bind_method(_MD("_filters_exclude_edited"),&ProjectExportDialog::_filters_exclude_edited); - ClassDB::bind_method(_MD("_export_action"),&ProjectExportDialog::_export_action); - ClassDB::bind_method(_MD("_export_action_pck"),&ProjectExportDialog::_export_action_pck); - ClassDB::bind_method(_MD("_quality_edited"),&ProjectExportDialog::_quality_edited); - ClassDB::bind_method(_MD("_shrink_edited"),&ProjectExportDialog::_shrink_edited); - ClassDB::bind_method(_MD("_image_export_edited"),&ProjectExportDialog::_image_export_edited); - ClassDB::bind_method(_MD("_format_toggled"),&ProjectExportDialog::_format_toggled); - ClassDB::bind_method(_MD("_group_changed"),&ProjectExportDialog::_group_changed); - ClassDB::bind_method(_MD("_group_add"),&ProjectExportDialog::_group_add); - ClassDB::bind_method(_MD("_group_del"),&ProjectExportDialog::_group_del); - ClassDB::bind_method(_MD("_group_selected"),&ProjectExportDialog::_group_selected); - ClassDB::bind_method(_MD("_update_group"),&ProjectExportDialog::_update_group); - ClassDB::bind_method(_MD("_update_group_list"),&ProjectExportDialog::_update_group_list); - ClassDB::bind_method(_MD("_select_group"),&ProjectExportDialog::_select_group); - ClassDB::bind_method(_MD("_update_group_tree"),&ProjectExportDialog::_update_group_tree); - ClassDB::bind_method(_MD("_group_item_edited"),&ProjectExportDialog::_group_item_edited); - ClassDB::bind_method(_MD("_save_export_cfg"),&ProjectExportDialog::_save_export_cfg); - ClassDB::bind_method(_MD("_image_filter_changed"),&ProjectExportDialog::_image_filter_changed); - ClassDB::bind_method(_MD("_group_atlas_preview"),&ProjectExportDialog::_group_atlas_preview); - ClassDB::bind_method(_MD("_group_select_all"),&ProjectExportDialog::_group_select_all); - ClassDB::bind_method(_MD("_group_select_none"),&ProjectExportDialog::_group_select_none); - ClassDB::bind_method(_MD("_script_edited"),&ProjectExportDialog::_script_edited); - ClassDB::bind_method(_MD("_update_script"),&ProjectExportDialog::_update_script); - ClassDB::bind_method(_MD("_sample_convert_edited"),&ProjectExportDialog::_sample_convert_edited); - - - ClassDB::bind_method(_MD("export_platform"),&ProjectExportDialog::export_platform); - ClassDB::bind_method(_MD("_create_android_keystore"),&ProjectExportDialog::_create_android_keystore); - ClassDB::bind_method(_MD("_check_keystore_path"),&ProjectExportDialog::_check_keystore_path); - ClassDB::bind_method(_MD("_keystore_dir_selected"),&ProjectExportDialog::_keystore_dir_selected); - ClassDB::bind_method(_MD("_keystore_created"),&ProjectExportDialog::_keystore_created); - - - //ADD_SIGNAL(MethodInfo("instance")); - //ADD_SIGNAL(MethodInfo("open")); - -} - - -ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { - - editor=p_editor; - set_title(TTR("Project Export Settings")); - - sections = memnew( TabContainer ); - add_child(sections); - //set_child_rect(sections); - - VBoxContainer *pvbox = memnew( VBoxContainer ); - sections->add_child(pvbox); - pvbox->set_name(TTR("Target")); - - HBoxContainer *phbox = memnew( HBoxContainer ); - pvbox->add_child(phbox); - phbox->set_v_size_flags(SIZE_EXPAND_FILL); - - plat_errors = memnew( HBoxContainer ); - pvbox->add_child(plat_errors); - platform_error_string = memnew( Label ); - platform_error_string->set_h_size_flags(SIZE_EXPAND_FILL); - plat_errors->add_child(platform_error_string); - - VBoxContainer *vb = memnew( VBoxContainer ); - vb->set_h_size_flags(SIZE_EXPAND_FILL); - vb->set_v_size_flags(SIZE_EXPAND_FILL); - phbox->add_child(vb); - platforms = memnew( Tree ); - platforms->set_hide_root(true); - vb->add_margin_child(TTR("Export to Platform"),platforms,true); - - platforms->connect("cell_selected",this,"_platform_selected"); - - - vb = memnew(VBoxContainer ); - phbox->add_child(vb); - vb->set_h_size_flags(SIZE_EXPAND_FILL); - vb->set_v_size_flags(SIZE_EXPAND_FILL); - platform_options = memnew( PropertyEditor() ); - platform_options->hide_top_label(); - vb->add_margin_child(TTR("Options"),platform_options,true); - platform_options->connect("property_edited",this,"_prop_edited"); - - - - ////////////////// - - vb = memnew( VBoxContainer ); - vb->set_name(TTR("Resources")); - sections->add_child(vb); - - export_mode = memnew( OptionButton ); - export_mode->add_item(TTR("Export selected resources (including dependencies).")); - export_mode->add_item(TTR("Export all resources in the project.")); - export_mode->add_item(TTR("Export all files in the project directory.")); - export_mode->connect("item_selected",this,"_export_mode_changed"); - - vb->add_margin_child(TTR("Export Mode:"),export_mode); - - - - tree_vb = memnew( VBoxContainer ); - vb->add_child(tree_vb); - tree_vb->set_v_size_flags(SIZE_EXPAND_FILL); - - tree = memnew( Tree ); - tree_vb->add_margin_child(TTR("Resources to Export:"),tree,true); - - tree->set_v_size_flags(SIZE_EXPAND_FILL); - tree->connect("item_edited",this,"_tree_changed"); - tree->set_columns(2); - tree->set_column_titles_visible(true); - tree->set_column_title(0,TTR("File")); - tree->set_column_title(1,TTR("Action")); - tree->set_column_expand(1,false); - tree->set_column_min_width(1,90); - - filters = memnew( LineEdit ); - vb->add_margin_child(TTR("Filters to export non-resource files (comma-separated, e.g.: *.json, *.txt):"),filters); - filters->connect("text_changed",this,"_filters_edited"); - filters_exclude = memnew( LineEdit ); - vb->add_margin_child(TTR("Filters to exclude from export (comma-separated, e.g.: *.json, *.txt):"),filters_exclude); - filters_exclude->connect("text_changed",this,"_filters_exclude_edited"); - - convert_text_scenes = memnew( CheckButton ); - convert_text_scenes->set_text(TTR("Convert text scenes to binary on export.")); - vb->add_child(convert_text_scenes); - convert_text_scenes->connect("toggled",this,"_export_mode_changed"); - - image_vb = memnew( VBoxContainer ); - image_vb->set_name(TTR("Images")); - image_action = memnew( OptionButton ); - image_action->add_item(TTR("Keep Original")); - image_action->add_item(TTR("Compress for Disk (Lossy, WebP)")); - image_action->add_item(TTR("Compress for RAM (BC/PVRTC/ETC)")); - image_vb->add_margin_child(TTR("Convert Images (*.png):"),image_action); - HBoxContainer *qhb = memnew( HBoxContainer ); - image_quality = memnew( HSlider ); - qhb->add_child(image_quality); - image_quality->set_h_size_flags(SIZE_EXPAND_FILL); - SpinBox *qspin = memnew( SpinBox ); - image_quality->share(qspin); - qhb->add_child(qspin); - image_quality->set_min(0); - image_quality->set_max(1); - image_quality->set_step(0.01); - image_vb->add_margin_child(TTR("Compress for Disk (Lossy) Quality:"),qhb); - image_shrink = memnew( SpinBox ); - image_shrink->set_min(1); - image_shrink->set_max(8); - image_shrink->set_step(0.1); - image_vb->add_margin_child(TTR("Shrink All Images:"),image_shrink); - sections->add_child(image_vb); - - image_formats=memnew(Tree); - image_formats->set_hide_root(true); - TreeItem *root = image_formats->create_item(NULL); - List<String> fmts; - ImageLoader::get_recognized_extensions(&fmts); - for(List<String>::Element *E=fmts.front();E;E=E->next()) { - - TreeItem *fmt = image_formats->create_item(root); - fmt->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); - fmt->set_text(0,E->get()); - fmt->set_editable(0,true); - formats.push_back(fmt); - } - image_vb->add_margin_child(TTR("Compress Formats:")+" ",image_formats,true); - - /// groups - HBoxContainer *group_hb = memnew( HBoxContainer ); - group_hb->set_name(TTR("Image Groups")); - sections->add_child(group_hb); - VBoxContainer *group_vb_left = memnew( VBoxContainer); - group_hb->add_child(group_vb_left); - - VBoxContainer *gvb = memnew(VBoxContainer); - HBoxContainer *ghb = memnew(HBoxContainer); - gvb->add_child(ghb); - - group_new_name = memnew( LineEdit ); - group_new_name->set_h_size_flags(SIZE_EXPAND_FILL); - ghb->add_child(group_new_name); - - group_add = memnew(ToolButton); - group_add->connect("pressed",this,"_group_add"); - ghb->add_child(group_add); - - group_new_name_error = memnew( Label ); - group_new_name_error->add_color_override("font_color",Color(1,0.4,0.4)); - gvb->add_child(group_new_name_error); - group_new_name_error->hide(); - - groups=memnew(Tree); - groups->set_v_size_flags(SIZE_EXPAND_FILL); - groups->connect("cell_selected",this,"_group_selected",varray(),CONNECT_DEFERRED); - groups->connect("button_pressed",this,"_group_del",varray(),CONNECT_DEFERRED); - groups->set_hide_root(true); - gvb->add_child(groups); - - group_vb_left->add_margin_child(TTR("Groups:"),gvb,true); - //group_vb_left->add_child( memnew( HSeparator)); - group_options = memnew(VBoxContainer); - group_vb_left->add_child(group_options); - - - group_image_action = memnew(OptionButton); - group_image_action->add_item(TTR("Default")); - group_image_action->add_item(TTR("Compress Disk")); - group_image_action->add_item(TTR("Compress RAM")); - group_image_action->add_item(TTR("Keep Original")); - group_options->add_margin_child(TTR("Compress Mode:"),group_image_action); - group_image_action->connect("item_selected",this,"_group_changed"); - - group_lossy_quality = memnew( HSlider ); - group_lossy_quality->set_min(0.1); - group_lossy_quality->set_max(1.0); - group_lossy_quality->set_step(0.01); - group_lossy_quality->set_value(0.7); - group_lossy_quality->connect("value_changed",this,"_quality_edited"); - - HBoxContainer *gqhb = memnew( HBoxContainer ); - SpinBox *gqspin = memnew( SpinBox ); - group_lossy_quality->share(gqspin); - group_lossy_quality->set_h_size_flags(SIZE_EXPAND_FILL); - gqhb->add_child(group_lossy_quality); - gqhb->add_child(gqspin); - group_options->add_margin_child(TTR("Lossy Quality:"),gqhb); - - group_atlas = memnew(CheckButton); - group_atlas->set_pressed(true); - group_options->add_margin_child(TTR("Atlas:"),group_atlas); - group_atlas->connect("toggled",this,"_group_changed"); - - group_shrink = memnew(SpinBox); - group_shrink->set_min(1); - group_shrink->set_max(8); - group_shrink->set_value(1); - group_shrink->set_step(0.001); - group_options->add_margin_child(TTR("Shrink By:"),group_shrink); - group_shrink->connect("value_changed",this,"_group_changed"); - - atlas_preview = memnew( Button ); - atlas_preview->set_text(TTR("Preview Atlas")); - group_options->add_child(atlas_preview); - atlas_preview->show(); - atlas_preview->connect("pressed",this,"_group_atlas_preview"); - Control *ec = memnew(Control ); - ec->set_custom_minimum_size(Size2(150,1)); - gvb->add_child(ec); - - VBoxContainer *group_vb_right = memnew( VBoxContainer ); - group_hb->add_child(group_vb_right); - group_vb_right->set_h_size_flags(SIZE_EXPAND_FILL); - - HBoxContainer *filter_hb = memnew (HBoxContainer); - - group_images_filter = memnew( LineEdit ); - group_vb_right->add_margin_child(TTR("Image Filter:"),filter_hb); - filter_hb->add_child(group_images_filter); - group_images_filter->set_h_size_flags(SIZE_EXPAND_FILL); - group_images_filter->connect("text_changed",this,"_image_filter_changed"); - group_images = memnew( Tree ); - group_images->set_v_size_flags(SIZE_EXPAND_FILL); - group_vb_right->add_margin_child(TTR("Images:"),group_images,true); - - Button *filt_select_all = memnew( Button ); - filt_select_all->set_text(TTR("Select All")); - filter_hb->add_child(filt_select_all); - filt_select_all->connect("pressed",this,"_group_select_all"); - - Button *filt_select_none = memnew( Button ); - filt_select_none->set_text(TTR("Select None")); - filter_hb->add_child(filt_select_none); - filt_select_none->connect("pressed",this,"_group_select_none"); - - atlas_preview_dialog = memnew( AcceptDialog ); - ScrollContainer *scroll = memnew( ScrollContainer ); - atlas_preview_dialog->add_child(scroll); - //atlas_preview_dialog->set_child_rect(scroll); - atlas_preview_frame = memnew( TextureRect ); - scroll->add_child(atlas_preview_frame); - add_child(atlas_preview_dialog); - - - group_images->set_hide_root(true); - group_images->set_columns(2); - group_images->set_column_expand(0,true); - group_images->set_column_expand(1,false); - group_images->set_column_min_width(1,100); - group_images->set_column_titles_visible(true); - group_images->set_column_title(0,TTR("Images")); - group_images->set_column_title(1,TTR("Group")); - group_images->connect("item_edited",this,"_group_item_edited",varray(),CONNECT_DEFERRED); - -/* SpinBox *group_shrink; - CheckButton *group_atlas; - OptionButton *group_image_action;*/ - - -/* progress = memnew( Label ); - add_child(progress); - progress->set_area_as_parent_rect(); - progress->set_anchor_and_margin(MARGIN_TOP,Control::ANCHOR_BEGIN,25); - progress->hide(); - progress->set_align(Label::ALIGN_CENTER);*/ - -/* - button_reload = memnew( Button ); - button_reload->set_pos(Point2(3,2)); - button_reload->set_size(Point2(20,5)); - button_reload->set_flat(true); - //add_child(button_reload); - button_reload->connect("pressed",this,"_rescan"); - hbc->add_child(button_reload); -*/ - - - sample_vbox = memnew( VBoxContainer ); - sample_vbox->set_name(TTR("Samples")); - sections->add_child(sample_vbox); - sample_mode = memnew( OptionButton ); - sample_vbox->add_margin_child(TTR("Sample Conversion Mode: (.wav files):"),sample_mode); - sample_mode->add_item(TTR("Keep")); - sample_mode->add_item(TTR("Compress (RAM - IMA-ADPCM)")); - sample_max_hz = memnew( SpinBox ); - sample_max_hz->set_max(192000); - sample_max_hz->set_min(8000); - sample_vbox->add_margin_child(TTR("Sampling Rate Limit (Hz):"),sample_max_hz); - sample_trim = memnew( CheckButton ); - sample_trim->set_text(TTR("Trim")); - sample_vbox->add_margin_child(TTR("Trailing Silence:"),sample_trim); - - script_vbox = memnew( VBoxContainer ); - script_vbox->set_name(TTR("Script")); - sections->add_child(script_vbox); - script_mode = memnew( OptionButton ); - script_vbox->add_margin_child(TTR("Script Export Mode:"),script_mode); - script_mode->add_item(TTR("Text")); - script_mode->add_item(TTR("Compiled")); - script_mode->add_item(TTR("Encrypted (Provide Key Below)")); - script_key = memnew( LineEdit ); - script_vbox->add_margin_child(TTR("Script Encryption Key (256-bits as hex):"),script_key); - - - - updating=false; - - error = memnew( AcceptDialog ); - add_child(error); - - confirm = memnew( ConfirmationDialog ); - add_child(confirm); - confirm->connect("confirmed",this,"_confirmed"); - - get_ok()->set_text(TTR("Export PCK/Zip")); - - - expopt="--,Export,Bundle"; - - file_export = memnew( EditorFileDialog ); - add_child(file_export); - file_export->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - file_export->set_current_dir( EditorSettings::get_singleton()->get("filesystem/directories/default_project_export_path") ); - - file_export->set_title(TTR("Export Project")); - file_export->connect("file_selected", this,"_export_action"); - - file_export_password = memnew( LineEdit ); - file_export_password->set_secret(true); - file_export_password->set_editable(false); - file_export->get_vbox()->add_margin_child(TTR("Password:"),file_export_password); - - pck_export = memnew( EditorFileDialog ); - pck_export->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - pck_export->set_current_dir( EditorSettings::get_singleton()->get("filesystem/directories/default_project_export_path") ); - pck_export->set_title(TTR("Export Project PCK")); - pck_export->connect("file_selected", this,"_export_action_pck"); - pck_export->add_filter("*.pck ; Data Pack"); - pck_export->add_filter("*.zip ; Zip"); - add_child(pck_export); - - button_export = add_button(TTR("Export.."),!OS::get_singleton()->get_swap_ok_cancel(),"export_pck"); - updating_script=false; - - ei="EditorIcons"; - ot="Object"; - pending_update_tree=true; - - _create_android_keystore_window(); -} - - -ProjectExportDialog::~ProjectExportDialog() { - - -} - -void ProjectExport::popup_export() { - - Set<String> presets; - presets.insert("default"); - - List<PropertyInfo> pi; - GlobalConfig::get_singleton()->get_property_list(&pi); - export_preset->clear(); - - for (List<PropertyInfo>::Element *E=pi.front();E;E=E->next()) { - - if (!E->get().name.begins_with("export_presets/")) - continue; - presets.insert(E->get().name.get_slice("/",1)); - } - - for(Set<String>::Element *E=presets.front();E;E=E->next()) { - - export_preset->add_item(E->get()); - } - - - - popup_centered(Size2(300,100)); - - - -} -Error ProjectExport::export_project(const String& p_preset) { - - return OK; - -#if 0 - - String selected=p_preset; - - PoolVector<String> preset_settings = GlobalConfig::get_singleton()->get("export_presets/"+selected); - String preset_path=GlobalConfig::get_singleton()->get("export_presets_path/"+selected); - if (preset_path=="") { - - error->set_text("Export path empty, see export options"); - error->popup_centered_minsize(Size2(300,100)); - ERR_FAIL_V(ERR_INVALID_DATA); - } - - int pc=preset_settings.size(); - - DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - if (d->change_dir(preset_path)!=OK) { - - memdelete(d); - error->set_text("Can't access to export path:\n "+preset_path); - error->popup_centered_minsize(Size2(300,100)); - ERR_FAIL_V(ERR_INVALID_DATA); - } - - if (pc==0) { - memdelete(d); - return OK; - } - if (pc%3 != 0 ) { - memdelete(d); - error->set_text("Corrupted export data.."); - error->popup_centered_minsize(Size2(300,100)); - ERR_EXPLAIN("Corrupted export data..."); - ERR_FAIL_V(ERR_INVALID_DATA); - } - - Map<String,ProjectExportSettings::ItemData> export_action; - - - Map<String,Map<String,String> > remapped_paths; - - Set<String> scene_extensions; - Set<String> resource_extensions; - - { - - List<String> l; - /* - SceneLoader::get_recognized_extensions(&l); - for(List<String>::Element *E=l.front();E;E=E->next()) { - - scene_extensions.insert(E->get()); - } - */ - ResourceLoader::get_recognized_extensions_for_type("",&l); - for(List<String>::Element *E=l.front();E;E=E->next()) { - - resource_extensions.insert(E->get()); - } - } - - Vector<String> names = GlobalConfig::get_singleton()->get_optimizer_presets(); - - //prepare base paths - - for(int i=0;i<pc;i+=3) { - - - String name = preset_settings[i+0]; - String pname=preset_settings[i+1]; - String deps=preset_settings[i+2]; - int idx=1; - if (pname=="") { - pname="copy"; - } else { - - for(int j=0;j<names.size();j++) { - if (pname==names[j]) { - idx=j+2; - break; - } - } - } - - int dep_idx=0; - - for(int j=0;j<ProjectExportSettings::DA_MAX;j++) { - if (ProjectExportSettings::da_string[j]==deps) { - dep_idx=j; - break; - } - } - - if (idx>=0) { - export_action[name].action=idx; - export_action[name].depaction=dep_idx; - } - - } - - - Set<String> bundle_exceptions; - for (Map<String,ProjectExportSettings::ItemData>::Element *E=export_action.front();E;E=E->next()) { - bundle_exceptions.insert(E->key()); - } - - - { - - // find dependencies and add them to export - - Map<String,ProjectExportSettings::ItemData> dependencies; - - for (Map<String,ProjectExportSettings::ItemData>::Element *E=export_action.front();E;E=E->next()) { - - ProjectExportSettings::ItemData &id=E->get(); - - if (id.depaction!=ProjectExportSettings::DA_COPY && id.depaction!=ProjectExportSettings::DA_OPTIMIZE) - continue; //no copy or optimize, go on - List<String> deplist; - ResourceLoader::get_dependencies(E->key(),&deplist); - - while (deplist.size()) { - - String dependency = deplist.front()->get(); - deplist.pop_front(); - if (export_action.has(dependency)) - continue; //taged to export, will not override - if (dependencies.has(dependency)) { - - if (id.action <= dependencies[dependency].action ) - continue; - } - - ProjectExportSettings::ItemData depid; - if (id.depaction==ProjectExportSettings::DA_COPY || id.action==ProjectExportSettings::DA_COPY) - depid.action=ProjectExportSettings::DA_COPY; - else if (id.depaction==ProjectExportSettings::DA_OPTIMIZE) - depid.action=id.action; - depid.depaction=0; - - dependencies[dependency]=depid; - - ResourceLoader::get_dependencies(dependency,&deplist); - } - - - } - - for (Map<String,ProjectExportSettings::ItemData>::Element *E=dependencies.front();E;E=E->next()) { - export_action[E->key()]=E->get(); - } - } - - - - int idx=0; - for (Map<String,ProjectExportSettings::ItemData>::Element *E=export_action.front();E;E=E->next(),idx++) { - - - String path=E->key(); - if (E->get().action==0) - continue; //nothing to do here - String preset; - if (E->get().action==1) - preset=""; - else - preset=names[E->get().action-2]; - - print_line("Exporting "+itos(idx)+"/"+itos(export_action.size())+": "+path); - - String base_dir = GlobalConfig::get_singleton()->localize_path(path.get_base_dir()).replace("\\","/").replace("res://",""); - DirAccess *da=DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - String cwd = d->get_current_dir(); - da->change_dir(cwd); - print_line("base dir: "+base_dir); - String remap_platform="all"; - - for(int j=0;j<base_dir.get_slice_count("/");j++) { - - String p = base_dir.get_slice("/",j); - if (da->change_dir(p)!=OK) { - - Error err = da->make_dir(p); - if (err!=OK) { - memdelete(da); - memdelete(d); - ERR_EXPLAIN("Cannot make dir: "+cwd+"/"+p); - ERR_FAIL_V(ERR_CANT_CREATE); - } - - if (da->change_dir(p)!=OK) { - - memdelete(da); - memdelete(d); - ERR_EXPLAIN("Cannot change to dir: "+cwd+"/"+p); - ERR_FAIL_V(ERR_CANT_CREATE); - } - - } - - cwd=da->get_current_dir(); - } - - memdelete(da); - //cwd is the target dir - - String source_file; - - print_line("Exporting: "+source_file); - bool delete_source=false; - if (preset=="") { - //just copy! - - source_file=path; - delete_source=false; - } else { - - delete_source=true; - //create an optimized source file - - if (!GlobalConfig::get_singleton()->has("optimizer_presets/"+preset)) { - memdelete(d); - ERR_EXPLAIN("Unknown optimizer preset: "+preset); - ERR_FAIL_V(ERR_INVALID_DATA); - } - - - Dictionary dc = GlobalConfig::get_singleton()->get("optimizer_presets/"+preset); - - ERR_FAIL_COND_V(!dc.has("__type__"),ERR_INVALID_DATA); - String type=dc["__type__"]; - - Ref<EditorOptimizedSaver> saver; - - for(int i=0;i<editor_data->get_optimized_saver_count();i++) { - - if (editor_data->get_optimized_saver(i)->get_target_name()==type) { - saver=editor_data->get_optimized_saver(i); - } - } - - if (saver.is_null()) { - memdelete(d); - ERR_EXPLAIN("Preset '"+preset+"' references nonexistent saver: "+type); - ERR_FAIL_COND_V(saver.is_null(),ERR_INVALID_DATA); - } - - List<Variant> keys; - dc.get_key_list(&keys); - - saver->clear(); - - for(List<Variant>::Element *E=keys.front();E;E=E->next()) { - - saver->set(E->get(),dc[E->get()]); - } - - - remap_platform=saver->get_target_platform(); - if (remap_platform=="") - remap_platform="all"; - - - if (resource_extensions.has(path.extension().to_lower())) { - - uint32_t flags=0; - - /* - if (saver->is_bundle_scenes_enabled()) - flags|=Reso::FLAG_BUNDLE_INSTANCED_SCENES; - */ - saver->set_bundle_exceptions(NULL); - if (E->get().depaction>=ProjectExportSettings::DA_BUNDLE) { - flags|=ResourceSaver::FLAG_BUNDLE_RESOURCES; - if (E->get().depaction==ProjectExportSettings::DA_BUNDLE) - saver->set_bundle_exceptions(&bundle_exceptions); - - } - - if (saver->is_remove_editor_data_enabled()) - flags|=ResourceSaver::FLAG_OMIT_EDITOR_PROPERTIES; - if (saver->is_big_endian_data_enabled()) - flags|=ResourceSaver::FLAG_SAVE_BIG_ENDIAN; - - RES res = ResourceLoader::load(path); - - if (res.is_null()) { - - memdelete(d); - ERR_EXPLAIN("Error loading resource to optimize: "+path); - ERR_FAIL_V(ERR_INVALID_DATA); - } - - if (saver->is_compress_translations_enabled() && res->get_type()=="Translation") { - - Ref<PHashTranslation> ct = Ref<PHashTranslation>( memnew( PHashTranslation ) ); - ct->generate(res); - res=ct; - } - - - //dst_file=path.get_file(); - //dst_file = cwd+"/"+dst_file.substr(0,dst_file.length()-dst_file.extension().length())+"opt.scn"; - - //String write_file = path.substr(0,path.length()-path.extension().length())+"optimized.res"; - String write_file = path+".opt.res"; - - - print_line("DST RES FILE: "+write_file); - Error err = ResourceSaver::save(write_file,res,flags,saver); - if (err) { - memdelete(d); - ERR_EXPLAIN("Error saving optimized resource: "+write_file); - ERR_FAIL_COND_V(err,ERR_CANT_OPEN); - } - source_file=write_file; - //project_settings->add_remapped_path(src_scene,path,platform); - - } - - - } - - String dst_file; - dst_file=cwd+"/"+source_file.get_file(); - print_line("copying from: "+source_file); - print_line("copying to: "+dst_file); - Error err = d->copy(source_file,dst_file); - - if (delete_source) - d->remove(source_file); - - if (err) { - - - ERR_EXPLAIN("Error copying from: "+source_file+" to "+dst_file+"."); - ERR_FAIL_COND_V(err,err); - } - - String src_remap=path; - String dst_remap=source_file; - print_line("remap from: "+src_remap); - print_line("remap to: "+dst_remap); - if (src_remap!=dst_remap) { - - - remapped_paths[remap_platform][src_remap]=dst_remap; - } - - //do the copy man... - - } - - Map<String,Variant> added_settings; - - - for (Map<String,Map<String,String> >::Element *E=remapped_paths.front();E;E=E->next()) { - - String platform=E->key(); - PoolVector<String> remaps; - for(Map<String,String>::Element *F=E->get().front();F;F=F->next() ) { - - remaps.push_back(F->key()); - remaps.push_back(F->get()); - } - - - - //added_settings["remap/"+platform]=remaps;` - added_settings["remap/"+platform]=Variant(remaps).operator Array(); - } - - String engine_cfg_path=d->get_current_dir()+"/godot.cfg"; - print_line("enginecfg: "+engine_cfg_path); - GlobalConfig::get_singleton()->save_custom(engine_cfg_path,added_settings); - - memdelete(d); - return OK; -#endif -} - -ProjectExport::ProjectExport(EditorData* p_data) { - - editor_data=p_data; - VBoxContainer *vbc = memnew( VBoxContainer ); - add_child(vbc); - //set_child_rect(vbc); - set_title(TTR("Project Export")); - label = memnew( Label ); - label->set_text(TTR("Export Preset:")); - vbc->add_child(label); - export_preset = memnew (OptionButton); - vbc->add_child(export_preset); - get_ok()->set_text(TTR("Export")); - set_hide_on_ok(false); - error = memnew( AcceptDialog ); - add_child(error); - - -} -#endif diff --git a/tools/editor/project_export.h b/tools/editor/project_export.h deleted file mode 100644 index c528a23121..0000000000 --- a/tools/editor/project_export.h +++ /dev/null @@ -1,246 +0,0 @@ -/*************************************************************************/ -/* project_export.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan 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 PROJECT_EXPORT_SETTINGS_H -#define PROJECT_EXPORT_SETTINGS_H - -#include "scene/main/timer.h" -#include "scene/gui/control.h" -#include "scene/gui/tree.h" -#include "scene/gui/label.h" -#include "tools/editor/editor_file_dialog.h" -#include "scene/gui/button.h" -#include "scene/gui/dialogs.h" -#include "scene/gui/tab_container.h" -#include "os/dir_access.h" -#include "os/thread.h" -#include "scene/gui/option_button.h" - -#include "scene/gui/slider.h" -#include "tools/editor/editor_file_system.h" -#include "property_editor.h" -#include "editor_import_export.h" - -#if 0 -class EditorNode; - -class ProjectExportDialog : public ConfirmationDialog { - GDCLASS( ProjectExportDialog, ConfirmationDialog ); - -public: - enum ExportAction { - ACTION_NONE, - ACTION_COPY, - ACTION_BUNDLE, - ACTION_MAX - - }; - - static const char *da_string[ACTION_MAX]; - -private: - - - EditorNode *editor; - String expopt; - - TabContainer *sections; - bool updating_tree; - bool pending_update_tree; - AcceptDialog *error; - ConfirmationDialog *confirm; - ConfirmationDialog *confirm_keystore; - - Button *button_reload; - LineEdit *filters, *filters_exclude; - HBoxContainer *plat_errors; - Label *platform_error_string; - - StringName ei; - StringName ot; - - Tree * tree; - - EditorFileDialog *pck_export; - EditorFileDialog *file_export; - LineEdit *file_export_password; - - Button *button_export; - String _delete_attempt; - - bool updating; - - void _tree_changed(); - void _update_tree(); - - bool _create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir); - void _rescan(); - //void _confirmed(); - void _scan_finished(); - - void _validate_platform(); - /////////////////// - - Tree * platforms; - PropertyEditor *platform_options; - - OptionButton *export_mode; - CheckButton *convert_text_scenes; - VBoxContainer *tree_vb; - - VBoxContainer *image_vb; - OptionButton *image_action; - HSlider *image_quality; - SpinBox *image_shrink; - Tree *image_formats; - Vector<TreeItem*> formats; - - LineEdit *group_new_name; - HSlider *group_lossy_quality; - Label *group_new_name_error; - VBoxContainer *group_options; - Tree *groups; - SpinBox *group_shrink; - CheckButton *group_atlas; - OptionButton *group_image_action; - Button *group_add; - Tree *group_images; - LineEdit *group_images_filter; - Button *atlas_preview; - - - AcceptDialog *atlas_preview_dialog; - TextureRect *atlas_preview_frame; - - - VBoxContainer *script_vbox; - OptionButton *script_mode; - LineEdit *script_key; - - VBoxContainer *sample_vbox; - OptionButton *sample_mode; - SpinBox *sample_max_hz; - CheckButton *sample_trim; - - ConfirmationDialog* keystore_create_dialog; - EditorFileDialog* keystore_file_dialog; - - - void _export_mode_changed(int p_idx); - void _prop_edited(String what); - - void _update_platform(); - void _update_exporter(); - void _platform_selected(); - - void _filters_edited(String what); - void _filters_exclude_edited(String what); - void _update_group_tree(); - - void _image_filter_changed(String); - bool _update_group_treef(TreeItem *p_parent,EditorFileSystemDirectory *p_dir,const Set<String>& p_extensions,const String& p_groups,const Map<StringName,int>& p_group_index); - void _group_item_edited(); - void _group_atlas_preview(); - - - - void _quality_edited(float what); - void _image_export_edited(int what); - void _shrink_edited(float what); - - void _sample_convert_edited(int what); - - void _update_group_list(); - void _select_group(const String& p_by_name); - - - String _get_selected_group(); - void _update_group(); - void _group_changed(Variant v); - void _group_selected(); - void _group_add(); - void _group_select_all(); - void _group_select_none(); - void _group_del(Object *item,int p_column, int p_button); - - bool updating_script; - void _update_script(); - void _script_edited(Variant v); - void _export_action(const String& p_file); - void _export_action_pck(const String& p_file); - void ok_pressed(); - void custom_action(const String&); - LineEdit* _create_keystore_input(Control* container, const String& p_label, const String& name); - void _create_android_keystore_window(); - void _create_android_keystore(); - bool _check_android_setting(const Ref<EditorExportPlatform>& exporter); - void _check_keystore_path(const String& path); - void _keystore_dir_selected(const String& path); - void _keystore_created(); - - void _save_export_cfg(); - void _format_toggled(); - - -protected: - void _notification(int p_what); - static void _bind_methods(); -public: - - String get_selected_path() const; - - Error export_platform(const String& p_platform, const String& p_path, bool p_debug,const String& p_password,bool p_quit_after=false); - - void popup_export(); - ProjectExportDialog(EditorNode *p_editor); - ~ProjectExportDialog(); -}; - -class EditorData; - -class ProjectExport : public ConfirmationDialog { - GDCLASS( ProjectExport, ConfirmationDialog ); - - EditorData *editor_data; - - AcceptDialog *error; - Label *label; - OptionButton *export_preset; -public: - - Error export_project(const String& p_preset); - void popup_export(); - - - ProjectExport(EditorData* p_data); - -}; - - -#endif // PROJECT_EXPORT_SETTINGS_H -#endif |